Adios lockscreen blur & see through [1/2]

Revert "Custom lockscreen wallpaper [1/2]"

This reverts commit bd695aba22e91dc87ac4e76a46dbec4b2e35fb13.

Revert "Use old see through when blur radius == 0"

This reverts commit 043388dd2ceb629dcb8b9360ed67949bb314e547.

Revert "Lockscreen Blur: fix for coverflows"

This reverts commit 7bd340fc62ef83dd82aad600975b8ec37389c4a3.

Revert "Partly fix lockscreen blur rotation issue"

This reverts commit 71d52c2c47145efbce7998c6f709319c65019236.

Conflicts:
	packages/Keyguard/src/com/android/keyguard/KeyguardViewManager.java

Change-Id: I41478f9cdff36536215e5d839ad3f56ac134ec05

Revert "Lockscreen Blur (1/2)"

This reverts commit d618a738078498fe00ecfd1b45bc4cd922f2521f.

Conflicts:
	core/java/android/provider/Settings.java
	packages/Keyguard/src/com/android/keyguard/KeyguardViewManager.java
	policy/src/com/android/internal/policy/impl/keyguard/KeyguardServiceWrapper.java

Change-Id: I08ac5510724f538d20c913c9f2de627f7bf12e61

Revert "Lockscreen: See through (1/2)"

This reverts commit 31478e0c0311638656da3a03f02b29a70c075677.

Conflicts:
	core/java/android/provider/Settings.java
	packages/Keyguard/src/com/android/keyguard/KeyguardViewManager.java

Change-Id: Icb20d10786d5612fca884d4c9d8a85544b1881f6
Frameworks: Lockscreen custom wallpaper (1/2)

kitkat now has code for a custom wallpaper image.

Using that code set a switch case to set the custom background between
- Custom Wallpaper
- Default background

This way allows the same overlay shadow thats set on the keyguard when
its the defualt way.

Change-Id: I98fde63ef9f3c0a5f334cd9a97b237a6f99c57f6

Conflicts:
core/java/android/provider/Settings.java
packages/Keyguard/src/com/android/keyguard/KeyguardViewManager.java

Lockscreen: Fix SystemUI crash on initial selection of Custom
Background.

Change-Id: I8df4984f4b90d211baa888d380a95fc00a85d1ad

Conflicts:
packages/Keyguard/src/com/android/keyguard/KeyguardViewManager.java

Revert "add a getter for the x and y offsets of the wallpaper window"

This reverts commit 3fc294a.

Revert "persist the changed position values in
updateWallpaperOffsetLocked, even with a null mWallpaperTarget"

This reverts commit e52c29f.

Revert "wallpaper: add missing @hides"

This reverts commit fb26f3a.

Revert "Wallpaper Overscroll"

This reverts commit efe8bac.

Wallpaper Overscroll and Transparent NavBar

Now possible to offset wallpaper windows by more than the size of the
wallpaper
and add added a transparent mode to the NavigationBar

Change-Id: I2b0f1129a4cf73b8def35abb7072d0472a9cc972

Conflicts:

packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java

packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java

add Custom Lockscreen switch

Change-Id: I3cc14cacf5462f589373b686f0dd87100507d524

Conflicts:
core/java/android/provider/Settings.java

wallpaper: add missing @hides

Add missing @hides to setWallpaperOverscroll and
setWallpaperOverscrollOffsets

Change-Id: I1cfe876272d7c0a94bef122567da30318eac9400

persist the changed position values in updateWallpaperOffsetLocked, even
with a null mWallpaperTarget

Change-Id: I175773f6e0b3f91c1d983857028a89b959e4e9f2

add a getter for the x and y offsets of the wallpaper window

Change-Id: I98fde63ef9f3c0a5f334cd9a97b237a6f99c57f6

Keyguard: more consistency with the new lockscreen wallpaper

* In the case when the screen was off and setCustomDrawable()
was being called, and the use wallpaper is null, then we could be
setting the color filter on a null drawable.

* Fix logic when old custom background was null and the new one is also
null (but could be the user one) and the func was being returned, thus
not
clearing out the current media album art.

