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

Commit bd0e03bb authored by Xiaohui Chen's avatar Xiaohui Chen
Browse files

More USER_OWNER cleanup.

Bug: 19913735
Change-Id: I408a92d9dbab2a096407efccb91e2a8bdc22714d
parent 72d9c026
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -61,7 +61,7 @@ public class ShellUiAutomatorBridge extends UiAutomatorBridge {
            IBinder token = new Binder();
            try {
                ContentProviderHolder holder = activityManager.getContentProviderExternal(
                        providerName, UserHandle.USER_OWNER, token);
                        providerName, UserHandle.USER_SYSTEM, token);
                if (holder == null) {
                    throw new IllegalStateException("Could not find provider: " + providerName);
                }
+5 −3
Original line number Diff line number Diff line
@@ -56,11 +56,12 @@ public class WallpaperBackupHelper extends FileBackupHelperBase implements Backu

    // This path must match what the WallpaperManagerService uses
    // TODO: Will need to change if backing up non-primary user's wallpaper
    // http://b/22388012
    public static final String WALLPAPER_IMAGE =
            new File(Environment.getUserSystemDirectory(UserHandle.USER_OWNER),
            new File(Environment.getUserSystemDirectory(UserHandle.USER_SYSTEM),
                    "wallpaper").getAbsolutePath();
    public static final String WALLPAPER_INFO =
            new File(Environment.getUserSystemDirectory(UserHandle.USER_OWNER),
            new File(Environment.getUserSystemDirectory(UserHandle.USER_SYSTEM),
                    "wallpaper_info.xml").getAbsolutePath();
    // Use old keys to keep legacy data compatibility and avoid writing two wallpapers
    public static final String WALLPAPER_IMAGE_KEY =
@@ -71,8 +72,9 @@ public class WallpaperBackupHelper extends FileBackupHelperBase implements Backu
    // will be saved to this file from the restore stream, then renamed to the proper
    // location if it's deemed suitable.
    // TODO: Will need to change if backing up non-primary user's wallpaper
    // http://b/22388012
    private static final String STAGE_FILE =
            new File(Environment.getUserSystemDirectory(UserHandle.USER_OWNER),
            new File(Environment.getUserSystemDirectory(UserHandle.USER_SYSTEM),
                    "wallpaper-tmp").getAbsolutePath();

    Context mContext;
+2 −1
Original line number Diff line number Diff line
@@ -152,8 +152,9 @@ public class UserInfo implements Parcelable {
        }
        if (UserManager.isSplitSystemUser()) {
            return id != UserHandle.USER_SYSTEM;
        } else {
            return id == UserHandle.USER_SYSTEM;
        }
        return id == UserHandle.USER_OWNER;
    }

    public UserInfo() {
+2 −1
Original line number Diff line number Diff line
@@ -178,7 +178,8 @@ public class SecurityControllerImpl implements SecurityController {
        mCurrentUserId = newUserId;
        if (mUserManager.getUserInfo(newUserId).isRestricted()) {
            // VPN for a restricted profile is routed through its owner user
            mVpnUserId = UserHandle.USER_OWNER;
            // TODO: http://b/22950929
            mVpnUserId = UserHandle.USER_SYSTEM;
        } else {
            mVpnUserId = mCurrentUserId;
        }
+2 −1
Original line number Diff line number Diff line
@@ -146,7 +146,8 @@ public class Vpn {
        } catch (RemoteException e) {
            Log.wtf(TAG, "Problem registering observer", e);
        }
        if (userHandle == UserHandle.USER_OWNER) {
        // TODO: http://b/22950929
        if (userHandle == UserHandle.USER_SYSTEM) {
            // Owner's VPN also needs to handle restricted users
            mUserIntentReceiver = new BroadcastReceiver() {
                @Override