Base: App Circle sidebar (add support floating window)

PS.8 : rebased
PS.9 : add support minimize/maximize window

Change-Id: Ied388a0a4054dfaf1d3e6fcdc33dd5aab28565a9
Signed-off-by: scott <scott@ubuntu>

Conflicts:
	packages/SystemUI/res/values/probam_strings.xml
App Circle Sidebar: Support for Configurable Trigger Region[1/2]

Change-Id: Ib89a98e607f48108b1a1fb54f00335a3bc4ff2e7
Base: Sync AOSPA Floating window Changes with AOSB
Fix Duplicate styles

Change-Id: Iba1474de4a3b2c7430ca8eb7f5c9b12a0454211a
Signed-off-by: scott <scott@ubuntu>

Conflicts:
	core/res/res/values/probam_strings.xml
improve expression
Fix Floating window bug

1. any app in recent apps + launch floating app in home screen
2. close floating app
3. last app in recent apps will launch and close in 0.5 sec

Change-Id: I6fa8605b431ae8f82ca6be34a8fc4b9cab407c9a
Make sure we clean up

pruneDeadThumbnailFile need to close its cursor
in a finally block to avoid leak resouces.

Change-Id: I2646b91970e47ee80a721a2452215b7cae149d10
LIB: SlidingLayer
 an easy way to include an autonomous layer/view that slides from the side of your screen and which is fully gesture ready
Preview: http://www.youtube.com/watch?v=162oD0XPM40
Author: @CesarValiente

Signed-off-by: scott <scott@ubuntu>

Conflicts:
	packages/SystemUI/AndroidManifest.xml
	packages/SystemUI/res/values/probam_attrs.xml
	packages/SystemUI/res/values/probam_dimens.xml

Change-Id: I68bf7a4c9af928561e2c6970101ea4709ae17323
Revert "improve a calculation method for LTE antenna reception level"

This reverts commit 8ee32b7365c94231daa01eae66e9c6e40b147aba.
Themes: Update LoadedApk resources.

Instead of creating a new LoadedApk when resources are not up to
date, we use the existing LoadedApk but recreate mResources.

Change-Id: Ic1ad810863d03c2cedc751c9e84dd7c954daf3d7
Restore lazy loading of LoadedApk resources

This was broken in 8fff544ec349593cfa61ae2f5ec59419fff666b6. Since that change,
resources are always initialized in getPackageInfo(), even if they haven't been
loaded before (mResources == null).

It shouldn't be necessary in *any* case to preload the resources at this point.
Anything using the resources should call LoadedApk.getResources(), which will
initialize them just when needed. Setting mResources to null resets the cache
and will force a reload the next time the resources are requested.

Change-Id: I9bc9986297478e99752b1e2b9bd04dab3dcc9656
Fix FragmentTransaction replace() behavior

This is from AOSP Gerrit Review, was just Pushed, so not yet merged.
It is a definate problem though:
case OP_REPLACE should not remove only every other fragment.
It needs to be fixed. So here it is.
-----------------------------------

According to FragmentTransaction's reference, replace()
should be equivalent to remove()'ing every fragment in
a given container and then adding the specified fragment
to replace those that were removed.

Commit ee76efb74b5886f98cdfebfbefe9b69224e016fb broke
this intended behavior in the framework.

This patch makes it so that the removal loop doesn't
end prematurely. It also fixes an issue where the
replace operation would remove fragments regardless
of their container after encountering the first fragment
with a matching container ID.

Relevant issues:
http://b.android.com/43265
http://b.android.com/52112
http://b.android.com/53393
http://b.android.com/68856
http://b.android.com/70803

Change-Id: Ica4691746ab8979ed974a998e85324e4feacc5e3
Signed-off-by: Eddie Ringle <eddie.ringle@gmail.com>
AudioService: Show safe volume panel for non-interactive volume adjustments

