summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/widget/WidgetAddFlowHandler.java
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2017-07-03 13:50:52 -0700
committerSunny Goyal <sunnygoyal@google.com>2017-07-21 14:10:13 -0700
commit64a75aa305bdd1ca8f22d2b48dedc5cada8fabc5 (patch)
treece56a7e74ed2dcbcec78dacbbbc9494b9ef0ca44 /src/com/android/launcher3/widget/WidgetAddFlowHandler.java
parent70999fef4bc37bcf32556e2de23ec115dbd30cf8 (diff)
downloadandroid_packages_apps_Trebuchet-64a75aa305bdd1ca8f22d2b48dedc5cada8fabc5.tar.gz
android_packages_apps_Trebuchet-64a75aa305bdd1ca8f22d2b48dedc5cada8fabc5.tar.bz2
android_packages_apps_Trebuchet-64a75aa305bdd1ca8f22d2b48dedc5cada8fabc5.zip
Adding A feature flag to disable widgets and a corresponding build
target Launcher3Go without widgets support Bug: 62353159 Change-Id: Ia03d2235a9bcf75f9ef191924f81630e63a2c684
Diffstat (limited to 'src/com/android/launcher3/widget/WidgetAddFlowHandler.java')
-rw-r--r--src/com/android/launcher3/widget/WidgetAddFlowHandler.java18
1 files changed, 3 insertions, 15 deletions
diff --git a/src/com/android/launcher3/widget/WidgetAddFlowHandler.java b/src/com/android/launcher3/widget/WidgetAddFlowHandler.java
index 629f30c26..5387be839 100644
--- a/src/com/android/launcher3/widget/WidgetAddFlowHandler.java
+++ b/src/com/android/launcher3/widget/WidgetAddFlowHandler.java
@@ -15,10 +15,8 @@
*/
package com.android.launcher3.widget;
-import android.appwidget.AppWidgetManager;
import android.appwidget.AppWidgetProviderInfo;
import android.content.Context;
-import android.content.Intent;
import android.os.Parcel;
import android.os.Parcelable;
@@ -26,7 +24,6 @@ import com.android.launcher3.ItemInfo;
import com.android.launcher3.Launcher;
import com.android.launcher3.LauncherAppWidgetInfo;
import com.android.launcher3.LauncherAppWidgetProviderInfo;
-import com.android.launcher3.compat.AppWidgetManagerCompat;
import com.android.launcher3.util.PendingRequestArgs;
/**
@@ -56,15 +53,8 @@ public class WidgetAddFlowHandler implements Parcelable {
public void startBindFlow(Launcher launcher, int appWidgetId, ItemInfo info, int requestCode) {
launcher.setWaitingForResult(PendingRequestArgs.forWidgetInfo(appWidgetId, this, info));
-
- Intent intent = new Intent(AppWidgetManager.ACTION_APPWIDGET_BIND);
- intent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId);
- intent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_PROVIDER, mProviderInfo.provider);
- intent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_PROVIDER_PROFILE,
- mProviderInfo.getProfile());
- // TODO: we need to make sure that this accounts for the options bundle.
- // intent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_OPTIONS, options);
- launcher.startActivityForResult(intent, requestCode);
+ launcher.getAppWidgetHost()
+ .startBindFlow(launcher, appWidgetId, mProviderInfo, requestCode);
}
/**
@@ -85,9 +75,7 @@ public class WidgetAddFlowHandler implements Parcelable {
return false;
}
launcher.setWaitingForResult(PendingRequestArgs.forWidgetInfo(appWidgetId, this, info));
-
- AppWidgetManagerCompat.getInstance(launcher).startConfigActivity(
- mProviderInfo, appWidgetId, launcher, launcher.getAppWidgetHost(), requestCode);
+ launcher.getAppWidgetHost().startConfigActivity(launcher, appWidgetId, requestCode);
return true;
}