* Move resetting the shouldShowWallpaper() flag to the show() method
so it is not being called every time the screen is turned on.

* Fix user image not showing up on first boot if it exists

Change-Id: I567c2ec8920df627835defb822c2ea25be7b3cab
Signed-off-by: Roman Birg <roman@cyngn.com>

Conflicts:
packages/Keyguard/src/com/android/keyguard/KeyguardViewManager.java

Lockscreen wallpaper for themes

Change-Id: If77b97301c5bfebd94b193fe9a54e676e678d3ed

Conflicts:
core/java/android/content/pm/ThemeUtils.java
services/java/com/android/server/ThemeService.java

Keyguard : Fix album art sticking after playback is stopped

newIsNull should be populated by what is currently being set and not by
what the user's custom background is, since otherwise you end up a in
state
where the user has no custom background set, music stops, no album art
via arg is provided and you simply return.

Change-Id: Ifaea1cae176faaba6b32a711071f3b75ccacdd63

revert camera icon disable when
Settings.System.LOCKSCREEN_MODLOCK_ENABLED was set to 1

Change-Id: I0f6e318c5da7b526e24f8c0c73102e3d7d826a46

Conflicts:

packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java

cleanup leftovers from kill-app on longpress

Change-Id: I790c8843b136c8523c86d5d235f5b0899fd8dfd7

Keyguard: give the Keyguard a non-empty app label

A blank app label under "Apps" looks suspicious to
the untrained eye.

Change-Id: Ic679e5d6d825a83a8f666bb7e6429bebf1280f6d
Signed-off-by: Roman Birg <roman@cyngn.com>

hide search assistant arrow from lockscreen when custom lockscreen is
enabled

Change-Id: I02d8286dd9f07cdb1de8a61101e772be35f65fda

Conflicts:

packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java

cleanup some resources

Change-Id: I022eae8f6bd0977a10c228bc473930da6515aad8

Keyguard: Move test app translations to the correct place

Google messed up again with translations.
This change is needed because it interferes with our translations
which happen to use same string names as the Keyguard test app.

Change-Id: I593ab5f004f09e1b33c5ba7ef3d1bb19ffc643b4

Conflicts:
packages/Keyguard/test/res/values-es-rXA/strings.xml
packages/Keyguard/test/res/values-ug/strings.xml

Revert "Themes: Support applying components from multiple themes [1/3]"

This reverts commit 6c43f81.

frameworks: allow Keyguard package to be defined in overlay

This way, custom keyguards can have their own namespace.

Change-Id: Ia2dfa57652c6f3d3404963897fb2f20a265e5c76
Signed-off-by: Roman Birg <roman@cyngn.com>

Conflicts:
core/java/com/android/internal/util/slim/LockscreenTargetUtils.java

frameworks: move keyguard wallpaper to system  (1/2)

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

Conflicts:
core/java/android/app/WallpaperManager.java
core/java/android/provider/Settings.java
core/res/res/values/cm_strings.xml
packages/Keyguard/src/com/android/keyguard/KeyguardViewManager.java
services/java/com/android/server/ThemeService.java

WallpaperManager: add NULL pointer check for
getCropAndSetWallpaperIntent

Originally the api 'getCropAndSetWallpaperIntent' does not check
whether the parsed parameter is a NULL pointer, as leads to the
whole app crash if it call this api with a null parameter accidentally.
A null pointer check logic is added into its original parameter check
logic, so that this API will throw an IllegalArgumentException if it
is parsed with a null pointer

Change-Id: Ib7de40e571419d09e1a744edc969eb7162766b75

Add wallpaper pickers to seperate package [1/2]

Currently wallpaper pickers were part of the various launchers
and we were relying on Trebuchet's to add code for including
wallpapers from themes.  If Trebuchet is removed then this
functionality is lost.  This package is already included in all
builds so making the picker available here removes the dependency
on a specific launcher.

Trebuchet still contains a picker which should probably be removed
and make use of this package instead.

Change-Id: Ie42ae0e01f951a8293d13d6c8a73fde0dea6682b

