Ensure that hotseat callout only occurs when appropriate

issue 13551957

Change-Id: I87bda7eef8047edbd41f066930ed156a17d042df
This commit is contained in:
Adam Cohen
2014-05-19 13:12:13 -07:00
parent 876b003901
commit 5eed5d8c7b
2 changed files with 10 additions and 15 deletions
+3
View File
@@ -4434,6 +4434,9 @@ public class Launcher extends Activity
}
}
protected boolean shouldClingFocusHotseatApp() {
return false;
}
protected String getFirstRunClingSearchBarHint() {
return "";
}
+7 -15
View File
@@ -264,21 +264,13 @@ class LauncherClings {
WORKSPACE_CLING_DISMISSED_KEY, false)) {
Cling c = initCling(R.id.workspace_cling, 0, false, true);
c.updateWorkspaceBubblePosition();
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();
if (mLauncher.shouldClingFocusHotseatApp()) {
// Set the focused hotseat app
c.setFocusedHotseatApp(mLauncher.getFirstRunFocusedHotseatAppDrawableId(),
mLauncher.getFirstRunFocusedHotseatAppRank(),
mLauncher.getFirstRunFocusedHotseatAppComponentName(),
mLauncher.getFirstRunFocusedHotseatAppBubbleTitle(),
mLauncher.getFirstRunFocusedHotseatAppBubbleDescription());
}
} else {
removeCling(R.id.workspace_cling);