summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWinson Chung <winsonc@google.com>2014-04-05 02:57:36 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-04-05 02:57:36 +0000
commit45df45fc020beb0e6cd55c17452f980e5983b740 (patch)
tree553be88b7117cf6889d686c6eca2a8a80bc7eaab
parentf8f1ec378ee9176e922eef5ef736e4c257a2d56a (diff)
parent69dffdb83a614a6b02a2363e0ade510948549972 (diff)
downloadandroid_packages_apps_Trebuchet-45df45fc020beb0e6cd55c17452f980e5983b740.tar.gz
android_packages_apps_Trebuchet-45df45fc020beb0e6cd55c17452f980e5983b740.tar.bz2
android_packages_apps_Trebuchet-45df45fc020beb0e6cd55c17452f980e5983b740.zip
am 69dffdb8: Disabling the focused hotseat app cling if GEL is not preinstalled on the device. (Bug. 13551957)
* commit '69dffdb83a614a6b02a2363e0ade510948549972': Disabling the focused hotseat app cling if GEL is not preinstalled on the device. (Bug. 13551957)
-rw-r--r--src/com/android/launcher3/LauncherClings.java24
1 files changed, 18 insertions, 6 deletions
diff --git a/src/com/android/launcher3/LauncherClings.java b/src/com/android/launcher3/LauncherClings.java
index 952edfd06..97138eeaa 100644
--- a/src/com/android/launcher3/LauncherClings.java
+++ b/src/com/android/launcher3/LauncherClings.java
@@ -21,8 +21,11 @@ import android.accounts.AccountManager;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.app.ActivityManager;
+import android.content.ComponentName;
import android.content.Context;
import android.content.SharedPreferences;
+import android.content.pm.ApplicationInfo;
+import android.content.pm.PackageManager;
import android.graphics.Rect;
import android.os.Bundle;
import android.os.UserManager;
@@ -262,12 +265,21 @@ class LauncherClings {
Cling c = initCling(R.id.workspace_cling, 0, false, true);
c.updateWorkspaceBubblePosition();
- // Set the focused hotseat app if there is one
- c.setFocusedHotseatApp(mLauncher.getFirstRunFocusedHotseatAppDrawableId(),
- mLauncher.getFirstRunFocusedHotseatAppRank(),
- mLauncher.getFirstRunFocusedHotseatAppComponentName(),
- mLauncher.getFirstRunFocusedHotseatAppBubbleTitle(),
- mLauncher.getFirstRunFocusedHotseatAppBubbleDescription());
+ try {
+ // We only enable the focused hotseat app if we are preinstalled
+ PackageManager pm = mLauncher.getPackageManager();
+ ApplicationInfo ai = pm.getApplicationInfo(mLauncher.getPackageName(), 0);
+ if ((ai.flags & ApplicationInfo.FLAG_SYSTEM) != 0) {
+ // Set the focused hotseat app
+ c.setFocusedHotseatApp(mLauncher.getFirstRunFocusedHotseatAppDrawableId(),
+ mLauncher.getFirstRunFocusedHotseatAppRank(),
+ mLauncher.getFirstRunFocusedHotseatAppComponentName(),
+ mLauncher.getFirstRunFocusedHotseatAppBubbleTitle(),
+ mLauncher.getFirstRunFocusedHotseatAppBubbleDescription());
+ }
+ } catch (PackageManager.NameNotFoundException e) {
+ e.printStackTrace();
+ }
} else {
removeCling(R.id.workspace_cling);
}