Conflicts:

packages/WallpaperCropper/src/com/android/wallpapercropper/WallpaperCropActivity.java

rename the custom lockscreen state action

Change-Id: I4ffadda9392e8ca8765e5b8ca47994e3a9990792

WallpaperPicker: Destroy cropview to avoid leaks

If the cropview's TiledImageRenderer is rendering threads, the activity
context gets leaked. Avoid that by invoking its destroy in onDestroy()
of activity.

Change-Id: I0804c903d14d3f3d13529f0fe90d12784d97e93f

Fix wallpapers not applying in full screen

Change-Id: I01f451d0b9a2236c2cdf0c7533e6f13ef03b7bf2

WallpaperCropper requires these permission.

Without these it just crashes lockscreen wallpaper.

Change-Id: I25c676244a919ed355e02664828ddd79dd327062

WallpaperCropper: do not display null bitmaps

It is possible that themes can include a corrupted bitmap,
and the lockscreen will try and display a NULL image resulting in an
empty thumbnail and applying it will cause the app to crash.

Change-Id: Ie0770486a9d58050a5f296a219d844a39937421e
Signed-off-by: Roman Birg <roman@cyngn.com>

WallpaperCropper: include wallpapers from themes!

Theme all the things!!!!!!!!!

Change-Id: Ie9d5d4dfe6533442188e38fa0b11742368246e37
Signed-off-by: Roman Birg <roman@cyngn.com>

WallpaperCropper: load wallpapers in the background

Change-Id: I134d94a85f25bf5db4c15fa9a89265c53e5b0c1d
Signed-off-by: Roman Birg <roman@cyngn.com>

Notify callbacks on "any" wallpaper change

Callbacks are not notified when the wallpaper is changed to
a live wallpaper.  This patch notifies callbacks of the change
regardless of the type of wallpaper be set.

Change-Id: Icbb7b825cd7e7096c90c5498b6fee0bc61a3de3b

Keyguard: Make sure disabling Camera widget

This fixes the issue that Camera widget is enabled on non-camera devices
until users open up lockscreen settings

Change-Id: I599733f65ec31a16f8a8c5ee98a8a2ba6bc56c63

Conflicts:
packages/Keyguard/src/com/android/keyguard/KeyguardHostView.java

perf: Send a boost hint when a key on the navbar is pressed

* A lot of stuff happens, especially when invoking recents.
* Get ahead of the storm by sending a boost hint before
kicking off the animations.

Change-Id: I0cecd0c58f8bc8479ea44f63af796500d7b9d7d2

Conflicts:

packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyButtonView.java

Themes: Theme immersive mode cling.

Change-Id: I5521b93f69e859c40cfd62eb4a367562200074e9

Themes: Use first asset entry for lockscreen wallpaper

The current implementation assumes the wallpaper will be named
either wallpaper.png or wallpaper.jpg.  If this is not the case
the wallpaper is not applied.  This patch implements the lockscreen
wallpaper the same way that the regular wallpaper is done.

Change-Id: I9f3dd299c1e61158fa53c163f7e42e21e2f9b1dc

Conflicts:
core/java/android/content/pm/ThemeUtils.java

Themes: Use default_wallpaper for HOLO lockscreen wp

Change-Id: I9c7fd29c99d13e811993eb9b3b045010431ccad0

Conflicts:
services/java/com/android/server/ThemeService.java

Fix setting change observing.

The observer doesn't deal with keyguard related options only.

Change-Id: Ib185662f4f8ca7508be3dce10091b5132aa823e1

Conflicts:

packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java

Themes: Support applying components from multiple themes [1/3]

The current implementation assumes the components being passed
into the ThemeService belong to the same theme.  This patch uses
a Map instead of a List to pass in a mapping of components to
package names, allowing us to apply several components from
different themes.

Requesting a theme change now takes a Map<String, String> which
maps components to the theme package name they will be applied
from.
Example:
Map<String, String> componentMap = new HashMap<String,String>();
componentMap.add(ThemesColumns.MODIFIES_ICONS, "com.mytheme.blue");
componentMap.add(ThemesColumns.MODIFIES_OVERLAYS, "com.mytheme.red");

