More USER_OWNER cleanup.

Bug: 19913735
Change-Id: I408a92d9dbab2a096407efccb91e2a8bdc22714d
This commit is contained in:
Xiaohui Chen
2015-08-21 09:19:49 -07:00
parent 72d9c02656
commit bd0e03bb76
5 changed files with 12 additions and 7 deletions

View File

@@ -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);
}

View File

@@ -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;

View File

@@ -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() {

View File

@@ -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;
}

View File

@@ -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