OSDN Git Service

deprecate sharedUserId attribute
authorTodd Kennedy <toddke@google.com>
Thu, 18 Apr 2019 20:13:17 +0000 (13:13 -0700)
committerTodd Kennedy <toddke@google.com>
Mon, 22 Apr 2019 12:59:45 +0000 (05:59 -0700)
Shared user ids have caused numerous issues, inconsistencies,
and other random behaviours. They are generally not needed as
proper methodologies -- such as providers and services -- exist
and should be used for cross-package interaction.

We are deprecating the sharedUserId and sharedUserLabel
attributes in Q with the eventual goal of entirely removing them
in a future Android release.

Fixes: 129297713
Test: none. doc only change
Change-Id: Id84e8e22918010b2a42531c0b94aff75689d419b

api/current.txt
core/res/res/values/attrs_manifest.xml

index 44b11e1..d2f63fa 100644 (file)
@@ -1223,8 +1223,8 @@ package android {
     field public static final int shadowRadius = 16843108; // 0x1010164
     field public static final int shape = 16843162; // 0x101019a
     field public static final int shareInterpolator = 16843195; // 0x10101bb
-    field public static final int sharedUserId = 16842763; // 0x101000b
-    field public static final int sharedUserLabel = 16843361; // 0x1010261
+    field @Deprecated public static final int sharedUserId = 16842763; // 0x101000b
+    field @Deprecated public static final int sharedUserLabel = 16843361; // 0x1010261
     field public static final int shell = 16844180; // 0x1010594
     field public static final int shortcutDisabledMessage = 16844075; // 0x101052b
     field public static final int shortcutId = 16844072; // 0x1010528
index bbc784a..26a9f57 100644 (file)
          By setting this value on two or more packages, each of these packages
          will be given a single shared user ID, so they can for example run
          in the same process.  Note that for them to actually get the same
-         user ID, they must also be signed with the same signature. -->
+         user ID, they must also be signed with the same signature.
+         @deprecated Shared user id's cause non-deterministic behaviour within the
+         package manager. As such, it's use is discouraged, deprecated, and will
+         be removed altogether in a future version of Android. Instead, proper
+         communication mechanisms such as services and providers should be used
+         to facilitate interoperability between shared components. -->
     <attr name="sharedUserId" format="string" />
 
     <!-- Specify a label for the shared user UID of this package.  This is
          only used if you have also used android:sharedUserId.  This must
          be a reference to a string resource; it can not be an explicit
-         string. -->
+         string.
+         @deprecated There is no replacement for this attribute.
+         {@link android.R.attr#sharedUserId} has been deprecated making
+         this attribute unnecessary. -->
     <attr name="sharedUserLabel" format="reference" />
 
     <!-- Internal version code.  This is the number used to determine whether