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
Tethering: fix NPE when retrieving active interfaces

When in airplane mode getActiveNetworkInfo() may return null.

Change-Id: Icba37abb51b9378c8af73d9f6587e04c588dd85e
Signed-off-by: Dirk Rettschlag <dirk.rettschlag@gmail.com>
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>
Prevent wakeup when receiving AVRCP media KeyEvents

Devices connected via AVRCP use different codes.
Added playback events to the filter.

Change-Id: I359a5c34a29ef524d5781f9ab35bd2c4f2ae8be1
Signed-off-by: sethyx <sethyx@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>
Prevent nullPointerException by updateBondedBluetoothDevices

In some very rare cases difficult to identify, it seems that the
IBluetooth.getBondedDevices() returns a Set with a null element.

This patch will prevent calling getBondState() if the device is null to
avoid a nullPointerException.

Change-Id: I9bcad60c37e03c77ec39227e5c947c002a3ae2c7
Orig-Change-Id: I8845f0e6b8fdcda679bc71e2b5c33fd4a52f3ac5
Signed-off-by: Patrick Combes <patrick.combes@intel.com>
Reviewed-on: http://android.intel.com:8080/116592
Reviewed-by: Bondier, CedricX <cedricx.bondier@intel.com>
Reviewed-by: Chen, HuaqiangX <huaqiangx.chen@intel.com>
Reviewed-by: Yao, Yong <yong.yao@intel.com>
Reviewed-by: Aquilone, RaffaeleX <raffaelex.aquilone@intel.com>
Tested-by: Lestienne, ChristopheX <christophex.lestienne@intel.com>
Reviewed-by: buildbot <buildbot@intel.com>
Tested-by: buildbot <buildbot@intel.com>
Signed-off-by: Jian Luo <jian.luo@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Author-tracking-BZ: 90085
Merge "Prevent wakeup when receiving AVRCP media KeyEvents" into kitkat
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