summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/Launcher.java
diff options
context:
space:
mode:
authorDaniel Sandler <dsandler@android.com>2013-08-05 02:12:05 -0400
committerDaniel Sandler <dsandler@android.com>2013-08-06 00:18:38 -0400
commitff02d49e464c2fe92ba625a3046f31aa042e5d32 (patch)
tree8b766db2f5690e011fa0c2c2b3c235c593c9fdc4 /src/com/android/launcher3/Launcher.java
parent482a5b6ed389ef943990277e461444626c34ebf2 (diff)
downloadandroid_packages_apps_Trebuchet-ff02d49e464c2fe92ba625a3046f31aa042e5d32.tar.gz
android_packages_apps_Trebuchet-ff02d49e464c2fe92ba625a3046f31aa042e5d32.tar.bz2
android_packages_apps_Trebuchet-ff02d49e464c2fe92ba625a3046f31aa042e5d32.zip
Initial implementation: Broadcasts on app launch.
Look for com.android.launcher3.action.LAUNCH to be sent when an icon is clicked in Launcher. (Restricted to com.android.launcher3.permission.RECEIVE_LAUNCH_BROADCASTS which is a signature permission right now. This is specifically tracking apps launched via shortcut icon; any other method of launching apps (notifications, recents, internal navigation, etc.) is outside of Launcher's purview and hence not broadcast. The broadcast currently includes, in the "intent" extra, the Uri flattening of the specific shortcut clicked. The file /data/data/<pkg>/files/launches.log contains a binary log of all such launches, including additional info like screen# that should probably be in the broadcast too. This info is summarized in .../stats.log, which encodes a simple histogram of app launches since basically forever. This should probably be done over a sliding window, which will require more processing on startup. Bug: 10031590 Change-Id: Ifc5921d5dc20701c67678cbfdc89b03cacd62028
Diffstat (limited to 'src/com/android/launcher3/Launcher.java')
-rw-r--r--src/com/android/launcher3/Launcher.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index fa9627973..c3ea1ef8a 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -345,6 +345,8 @@ public class Launcher extends Activity
int cellY;
}
+ private Stats mStats;
+
private static boolean isPropertyEnabled(String propertyName) {
return Log.isLoggable(propertyName, Log.VERBOSE);
}
@@ -378,6 +380,8 @@ public class Launcher extends Activity
mDragController = new DragController(this);
mInflater = getLayoutInflater();
+ mStats = new Stats(this);
+
mAppWidgetManager = AppWidgetManager.getInstance(this);
mAppWidgetHost = new LauncherAppWidgetHost(this, APPWIDGET_HOST_ID);
mAppWidgetHost.startListening();
@@ -2086,7 +2090,8 @@ public class Launcher extends Activity
Object tag = v.getTag();
if (tag instanceof ShortcutInfo) {
// Open shortcut
- final Intent intent = ((ShortcutInfo) tag).intent;
+ final ShortcutInfo shortcut = (ShortcutInfo) tag;
+ final Intent intent = shortcut.intent;
// Check for special shortcuts
if (intent.getComponent() != null) {
@@ -2112,6 +2117,8 @@ public class Launcher extends Activity
boolean success = startActivitySafely(v, intent, tag);
+ mStats.recordLaunch(intent, shortcut);
+
if (success && v instanceof BubbleTextView) {
mWaitingForResume = (BubbleTextView) v;
mWaitingForResume.setStayPressed(true);