Framework: Show advanced reboot menu only if device is unlocked

The advanced reboot menu will only show if the device is unlocked.
Otherwise
the reboot entry will allow the user to simply reboot the phone.

PS2: Reverted changes done to
core/java/android/view/WindowManagerPolicy.java
PS3: Removed tmp file which was created by gedit..
PS4: Only show reboot options if unlocked or not a secure lockscreen

Change-Id: I6f98eca87fa392d2f9aa918f2d3343d1489fa5fd
Signed-off-by: Parthipan Ramesh <parthipan.ramesh@gmail.com>
[1/4] Dialer lookup

Squashed commit of the following:

commit 7802111
Author: Xiao-Long Chen <chenxiaolong@cxl.epac.to>
Date:   Fri Mar 7 17:11:02 2014 -0500

    Add people lookup settings keys

    Change-Id: I2ff9bb7684d04f4f9b640939c7db269873aa3308

commit 0e5ed5a
Author: Xiao-Long Chen <chenxiaolong@cxl.epac.to>
Date:   Fri Jan 31 11:43:10 2014 -0500

    Frameworks: Add settings keys for forward and reverse phone number lookup

    Change-Id: I1c4c7825b4361b7a52dd419f83afd7b9fcbe1494

Change-Id: I68e4214e813695021b64c29ab1d831a944a6275a
[1/2] Frameworks: Battery Icons

      Reveal hidden battery option
      Remove all customizations; return to stock design

PS2 - made font black and bold

Change-Id: I026daf0e2b75c8cf9923ed28ef02289813cfdb50
Use checkOperation in BroadcastQueue.

ActivityManagerService uses NoteOperation before delivering a broadcast to
a package. NoteOperation can be blocking due to permisison dialog box.

Use non-blocking checkOperation in BroadcastQueue.

Change-Id: Iccded96217d99589aed771f2f3c15d0a39d9a340
Solve three memory leaks related to PatchCache

A Patch can be fairly large, holding bitmap data, but
is also frequently leaked which adds to the severity.
The feature is used in many important processes such
as Home, SystemUI and Chrome.

The following leaks are solved:

1. The Patch itself was not always freed.
PatchCache::removeDeferred() can mark patches to be
cared for by PatchCache::clearGarbage(). But
mCache.remove() would only destroy the container
and the pointer, not the Patch object itself.

2. The vertices stored in the Patch at Patch::createMesh()
would always leak. The empty/default destructor in Patch
would not properly destroy "vertices" since it's just a
pointer.

3. A BufferBlock that's added to the mFreeBlocks
in PatchCache could leak. The leak happened when a
patch later needed the entire free block, because the
object was removed from the list but never deleted
in PatchCache::setupMesh().

Change-Id: I41e60824479230b67426fc546d3dbff294c8891f
Merge "Framework: Show advanced reboot menu only if device is unlocked" into kitkat
Merge remote-tracking branch 'PA/kitkat' into remix-staging
Volumes in Settings/Sound is slow to start

There is a delay after pressing volume menu item
there is a delay until the Volume popup is shown.

The reason for this is that the initialization of
the different seekbars is slow and run in the main
thread. More specifically the call to get the
ringtone from the RingtoneManager is causing this
delay.

Moving the call to the ringtone manager to the
handler thread used to play ringtones to make
the launch of the volume dialog a bit snappier.

Change-Id: I76da0226592468debd542d67164b37b2b59897c7
Reduce warning verbosity in aapt

- Attributed source of problems to the correct file.
- Only verify string localizations against valid
  locales.
Bug:13140015
Change-Id: I9dabc5efa0510649caee8af0c8ebb803d6f48269
base: Fix screen on stats after a boot

Prior to this change, the following sequence:

  * Turn the display off
  * Issue a reboot via adb
  * Unlock the device (after rebooting) before the screen turns off

results in the screen being on but the battery stats not reflecting
this fact.

In general, the mismatch occurs when either there is no serialized
battery stats state or when it is serialized in a state where the
screen is off.

Change-Id: I17374553fae6a08a1be8fdf445967509474177a9
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
QS Sleeptile: Add 45 seconds timeout value
Separate Change Encryption Password Entry (2 of 2)

This permits the use of a different (hopefully longer and more complex!) encryption password,
while using a simpler (and easier to type) lockscreen password.

Requires Settings change to give UI for this

(port to cm11 - cyanogen)

Conflicts:
	core/java/com/android/internal/widget/LockPatternUtils.java

Change-Id: Ib54532f92f4f3beb8713fd73e466ae46b7e15f7d
Revert "fb: small observer multiuser correction on notificationlight" (Might fix notification light issue)