If safe volume is active, apps calling mp.setVolume() to adjust the
headset to a value higher than the threshold will have the operation
fail silently because no volume dialog is active to pop up the
"do you wish to override" question.
This is particularly bad for peripherals that use the audio jack
(Square readers, Jawbone bands), since they usually require levels
close to maximum for proper communication and the app isn't prepared
to deal with a silent rejection of the requested volume.

Change-Id: I2047d199506106a87841b8b680007c5ab45b527b
[ActivityManager] Prevent potential deadlock from system error dialog and InputMethodManager.

Sympton:
When application crash in a special timing and system server's InputMethodManager is binding, deadlock may occur.

Root Cause:
Thread(1): When using InputMethodManager in system server, it will lock mH(handler) of InputMethodManager,
and sometimes it will call to InputMethodManagerService::showCurrentInputLocked and will call bindService at some condition,
then it will also lock ActivityManagerService.
Thread(2): When an application crashed, it will lock ActivityManager when showing crash dialog, inside the dialog,
it will call setEnabled of Button and lock mH of InputMethodManager.setEnable of TextView will lock IMM's handler.
So the deadlock happened as the flow: (2) lock AMS -> (1)lock mH -> (2)wait mH -> (1) wait AMS

Solution:
Reduce nested lock of error dialog: post message to let (2) lock mH after release AMS lock.

Change-Id: Id85c29406236db3b5fca9655fde1fcaf0afd1337
[ActivityManager] Avoid keeping restarting home when only home activity exists.

Root Cause:
When there is only home activity existed,
updating home apk will call forceStopPackageLocked to finish the activity.
Then activity history becomes empty, then home will be launched,
but its package is still target to close that results a loop.

Solution:
If home activity has been force-stopped, do not stop the same home activity again.

Change-Id: Icff12028d407873c2e6f50a06bcad231b908ccbd
[ActivityManager] Prevent kill a restarted process again.

Root Cause:
Use removeTask with flag ActivityManager.REMOVE_TASK_KILL_PROCESS will set waitingToKill = "remove task"
to the target process when its setSchedGroup is not BG_NONINTERACTIVE.
Later the target process may be killed when applying oom-adj due to setSchedGroup has changed to BG_NONINTERACTIVE.
If the process is needed to restart, the process record will be resued.
Then the restarted process may be killed again because its waitingToKill is not null.

Solution:
Clean waitingToKill when process is dead.

Change-Id: I5ffb5388127f4221da4c700d3f1c224f7ca6e7b2
Make misc config directory during user creation

Directories will appear in /data/misc/user/XX, readable only by
applications within that user.

Change-Id: I0adb14deb1a035abdbe51714356bd0c94ccf04c5
Fix Jira issue with gap underneath clock/data view
Wireless charging alert dialog.

 - Reason for adding this most devices with wireless charging the oem
   software providers a popup when charging starts (eg. placed on
   charging pad) and when charging stops (eg. lifted off). I personally
   like this feature so thats what this does.

* Set on wireless charger and alert dialog pops up "Wireless charging"
* Lifted off wireless charger and alert dialog pops up "Charging stopped
* All this follows certain other settings too. Like Wake when plugged
  or uplugged. When wakeWhenPluggedUnplugged is true. Alert dialog
  happens as the device will wake anyway then. When false no alert
  dialog is done even.

Signed-off-by: baked <travp624@gmail.com>
Signed-off-by: scott <scott@ubuntu>

Conflicts:
	packages/SystemUI/res/values/baked_strings.xml
	packages/SystemUI/src/com/android/systemui/power/PowerUI.java

Change-Id: I2b568c2f676d2e50e1dea7d2f6dd90dc6fd8fadb
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: Id1fd4f50755c5172cdc557fc27e2298290edecef
Signed-off-by: Roman Birg <roman@cyngn.com>
Signed-off-by: scott <scott@ubuntu>

Conflicts:
	core/res/res/values/baked_strings.xml
	core/res/res/values/symbols.xml