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

Commit 2f3e3537 authored by Jeff Sharkey's avatar Jeff Sharkey
Browse files

More work towards triaging missing app behavior.

Many places across the platform query package details without
gracefully handling packages or components that go missing for
various reasons.  This can cause annoying user data loss, such as
resetting back to built-in apps or dropping of accounts, etc.

This change verifies that system callers have thought about these
edge cases by logging if they use default matching behaviors without
explicitly marking themselves as being "triaged."  (The logging is
currently disabled by default.)

Also creates explicit definitions of supported flags for various
incoming PackageManager calls, and defines a clear distinction
between flag types:

-- GET-style flags are used to request additional data that may have
been elided to save wire space.

-- MATCH-style flags are used to include components or packages that
would have otherwise been omitted from a result set by current system
state.

There are a handful of existing GET flags that better fit under the
MATCH definition, so this change clones them to new constants and
marks the old ones as deprecated.

Fixes bug in JobSchedulerService to consider jobs from apps on
external storage.  Revert some dialer behavior back to being
untriaged.

Change-Id: I9b6ab0968241e3479bddbd78de0c51e3b9917318
parent 154a01ec
Loading
Loading
Loading
Loading
+9 −5
Original line number Diff line number Diff line
@@ -9571,8 +9571,8 @@ package android.content.pm {
    field public static final java.lang.String FEATURE_WIFI_DIRECT = "android.hardware.wifi.direct";
    field public static final int GET_ACTIVITIES = 1; // 0x1
    field public static final int GET_CONFIGURATIONS = 16384; // 0x4000
    field public static final int GET_DISABLED_COMPONENTS = 512; // 0x200
    field public static final int GET_DISABLED_UNTIL_USED_COMPONENTS = 32768; // 0x8000
    field public static final deprecated int GET_DISABLED_COMPONENTS = 512; // 0x200
    field public static final deprecated int GET_DISABLED_UNTIL_USED_COMPONENTS = 32768; // 0x8000
    field public static final int GET_GIDS = 256; // 0x100
    field public static final int GET_INSTRUMENTATION = 16; // 0x10
    field public static final int GET_INTENT_FILTERS = 32; // 0x20
@@ -9584,13 +9584,17 @@ package android.content.pm {
    field public static final int GET_SERVICES = 4; // 0x4
    field public static final int GET_SHARED_LIBRARY_FILES = 1024; // 0x400
    field public static final int GET_SIGNATURES = 64; // 0x40
    field public static final int GET_UNINSTALLED_PACKAGES = 8192; // 0x2000
    field public static final deprecated int GET_UNINSTALLED_PACKAGES = 8192; // 0x2000
    field public static final int GET_URI_PERMISSION_PATTERNS = 2048; // 0x800
    field public static final int MATCH_ALL = 131072; // 0x20000
    field public static final int MATCH_DEFAULT_ONLY = 65536; // 0x10000
    field public static final int MATCH_DISABLED_COMPONENTS = 512; // 0x200
    field public static final int MATCH_DISABLED_UNTIL_USED_COMPONENTS = 32768; // 0x8000
    field public static final int MATCH_ENCRYPTION_AWARE = 524288; // 0x80000
    field public static final int MATCH_ENCRYPTION_AWARE_AND_UNAWARE = 786432; // 0xc0000
    field public static final int MATCH_ENCRYPTION_AWARE_ONLY = 524288; // 0x80000
    field public static final int MATCH_ENCRYPTION_UNAWARE_ONLY = 262144; // 0x40000
    field public static final int MATCH_ENCRYPTION_UNAWARE = 262144; // 0x40000
    field public static final int MATCH_SYSTEM_ONLY = 1048576; // 0x100000
    field public static final int MATCH_UNINSTALLED_PACKAGES = 8192; // 0x2000
    field public static final long MAXIMUM_VERIFICATION_TIMEOUT = 3600000L; // 0x36ee80L
    field public static final int PERMISSION_DENIED = -1; // 0xffffffff
    field public static final int PERMISSION_GRANTED = 0; // 0x0
+9 −5
Original line number Diff line number Diff line
@@ -9887,8 +9887,8 @@ package android.content.pm {
    field public static final java.lang.String FEATURE_WIFI_DIRECT = "android.hardware.wifi.direct";
    field public static final int GET_ACTIVITIES = 1; // 0x1
    field public static final int GET_CONFIGURATIONS = 16384; // 0x4000
    field public static final int GET_DISABLED_COMPONENTS = 512; // 0x200
    field public static final int GET_DISABLED_UNTIL_USED_COMPONENTS = 32768; // 0x8000
    field public static final deprecated int GET_DISABLED_COMPONENTS = 512; // 0x200
    field public static final deprecated int GET_DISABLED_UNTIL_USED_COMPONENTS = 32768; // 0x8000
    field public static final int GET_GIDS = 256; // 0x100
    field public static final int GET_INSTRUMENTATION = 16; // 0x10
    field public static final int GET_INTENT_FILTERS = 32; // 0x20
@@ -9900,7 +9900,7 @@ package android.content.pm {
    field public static final int GET_SERVICES = 4; // 0x4
    field public static final int GET_SHARED_LIBRARY_FILES = 1024; // 0x400
    field public static final int GET_SIGNATURES = 64; // 0x40
    field public static final int GET_UNINSTALLED_PACKAGES = 8192; // 0x2000
    field public static final deprecated int GET_UNINSTALLED_PACKAGES = 8192; // 0x2000
    field public static final int GET_URI_PERMISSION_PATTERNS = 2048; // 0x800
    field public static final int INSTALL_FAILED_ALREADY_EXISTS = -1; // 0xffffffff
    field public static final int INSTALL_FAILED_CONFLICTING_PROVIDER = -13; // 0xfffffff3
@@ -9941,9 +9941,13 @@ package android.content.pm {
    field public static final int MASK_PERMISSION_FLAGS = 255; // 0xff
    field public static final int MATCH_ALL = 131072; // 0x20000
    field public static final int MATCH_DEFAULT_ONLY = 65536; // 0x10000
    field public static final int MATCH_DISABLED_COMPONENTS = 512; // 0x200
    field public static final int MATCH_DISABLED_UNTIL_USED_COMPONENTS = 32768; // 0x8000
    field public static final int MATCH_ENCRYPTION_AWARE = 524288; // 0x80000
    field public static final int MATCH_ENCRYPTION_AWARE_AND_UNAWARE = 786432; // 0xc0000
    field public static final int MATCH_ENCRYPTION_AWARE_ONLY = 524288; // 0x80000
    field public static final int MATCH_ENCRYPTION_UNAWARE_ONLY = 262144; // 0x40000
    field public static final int MATCH_ENCRYPTION_UNAWARE = 262144; // 0x40000
    field public static final int MATCH_SYSTEM_ONLY = 1048576; // 0x100000
    field public static final int MATCH_UNINSTALLED_PACKAGES = 8192; // 0x2000
    field public static final long MAXIMUM_VERIFICATION_TIMEOUT = 3600000L; // 0x36ee80L
    field public static final int PERMISSION_DENIED = -1; // 0xffffffff
    field public static final int PERMISSION_GRANTED = 0; // 0x0
+9 −5
Original line number Diff line number Diff line
@@ -9571,8 +9571,8 @@ package android.content.pm {
    field public static final java.lang.String FEATURE_WIFI_DIRECT = "android.hardware.wifi.direct";
    field public static final int GET_ACTIVITIES = 1; // 0x1
    field public static final int GET_CONFIGURATIONS = 16384; // 0x4000
    field public static final int GET_DISABLED_COMPONENTS = 512; // 0x200
    field public static final int GET_DISABLED_UNTIL_USED_COMPONENTS = 32768; // 0x8000
    field public static final deprecated int GET_DISABLED_COMPONENTS = 512; // 0x200
    field public static final deprecated int GET_DISABLED_UNTIL_USED_COMPONENTS = 32768; // 0x8000
    field public static final int GET_GIDS = 256; // 0x100
    field public static final int GET_INSTRUMENTATION = 16; // 0x10
    field public static final int GET_INTENT_FILTERS = 32; // 0x20
@@ -9584,13 +9584,17 @@ package android.content.pm {
    field public static final int GET_SERVICES = 4; // 0x4
    field public static final int GET_SHARED_LIBRARY_FILES = 1024; // 0x400
    field public static final int GET_SIGNATURES = 64; // 0x40
    field public static final int GET_UNINSTALLED_PACKAGES = 8192; // 0x2000
    field public static final deprecated int GET_UNINSTALLED_PACKAGES = 8192; // 0x2000
    field public static final int GET_URI_PERMISSION_PATTERNS = 2048; // 0x800
    field public static final int MATCH_ALL = 131072; // 0x20000
    field public static final int MATCH_DEFAULT_ONLY = 65536; // 0x10000
    field public static final int MATCH_DISABLED_COMPONENTS = 512; // 0x200
    field public static final int MATCH_DISABLED_UNTIL_USED_COMPONENTS = 32768; // 0x8000
    field public static final int MATCH_ENCRYPTION_AWARE = 524288; // 0x80000
    field public static final int MATCH_ENCRYPTION_AWARE_AND_UNAWARE = 786432; // 0xc0000
    field public static final int MATCH_ENCRYPTION_AWARE_ONLY = 524288; // 0x80000
    field public static final int MATCH_ENCRYPTION_UNAWARE_ONLY = 262144; // 0x40000
    field public static final int MATCH_ENCRYPTION_UNAWARE = 262144; // 0x40000
    field public static final int MATCH_SYSTEM_ONLY = 1048576; // 0x100000
    field public static final int MATCH_UNINSTALLED_PACKAGES = 8192; // 0x2000
    field public static final long MAXIMUM_VERIFICATION_TIMEOUT = 3600000L; // 0x36ee80L
    field public static final int PERMISSION_DENIED = -1; // 0xffffffff
    field public static final int PERMISSION_GRANTED = 0; // 0x0
+9 −2
Original line number Diff line number Diff line
@@ -4169,11 +4169,18 @@ public class Intent implements Parcelable, Cloneable {

    /**
     * Internal flag used to indicate that a system component has done their
     * homework and verified their encryption-aware behavior.
     * homework and verified that they correctly handle packages and components
     * that come and go over time. In particular:
     * <ul>
     * <li>Apps installed on external storage, which will appear to be
     * uninstalled while the the device is ejected.
     * <li>Apps with encryption unaware components, which will appear to not
     * exist while the device is locked.
     * </ul>
     *
     * @hide
     */
    public static final int FLAG_DEBUG_ENCRYPTION_TRIAGED = 0x00000100;
    public static final int FLAG_DEBUG_TRIAGED_MISSING = 0x00000100;

    /**
     * If set, the new activity is not kept in the history stack.  As soon as
+194 −63

File changed.

Preview size limit exceeded, changes collapsed.

Loading