From e78499d6db2bbd11e92efb23294e8ef1e2538847 Mon Sep 17 00:00:00 2001 From: Sunny Goyal Date: Mon, 23 Jan 2017 10:57:58 -0800 Subject: [PATCH] Passing bind options to the service in the bind-widget permission prompt Test: Manually rested on device Change-Id: I155094b21be9641ef8e8646dea7e1a3a8dbde9ad --- src/com/android/settings/AllowBindAppWidgetActivity.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/com/android/settings/AllowBindAppWidgetActivity.java b/src/com/android/settings/AllowBindAppWidgetActivity.java index c3bf78ab512..2f98ab30556 100644 --- a/src/com/android/settings/AllowBindAppWidgetActivity.java +++ b/src/com/android/settings/AllowBindAppWidgetActivity.java @@ -42,6 +42,7 @@ public class AllowBindAppWidgetActivity extends AlertActivity implements private CheckBox mAlwaysUse; private int mAppWidgetId; + private Bundle mBindOptions; private UserHandle mProfile; private ComponentName mComponentName; private String mCallingPackage; @@ -57,7 +58,7 @@ public class AllowBindAppWidgetActivity extends AlertActivity implements if (mAppWidgetId != -1 && mComponentName != null && mCallingPackage != null) { try { final boolean bound = mAppWidgetManager.bindAppWidgetIdIfAllowed(mAppWidgetId, - mProfile, mComponentName, null); + mProfile, mComponentName, mBindOptions); if (bound) { Intent result = new Intent(); result.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, mAppWidgetId); @@ -100,6 +101,8 @@ public class AllowBindAppWidgetActivity extends AlertActivity implements } mComponentName = intent.getParcelableExtra(AppWidgetManager.EXTRA_APPWIDGET_PROVIDER); + mBindOptions = + intent.getParcelableExtra(AppWidgetManager.EXTRA_APPWIDGET_OPTIONS); mCallingPackage = getCallingPackage(); PackageManager pm = getPackageManager(); ApplicationInfo ai = pm.getApplicationInfo(mCallingPackage, 0);