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

Commit 5504622f authored by Makoto Onuki's avatar Makoto Onuki
Browse files

ShortcutManager: add remaining APIs.

- Icons are now persisted. (under /data/system_ce, as PNGs)
- the "load icon" APIs in LauncherApps are supported.
- Implement updateShortcuts()

- Addressed all the comments on the previous CL
- @hide the newly added constructor for PersistableBundle

- Enhance incoming shortcut validation
- A lot of internal clean-up.

Bug 27548047

Change-Id: I8e3c1ccd3e0a997a6d271c84d81170f0c022b60e
parent 76cb56bb
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -9994,6 +9994,7 @@ package android.content.pm {
    method public int getWeight();
    method public boolean hasIconFile();
    method public boolean hasIconResource();
    method public boolean hasKeyFieldsOnly();
    method public boolean isDynamic();
    method public boolean isPinned();
    method public void writeToParcel(android.os.Parcel, int);
@@ -10004,6 +10005,7 @@ package android.content.pm {
    field public static final int FLAG_DYNAMIC = 1; // 0x1
    field public static final int FLAG_HAS_ICON_FILE = 8; // 0x8
    field public static final int FLAG_HAS_ICON_RES = 4; // 0x4
    field public static final int FLAG_KEY_FIELDS_ONLY = 16; // 0x10
    field public static final int FLAG_PINNED = 2; // 0x2
  }
@@ -10024,6 +10026,7 @@ package android.content.pm {
    method public void deleteAllDynamicShortcuts();
    method public void deleteDynamicShortcut(java.lang.String);
    method public java.util.List<android.content.pm.ShortcutInfo> getDynamicShortcuts();
    method public int getIconMaxDimensions();
    method public int getMaxDynamicShortcutCount();
    method public java.util.List<android.content.pm.ShortcutInfo> getPinnedShortcuts();
    method public long getRateLimitResetTime();
@@ -29080,7 +29083,6 @@ package android.os {
    ctor public PersistableBundle();
    ctor public PersistableBundle(int);
    ctor public PersistableBundle(android.os.PersistableBundle);
    ctor public PersistableBundle(android.os.Bundle);
    method public java.lang.Object clone();
    method public int describeContents();
    method public android.os.PersistableBundle getPersistableBundle(java.lang.String);
+3 −1
Original line number Diff line number Diff line
@@ -10388,6 +10388,7 @@ package android.content.pm {
    method public int getWeight();
    method public boolean hasIconFile();
    method public boolean hasIconResource();
    method public boolean hasKeyFieldsOnly();
    method public boolean isDynamic();
    method public boolean isPinned();
    method public void writeToParcel(android.os.Parcel, int);
@@ -10398,6 +10399,7 @@ package android.content.pm {
    field public static final int FLAG_DYNAMIC = 1; // 0x1
    field public static final int FLAG_HAS_ICON_FILE = 8; // 0x8
    field public static final int FLAG_HAS_ICON_RES = 4; // 0x4
    field public static final int FLAG_KEY_FIELDS_ONLY = 16; // 0x10
    field public static final int FLAG_PINNED = 2; // 0x2
  }
@@ -10418,6 +10420,7 @@ package android.content.pm {
    method public void deleteAllDynamicShortcuts();
    method public void deleteDynamicShortcut(java.lang.String);
    method public java.util.List<android.content.pm.ShortcutInfo> getDynamicShortcuts();
    method public int getIconMaxDimensions();
    method public int getMaxDynamicShortcutCount();
    method public java.util.List<android.content.pm.ShortcutInfo> getPinnedShortcuts();
    method public long getRateLimitResetTime();
@@ -31360,7 +31363,6 @@ package android.os {
    ctor public PersistableBundle();
    ctor public PersistableBundle(int);
    ctor public PersistableBundle(android.os.PersistableBundle);
    ctor public PersistableBundle(android.os.Bundle);
    method public java.lang.Object clone();
    method public int describeContents();
    method public android.os.PersistableBundle getPersistableBundle(java.lang.String);
+3 −1
Original line number Diff line number Diff line
@@ -10004,6 +10004,7 @@ package android.content.pm {
    method public int getWeight();
    method public boolean hasIconFile();
    method public boolean hasIconResource();
    method public boolean hasKeyFieldsOnly();
    method public boolean isDynamic();
    method public boolean isPinned();
    method public void writeToParcel(android.os.Parcel, int);
@@ -10014,6 +10015,7 @@ package android.content.pm {
    field public static final int FLAG_DYNAMIC = 1; // 0x1
    field public static final int FLAG_HAS_ICON_FILE = 8; // 0x8
    field public static final int FLAG_HAS_ICON_RES = 4; // 0x4
    field public static final int FLAG_KEY_FIELDS_ONLY = 16; // 0x10
    field public static final int FLAG_PINNED = 2; // 0x2
  }
@@ -10034,6 +10036,7 @@ package android.content.pm {
    method public void deleteAllDynamicShortcuts();
    method public void deleteDynamicShortcut(java.lang.String);
    method public java.util.List<android.content.pm.ShortcutInfo> getDynamicShortcuts();
    method public int getIconMaxDimensions();
    method public int getMaxDynamicShortcutCount();
    method public java.util.List<android.content.pm.ShortcutInfo> getPinnedShortcuts();
    method public long getRateLimitResetTime();
@@ -29091,7 +29094,6 @@ package android.os {
    ctor public PersistableBundle();
    ctor public PersistableBundle(int);
    ctor public PersistableBundle(android.os.PersistableBundle);
    ctor public PersistableBundle(android.os.Bundle);
    method public java.lang.Object clone();
    method public int describeContents();
    method public android.os.PersistableBundle getPersistableBundle(java.lang.String);
+5 −6
Original line number Diff line number Diff line
@@ -756,8 +756,7 @@ final class SystemServiceRegistry {
            @Override
            public ShortcutManager createService(ContextImpl ctx) {
                IBinder b = ServiceManager.getService(Context.SHORTCUT_SERVICE);
                        return new ShortcutManager(ctx,
                                IShortcutService.Stub.asInterface(b));
                return new ShortcutManager(ctx, IShortcutService.Stub.asInterface(b));
            }});
    }

+6 −0
Original line number Diff line number Diff line
@@ -26,6 +26,8 @@ import android.content.pm.ShortcutInfo;
import android.graphics.Rect;
import android.os.Bundle;
import android.os.UserHandle;
import android.os.ParcelFileDescriptor;

import java.util.List;

/**
@@ -52,4 +54,8 @@ interface ILauncherApps {
            in UserHandle user);
    boolean startShortcut(String callingPackage, String packageName, String id,
            in Rect sourceBounds, in Bundle startActivityOptions, in UserHandle user);

    int getShortcutIconResId(String callingPackage, in ShortcutInfo shortcut, in UserHandle user);
    ParcelFileDescriptor getShortcutIconFd(String callingPackage, in ShortcutInfo shortcut,
            in UserHandle user);
}
Loading