summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/WallpaperChangedReceiver.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/launcher3/WallpaperChangedReceiver.java')
-rw-r--r--src/com/android/launcher3/WallpaperChangedReceiver.java15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/com/android/launcher3/WallpaperChangedReceiver.java b/src/com/android/launcher3/WallpaperChangedReceiver.java
index 2d5612f12..0a6a7efa5 100644
--- a/src/com/android/launcher3/WallpaperChangedReceiver.java
+++ b/src/com/android/launcher3/WallpaperChangedReceiver.java
@@ -20,10 +20,25 @@ import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
+import android.content.SharedPreferences;
+import com.android.launcher3.stats.LauncherStats;
+
public class WallpaperChangedReceiver extends BroadcastReceiver {
public void onReceive(Context context, Intent data) {
LauncherAppState.setApplicationContext(context.getApplicationContext());
LauncherAppState appState = LauncherAppState.getInstance();
appState.onWallpaperChanged();
+ SharedPreferences prefs = context.getSharedPreferences(LauncherAppState
+ .getSharedPreferencesKey(), Context.MODE_PRIVATE);
+ boolean fromSelf = prefs.getBoolean(Launcher.LONGPRESS_CHANGE, false);
+ if (fromSelf) {
+ prefs.edit().putBoolean(Launcher.LONGPRESS_CHANGE, false).apply();
+ LauncherApplication.getLauncherStats().sendWallpaperChangedEvent(
+ LauncherStats.ORIGIN_TREB_LONGPRESS);
+ } else {
+ LauncherApplication.getLauncherStats().sendWallpaperChangedEvent(
+ LauncherStats.ORIGIN_CHOOSER);
+ }
+
}
}