ThemeManager tm = (ThemeManager)
contex.getSystemService(Context.THEME_SERVICE);
tm.requestThemeChange(componentMap);

Change-Id: I13fa17eabecb824884fe522d5dc1822a4d7c55f4

Themes: Find wp asset when APK has dir entries

Some APKs are compiled with folders included as zip entries in the APK.
This was causing
lockscreen wp to not correctly be set.

Change-Id: I9eca7878b29e3cfcb43abc4a9dab084d9c200b83

WallpaperCropper: fix lockscreen wallpaper "Set wallpaper" string

The string is wrong and does not reflect the correct action the user is
about to apply.

Change-Id: I91eba87a38546563d6cf88138a0ed07219ec794f
Signed-off-by: Roman Birg <roman@cyngn.com>
Revert "services: don't clear wallpaper when SystemUI"

This reverts commit fb2840a98928be2fd02ec5ac98a16c8a21506c0c.

Change-Id: Ib23bd688f690c51afe2115cc7497d3cf508a091e
Fix: wallpaper changes when changing lockscreen WP

Since LockscreenWallpaperPickerActivity did not override
cropImageAndSetWallpaper the homescreen wallpaper was changing
when selecting the default_wallpaper resource.

Change-Id: I26dd28e628a3ef701ad92a81aa80327d3ccba092

Conflicts:
	packages/WallpaperCropper/src/com/android/wallpapercropper/LockWallpaperPickerActivity.java
Ensure to add Persistent Apps to LruProcess List on app restart

This change will ensure to add Persistent Apps to mLruProcesses
if not already present while restarting.Previously, on some
occasions, the process was not getting added to the list
resulting in SecurityException as this process was not found
in the mLruProcesses.

Change-Id: I26813a794e01aae316dffd3cf2bb38ab66ac69a9
Wifi: Fix 2 ip addresses issue

Invoking the function clearInterfaceAddresses to clear
the initial IP first when change the "IP Settings"
for the select AP.

Change-Id: I38f6614e66cc3cf8d84e03c19d2d4badb1b16108
CRs-Fixed: 683307
NetworkManagementService: Change exception type thrown on IPv6

Changed the exception type thrown from IllegalStateException to
RemoteException whenever the IPv6 tethering rules fail to apply. The
IllegalStateException is not caught by the caller causing the JVM
to crash. By throwing RemoteException, the caller will catch and
print and error message instead of crashing.

CRs-Fixed: 662171
Change-Id: I92fadd43479a330f09bb20f699a4b9852123ab68
Broadcast upstream interface change event independently for IPv4 & IPv6

On change in tethering upstream interface for IPV4 or IPV6 address,
broadcast an intent with the information viz iface name, ip address
type and update type(i.e add or delete).

Change-Id: I69339dc0cfe3ceb566eb1891e264ccfd07785b48
CRs-Fixed: 680728
Revert " Audio: SetForceUse config check in AudioService"

This reverts commit 0af88afe6dc16760b57afa74ca42e40fbe6ff9cf.

- During playback over BT using the Google Play Music app,
  if BT is disconnected through the app and playback is resumed,
  it continues over BT and not the speaker.
- The original commit forces playback to continue over BT
  although it is disconnected.
- Reverting the commit fixes this issue and the issue
  addressed by the commit is also not observed after reversion.

Change-Id: Ic7b04d0f271a7f6206d3a30f01c5a1567a23f790
CRs-Fixed: 679301
[View] Clear Hardware-Layers before system destroys HardwareRenderer​.

Symptom: Sometimes HardwareLayer display is corrupted.

Root Cause: In some cases, ViewRootImpl destroys HardwareRenderer​ without
clearing HardwareLayers in the view hirarchy. If the system trims memory fully
and kill the glContext at the same time, HardwareLayer may corrupt.

Solution: Clear Hardware-Layers before system destroys HardwareRenderer​.

