Cleanup OWNER references.

Bug: 19913735
Change-Id: I2150c6baaab80fe11312e4401394a2a8da52e595
diff --git a/services/core/java/com/android/server/DeviceIdleController.java b/services/core/java/com/android/server/DeviceIdleController.java
index 2f4ad3f..0c6eb40 100644
--- a/services/core/java/com/android/server/DeviceIdleController.java
+++ b/services/core/java/com/android/server/DeviceIdleController.java
@@ -1523,13 +1523,13 @@
     private void reportPowerSaveWhitelistChangedLocked() {
         Intent intent = new Intent(PowerManager.ACTION_POWER_SAVE_WHITELIST_CHANGED);
         intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY);
-        getContext().sendBroadcastAsUser(intent, UserHandle.OWNER);
+        getContext().sendBroadcastAsUser(intent, UserHandle.SYSTEM);
     }
 
     private void reportTempWhitelistChangedLocked() {
         Intent intent = new Intent(PowerManager.ACTION_POWER_SAVE_TEMP_WHITELIST_CHANGED);
         intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY);
-        getContext().sendBroadcastAsUser(intent, UserHandle.OWNER);
+        getContext().sendBroadcastAsUser(intent, UserHandle.SYSTEM);
     }
 
     void readConfigFileLocked() {
diff --git a/services/core/java/com/android/server/DropBoxManagerService.java b/services/core/java/com/android/server/DropBoxManagerService.java
index b9db89ec..2454487 100644
--- a/services/core/java/com/android/server/DropBoxManagerService.java
+++ b/services/core/java/com/android/server/DropBoxManagerService.java
@@ -170,7 +170,7 @@
             @Override
             public void handleMessage(Message msg) {
                 if (msg.what == MSG_SEND_BROADCAST) {
-                    getContext().sendBroadcastAsUser((Intent)msg.obj, UserHandle.OWNER,
+                    getContext().sendBroadcastAsUser((Intent)msg.obj, UserHandle.SYSTEM,
                             android.Manifest.permission.READ_LOGS);
                 }
             }
@@ -488,7 +488,7 @@
 
     ///////////////////////////////////////////////////////////////////////////
 
-    /** Chronologically sorted list of {@link #EntryFile} */
+    /** Chronologically sorted list of {@link EntryFile} */
     private static final class FileList implements Comparable<FileList> {
         public int blocks = 0;
         public final TreeSet<EntryFile> contents = new TreeSet<EntryFile>();
@@ -613,7 +613,7 @@
 
         /**
          * Creates a EntryFile object with only a timestamp for comparison purposes.
-         * @param timestampMillis to compare with.
+         * @param millis to compare with.
          */
         public EntryFile(long millis) {
             this.tag = null;
diff --git a/services/core/java/com/android/server/MountService.java b/services/core/java/com/android/server/MountService.java
index 540f8cb..c3d32c2 100644
--- a/services/core/java/com/android/server/MountService.java
+++ b/services/core/java/com/android/server/MountService.java
@@ -2981,7 +2981,7 @@
 
             Intent service = new Intent().setComponent(DEFAULT_CONTAINER_COMPONENT);
             if (mContext.bindServiceAsUser(service, mDefContainerConn, Context.BIND_AUTO_CREATE,
-                    UserHandle.OWNER)) {
+                    UserHandle.SYSTEM)) {
                 mBound = true;
                 return true;
             }
@@ -3014,7 +3014,6 @@
                     Slog.w(TAG, "Failed to invoke remote methods on default container service. Giving up");
                     mObbActionHandler.sendEmptyMessage(OBB_MCS_UNBIND);
                     handleError();
-                    return;
                 } else {
                     handleExecute();
                     if (DEBUG_OBB)
@@ -3176,8 +3175,6 @@
             waitForReady();
             warnOnNotMounted();
 
-            final ObbInfo obbInfo = getObbInfo();
-
             final ObbState existingState;
             synchronized (mObbMounts) {
                 existingState = mObbPathToStateMap.get(mObbState.rawPath);
diff --git a/services/core/java/com/android/server/NetworkScoreService.java b/services/core/java/com/android/server/NetworkScoreService.java
index b05a690..b984e19 100644
--- a/services/core/java/com/android/server/NetworkScoreService.java
+++ b/services/core/java/com/android/server/NetworkScoreService.java
@@ -133,8 +133,8 @@
                 filter.addDataSchemeSpecificPart(scorer.mPackageName,
                         PatternMatcher.PATTERN_LITERAL);
                 mReceiver = new ScorerChangedReceiver(scorer.mPackageName);
-                // TODO: Need to update when we support per-user scorers.
-                mContext.registerReceiverAsUser(mReceiver, UserHandle.OWNER, filter, null, null);
+                // TODO: Need to update when we support per-user scorers. http://b/23422763
+                mContext.registerReceiverAsUser(mReceiver, UserHandle.SYSTEM, filter, null, null);
                 if (Log.isLoggable(TAG, Log.VERBOSE)) {
                     Log.v(TAG, "Registered receiver for " + scorer.mPackageName);
                 }
diff --git a/services/core/java/com/android/server/location/GeofenceProxy.java b/services/core/java/com/android/server/location/GeofenceProxy.java
index d1bb8db..b3a0010 100644
--- a/services/core/java/com/android/server/location/GeofenceProxy.java
+++ b/services/core/java/com/android/server/location/GeofenceProxy.java
@@ -94,7 +94,7 @@
 
     private void bindHardwareGeofence() {
         mContext.bindServiceAsUser(new Intent(mContext, GeofenceHardwareService.class),
-                mServiceConnection, Context.BIND_AUTO_CREATE, UserHandle.OWNER);
+                mServiceConnection, Context.BIND_AUTO_CREATE, UserHandle.SYSTEM);
     }
 
     private ServiceConnection mServiceConnection = new ServiceConnection() {
diff --git a/services/core/java/com/android/server/policy/keyguard/KeyguardServiceDelegate.java b/services/core/java/com/android/server/policy/keyguard/KeyguardServiceDelegate.java
index 7ae3c79..c0dfbcb 100644
--- a/services/core/java/com/android/server/policy/keyguard/KeyguardServiceDelegate.java
+++ b/services/core/java/com/android/server/policy/keyguard/KeyguardServiceDelegate.java
@@ -129,7 +129,7 @@
         intent.setComponent(keyguardComponent);
 
         if (!context.bindServiceAsUser(intent, mKeyguardConnection,
-                Context.BIND_AUTO_CREATE, UserHandle.OWNER)) {
+                Context.BIND_AUTO_CREATE, UserHandle.SYSTEM)) {
             Log.v(TAG, "*** Keyguard: can't bind to " + keyguardComponent);
             mKeyguardState.showing = false;
             mKeyguardState.showingAndNotOccluded = false;
diff --git a/services/core/java/com/android/server/statusbar/StatusBarManagerService.java b/services/core/java/com/android/server/statusbar/StatusBarManagerService.java
index 87dc6c4..11a1639 100644
--- a/services/core/java/com/android/server/statusbar/StatusBarManagerService.java
+++ b/services/core/java/com/android/server/statusbar/StatusBarManagerService.java
@@ -305,9 +305,8 @@
                 throw new SecurityException("invalid status bar icon slot: " + slot);
             }
 
-            StatusBarIcon icon = new StatusBarIcon(iconPackage, UserHandle.OWNER, iconId,
-                    iconLevel, 0,
-                    contentDescription);
+            StatusBarIcon icon = new StatusBarIcon(iconPackage, UserHandle.SYSTEM, iconId,
+                    iconLevel, 0, contentDescription);
             //Slog.d(TAG, "setIcon slot=" + slot + " index=" + index + " icon=" + icon);
             mIcons.setIcon(index, icon);
 
diff --git a/services/core/java/com/android/server/telecom/TelecomLoaderService.java b/services/core/java/com/android/server/telecom/TelecomLoaderService.java
index f4bd61f..6c5452a 100644
--- a/services/core/java/com/android/server/telecom/TelecomLoaderService.java
+++ b/services/core/java/com/android/server/telecom/TelecomLoaderService.java
@@ -188,7 +188,7 @@
                     | Context.BIND_AUTO_CREATE;
 
             // Bind to Telecom and register the service
-            if (mContext.bindServiceAsUser(intent, serviceConnection, flags, UserHandle.OWNER)) {
+            if (mContext.bindServiceAsUser(intent, serviceConnection, flags, UserHandle.SYSTEM)) {
                 mServiceConnection = serviceConnection;
             }
         }