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

Commit df89203a authored by Xiaohui Chen's avatar Xiaohui Chen Committed by Android (Google) Code Review
Browse files

Merge "Clean up USER_OWNER reference in cmds."

parents 86fff063 b52c7330
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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());
                }
+1 −1
Original line number Diff line number Diff line
@@ -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);
+6 −6
Original line number Diff line number Diff line
@@ -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;
+1 −1
Original line number Diff line number Diff line
@@ -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
+4 −3
Original line number Diff line number Diff line
@@ -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() {