Make com.android.launcher3.action.LAUNCH intent explicit

b/27967359

Change-Id: I355ffc0af07d5bddcf87d41cf42bead9d5c824dc
This commit is contained in:
Hyunyoung Song
2016-04-08 10:55:50 -07:00
parent 04907eea71
commit f9dc857a0e
2 changed files with 11 additions and 1 deletions
+4
View File
@@ -71,6 +71,10 @@
filter the activities shown in the launcher. Can be empty. -->
<string name="app_filter_class" translatable="false"></string>
<!-- Name of a packages that com.android.launcher3.action.LAUNCH
should be targeting. Can be empty. -->
<array name="launch_broadcast_targets" translatable="false"></array>
<!-- View ID to use for QSB widget -->
<item type="id" name="qsb_widget" />
+7 -1
View File
@@ -132,6 +132,7 @@ public class Stats {
final String flat = intent.toUri(0);
Intent broadcastIntent = new Intent(ACTION_LAUNCH).putExtra(EXTRA_INTENT, flat);
if (shortcut != null) {
broadcastIntent.putExtra(EXTRA_CONTAINER, shortcut.container)
.putExtra(EXTRA_SCREEN, shortcut.screenId)
@@ -142,6 +143,11 @@ public class Stats {
Bundle sourceExtras = LaunchSourceUtils.createSourceData();
LaunchSourceUtils.populateSourceDataFromAncestorProvider(v, sourceExtras);
broadcastIntent.putExtra(EXTRA_SOURCE, sourceExtras);
mLauncher.sendBroadcast(broadcastIntent, mLaunchBroadcastPermission);
String[] packages = mLauncher.getResources().getStringArray(R.array.launch_broadcast_targets);
for(String p: packages) {
broadcastIntent.setPackage(p);
mLauncher.sendBroadcast(broadcastIntent, mLaunchBroadcastPermission);
}
}
}