Reproduce steps: Modify the cache's trim memory mechanism to make it easier to
trim fully, HardwareLayers implemented in app will easily be corrupted.
Modification of the cache is not required but make it easier to reproduce.

Change-Id: If57c802cdacf8dc37cbbcc199e74f9482834f981
[ActivityManager] Ensure alive process is not killedByAm.

Symptom: Unable to kill by Am again and will be skipped updating its oom adj.

Root Cause:
A restarted process will reuse original process record.
The flag killedByAm will keep previous state.

Solution:
Reset the flag killedByAm to false when the process is started.

Note: Found another similiar patch If95137d91939cc44882ad2813131bcde0edd0c1b

Change-Id: I59a86648ca8d0aed4c489d92751af120aae5ef90
[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
[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 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] Move top task to top in window manager

Symptom:
In certain situations, application starts activity while
it is in background. When an existing background activity
starts a new activity which results to be kept in the same
background task, the new activity won't be resumed.
In that case, the background task (sourceTask) should not be
moved to top in window manager.

Solution:
Move top task of the target stack to top in window manager

Change-Id: Id7a37ea67ce1f80e0c2b5399865c51fd7113deb8
[ActivityManager] Do not finish root activity when reset task

Symptom:
The root activity not always located at index 0 of the task.
For example, the index 1 activity will become the new root
when the original root activity (at index 0) finished.
The new root activity might be finished unexpectedly before
the original root activity actually destroyed.

Solution:
Check frontOfTask to avoid finishing the root activity unexpectedly

Change-Id: I623ab97e9c95c83b3cfe7c9dfc151a291a391ea4
[ActivityManager]: Update home process when home activity resumed

Symptom:
  When switch between two home activities, the home process might not be updated to the correct one. In that case, the home activity might be killed easily.

Root Cause:
  The home process is updated only when a home activity is newly created or being restarted. ActivityManager did not update the home process when simply resume a home activity.

Solution:
  Update home process when home activity resumed

Reproduce Steps:
  1. Install a launcher application, such as Apex Launcher
  2. Press home key to change to Apex Launcher by "Just once" option
  3. Press home key to switch back to original home activity by "Just once" option.
     (The home process is still the Apex Launcher's process because ActivityManager does not update the home process when resuming the original home activity.)

Change-Id: I046279ca7ba851a283ee67ea19202890f7b3f343
[ActivityManager] Avoid mistaking visibility by finishing task.

Sympton:
Next activity only adds to history but does not launch/resume then results ANR.

Root Cause:
In a rare timing, some windows are switched at the same time,
it will cause some finishing records on the top temporarily,
then set startIt to false that skip to resume the real top activty.

Solution:
If all activities in a task are finishing, do not use it to check.
The behavior/checking is the same concept as in JellyBean:
            // If starting in an existing task, find where that is...
            boolean startIt = true;
            for (int i = NH-1; i >= 0; i--) {
                ActivityRecord p = mHistory.get(i);
                if (p.finishing) { // <--
                    continue;
                }

Change-Id: I9d81a7b5182400c52e173da23eee61c74692beee
[ActivityManager] Prevent coredump file may not complete for testing.

Sympton:
During testing, skip kill native crash process manually because it will continue to die by default.

Root Cause:
Large process may take some time to do coredump.In auto test, crash process will be killed immediately that results incomplete coredump file.

Solution:
If the tester (IActivityController) will handle app crash event,
Do not kill native crashed process if the rom is debuggable.

Change-Id: Ia360af147d694125d440e5ba2f958c4759a50494
Fix a bug that the RecentTask list of other’s may show up to non-primary users.

When switching to a newly created user, the user may face this bug when he opens the RecentTask screen.
A possible bug scenario is described as follows:
A user id of a removed user may be recycled when created a new user.
However, mRecentTasks is not correctly controlled so that old information may still remain and be possibly mapped to wrong user.
This patch prevents this bug by explicitly removing old information in mRecentTasks when removing existing user.

Change-Id: I1874dbd604598a5d740ae1e034981e21214c15c6
Signed-off-by: Eunae Kim <eunae.kim@lge.com>