StorageManager: only register MountService listener when needed

When other service get StorageManager, StorageManager will register a
listener in MountService, which won't be unregistered.

So change the policy to be:
1. when other service needs to register listener in StorageManager,
StorageManager will register listener in MountService.
2. When other service needs to unreg0ster listener in StorageManager,
if there is no more other listeners in StorageManager, StorageManager
will unregister listener in MountService

Change-Id: Ie59ad96279ac3b51f7a606fcfbbde0c130cf61dc
Author: Chuanxiao Dong <chuanxiao.dong@intel.com>
Signed-off-by: Chuanxiao Dong <chuanxiao.dong@intel.com>
Signed-off-by: Bing Deng <bingx.deng@intel.com>
Signed-off-by: Shuo Gao <shuo.gao@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Author-tracking-BZ: 30943
Show live wallpapers in the recents view on high-end devices

Change-Id: Iefbf4f292b6a9bfdb516f154cc2976db2ba86cde
Add option to enable/disable navring (1/2)

This will add an option to toggle navigation ring.

If the navigation bar is disabled then a standalone
navigation ring is added.

Change-Id: I527c25b11bcb2c5f4b70799055f97bab65ed2cec
Signed-off-by: Dirk Rettschlag <dirk.rettschlag@gmail.com>
Add "Turn WiFi off" action to "Open networks" notification

Forward ported to kitkat

Squashed:
add "Turn Wi-Fi off" action to the "open networks available" notification
add missing xhdpi turn wifi off image
WiFi open network notification: fix potential crash

Change-Id: I416a129388074c616892f6266af7005b4da1a521
Signed-off-by: Rohan Mathur <rohanmathur34@gmail.com>
Add implementation for Clock (Alarm) Toggle

PS1: Remove extra space
PS4: Complete revamp:
- Display alarm and its time if set
- Display analog clock with time and "alarm off" if no alarm set

Change-Id: I8d571082f5e264a1560e7e549bb555de45202866
Signed-off-by: sethyx <sethyx@gmail.com>
Merge "Add option to enable/disable navring (1/2)" into kitkat
Merge "Add implementation for Clock (Alarm) Toggle" into kitkat
Merge "Add "Turn WiFi off" action to "Open networks" notification" into kitkat
Add "Turn Tethering off" action to WiFi and USB tethering notifications

Change-Id: Ibfbc1fbd8f147b46a7a079511f93227b0687bd3e
Signed-off-by: sethyx <sethyx@gmail.com>
[1/2] Navigation bar width & height

Change-Id: I68d5b37e30733771a8db80329bf7a73c91b91d5b
Signed-off-by: kecinzer <kecinzer@gmail.com>
Merge "Add "Turn Tethering off" action to WiFi and USB tethering notifications" into kitkat
Merge "Show live wallpapers in the recents view on high-end devices" into kitkat
Merge "StorageManager: only register MountService listener when needed" into kitkat
WifiController: fix high perf lock sometimes not respected

When the device screen is turned off, the state is DeviceActive for
15 minutes. In this time, high perf lock is not respected and
Wi-Fi power-saving mode will be turned on because screen is off.

Fix by adding a new DeviceActiveHighPerfState.

Change-Id: I71074beec4d41286dea0861107d7931da205aca2
JIRA: CYAN-2860
Avoid possible memory leaks by ensuring stream closures

Stream close() methods should always be called in finally block
to ensure we don't accidentally leak a stream.

Time to fix some old sloppy code.

Patch Set 2:
 + ensure closure of some other streams
Patch Set 3:
 + missing import java.io.IOException
Patch Set 4:
 + missing import
Patch Set 5:
 + missing ';'
 + whitespace cleanup
Patch Set 6:
 - Reverted changes to MemoryUsage (final requirement
     prevents my implentation)
 + fixed Object allocation in Root.java
Patch Set 7:
 + fixed curly bracket style violations
Patch Set 8:
 x fixed my own sloppy code :/

Change-Id: I3460b558ed5b4489296388c9a52fbb773cefd31f

Conflicts:
	packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java
Display: Dirty region propagation

Pass Dirty region values from HW renderer to Surface Texture.

Change-Id: Ibd121ed398a1319d3daf26f9fd39a03323bba666
Release wakelocks acquired by SyncManager

Release the wakelocks internally acquired by SyncManager to improve
power performance.

Change-Id: I6d9663292cb4471d92ed9132beb7ed1ba2e8128f
CRs-Fixed: 585825
Merge remote-tracking branch 'aokp/kitkat' into kitkat