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
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index b9f75cf..f885a6c 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -50,6 +50,11 @@
         android:label="@string/permlab_write_settings"
         android:description="@string/permdesc_write_settings"/>
 
+    <permission
+        android:name="com.android.launcher3.permission.RECEIVE_LAUNCH_BROADCASTS"
+        android:protectionLevel="signature"
+        />
+
     <uses-permission android:name="android.permission.CALL_PHONE" />
     <uses-permission android:name="android.permission.SET_WALLPAPER" />
     <uses-permission android:name="android.permission.SET_WALLPAPER_HINTS" />
@@ -60,6 +65,7 @@
     <uses-permission android:name="com.android.launcher.permission.WRITE_SETTINGS" />
     <uses-permission android:name="com.android.launcher3.permission.READ_SETTINGS" />
     <uses-permission android:name="com.android.launcher3.permission.WRITE_SETTINGS" />
+    <uses-permission android:name="com.android.launcher3.permission.RECEIVE_LAUNCH_BROADCASTS" />
 
     <application
         android:name="com.android.launcher3.LauncherApplication"