Renamed primaryUserOnly to systemUserOnly

In the split mode, broadcast receivers and activities marked as
systemUserOnly will be running as system. This is a non-functional change for
non-split system user mode.

Bug: 22958572
Change-Id: I0f7d4f4a81275bc326bf630a776c695e8b5291a6
diff --git a/core/java/android/content/pm/ActivityInfo.java b/core/java/android/content/pm/ActivityInfo.java
index 83092a9..a59f429 100644
--- a/core/java/android/content/pm/ActivityInfo.java
+++ b/core/java/android/content/pm/ActivityInfo.java
@@ -273,10 +273,10 @@
     public static final int FLAG_RESUME_WHILE_PAUSING = 0x4000;
     /**
      * @hide Bit in {@link #flags}: If set, this component will only be seen
-     * by the primary user.  Only works with broadcast receivers.  Set from the
-     * android.R.attr#primaryUserOnly attribute.
+     * by the system user.  Only works with broadcast receivers.  Set from the
+     * android.R.attr#systemUserOnly attribute.
      */
-    public static final int FLAG_PRIMARY_USER_ONLY = 0x20000000;
+    public static final int FLAG_SYSTEM_USER_ONLY = 0x20000000;
     /**
      * Bit in {@link #flags}: If set, a single instance of the receiver will
      * run for all users on the device.  Set from the
diff --git a/core/java/android/content/pm/PackageParser.java b/core/java/android/content/pm/PackageParser.java
index 502f735..968f9b2 100644
--- a/core/java/android/content/pm/PackageParser.java
+++ b/core/java/android/content/pm/PackageParser.java
@@ -3138,8 +3138,8 @@
             a.info.flags |= ActivityInfo.FLAG_IMMERSIVE;
         }
 
-        if (sa.getBoolean(R.styleable.AndroidManifestActivity_primaryUserOnly, false)) {
-            a.info.flags |= ActivityInfo.FLAG_PRIMARY_USER_ONLY;
+        if (sa.getBoolean(R.styleable.AndroidManifestActivity_systemUserOnly, false)) {
+            a.info.flags |= ActivityInfo.FLAG_SYSTEM_USER_ONLY;
         }
 
         if (!receiver) {
diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml
index fefd5a7..7304872 100644
--- a/core/res/AndroidManifest.xml
+++ b/core/res/AndroidManifest.xml
@@ -2804,7 +2804,7 @@
         </activity>
 
         <receiver android:name="com.android.server.BootReceiver"
-                android:primaryUserOnly="true">
+                android:systemUserOnly="true">
             <intent-filter android:priority="1000">
                 <action android:name="android.intent.action.BOOT_COMPLETED" />
             </intent-filter>
diff --git a/core/res/res/values/attrs_manifest.xml b/core/res/res/values/attrs_manifest.xml
index 1a2600d..4531f75 100644
--- a/core/res/res/values/attrs_manifest.xml
+++ b/core/res/res/values/attrs_manifest.xml
@@ -1816,9 +1816,9 @@
         <attr name="uiOptions" />
         <attr name="parentActivityName" />
         <attr name="singleUser" />
-        <!-- @hide This broacast receiver will only receive broadcasts for the
-             primary user.  Can only be used with receivers. -->
-        <attr name="primaryUserOnly" format="boolean" />
+        <!-- @hide This broadcast receiver or activity will only receive broadcasts for the
+             system user-->
+        <attr name="systemUserOnly" format="boolean" />
         <attr name="persistableMode" />
         <attr name="allowEmbedded" />
         <attr name="documentLaunchMode" />