summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2014-07-07 15:28:02 -0700
committerSunny Goyal <sunnygoyal@google.com>2014-07-07 17:52:35 -0700
commit481c1fb796ea00d725b079a98cd6958247794a83 (patch)
tree305d8df73086680e2c81044a907d5c07c86cd963 /src
parente54e67f8982f42190dcc3b2ee02092f474d1f7c6 (diff)
downloadandroid_packages_apps_Trebuchet-481c1fb796ea00d725b079a98cd6958247794a83.tar.gz
android_packages_apps_Trebuchet-481c1fb796ea00d725b079a98cd6958247794a83.tar.bz2
android_packages_apps_Trebuchet-481c1fb796ea00d725b079a98cd6958247794a83.zip
Fixing icon disappearing when apps are moved to sdcard
For intents, external application unavailable/available, the extra argument 'replacing' is not sent for jelly beans and lower devices. Using appropriate default value issue: 15852084 Change-Id: I865aa22a16700629fffe440a4b92a634a0ba8ae7
Diffstat (limited to 'src')
-rw-r--r--src/com/android/launcher3/compat/LauncherAppsCompatV16.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/com/android/launcher3/compat/LauncherAppsCompatV16.java b/src/com/android/launcher3/compat/LauncherAppsCompatV16.java
index f30c28b82..de9f3a032 100644
--- a/src/com/android/launcher3/compat/LauncherAppsCompatV16.java
+++ b/src/com/android/launcher3/compat/LauncherAppsCompatV16.java
@@ -174,13 +174,18 @@ public class LauncherAppsCompatV16 extends LauncherAppsCompat {
}
}
} else if (Intent.ACTION_EXTERNAL_APPLICATIONS_AVAILABLE.equals(action)) {
- final boolean replacing = intent.getBooleanExtra(Intent.EXTRA_REPLACING, false);
+ // EXTRA_REPLACING is available Kitkat onwards. For lower devices, it is broadcasted
+ // when moving a package or mounting/un-mounting external storage. Assume that
+ // it is a replacing operation.
+ final boolean replacing = intent.getBooleanExtra(Intent.EXTRA_REPLACING,
+ Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT);
String[] packages = intent.getStringArrayExtra(Intent.EXTRA_CHANGED_PACKAGE_LIST);
for (OnAppsChangedCallbackCompat callback : getCallbacks()) {
callback.onPackagesAvailable(packages, user, replacing);
}
} else if (Intent.ACTION_EXTERNAL_APPLICATIONS_UNAVAILABLE.equals(action)) {
- final boolean replacing = intent.getBooleanExtra(Intent.EXTRA_REPLACING, false);
+ final boolean replacing = intent.getBooleanExtra(Intent.EXTRA_REPLACING,
+ Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT);
String[] packages = intent.getStringArrayExtra(Intent.EXTRA_CHANGED_PACKAGE_LIST);
for (OnAppsChangedCallbackCompat callback : getCallbacks()) {
callback.onPackagesUnavailable(packages, user, replacing);