Ensure that hotseat callout only occurs when appropriate
issue 13551957 Change-Id: I87bda7eef8047edbd41f066930ed156a17d042df
This commit is contained in:
@@ -4434,6 +4434,9 @@ public class Launcher extends Activity
|
||||
}
|
||||
}
|
||||
|
||||
protected boolean shouldClingFocusHotseatApp() {
|
||||
return false;
|
||||
}
|
||||
protected String getFirstRunClingSearchBarHint() {
|
||||
return "";
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user