Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 33d9bc52 authored by Sunny Goyal's avatar Sunny Goyal Committed by Android (Google) Code Review
Browse files

Merge "Adding AppWidgetManager.isRequestPinAppWidgetSupported"

parents 4e231da7 7f7372ae
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -6911,6 +6911,7 @@ package android.appwidget {
    method public java.util.List<android.appwidget.AppWidgetProviderInfo> getInstalledProviders();
    method public java.util.List<android.appwidget.AppWidgetProviderInfo> getInstalledProvidersForProfile(android.os.UserHandle);
    method public static android.appwidget.AppWidgetManager getInstance(android.content.Context);
    method public boolean isRequestPinAppWidgetSupported();
    method public void notifyAppWidgetViewDataChanged(int[], int);
    method public void notifyAppWidgetViewDataChanged(int, int);
    method public void partiallyUpdateAppWidget(int[], android.widget.RemoteViews);
@@ -9918,7 +9919,8 @@ package android.content.pm {
    method public void startShortcut(java.lang.String, java.lang.String, android.graphics.Rect, android.os.Bundle, android.os.UserHandle);
    method public void startShortcut(android.content.pm.ShortcutInfo, android.graphics.Rect, android.os.Bundle);
    method public void unregisterCallback(android.content.pm.LauncherApps.Callback);
    field public static final java.lang.String ACTION_CONFIRM_PIN_ITEM = "android.content.pm.action.CONFIRM_PIN_ITEM";
    field public static final java.lang.String ACTION_CONFIRM_PIN_APPWIDGET = "android.content.pm.action.CONFIRM_PIN_APPWIDGET";
    field public static final java.lang.String ACTION_CONFIRM_PIN_SHORTCUT = "android.content.pm.action.CONFIRM_PIN_SHORTCUT";
    field public static final java.lang.String EXTRA_PIN_ITEM_REQUEST = "android.content.pm.extra.PIN_ITEM_REQUEST";
  }
+3 −1
Original line number Diff line number Diff line
@@ -7266,6 +7266,7 @@ package android.appwidget {
    method public java.util.List<android.appwidget.AppWidgetProviderInfo> getInstalledProviders();
    method public java.util.List<android.appwidget.AppWidgetProviderInfo> getInstalledProvidersForProfile(android.os.UserHandle);
    method public static android.appwidget.AppWidgetManager getInstance(android.content.Context);
    method public boolean isRequestPinAppWidgetSupported();
    method public void notifyAppWidgetViewDataChanged(int[], int);
    method public void notifyAppWidgetViewDataChanged(int, int);
    method public void partiallyUpdateAppWidget(int[], android.widget.RemoteViews);
@@ -10381,7 +10382,8 @@ package android.content.pm {
    method public void startShortcut(java.lang.String, java.lang.String, android.graphics.Rect, android.os.Bundle, android.os.UserHandle);
    method public void startShortcut(android.content.pm.ShortcutInfo, android.graphics.Rect, android.os.Bundle);
    method public void unregisterCallback(android.content.pm.LauncherApps.Callback);
    field public static final java.lang.String ACTION_CONFIRM_PIN_ITEM = "android.content.pm.action.CONFIRM_PIN_ITEM";
    field public static final java.lang.String ACTION_CONFIRM_PIN_APPWIDGET = "android.content.pm.action.CONFIRM_PIN_APPWIDGET";
    field public static final java.lang.String ACTION_CONFIRM_PIN_SHORTCUT = "android.content.pm.action.CONFIRM_PIN_SHORTCUT";
    field public static final java.lang.String EXTRA_PIN_ITEM_REQUEST = "android.content.pm.extra.PIN_ITEM_REQUEST";
  }
+3 −1
Original line number Diff line number Diff line
@@ -6934,6 +6934,7 @@ package android.appwidget {
    method public java.util.List<android.appwidget.AppWidgetProviderInfo> getInstalledProviders();
    method public java.util.List<android.appwidget.AppWidgetProviderInfo> getInstalledProvidersForProfile(android.os.UserHandle);
    method public static android.appwidget.AppWidgetManager getInstance(android.content.Context);
    method public boolean isRequestPinAppWidgetSupported();
    method public void notifyAppWidgetViewDataChanged(int[], int);
    method public void notifyAppWidgetViewDataChanged(int, int);
    method public void partiallyUpdateAppWidget(int[], android.widget.RemoteViews);
@@ -9947,7 +9948,8 @@ package android.content.pm {
    method public void startShortcut(java.lang.String, java.lang.String, android.graphics.Rect, android.os.Bundle, android.os.UserHandle);
    method public void startShortcut(android.content.pm.ShortcutInfo, android.graphics.Rect, android.os.Bundle);
    method public void unregisterCallback(android.content.pm.LauncherApps.Callback);
    field public static final java.lang.String ACTION_CONFIRM_PIN_ITEM = "android.content.pm.action.CONFIRM_PIN_ITEM";
    field public static final java.lang.String ACTION_CONFIRM_PIN_APPWIDGET = "android.content.pm.action.CONFIRM_PIN_APPWIDGET";
    field public static final java.lang.String ACTION_CONFIRM_PIN_SHORTCUT = "android.content.pm.action.CONFIRM_PIN_SHORTCUT";
    field public static final java.lang.String EXTRA_PIN_ITEM_REQUEST = "android.content.pm.extra.PIN_ITEM_REQUEST";
  }
+13 −0
Original line number Diff line number Diff line
@@ -1071,6 +1071,18 @@ public class AppWidgetManager {
        }
    }

    /**
     * Return {@code TRUE} if the default launcher supports
     * {@link #requestPinAppWidget(ComponentName, PendingIntent)}
     */
    public boolean isRequestPinAppWidgetSupported() {
        try {
            return mService.isRequestPinAppWidgetSupported();
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }
    }

    /**
     * Request to pin an app widget on the current launcher. It's up to the launcher to accept this
     * request (optionally showing a user confirmation). If the request is accepted, the caller will
@@ -1095,6 +1107,7 @@ public class AppWidgetManager {
     *
     * @see android.content.pm.ShortcutManager#isRequestPinShortcutSupported()
     * @see android.content.pm.ShortcutManager#requestPinShortcut(ShortcutInfo, IntentSender)
     * @see #isRequestPinAppWidgetSupported()
     *
     * @throws IllegalStateException The caller doesn't have a foreground activity or a foreground
     * service or when the user is locked.
+1 −1
Original line number Diff line number Diff line
@@ -71,5 +71,5 @@ interface IShortcutService {

    void applyRestore(in byte[] payload, int user);

    boolean isRequestPinShortcutSupported(int user);
    boolean isRequestPinItemSupported(int user, int requestType);
}
 No newline at end of file
Loading