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

Commit 157b1628 authored by Makoto Onuki's avatar Makoto Onuki
Browse files

ShortcutManager: deal with changing resource IDs on app update

- When an app is upgraded, all the resource IDs may change.  So
if a shortcut is previously published with an icon for res ID 100
and the publisher is upgraded, resource #100 may refer to something
different.

- So now the service also remembers resource names for icon resources,
as wells as string resources.  When an app is updated, the service
fetch the updated resource IDs by name.

- Also extract all string resources when a shortcut is published
and persist them, so that even when the original string resources are
removed from the app, the launcher can still show the extracted strings.

- When the system locale changes, re-extract all string resources.

- Also really hide the constants in ShortcutInfo that were
accidentally made public.

Change-Id: I23c29b45c1de5d76175229190a1533c9c62c5960
parent 5eebdd8b
Loading
Loading
Loading
Loading
+0 −12
Original line number Diff line number Diff line
@@ -10088,19 +10088,7 @@ package android.content.pm {
    method public boolean isManifestShortcut();
    method public boolean isPinned();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final int CLONE_REMOVE_FOR_CREATOR = 1; // 0x1
    field public static final int CLONE_REMOVE_FOR_LAUNCHER = 3; // 0x3
    field public static final int CLONE_REMOVE_NON_KEY_INFO = 4; // 0x4
    field public static final android.os.Parcelable.Creator<android.content.pm.ShortcutInfo> CREATOR;
    field public static final int FLAG_DISABLED = 64; // 0x40
    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_IMMUTABLE = 256; // 0x100
    field public static final int FLAG_KEY_FIELDS_ONLY = 16; // 0x10
    field public static final int FLAG_MANIFEST = 32; // 0x20
    field public static final int FLAG_PINNED = 2; // 0x2
    field public static final int FLAG_STRINGS_RESOLVED = 128; // 0x80
    field public static final java.lang.String SHORTCUT_CATEGORY_CONVERSATION = "android.shortcut.conversation";
  }
+0 −12
Original line number Diff line number Diff line
@@ -10511,19 +10511,7 @@ package android.content.pm {
    method public boolean isManifestShortcut();
    method public boolean isPinned();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final int CLONE_REMOVE_FOR_CREATOR = 1; // 0x1
    field public static final int CLONE_REMOVE_FOR_LAUNCHER = 3; // 0x3
    field public static final int CLONE_REMOVE_NON_KEY_INFO = 4; // 0x4
    field public static final android.os.Parcelable.Creator<android.content.pm.ShortcutInfo> CREATOR;
    field public static final int FLAG_DISABLED = 64; // 0x40
    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_IMMUTABLE = 256; // 0x100
    field public static final int FLAG_KEY_FIELDS_ONLY = 16; // 0x10
    field public static final int FLAG_MANIFEST = 32; // 0x20
    field public static final int FLAG_PINNED = 2; // 0x2
    field public static final int FLAG_STRINGS_RESOLVED = 128; // 0x80
    field public static final java.lang.String SHORTCUT_CATEGORY_CONVERSATION = "android.shortcut.conversation";
  }
+0 −12
Original line number Diff line number Diff line
@@ -10101,19 +10101,7 @@ package android.content.pm {
    method public boolean isManifestShortcut();
    method public boolean isPinned();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final int CLONE_REMOVE_FOR_CREATOR = 1; // 0x1
    field public static final int CLONE_REMOVE_FOR_LAUNCHER = 3; // 0x3
    field public static final int CLONE_REMOVE_NON_KEY_INFO = 4; // 0x4
    field public static final android.os.Parcelable.Creator<android.content.pm.ShortcutInfo> CREATOR;
    field public static final int FLAG_DISABLED = 64; // 0x40
    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_IMMUTABLE = 256; // 0x100
    field public static final int FLAG_KEY_FIELDS_ONLY = 16; // 0x10
    field public static final int FLAG_MANIFEST = 32; // 0x20
    field public static final int FLAG_PINNED = 2; // 0x2
    field public static final int FLAG_STRINGS_RESOLVED = 128; // 0x80
    field public static final java.lang.String SHORTCUT_CATEGORY_CONVERSATION = "android.shortcut.conversation";
  }
+343 −38

File changed.

Preview size limit exceeded, changes collapsed.

+93 −9

File changed.

Preview size limit exceeded, changes collapsed.

Loading