Home | History | Annotate | Download | only in device

Lines Matching refs:userId

208     public String installPackageForUser(File packageFile, boolean reinstall, int userId,
217 args.add(Integer.toString(userId));
226 boolean grantPermissions, int userId, String... extraArgs)
234 args.add(Integer.toString(userId));
879 public boolean removeUser(int userId) throws DeviceNotAvailableException {
880 final String output = executeShellCommand(String.format("pm remove-user %s", userId));
892 public boolean startUser(int userId) throws DeviceNotAvailableException {
893 final String output = executeShellCommand(String.format("am start-user %s", userId));
905 public boolean stopUser(int userId) throws DeviceNotAvailableException {
907 return stopUser(userId, false, false);
914 public boolean stopUser(int userId, boolean waitFlag, boolean forceFlag)
930 cmd.append(userId);
942 if (isUserRunning(userId)) {
943 CLog.w("User Id: %s is still running after the stop-user command.", userId);
972 int userId = Integer.parseInt(output.trim());
973 return userId;
990 public int getUserFlags(int userId) throws DeviceNotAvailableException {
995 if (Integer.parseInt(matcher.group(2)) == userId) {
999 CLog.w("Could not find any flags for userId: %d in output: %s", userId, commandOutput);
1007 public boolean isUserRunning(int userId) throws DeviceNotAvailableException {
1012 if (Integer.parseInt(matcher.group(2)) == userId) {
1025 public int getUserSerialNumber(int userId) throws DeviceNotAvailableException {
1033 if (Integer.parseInt(matcher.group(2)) == userId) {
1037 CLog.w("Could not find user serial number for userId: %d, in output: %s",
1038 userId, commandOutput);
1046 public boolean switchUser(int userId) throws DeviceNotAvailableException {
1047 return switchUser(userId, AM_COMMAND_TIMEOUT);
1054 public boolean switchUser(int userId, long timeout) throws DeviceNotAvailableException {
1056 if (userId == getCurrentUser()) {
1057 CLog.w("Already running as user id: %s. Nothing to be done.", userId);
1060 executeShellCommand(String.format("am switch-user %d", userId));
1063 if (userId == getCurrentUser()) {
1114 public String getSetting(int userId, String namespace, String key)
1116 return getSettingInternal(String.format("--user %d", userId), namespace.trim(), key.trim());
1120 * Internal Helper to get setting with or without a userId provided.
1152 public void setSetting(int userId, String namespace, String key, String value)
1154 setSettingInternal(String.format("--user %d", userId), namespace.trim(), key.trim(),
1159 * Internal helper to set a setting with or without a userId provided.
1177 public String getAndroidId(int userId) throws DeviceNotAvailableException {
1181 + "'select value from main where name = \"android_id\"'", userId);
1257 public boolean setDeviceOwner(String componentName, int userId)
1259 final String command = "dpm set-device-owner --user " + userId + " '" + componentName + "'";
1266 public boolean removeAdmin(String componentName, int userId)
1269 "dpm remove-active-admin --user " + userId + " '" + componentName + "'";
1285 int userId = Integer.parseInt(tokens[4]);
1291 CLog.d("Cleaning up profile owner " + userId + " " + componentName);
1292 userId);
1304 int userId = Integer.parseInt(tokens[1].trim());
1305 CLog.d("Cleaning up device owner " + userId + " " + componentName);
1306 removeAdmin(componentName, userId);