Smooth Spinners: Makes the loading "spinner" animation smoother in non-holo apps

The loading "spinner" animation is quite jerky by default when the progress xml's from
drawable are called in applications that don't use the holo progress animation. The holo
"spinner" animation is already smooth by default. This makes every other "spinner"
animation smooth.

We've been changing this value in all ROM's we release, both AOSP and CM based ones
as well as stock ROM's, since it gives a more polished look to the entire system. In the past
3 years we've been using this small tweak we have not noticed anything that would
adversely affect battery life or system operations as a whole.

Change-Id: I4c333ecaee72844fb4d06a3cc6925b17e2208433
Signed-off-by: Sar Castillo <sar.castillo@gmail.com>
Change SQL to improve performance.

To know the number of images, use "COUNT(*)" instead of "_id" in SQL.
Using "_id" gets all result set. and when getCount() is called, CursorWindow is filled.
But using "COUNT(*)" gets just 1by1 data.
So using "COUNT(*)" is more faster than now.
And this SQL is called everytime per a file during a file transfer in MTP
The better way is by using "EXIST".
But if using "EXIST", modify MediaProvider.call() method.
So i applied just a "COUNT(*)"

Change-Id: Ic5882af0fad2304f836b7b7043a4746359391609
Signed-off-by: muzbit.kim <muzbit.kim@lge.com>
Override updateEnabled to let other things know we changed

Summary: device settings app want's to know about this

Test Plan: see if this override works correctly by seeing if it logs correctly

Reviewers: anders3408, raymanfx

Differential Revision: http://review.codefirex.com/D521
KeyguardViewMediator: Play lock screen sound sooner

When the screen is locked, there is a long pause before the lock
sound actually plays. This makes that sound happen much sooner.

Change-Id: I62547a183d68b93a33651c4078b5788d324055a9
Keyguard: disable music transport control debug

Change-Id: Ia4361d0850334dc0944559c40409c9062cf02e47
Prevent lock/unlock sound during music playback

Lock/unlock sound mixes in with music and causes
lag and distortion.

Change-Id: I9d3582c6bf28aa62a5a6712bc9e89eb2f73e0288
Keyguard: fix statusbar lags when default widget shown.

When statusbar became expanded KeyguardStatusView receives
onKeyguardVisibilityChanged callback and refreshes ClockView.
Because it receives more than one call and every time it reads
new values from resources it cause lags in opening statusbar panel.

Replace this code with BroadcastReceiver and ContentObserver to
refresh it only in case something was changed.

Change-Id: If0dbc1db059536806852661931cb2e6436f2acf4
keyguard: fix layout for sw320dp devices

800x480px dpi devices have less screen space than the xhdpi devices
Google designed the layout for and the layout needs adjustment.

- Reduce the lockscreen security container size such that the clock
  widget has enough space to display its content.
- In the SIM PIN/PUK view, Google put an empty widget on top, but
  we don't have space for that, increase its size such that the
  widget practically disappears.

This should not have any effect on devices with larger screens.

Ported from cm-10.2.
* Removed invalid mdpi layout leftover from framework-res
* Fix keyguard for mdpi devices too

Change-Id: I9e811cfd312abae24a9cad189d19e73848f6c4c1
keyguard: fix-fix layout for sw320dp devices

Default values need to be defined in sw360dp or larger devices will
pick up sw320dp values automatically.

On the maguro device the keyguard isn't properly centered.

- Before http://review.cyanogenmod.org/54758:
    http://i.imgur.com/F6sokhA.jpg
- After http://review.cyanogenmod.org/54758:
    http://i.imgur.com/OdTkZLL.jpg
- With this commit:
    http://i.imgur.com/TThq9da.jpg

Change-Id: Idcc29ec79a12e61b26d2ad5070468e70a8ef39df
Keyguard: fix not shown overlay widgets from system

google derp....due that if widgets are disabled current AOSP
code just add the default widget. Then checkAppWidgetConsistency()
detects a widget which was added and the complete method is non op.
Whatever lets handle the whole process over checkAppWidgetConsistency()
on widget disabled it tries to bind the default widget over overlay if
this is without sucess it falls back to the system one.
Safemode falls always to the system one

This fixes as well an issue that the saved default id in LockPatternUtils
is not reseted back to default if all widgets were deleted from the user.
Based on an old patch from Danesh. Thanks for the suggestion

Change-Id: I6b21d18346fed5accc72141097939c92ee9aaa3c
Keyguard: Set WIDGET_CATEGORY_KEYGUARD when AppWidgetHostView is created

Allows the default lockscreen widget to inherit the keyguard widget
host category.  Without this, only widgets added through
KeyguardActivityLauncher are assigned the correct
OPTION_APPWIDGET_HOST_CATEGORY.

Change-Id: Ic97818d85ca5f00da0ce43bb36006d66a6935363
Keyguard: smooth background change.

Change-Id: Ia0e4d0000db72b5cdb6fede03791805e34fa311d
Keyguard: Fix PIN layout on sw320dp-mdpi devices

Fix a long standing lockscreen layout problem that was introduced in 4.2

Before: http://i.imgur.com/9sVKHRR.png
After: http://i.imgur.com/DLY4DRu.png

Change-Id: Ia3cdc0d10217a0a2504a7287f480d9f036e66eee
Keyguard: don't refresh ui when screen off

KeyguardStatusView is doing refresh all the time,
which cause high power when screen off.

Change-Id: Ifabdde4419a23e919cd52fe77e78ec3160575af1
keyguard: fix delay lock screen sound

Change-Id: Ia4cd2c856df1573856386e1597dcc0a9600d25a5
JIRA: CYAN-3362
Issue: https://jira.cyanogenmod.org/browse/CYAN-3362
Signed-off-by: Jorge Ruesga <jorge@ruesga.com>
Don't recreate keyguard for MCC/MNC changes.

Change-Id: I9e5dfdb12df522dc7dd50c26f35aba26b1bbe44e
Keyguard: Fix configuration change observer

Change I9e5dfdb12df522dc7dd50c26f35aba26b1bbe44e made recreations
only happen when a stored copy of the previous configuration differs
from the current one. But "configuration = otherConfiguration" creates
a reference to the original object, not a copy, so newConfig.diff(mLastConfiguration)
always returned zero. Fixit by creating an actual deep copy of the
Configuration object.

Change-Id: I236932dfc0e121dd83212882b4fe71306c8a3fab
Fix problem where PhoneWindowManager waits for keyguard to draw

This fixes a problem where PhoneWindowManager times out waiting
for keyguard to draw when it's disabled.  Instead, we pass a null
token back which allows PhoneWindowManager to continue.

Fixes bug 11190932

Change-Id: I041ea1d88dca681476d9477a3aab54559976b312

Conflicts:

	packages/Keyguard/src/com/android/keyguard/KeyguardViewManager.java
Set Settings.Global.WIFI_SCAN_ALWAYS_AVAILABLE default value

To be able to customize the "WiFi scan always available"
setting we need to set a default value.

Change-Id: I3673f2613ab9b6a947aed7e29d4cc876140c2180

Conflicts:
	packages/SettingsProvider/res/values/defaults.xml
	packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java

Conflicts:
	packages/SettingsProvider/res/values/defaults.xml

Conflicts:

	packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java
Set Settings.Global.WIFI_SUSPEND_OPTIMIZATIONS_ENABLED default value

To be able to customize the "WiFi optimization"
setting we need to set a default value.

Change-Id: I9cd2f204cf46c0b4c70a4a147da2f1d73a708308