OSDN Git Service

Updating java doc for requestPinAppWidget
authorSunny Goyal <sunnygoyal@google.com>
Thu, 8 Mar 2018 19:23:06 +0000 (11:23 -0800)
committerSunny Goyal <sunnygoyal@google.com>
Sat, 17 Mar 2018 21:24:35 +0000 (21:24 +0000)
Bug: 74435565
Test: N/A
Change-Id: Iae290e411929c817721f481301f8fb057ebe7b2c

core/java/android/appwidget/AppWidgetManager.java
core/java/android/content/pm/LauncherApps.java

index e736f34..f67ec4a 100644 (file)
@@ -35,7 +35,6 @@ import android.content.pm.ParceledListSlice;
 import android.content.pm.ShortcutInfo;
 import android.os.Bundle;
 import android.os.Handler;
-import android.os.Process;
 import android.os.RemoteException;
 import android.os.UserHandle;
 import android.util.DisplayMetrics;
@@ -1186,6 +1185,11 @@ public class AppWidgetManager {
      * calls this API multiple times in a row.  It may ignore the previous requests,
      * for example.
      *
+     * <p>Launcher will not show the configuration activity associated with the provider in this
+     * case. The app could either show the configuration activity as a response to the callback,
+     * or show if before calling the API (various configurations can be encapsulated in
+     * {@code successCallback} to avoid persisting them before the widgetId is known).
+     *
      * @param provider The {@link ComponentName} for the {@link
      *    android.content.BroadcastReceiver BroadcastReceiver} provider for your AppWidget.
      * @param extras In not null, this is passed to the launcher app. For eg {@link
index b4a7eec..21ede16 100644 (file)
@@ -1429,6 +1429,10 @@ public class LauncherApps {
          * Always non-null for a {@link #REQUEST_TYPE_APPWIDGET} request, and always null for a
          * different request type.
          *
+         * <p>Launcher should not show any configuration activity associated with the provider, and
+         * assume that the widget is already fully configured. Upon accepting the widget, it should
+         * pass the widgetId in {@link #accept(Bundle)}.
+         *
          * @return requested {@link AppWidgetProviderInfo} when a request is of the
          * {@link #REQUEST_TYPE_APPWIDGET} type.  Null otherwise.
          */