summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/Launcher.java
diff options
context:
space:
mode:
authorAdam Cohen <adamcohen@google.com>2014-07-23 18:21:20 -0700
committerAdam Cohen <adamcohen@google.com>2014-07-23 20:40:09 -0700
commit3ed316a71d5ec5be2e25ba0a993ebd71a260217c (patch)
tree64d66cdf5f43895da027ed4811381beb3b1c1a37 /src/com/android/launcher3/Launcher.java
parenta043fa89211541c71b5bef052ebc49f722d338b9 (diff)
downloadandroid_packages_apps_Trebuchet-3ed316a71d5ec5be2e25ba0a993ebd71a260217c.tar.gz
android_packages_apps_Trebuchet-3ed316a71d5ec5be2e25ba0a993ebd71a260217c.tar.bz2
android_packages_apps_Trebuchet-3ed316a71d5ec5be2e25ba0a993ebd71a260217c.zip
Adding broadcast to indicate first launcher load
-> fixing small thing from previous CL issue 16191557 Change-Id: I015859f6028066e7c8664436f291ed226a539e29
Diffstat (limited to 'src/com/android/launcher3/Launcher.java')
-rw-r--r--src/com/android/launcher3/Launcher.java17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index 65f9cbee8..718634d42 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -209,6 +209,10 @@ public class Launcher extends Activity
static final String INTRO_SCREEN_DISMISSED = "launcher.intro_screen_dismissed";
static final String FIRST_RUN_ACTIVITY_DISPLAYED = "launcher.first_run_activity_displayed";
+ static final String FIRST_LOAD_COMPLETE = "launcher.first_load_complete";
+ static final String ACTION_FIRST_LOAD_COMPLETE =
+ "com.android.launcher3.action.FIRST_LOAD_COMPLETE";
+
private static final String TOOLBAR_ICON_METADATA_NAME = "com.android.launcher.toolbar_icon";
private static final String TOOLBAR_SEARCH_ICON_METADATA_NAME =
"com.android.launcher.toolbar_search_icon";
@@ -4454,6 +4458,7 @@ public class Launcher extends Activity
}
setWorkspaceLoading(false);
+ sendLoadingCompleteBroadcastIfNecessary();
// If we received the result of any pending adds while the loader was running (e.g. the
// widget configuration forced an orientation change), process them now.
@@ -4478,6 +4483,18 @@ public class Launcher extends Activity
}
}
+ private void sendLoadingCompleteBroadcastIfNecessary() {
+ if (!mSharedPrefs.getBoolean(FIRST_LOAD_COMPLETE, false)) {
+ String permission =
+ getResources().getString(R.string.receive_first_load_broadcast_permission);
+ Intent intent = new Intent(ACTION_FIRST_LOAD_COMPLETE);
+ sendBroadcast(intent, permission);
+ SharedPreferences.Editor editor = mSharedPrefs.edit();
+ editor.putBoolean(FIRST_LOAD_COMPLETE, true);
+ editor.apply();
+ }
+ }
+
public boolean isAllAppsButtonRank(int rank) {
if (mHotseat != null) {
return mHotseat.isAllAppsButtonRank(rank);