Clean up USER_OWNER reference in cmds.

Again, the easy ones.

Bug: 19913735
Change-Id: Ib9519cb8309b332258b20dee54a38007eaba3b1d
This commit is contained in:
Xiaohui Chen
2015-08-06 14:05:35 -07:00
parent 09e02917ff
commit b52c7330d9
5 changed files with 14 additions and 13 deletions

View File

@@ -284,8 +284,8 @@ public class AppOpsCommand extends BaseCommand {
userId = UserHandle.USER_ALL;
} else if ("current".equals(userStr)) {
userId = UserHandle.USER_CURRENT;
} else if ("owner".equals(userStr)) {
userId = UserHandle.USER_OWNER;
} else if ("owner".equals(userStr) || "system".equals(userStr)) {
userId = UserHandle.USER_SYSTEM;
} else {
userId = Integer.parseInt(nextArgRequired());
}

View File

@@ -85,7 +85,7 @@ public class AppWidget {
private SetBindAppWidgetPermissionCommand parseSetGrantBindAppWidgetPermissionCommand(
boolean granted) {
String packageName = null;
int userId = UserHandle.USER_OWNER;
int userId = UserHandle.USER_SYSTEM;
for (String argument; (argument = mTokenizer.nextArg()) != null;) {
if (ARGUMENT_PACKAGE.equals(argument)) {
packageName = argumentValueRequired(argument);

View File

@@ -184,7 +184,7 @@ public class Content {
private InsertCommand parseInsertCommand() {
Uri uri = null;
int userId = UserHandle.USER_OWNER;
int userId = UserHandle.USER_SYSTEM;
ContentValues values = new ContentValues();
for (String argument; (argument = mTokenizer.nextArg()) != null;) {
if (ARGUMENT_URI.equals(argument)) {
@@ -210,7 +210,7 @@ public class Content {
private DeleteCommand parseDeleteCommand() {
Uri uri = null;
int userId = UserHandle.USER_OWNER;
int userId = UserHandle.USER_SYSTEM;
String where = null;
for (String argument; (argument = mTokenizer.nextArg())!= null;) {
if (ARGUMENT_URI.equals(argument)) {
@@ -232,7 +232,7 @@ public class Content {
private UpdateCommand parseUpdateCommand() {
Uri uri = null;
int userId = UserHandle.USER_OWNER;
int userId = UserHandle.USER_SYSTEM;
String where = null;
ContentValues values = new ContentValues();
for (String argument; (argument = mTokenizer.nextArg())!= null;) {
@@ -261,7 +261,7 @@ public class Content {
public CallCommand parseCallCommand() {
String method = null;
int userId = UserHandle.USER_OWNER;
int userId = UserHandle.USER_SYSTEM;
String arg = null;
Uri uri = null;
ContentValues values = new ContentValues();
@@ -293,7 +293,7 @@ public class Content {
private ReadCommand parseReadCommand() {
Uri uri = null;
int userId = UserHandle.USER_OWNER;
int userId = UserHandle.USER_SYSTEM;
for (String argument; (argument = mTokenizer.nextArg())!= null;) {
if (ARGUMENT_URI.equals(argument)) {
uri = Uri.parse(argumentValueRequired(argument));
@@ -312,7 +312,7 @@ public class Content {
public QueryCommand parseQueryCommand() {
Uri uri = null;
int userId = UserHandle.USER_OWNER;
int userId = UserHandle.USER_SYSTEM;
String[] projection = null;
String sort = null;
String where = null;

View File

@@ -43,7 +43,7 @@ public final class Dpm extends BaseCommand {
private static final String COMMAND_SET_PROFILE_OWNER = "set-profile-owner";
private IDevicePolicyManager mDevicePolicyManager;
private int mUserId = UserHandle.USER_OWNER;
private int mUserId = UserHandle.USER_SYSTEM;
private ComponentName mComponent = null;
@Override

View File

@@ -130,7 +130,7 @@ public final class SettingsCmd {
if (valid) {
if (mUser < 0) {
mUser = UserHandle.USER_OWNER;
mUser = UserHandle.USER_SYSTEM;
}
try {
@@ -139,7 +139,7 @@ public final class SettingsCmd {
IBinder token = new Binder();
try {
ContentProviderHolder holder = activityManager.getContentProviderExternal(
"settings", UserHandle.USER_OWNER, token);
"settings", UserHandle.USER_SYSTEM, token);
if (holder == null) {
throw new IllegalStateException("Could not find settings provider");
}
@@ -291,7 +291,8 @@ public final class SettingsCmd {
System.err.println(" settings [--user NUM] delete namespace key");
System.err.println(" settings [--user NUM] list namespace");
System.err.println("\n'namespace' is one of {system, secure, global}, case-insensitive");
System.err.println("If '--user NUM' is not given, the operations are performed on the owner user.");
System.err.println("If '--user NUM' is not given, the operations are performed on the"
+ "system user.");
}
public static String resolveCallingPackage() {