Answer call with hardware HOME button (2/2)

preparation to winter time

Change-Id: Ic11449acf87c6b4d932142b74158af7441658b3d
SystemUI: make long pressing recent switch to last app

With this patch, long pressing the recents key on the navigation bar
will attempt to switch to your last application in the activity stack
before the active one.

The user's current home launcher package is ignored as well as SystemUI (so that
RecentsActivity does not influence the behavior).

Change-Id: I38771e0fce16b55bb5186af47115b4e812cb60b0
Signed-off-by: Roman Birg <roman@cyngn.com>
Signed-off-by: Adnan Begovic <adnan@cyngn.com>
frameworks: allow last app action to be assigned to hardware keys

Also fix multi-user handling for 'switch to last app' and 'kill
foreground app' actions.

Change-Id: I1fb586d19b1198e6888b0f11e0a2813acf0bcd5b
Signed-off-by: Roman Birg <roman@cyngn.com>
Signed-off-by: Danny Baumann <dannybaumann@web.de>
Signed-off-by: Adnan Begovic <adnan@cyngn.com>
Signed-off-by: iceandfire <arhamjamal@gmail.com>

Conflicts:
	core/res/res/values/symbols.xml
frameworks: add keyguard wallpaper functionality to WallpaperManager

Adapted for cm-12.

Change-Id: I0eb1b5578b705c2ade4c0772fa86e09478b9f73e
Signed-off-by: Roman Birg <roman@cyngn.com>
Signed-off-by: iceandfire <arhamjamal@gmail.com>

Conflicts:
	core/res/res/values/cm_strings.xml
Runtime toggle of navbar

This adds the framework support for enabling the Navigation bar
on devices with hardware keys. It is toggled from Settings, and
depends on device-specific support for the KeyDisabler hardware
control

Change-Id: I88fecb2ca1e8613591c327a93f53909b00239cd8

wm: Nullify hardkey function assignments if enabling the navbar

This caused erroneous (and sometimes duplicate) events being generated
due to the regular key function assignments. The navbar does its
own action management, so don't try to derive from the actions
usually present in hard keys.

Change-Id: I82866e24547f8145cac4f07820ae90aacce09281
Signed-off-by: iceandfire <arhamjamal@gmail.com>

Conflicts:
	policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
frameworks/base: Don't report existing menu key if it was remapped.

Change-Id: Iabad06cd42cebecdff6f0440899432513681b063
Signed-off-by: iceandfire <arhamjamal@gmail.com>

Conflicts:
	policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
frameworks/base: Fix key remapping after toggling navigationbar.

Change-Id: I8069e3106601caf3990cbcdc5056ffc64ddf7bcd
Signed-off-by: iceandfire <arhamjamal@gmail.com>

Conflicts:
	policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
Cleanup button wake settings (2/2)

Change-Id: Ie37136cbd57c4c334321abbfa4543727e940bc43
Signed-off-by: iceandfire <arhamjamal@gmail.com>

Conflicts:
	policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
SystemUI: fix battery icon patch for MSim

Change-Id: Ia3437069de3faeb0cc922b756e4c1db85e2a2524
SystemUI: fix MediaProjection cast crash

Clicking on the "cast" icon of an app using the MediaProjection API will
crash as the code assume that it is a device.

java.lang.ClassCastException: android.media.projection.MediaProjectionInfo cannot be cast to android.media.MediaRouter$RouteInfo
	at com.android.systemui.statusbar.policy.CastControllerImpl.startCasting(CastControllerImpl.java:177)
	at com.android.systemui.qs.tiles.CastTile$CastDetailAdapter.onDetailItemClick(CastTile.java:237)
	at com.android.systemui.qs.QSDetailItems$1.onClick(QSDetailItems.java:177)
	at android.view.View.performClick(View.java:4756)
	at android.view.View$PerformClick.run(View.java:19749)
	at android.os.Handler.handleCallback(Handler.java:739)
	at android.os.Handler.dispatchMessage(Handler.java:95)
	at android.os.Looper.loop(Looper.java:135)
	at android.app.ActivityThread.main(ActivityThread.java:5221)
	at java.lang.reflect.Method.invoke(Native Method)
	at java.lang.reflect.Method.invoke(Method.java:372)
	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:898)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:693)

Change-Id: Icfdf745c03da7bd1bbb228e06005f55324c1b8fa