Skip to content

Commit 0a75b94

Browse files
committed
Supporting EXTRA_APPWIDGET_OPTIONS correctly
1 parent d812e7a commit 0a75b94

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

policy/src/com/android/internal/policy/impl/keyguard/KeyguardHostView.java

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -917,7 +917,10 @@ private void launchPickActivityIntent() {
917917
pickIntent.putExtra(AppWidgetManager.EXTRA_CATEGORY_FILTER,
918918
AppWidgetProviderInfo.WIDGET_CATEGORY_KEYGUARD);
919919

920-
pickIntent.putExtra(Intent.EXTRA_INTENT, getBaseIntent());
920+
Bundle options = new Bundle();
921+
options.putInt(AppWidgetManager.OPTION_APPWIDGET_HOST_CATEGORY,
922+
AppWidgetProviderInfo.WIDGET_CATEGORY_KEYGUARD);
923+
pickIntent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_OPTIONS, options);
921924
pickIntent.addFlags(
922925
Intent.FLAG_ACTIVITY_NEW_TASK
923926
| Intent.FLAG_ACTIVITY_SINGLE_TOP
@@ -930,17 +933,6 @@ private void launchPickActivityIntent() {
930933
}
931934
}
932935

933-
private Intent getBaseIntent() {
934-
Intent baseIntent = new Intent(Intent.ACTION_MAIN, null);
935-
baseIntent.addCategory(Intent.CATEGORY_DEFAULT);
936-
937-
Bundle options = new Bundle();
938-
options.putInt(AppWidgetManager.OPTION_APPWIDGET_HOST_CATEGORY,
939-
AppWidgetProviderInfo.WIDGET_CATEGORY_KEYGUARD);
940-
baseIntent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_OPTIONS, options);
941-
return baseIntent;
942-
}
943-
944936
private void removeTransportFromWidgetPager() {
945937
int page = getWidgetPosition(R.id.keyguard_transport_control);
946938
if (page != -1) {

0 commit comments

Comments
 (0)