This reverts commit 179e33204be32f817aa3a2e69617fb5b394da3b9.
Update IT Translation

PS4: Fix derps and update safe headset volume on the spot.
PS5: Conditional for safe volume aswell.

Change-Id: Iabf7613b90d84476405522c2352361d0153ec655
On-The-Spot: Add clear all recents button to user preferences.

PS3: Add proper drawable thanks to / by Dani Rosenkamp @DaNi--
     Fix wrong change id (from abandoned commit)
PS4: More logic drawable

Signed-off-by: Carlo Savignano <stevewatersy@gmail.com>
Change-Id: I632730bee6b409072689e07fb1084ceaca5b1d49
Merge remote-tracking branch 'PA/kitkat' into remix-staging
Keyguard: allow keyguard to be dismissed via intent

Requires system permission "android.permission.CONTROL_KEYGUARD"

Change-Id: I9f8f5ca90a65b949d43fac33ce3e9e39ffdf9254
Signed-off-by: Roman Birg <roman@cyngn.com>
Audio: Fixed system/call stream volume can't adjust with HS connected.

Issue Description:
When headset connected, the system/voice call stream volume can't be
adjusted from Volume bar.

Root Cause:
Currently adjustStreamVolume is applied to stream type alias and the
device for the stream alias. So when headset connected and adjust
volume for SYSTEM_STREAM, the operation will be applied to RING_STREAM
(which is aliased by SYSTEM_STREAM) and speaker. As headset is returned
from getDeviceForStream(SYSTEM_STREAM), but speaker for RING_STREAM.

Solution:
Change the adjustStreamVolume to apply volume to the stream alias and
the device for the stream type exactly.

Change-Id: Icd226d9eb197017cd3c186a0096edaed755680ec
Signed-off-by: Guo Xie <gxie@marvell.com>
[1/2] Base: Battery Saver mode

Concept:
http://jira.omnirom.org/browse/CONCEPT-24

introduce battery saver mode
this based from what user want or what user do to saving the battery life
this include:
1. Automatically switch mobile network into what user choice and also disable mobile data IF wifi connected to an AP
2. Automatically switch mobile network and disable mobile data IF battery low (battery level can configure)
3. Reduce screen brightness based low battery (this feature will disabled if Auto brightness mode enabled)
4. Not changing network IF on Call or Usb tether enabled or WifiAP enabled
5. Not changing network IF there is Download/upload progress
6. Support For Both GSM and CDMA devices (need someone to test for CDMA devices)
7. every condition has an option :D
8. Restore all network configuration if battery saver mode disabled
9. Add Time Range to start battery saver mode
10. allow device without mobile data support, to using this feature
11. fix inconsistent battery low level
12. rewrite to better performance
13. modified the controller to support battery saver mode
14. add bluetooth, gps, wifi, and mobile data (if support) to be disabled while power saving activated
15. fix build QuickSettings because of LocationController change
16. rewrite to better performance
17. fix brightness value
18. rewrite (again) to allow add more saving mode
19. do delay changing only for POWER SAVING not NORMAL mode
20. add Cpu power saving mode
21. fix Cpu freq value
22. fix call saving state for non user configuration mode
23. fix NPE
24. add kill all task
25. add disable sync
26. add disable vibrate
27. add disable led
28. add notification :)
29. finally fix sync interval :D

preview:
http://jira.omnirom.org/secure/attachment/10394/Screenshot_2014-03-07-19-54-57.png
http://jira.omnirom.org/secure/attachment/10395/Screenshot_2014-03-07-19-55-56.png
http://jira.omnirom.org/secure/attachment/10396/Screenshot_2014-03-07-19-56-06.png
http://jira.omnirom.org/secure/attachment/10397/Screenshot_2014-03-07-19-56-14.png
http://jira.omnirom.org/secure/attachment/10398/Screenshot_2014-03-07-19-56-27.png
http://jira.omnirom.org/secure/attachment/10399/Screenshot_2014-03-07-19-56-34.png

Conflicts:
	packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettings.java
	packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettingsModel.java

Change-Id: I9d86ef1425228e11cadd85d37c5b6e8b20e50fb0

Conflicts:
	core/java/android/content/Intent.java
	core/java/com/android/internal/util/omni/TaskUtils.java
	packages/SystemUI/res/values/pac_strings.xml
	packages/SystemUI/src/com/android/systemui/statusbar/policy/BluetoothController.java
	services/java/com/android/server/NotificationManagerService.java
	services/java/com/android/server/VibratorService.java
	telephony/java/android/telephony/TelephonyManager.java
	telephony/java/com/android/internal/telephony/ITelephony.aidl