Merge "When system server goes down, crash apps." into nyc-dev

am: 49607029be

* commit '49607029bef037d162f64f841468d7b99d862489':
  When system server goes down, crash apps.
This commit is contained in:
Jeff Sharkey
2016-02-26 18:19:22 +00:00
committed by android-build-merger
3 changed files with 221 additions and 288 deletions

View File

@@ -716,8 +716,7 @@ public class ActivityManager {
try { try {
return ActivityManagerNative.getDefault().getFrontActivityScreenCompatMode(); return ActivityManagerNative.getDefault().getFrontActivityScreenCompatMode();
} catch (RemoteException e) { } catch (RemoteException e) {
// System dead, we will be dead too soon! throw e.rethrowAsRuntimeException();
return 0;
} }
} }
@@ -726,7 +725,7 @@ public class ActivityManager {
try { try {
ActivityManagerNative.getDefault().setFrontActivityScreenCompatMode(mode); ActivityManagerNative.getDefault().setFrontActivityScreenCompatMode(mode);
} catch (RemoteException e) { } catch (RemoteException e) {
// System dead, we will be dead too soon! throw e.rethrowAsRuntimeException();
} }
} }
@@ -735,8 +734,7 @@ public class ActivityManager {
try { try {
return ActivityManagerNative.getDefault().getPackageScreenCompatMode(packageName); return ActivityManagerNative.getDefault().getPackageScreenCompatMode(packageName);
} catch (RemoteException e) { } catch (RemoteException e) {
// System dead, we will be dead too soon! throw e.rethrowAsRuntimeException();
return 0;
} }
} }
@@ -745,7 +743,7 @@ public class ActivityManager {
try { try {
ActivityManagerNative.getDefault().setPackageScreenCompatMode(packageName, mode); ActivityManagerNative.getDefault().setPackageScreenCompatMode(packageName, mode);
} catch (RemoteException e) { } catch (RemoteException e) {
// System dead, we will be dead too soon! throw e.rethrowAsRuntimeException();
} }
} }
@@ -754,8 +752,7 @@ public class ActivityManager {
try { try {
return ActivityManagerNative.getDefault().getPackageAskScreenCompat(packageName); return ActivityManagerNative.getDefault().getPackageAskScreenCompat(packageName);
} catch (RemoteException e) { } catch (RemoteException e) {
// System dead, we will be dead too soon! throw e.rethrowAsRuntimeException();
return false;
} }
} }
@@ -764,7 +761,7 @@ public class ActivityManager {
try { try {
ActivityManagerNative.getDefault().setPackageAskScreenCompat(packageName, ask); ActivityManagerNative.getDefault().setPackageAskScreenCompat(packageName, ask);
} catch (RemoteException e) { } catch (RemoteException e) {
// System dead, we will be dead too soon! throw e.rethrowAsRuntimeException();
} }
} }
@@ -1049,6 +1046,7 @@ public class ActivityManager {
return ActivityManagerNative.getDefault().getTaskDescriptionIcon(iconFilename, return ActivityManagerNative.getDefault().getTaskDescriptionIcon(iconFilename,
userId); userId);
} catch (RemoteException e) { } catch (RemoteException e) {
throw e.rethrowAsRuntimeException();
} }
} }
return null; return null;
@@ -1429,8 +1427,7 @@ public class ActivityManager {
return ActivityManagerNative.getDefault().getRecentTasks(maxNum, return ActivityManagerNative.getDefault().getRecentTasks(maxNum,
flags, UserHandle.myUserId()); flags, UserHandle.myUserId());
} catch (RemoteException e) { } catch (RemoteException e) {
// System dead, we will be dead too soon! throw e.rethrowAsRuntimeException();
return null;
} }
} }
@@ -1455,8 +1452,7 @@ public class ActivityManager {
return ActivityManagerNative.getDefault().getRecentTasks(maxNum, return ActivityManagerNative.getDefault().getRecentTasks(maxNum,
flags, userId); flags, userId);
} catch (RemoteException e) { } catch (RemoteException e) {
// System dead, we will be dead too soon! throw e.rethrowAsRuntimeException();
return null;
} }
} }
@@ -1591,8 +1587,7 @@ public class ActivityManager {
try { try {
appTasks = ActivityManagerNative.getDefault().getAppTasks(mContext.getPackageName()); appTasks = ActivityManagerNative.getDefault().getAppTasks(mContext.getPackageName());
} catch (RemoteException e) { } catch (RemoteException e) {
// System dead, we will be dead too soon! throw e.rethrowAsRuntimeException();
return null;
} }
int numAppTasks = appTasks.size(); int numAppTasks = appTasks.size();
for (int i = 0; i < numAppTasks; i++) { for (int i = 0; i < numAppTasks; i++) {
@@ -1617,7 +1612,7 @@ public class ActivityManager {
try { try {
mAppTaskThumbnailSize = ActivityManagerNative.getDefault().getAppTaskThumbnailSize(); mAppTaskThumbnailSize = ActivityManagerNative.getDefault().getAppTaskThumbnailSize();
} catch (RemoteException e) { } catch (RemoteException e) {
throw new IllegalStateException("System dead?", e); throw e.rethrowAsRuntimeException();
} }
} }
} }
@@ -1683,7 +1678,7 @@ public class ActivityManager {
return ActivityManagerNative.getDefault().addAppTask(activity.getActivityToken(), return ActivityManagerNative.getDefault().addAppTask(activity.getActivityToken(),
intent, description, thumbnail); intent, description, thumbnail);
} catch (RemoteException e) { } catch (RemoteException e) {
throw new IllegalStateException("System dead?", e); throw e.rethrowAsRuntimeException();
} }
} }
@@ -1725,8 +1720,7 @@ public class ActivityManager {
try { try {
return ActivityManagerNative.getDefault().getTasks(maxNum, 0); return ActivityManagerNative.getDefault().getTasks(maxNum, 0);
} catch (RemoteException e) { } catch (RemoteException e) {
// System dead, we will be dead too soon! throw e.rethrowAsRuntimeException();
return null;
} }
} }
@@ -1742,8 +1736,7 @@ public class ActivityManager {
try { try {
return ActivityManagerNative.getDefault().removeTask(taskId); return ActivityManagerNative.getDefault().removeTask(taskId);
} catch (RemoteException e) { } catch (RemoteException e) {
// System dead, we will be dead too soon! throw e.rethrowAsRuntimeException();
return false;
} }
} }
@@ -1902,8 +1895,7 @@ public class ActivityManager {
try { try {
return ActivityManagerNative.getDefault().getTaskThumbnail(id); return ActivityManagerNative.getDefault().getTaskThumbnail(id);
} catch (RemoteException e) { } catch (RemoteException e) {
// System dead, we will be dead too soon! throw e.rethrowAsRuntimeException();
return null;
} }
} }
@@ -1912,8 +1904,7 @@ public class ActivityManager {
try { try {
return ActivityManagerNative.getDefault().isInHomeStack(taskId); return ActivityManagerNative.getDefault().isInHomeStack(taskId);
} catch (RemoteException e) { } catch (RemoteException e) {
// System dead, we will be dead too soon! throw e.rethrowAsRuntimeException();
return false;
} }
} }
@@ -1962,7 +1953,7 @@ public class ActivityManager {
try { try {
ActivityManagerNative.getDefault().moveTaskToFront(taskId, flags, options); ActivityManagerNative.getDefault().moveTaskToFront(taskId, flags, options);
} catch (RemoteException e) { } catch (RemoteException e) {
// System dead, we will be dead too soon! throw e.rethrowAsRuntimeException();
} }
} }
@@ -2148,8 +2139,7 @@ public class ActivityManager {
return ActivityManagerNative.getDefault() return ActivityManagerNative.getDefault()
.getServices(maxNum, 0); .getServices(maxNum, 0);
} catch (RemoteException e) { } catch (RemoteException e) {
// System dead, we will be dead too soon! throw e.rethrowAsRuntimeException();
return null;
} }
} }
@@ -2164,8 +2154,7 @@ public class ActivityManager {
return ActivityManagerNative.getDefault() return ActivityManagerNative.getDefault()
.getRunningServiceControlPanel(service); .getRunningServiceControlPanel(service);
} catch (RemoteException e) { } catch (RemoteException e) {
// System dead, we will be dead too soon! throw e.rethrowAsRuntimeException();
return null;
} }
} }
@@ -2269,6 +2258,7 @@ public class ActivityManager {
try { try {
ActivityManagerNative.getDefault().getMemoryInfo(outInfo); ActivityManagerNative.getDefault().getMemoryInfo(outInfo);
} catch (RemoteException e) { } catch (RemoteException e) {
throw e.rethrowAsRuntimeException();
} }
} }
@@ -2387,7 +2377,7 @@ public class ActivityManager {
return ActivityManagerNative.getDefault().clearApplicationUserData(packageName, return ActivityManagerNative.getDefault().clearApplicationUserData(packageName,
observer, UserHandle.myUserId()); observer, UserHandle.myUserId());
} catch (RemoteException e) { } catch (RemoteException e) {
return false; throw e.rethrowAsRuntimeException();
} }
} }
@@ -2421,8 +2411,7 @@ public class ActivityManager {
return ActivityManagerNative.getDefault().getGrantedUriPermissions(packageName, return ActivityManagerNative.getDefault().getGrantedUriPermissions(packageName,
UserHandle.myUserId()); UserHandle.myUserId());
} catch (RemoteException e) { } catch (RemoteException e) {
Log.e(TAG, "Couldn't get granted URI permissions for :" + packageName, e); throw e.rethrowAsRuntimeException();
return ParceledListSlice.emptyList();
} }
} }
@@ -2440,7 +2429,7 @@ public class ActivityManager {
ActivityManagerNative.getDefault().clearGrantedUriPermissions(packageName, ActivityManagerNative.getDefault().clearGrantedUriPermissions(packageName,
UserHandle.myUserId()); UserHandle.myUserId());
} catch (RemoteException e) { } catch (RemoteException e) {
Log.e(TAG, "Couldn't clear granted URI permissions for :" + packageName, e); throw e.rethrowAsRuntimeException();
} }
} }
@@ -2560,7 +2549,7 @@ public class ActivityManager {
try { try {
return ActivityManagerNative.getDefault().getProcessesInErrorState(); return ActivityManagerNative.getDefault().getProcessesInErrorState();
} catch (RemoteException e) { } catch (RemoteException e) {
return null; throw e.rethrowAsRuntimeException();
} }
} }
@@ -2874,7 +2863,7 @@ public class ActivityManager {
try { try {
return ActivityManagerNative.getDefault().getRunningExternalApplications(); return ActivityManagerNative.getDefault().getRunningExternalApplications();
} catch (RemoteException e) { } catch (RemoteException e) {
return null; throw e.rethrowAsRuntimeException();
} }
} }
@@ -2891,7 +2880,7 @@ public class ActivityManager {
return ActivityManagerNative.getDefault().setProcessMemoryTrimLevel(process, userId, return ActivityManagerNative.getDefault().setProcessMemoryTrimLevel(process, userId,
level); level);
} catch (RemoteException e) { } catch (RemoteException e) {
return false; throw e.rethrowAsRuntimeException();
} }
} }
@@ -2909,7 +2898,7 @@ public class ActivityManager {
try { try {
return ActivityManagerNative.getDefault().getRunningAppProcesses(); return ActivityManagerNative.getDefault().getRunningAppProcesses();
} catch (RemoteException e) { } catch (RemoteException e) {
return null; throw e.rethrowAsRuntimeException();
} }
} }
@@ -2928,7 +2917,7 @@ public class ActivityManager {
mContext.getOpPackageName()); mContext.getOpPackageName());
return RunningAppProcessInfo.procStateToImportance(procState); return RunningAppProcessInfo.procStateToImportance(procState);
} catch (RemoteException e) { } catch (RemoteException e) {
return RunningAppProcessInfo.IMPORTANCE_GONE; throw e.rethrowAsRuntimeException();
} }
} }
@@ -2947,6 +2936,7 @@ public class ActivityManager {
try { try {
ActivityManagerNative.getDefault().getMyMemoryState(outState); ActivityManagerNative.getDefault().getMyMemoryState(outState);
} catch (RemoteException e) { } catch (RemoteException e) {
throw e.rethrowAsRuntimeException();
} }
} }
@@ -2965,7 +2955,7 @@ public class ActivityManager {
try { try {
return ActivityManagerNative.getDefault().getProcessMemoryInfo(pids); return ActivityManagerNative.getDefault().getProcessMemoryInfo(pids);
} catch (RemoteException e) { } catch (RemoteException e) {
return null; throw e.rethrowAsRuntimeException();
} }
} }
@@ -2999,6 +2989,7 @@ public class ActivityManager {
ActivityManagerNative.getDefault().killBackgroundProcesses(packageName, ActivityManagerNative.getDefault().killBackgroundProcesses(packageName,
UserHandle.myUserId()); UserHandle.myUserId());
} catch (RemoteException e) { } catch (RemoteException e) {
throw e.rethrowAsRuntimeException();
} }
} }
@@ -3015,7 +3006,7 @@ public class ActivityManager {
ActivityManagerNative.getDefault().killUid(UserHandle.getAppId(uid), ActivityManagerNative.getDefault().killUid(UserHandle.getAppId(uid),
UserHandle.getUserId(uid), reason); UserHandle.getUserId(uid), reason);
} catch (RemoteException e) { } catch (RemoteException e) {
Log.e(TAG, "Couldn't kill uid:" + uid, e); throw e.rethrowAsRuntimeException();
} }
} }
@@ -3042,6 +3033,7 @@ public class ActivityManager {
try { try {
ActivityManagerNative.getDefault().forceStopPackage(packageName, userId); ActivityManagerNative.getDefault().forceStopPackage(packageName, userId);
} catch (RemoteException e) { } catch (RemoteException e) {
throw e.rethrowAsRuntimeException();
} }
} }
@@ -3060,8 +3052,8 @@ public class ActivityManager {
try { try {
return ActivityManagerNative.getDefault().getDeviceConfigurationInfo(); return ActivityManagerNative.getDefault().getDeviceConfigurationInfo();
} catch (RemoteException e) { } catch (RemoteException e) {
throw e.rethrowAsRuntimeException();
} }
return null;
} }
/** /**
@@ -3150,8 +3142,8 @@ public class ActivityManager {
try { try {
return ActivityManagerNative.getDefault().isUserAMonkey(); return ActivityManagerNative.getDefault().isUserAMonkey();
} catch (RemoteException e) { } catch (RemoteException e) {
throw e.rethrowAsRuntimeException();
} }
return false;
} }
/** /**
@@ -3226,10 +3218,8 @@ public class ActivityManager {
return AppGlobals.getPackageManager() return AppGlobals.getPackageManager()
.checkUidPermission(permission, uid); .checkUidPermission(permission, uid);
} catch (RemoteException e) { } catch (RemoteException e) {
// Should never happen, but if it does... deny! throw e.rethrowAsRuntimeException();
Slog.e(TAG, "PackageManager is dead?!?", e);
} }
return PackageManager.PERMISSION_DENIED;
} }
/** @hide */ /** @hide */
@@ -3238,10 +3228,8 @@ public class ActivityManager {
return AppGlobals.getPackageManager() return AppGlobals.getPackageManager()
.checkUidPermission(permission, uid); .checkUidPermission(permission, uid);
} catch (RemoteException e) { } catch (RemoteException e) {
// Should never happen, but if it does... deny! throw e.rethrowAsRuntimeException();
Slog.e(TAG, "PackageManager is dead?!?", e);
} }
return PackageManager.PERMISSION_DENIED;
} }
/** /**
@@ -3277,7 +3265,7 @@ public class ActivityManager {
return ActivityManagerNative.getDefault().handleIncomingUser(callingPid, return ActivityManagerNative.getDefault().handleIncomingUser(callingPid,
callingUid, userId, allowAll, requireFull, name, callerPackage); callingUid, userId, allowAll, requireFull, name, callerPackage);
} catch (RemoteException e) { } catch (RemoteException e) {
throw new SecurityException("Failed calling activity manager", e); throw e.rethrowAsRuntimeException();
} }
} }
@@ -3292,7 +3280,7 @@ public class ActivityManager {
ui = ActivityManagerNative.getDefault().getCurrentUser(); ui = ActivityManagerNative.getDefault().getCurrentUser();
return ui != null ? ui.id : 0; return ui != null ? ui.id : 0;
} catch (RemoteException e) { } catch (RemoteException e) {
return 0; throw e.rethrowAsRuntimeException();
} }
} }
@@ -3304,7 +3292,7 @@ public class ActivityManager {
try { try {
return ActivityManagerNative.getDefault().switchUser(userid); return ActivityManagerNative.getDefault().switchUser(userid);
} catch (RemoteException e) { } catch (RemoteException e) {
return false; throw e.rethrowAsRuntimeException();
} }
} }
@@ -3328,7 +3316,7 @@ public class ActivityManager {
try { try {
return ActivityManagerNative.getDefault().isUserRunning(userId, 0); return ActivityManagerNative.getDefault().isUserRunning(userId, 0);
} catch (RemoteException e) { } catch (RemoteException e) {
return false; throw e.rethrowAsRuntimeException();
} }
} }
@@ -3338,7 +3326,7 @@ public class ActivityManager {
return ActivityManagerNative.getDefault().isUserRunning(userId, return ActivityManagerNative.getDefault().isUserRunning(userId,
ActivityManager.FLAG_AND_LOCKED); ActivityManager.FLAG_AND_LOCKED);
} catch (RemoteException e) { } catch (RemoteException e) {
return false; throw e.rethrowAsRuntimeException();
} }
} }
@@ -3348,7 +3336,7 @@ public class ActivityManager {
return ActivityManagerNative.getDefault().isUserRunning(userId, return ActivityManagerNative.getDefault().isUserRunning(userId,
ActivityManager.FLAG_AND_UNLOCKED); ActivityManager.FLAG_AND_UNLOCKED);
} catch (RemoteException e) { } catch (RemoteException e) {
return false; throw e.rethrowAsRuntimeException();
} }
} }
@@ -3433,6 +3421,7 @@ public class ActivityManager {
ActivityManagerNative.getDefault().setDumpHeapDebugLimit(null, 0, pssSize, ActivityManagerNative.getDefault().setDumpHeapDebugLimit(null, 0, pssSize,
mContext.getPackageName()); mContext.getPackageName());
} catch (RemoteException e) { } catch (RemoteException e) {
throw e.rethrowAsRuntimeException();
} }
} }
@@ -3451,6 +3440,7 @@ public class ActivityManager {
try { try {
ActivityManagerNative.getDefault().setDumpHeapDebugLimit(null, 0, 0, null); ActivityManagerNative.getDefault().setDumpHeapDebugLimit(null, 0, 0, null);
} catch (RemoteException e) { } catch (RemoteException e) {
throw e.rethrowAsRuntimeException();
} }
} }
@@ -3461,6 +3451,7 @@ public class ActivityManager {
try { try {
ActivityManagerNative.getDefault().startLockTaskMode(taskId); ActivityManagerNative.getDefault().startLockTaskMode(taskId);
} catch (RemoteException e) { } catch (RemoteException e) {
throw e.rethrowAsRuntimeException();
} }
} }
@@ -3471,6 +3462,7 @@ public class ActivityManager {
try { try {
ActivityManagerNative.getDefault().stopLockTaskMode(); ActivityManagerNative.getDefault().stopLockTaskMode();
} catch (RemoteException e) { } catch (RemoteException e) {
throw e.rethrowAsRuntimeException();
} }
} }
@@ -3497,7 +3489,7 @@ public class ActivityManager {
try { try {
return ActivityManagerNative.getDefault().getLockTaskModeState(); return ActivityManagerNative.getDefault().getLockTaskModeState();
} catch (RemoteException e) { } catch (RemoteException e) {
return ActivityManager.LOCK_TASK_MODE_NONE; throw e.rethrowAsRuntimeException();
} }
} }
@@ -3520,7 +3512,7 @@ public class ActivityManager {
try { try {
mAppTaskImpl.finishAndRemoveTask(); mAppTaskImpl.finishAndRemoveTask();
} catch (RemoteException e) { } catch (RemoteException e) {
Slog.e(TAG, "Invalid AppTask", e); throw e.rethrowAsRuntimeException();
} }
} }
@@ -3533,8 +3525,7 @@ public class ActivityManager {
try { try {
return mAppTaskImpl.getTaskInfo(); return mAppTaskImpl.getTaskInfo();
} catch (RemoteException e) { } catch (RemoteException e) {
Slog.e(TAG, "Invalid AppTask", e); throw e.rethrowAsRuntimeException();
return null;
} }
} }
@@ -3548,7 +3539,7 @@ public class ActivityManager {
try { try {
mAppTaskImpl.moveToFront(); mAppTaskImpl.moveToFront();
} catch (RemoteException e) { } catch (RemoteException e) {
Slog.e(TAG, "Invalid AppTask", e); throw e.rethrowAsRuntimeException();
} }
} }
@@ -3590,7 +3581,7 @@ public class ActivityManager {
try { try {
mAppTaskImpl.setExcludeFromRecents(exclude); mAppTaskImpl.setExcludeFromRecents(exclude);
} catch (RemoteException e) { } catch (RemoteException e) {
Slog.e(TAG, "Invalid AppTask", e); throw e.rethrowAsRuntimeException();
} }
} }
} }

View File

@@ -143,7 +143,7 @@ public class ApplicationPackageManager extends PackageManager {
return pi; return pi;
} }
} catch (RemoteException e) { } catch (RemoteException e) {
throw new RuntimeException("Package manager has died", e); throw e.rethrowAsRuntimeException();
} }
throw new NameNotFoundException(packageName); throw new NameNotFoundException(packageName);
@@ -154,7 +154,7 @@ public class ApplicationPackageManager extends PackageManager {
try { try {
return mPM.currentToCanonicalPackageNames(names); return mPM.currentToCanonicalPackageNames(names);
} catch (RemoteException e) { } catch (RemoteException e) {
throw new RuntimeException("Package manager has died", e); throw e.rethrowAsRuntimeException();
} }
} }
@@ -163,7 +163,7 @@ public class ApplicationPackageManager extends PackageManager {
try { try {
return mPM.canonicalToCurrentPackageNames(names); return mPM.canonicalToCurrentPackageNames(names);
} catch (RemoteException e) { } catch (RemoteException e) {
throw new RuntimeException("Package manager has died", e); throw e.rethrowAsRuntimeException();
} }
} }
@@ -227,7 +227,7 @@ public class ApplicationPackageManager extends PackageManager {
return gids; return gids;
} }
} catch (RemoteException e) { } catch (RemoteException e) {
throw new RuntimeException("Package manager has died", e); throw e.rethrowAsRuntimeException();
} }
throw new NameNotFoundException(packageName); throw new NameNotFoundException(packageName);
@@ -252,7 +252,7 @@ public class ApplicationPackageManager extends PackageManager {
return uid; return uid;
} }
} catch (RemoteException e) { } catch (RemoteException e) {
throw new RuntimeException("Package manager has died", e); throw e.rethrowAsRuntimeException();
} }
throw new NameNotFoundException(packageName); throw new NameNotFoundException(packageName);
@@ -267,7 +267,7 @@ public class ApplicationPackageManager extends PackageManager {
return pi; return pi;
} }
} catch (RemoteException e) { } catch (RemoteException e) {
throw new RuntimeException("Package manager has died", e); throw e.rethrowAsRuntimeException();
} }
throw new NameNotFoundException(name); throw new NameNotFoundException(name);
@@ -282,7 +282,7 @@ public class ApplicationPackageManager extends PackageManager {
return pi; return pi;
} }
} catch (RemoteException e) { } catch (RemoteException e) {
throw new RuntimeException("Package manager has died", e); throw e.rethrowAsRuntimeException();
} }
throw new NameNotFoundException(group); throw new NameNotFoundException(group);
@@ -297,7 +297,7 @@ public class ApplicationPackageManager extends PackageManager {
return pgi; return pgi;
} }
} catch (RemoteException e) { } catch (RemoteException e) {
throw new RuntimeException("Package manager has died", e); throw e.rethrowAsRuntimeException();
} }
throw new NameNotFoundException(name); throw new NameNotFoundException(name);
@@ -308,7 +308,7 @@ public class ApplicationPackageManager extends PackageManager {
try { try {
return mPM.getAllPermissionGroups(flags); return mPM.getAllPermissionGroups(flags);
} catch (RemoteException e) { } catch (RemoteException e) {
throw new RuntimeException("Package manager has died", e); throw e.rethrowAsRuntimeException();
} }
} }
@@ -330,7 +330,7 @@ public class ApplicationPackageManager extends PackageManager {
return maybeAdjustApplicationInfo(ai); return maybeAdjustApplicationInfo(ai);
} }
} catch (RemoteException e) { } catch (RemoteException e) {
throw new RuntimeException("Package manager has died", e); throw e.rethrowAsRuntimeException();
} }
throw new NameNotFoundException(packageName); throw new NameNotFoundException(packageName);
@@ -370,7 +370,7 @@ public class ApplicationPackageManager extends PackageManager {
return ai; return ai;
} }
} catch (RemoteException e) { } catch (RemoteException e) {
throw new RuntimeException("Package manager has died", e); throw e.rethrowAsRuntimeException();
} }
throw new NameNotFoundException(className.toString()); throw new NameNotFoundException(className.toString());
@@ -385,7 +385,7 @@ public class ApplicationPackageManager extends PackageManager {
return ai; return ai;
} }
} catch (RemoteException e) { } catch (RemoteException e) {
throw new RuntimeException("Package manager has died", e); throw e.rethrowAsRuntimeException();
} }
throw new NameNotFoundException(className.toString()); throw new NameNotFoundException(className.toString());
@@ -400,7 +400,7 @@ public class ApplicationPackageManager extends PackageManager {
return si; return si;
} }
} catch (RemoteException e) { } catch (RemoteException e) {
throw new RuntimeException("Package manager has died", e); throw e.rethrowAsRuntimeException();
} }
throw new NameNotFoundException(className.toString()); throw new NameNotFoundException(className.toString());
@@ -415,7 +415,7 @@ public class ApplicationPackageManager extends PackageManager {
return pi; return pi;
} }
} catch (RemoteException e) { } catch (RemoteException e) {
throw new RuntimeException("Package manager has died", e); throw e.rethrowAsRuntimeException();
} }
throw new NameNotFoundException(className.toString()); throw new NameNotFoundException(className.toString());
@@ -426,7 +426,7 @@ public class ApplicationPackageManager extends PackageManager {
try { try {
return mPM.getSystemSharedLibraryNames(); return mPM.getSystemSharedLibraryNames();
} catch (RemoteException e) { } catch (RemoteException e) {
throw new RuntimeException("Package manager has died", e); throw e.rethrowAsRuntimeException();
} }
} }
@@ -436,7 +436,7 @@ public class ApplicationPackageManager extends PackageManager {
try { try {
return mPM.getServicesSystemSharedLibraryPackageName(); return mPM.getServicesSystemSharedLibraryPackageName();
} catch (RemoteException e) { } catch (RemoteException e) {
throw new RuntimeException("Package manager has died", e); throw e.rethrowAsRuntimeException();
} }
} }
@@ -445,7 +445,7 @@ public class ApplicationPackageManager extends PackageManager {
try { try {
return mPM.getSystemAvailableFeatures(); return mPM.getSystemAvailableFeatures();
} catch (RemoteException e) { } catch (RemoteException e) {
throw new RuntimeException("Package manager has died", e); throw e.rethrowAsRuntimeException();
} }
} }
@@ -459,7 +459,7 @@ public class ApplicationPackageManager extends PackageManager {
try { try {
return mPM.hasSystemFeature(name, version); return mPM.hasSystemFeature(name, version);
} catch (RemoteException e) { } catch (RemoteException e) {
throw new RuntimeException("Package manager has died", e); throw e.rethrowAsRuntimeException();
} }
} }
@@ -468,7 +468,7 @@ public class ApplicationPackageManager extends PackageManager {
try { try {
return mPM.checkPermission(permName, pkgName, mContext.getUserId()); return mPM.checkPermission(permName, pkgName, mContext.getUserId());
} catch (RemoteException e) { } catch (RemoteException e) {
throw new RuntimeException("Package manager has died", e); throw e.rethrowAsRuntimeException();
} }
} }
@@ -477,7 +477,7 @@ public class ApplicationPackageManager extends PackageManager {
try { try {
return mPM.isPermissionRevokedByPolicy(permName, pkgName, mContext.getUserId()); return mPM.isPermissionRevokedByPolicy(permName, pkgName, mContext.getUserId());
} catch (RemoteException e) { } catch (RemoteException e) {
throw new RuntimeException("Package manager has died", e); throw e.rethrowAsRuntimeException();
} }
} }
@@ -491,7 +491,7 @@ public class ApplicationPackageManager extends PackageManager {
try { try {
mPermissionsControllerPackageName = mPM.getPermissionControllerPackageName(); mPermissionsControllerPackageName = mPM.getPermissionControllerPackageName();
} catch (RemoteException e) { } catch (RemoteException e) {
throw new RuntimeException("Package manager has died", e); throw e.rethrowAsRuntimeException();
} }
} }
return mPermissionsControllerPackageName; return mPermissionsControllerPackageName;
@@ -503,7 +503,7 @@ public class ApplicationPackageManager extends PackageManager {
try { try {
return mPM.addPermission(info); return mPM.addPermission(info);
} catch (RemoteException e) { } catch (RemoteException e) {
throw new RuntimeException("Package manager has died", e); throw e.rethrowAsRuntimeException();
} }
} }
@@ -512,7 +512,7 @@ public class ApplicationPackageManager extends PackageManager {
try { try {
return mPM.addPermissionAsync(info); return mPM.addPermissionAsync(info);
} catch (RemoteException e) { } catch (RemoteException e) {
throw new RuntimeException("Package manager has died", e); throw e.rethrowAsRuntimeException();
} }
} }
@@ -521,7 +521,7 @@ public class ApplicationPackageManager extends PackageManager {
try { try {
mPM.removePermission(name); mPM.removePermission(name);
} catch (RemoteException e) { } catch (RemoteException e) {
throw new RuntimeException("Package manager has died", e); throw e.rethrowAsRuntimeException();
} }
} }
@@ -531,7 +531,7 @@ public class ApplicationPackageManager extends PackageManager {
try { try {
mPM.grantRuntimePermission(packageName, permissionName, user.getIdentifier()); mPM.grantRuntimePermission(packageName, permissionName, user.getIdentifier());
} catch (RemoteException e) { } catch (RemoteException e) {
throw new RuntimeException("Package manager has died", e); throw e.rethrowAsRuntimeException();
} }
} }
@@ -541,7 +541,7 @@ public class ApplicationPackageManager extends PackageManager {
try { try {
mPM.revokeRuntimePermission(packageName, permissionName, user.getIdentifier()); mPM.revokeRuntimePermission(packageName, permissionName, user.getIdentifier());
} catch (RemoteException e) { } catch (RemoteException e) {
throw new RuntimeException("Package manager has died", e); throw e.rethrowAsRuntimeException();
} }
} }
@@ -550,7 +550,7 @@ public class ApplicationPackageManager extends PackageManager {
try { try {
return mPM.getPermissionFlags(permissionName, packageName, user.getIdentifier()); return mPM.getPermissionFlags(permissionName, packageName, user.getIdentifier());
} catch (RemoteException e) { } catch (RemoteException e) {
throw new RuntimeException("Package manager has died", e); throw e.rethrowAsRuntimeException();
} }
} }
@@ -561,7 +561,7 @@ public class ApplicationPackageManager extends PackageManager {
mPM.updatePermissionFlags(permissionName, packageName, flagMask, mPM.updatePermissionFlags(permissionName, packageName, flagMask,
flagValues, user.getIdentifier()); flagValues, user.getIdentifier());
} catch (RemoteException e) { } catch (RemoteException e) {
throw new RuntimeException("Package manager has died", e); throw e.rethrowAsRuntimeException();
} }
} }
@@ -571,7 +571,7 @@ public class ApplicationPackageManager extends PackageManager {
return mPM.shouldShowRequestPermissionRationale(permission, return mPM.shouldShowRequestPermissionRationale(permission,
mContext.getPackageName(), mContext.getUserId()); mContext.getPackageName(), mContext.getUserId());
} catch (RemoteException e) { } catch (RemoteException e) {
throw new RuntimeException("Package manager has died", e); throw e.rethrowAsRuntimeException();
} }
} }
@@ -580,7 +580,7 @@ public class ApplicationPackageManager extends PackageManager {
try { try {
return mPM.checkSignatures(pkg1, pkg2); return mPM.checkSignatures(pkg1, pkg2);
} catch (RemoteException e) { } catch (RemoteException e) {
throw new RuntimeException("Package manager has died", e); throw e.rethrowAsRuntimeException();
} }
} }
@@ -589,7 +589,7 @@ public class ApplicationPackageManager extends PackageManager {
try { try {
return mPM.checkUidSignatures(uid1, uid2); return mPM.checkUidSignatures(uid1, uid2);
} catch (RemoteException e) { } catch (RemoteException e) {
throw new RuntimeException("Package manager has died", e); throw e.rethrowAsRuntimeException();
} }
} }
@@ -598,7 +598,7 @@ public class ApplicationPackageManager extends PackageManager {
try { try {
return mPM.getPackagesForUid(uid); return mPM.getPackagesForUid(uid);
} catch (RemoteException e) { } catch (RemoteException e) {
throw new RuntimeException("Package manager has died", e); throw e.rethrowAsRuntimeException();
} }
} }
@@ -607,7 +607,7 @@ public class ApplicationPackageManager extends PackageManager {
try { try {
return mPM.getNameForUid(uid); return mPM.getNameForUid(uid);
} catch (RemoteException e) { } catch (RemoteException e) {
throw new RuntimeException("Package manager has died", e); throw e.rethrowAsRuntimeException();
} }
} }
@@ -620,7 +620,7 @@ public class ApplicationPackageManager extends PackageManager {
return uid; return uid;
} }
} catch (RemoteException e) { } catch (RemoteException e) {
throw new RuntimeException("Package manager has died", e); throw e.rethrowAsRuntimeException();
} }
throw new NameNotFoundException("No shared userid for user:"+sharedUserName); throw new NameNotFoundException("No shared userid for user:"+sharedUserName);
} }
@@ -638,7 +638,7 @@ public class ApplicationPackageManager extends PackageManager {
ParceledListSlice<PackageInfo> slice = mPM.getInstalledPackages(flags, userId); ParceledListSlice<PackageInfo> slice = mPM.getInstalledPackages(flags, userId);
return slice.getList(); return slice.getList();
} catch (RemoteException e) { } catch (RemoteException e) {
throw new RuntimeException("Package manager has died", e); throw e.rethrowAsRuntimeException();
} }
} }
@@ -652,7 +652,7 @@ public class ApplicationPackageManager extends PackageManager {
permissions, flags, userId); permissions, flags, userId);
return slice.getList(); return slice.getList();
} catch (RemoteException e) { } catch (RemoteException e) {
throw new RuntimeException("Package manager has died", e); throw e.rethrowAsRuntimeException();
} }
} }
@@ -664,7 +664,7 @@ public class ApplicationPackageManager extends PackageManager {
ParceledListSlice<ApplicationInfo> slice = mPM.getInstalledApplications(flags, userId); ParceledListSlice<ApplicationInfo> slice = mPM.getInstalledApplications(flags, userId);
return slice.getList(); return slice.getList();
} catch (RemoteException e) { } catch (RemoteException e) {
throw new RuntimeException("Package manager has died", e); throw e.rethrowAsRuntimeException();
} }
} }
@@ -680,7 +680,7 @@ public class ApplicationPackageManager extends PackageManager {
} }
return Collections.emptyList(); return Collections.emptyList();
} catch (RemoteException e) { } catch (RemoteException e) {
throw new RuntimeException("Package manager has died", e); throw e.rethrowAsRuntimeException();
} }
} }
@@ -695,7 +695,7 @@ public class ApplicationPackageManager extends PackageManager {
} }
return null; return null;
} catch (RemoteException e) { } catch (RemoteException e) {
throw new RuntimeException("Package manager has died", e); throw e.rethrowAsRuntimeException();
} }
} }
@@ -705,9 +705,8 @@ public class ApplicationPackageManager extends PackageManager {
return mPM.isEphemeralApplication( return mPM.isEphemeralApplication(
mContext.getPackageName(), mContext.getUserId()); mContext.getPackageName(), mContext.getUserId());
} catch (RemoteException e) { } catch (RemoteException e) {
Log.e(TAG, "System server is dead", e); throw e.rethrowAsRuntimeException();
} }
return false;
} }
@Override @Override
@@ -724,11 +723,12 @@ public class ApplicationPackageManager extends PackageManager {
mContext.getPackageName(), mContext.getUserId()); mContext.getPackageName(), mContext.getUserId());
if (cookie != null) { if (cookie != null) {
return cookie; return cookie;
} else {
return EmptyArray.BYTE;
} }
} catch (RemoteException e) { } catch (RemoteException e) {
Log.e(TAG, "System server is dead", e); throw e.rethrowAsRuntimeException();
} }
return EmptyArray.BYTE;
} }
@Override @Override
@@ -737,9 +737,8 @@ public class ApplicationPackageManager extends PackageManager {
return mPM.setEphemeralApplicationCookie( return mPM.setEphemeralApplicationCookie(
mContext.getPackageName(), cookie, mContext.getUserId()); mContext.getPackageName(), cookie, mContext.getUserId());
} catch (RemoteException e) { } catch (RemoteException e) {
Log.e(TAG, "System server is dead", e); throw e.rethrowAsRuntimeException();
} }
return false;
} }
@Override @Override
@@ -756,7 +755,7 @@ public class ApplicationPackageManager extends PackageManager {
flags, flags,
userId); userId);
} catch (RemoteException e) { } catch (RemoteException e) {
throw new RuntimeException("Package manager has died", e); throw e.rethrowAsRuntimeException();
} }
} }
@@ -777,7 +776,7 @@ public class ApplicationPackageManager extends PackageManager {
flags, flags,
userId); userId);
} catch (RemoteException e) { } catch (RemoteException e) {
throw new RuntimeException("Package manager has died", e); throw e.rethrowAsRuntimeException();
} }
} }
@@ -809,7 +808,7 @@ public class ApplicationPackageManager extends PackageManager {
specificTypes, intent, intent.resolveTypeIfNeeded(resolver), specificTypes, intent, intent.resolveTypeIfNeeded(resolver),
flags, mContext.getUserId()); flags, mContext.getUserId());
} catch (RemoteException e) { } catch (RemoteException e) {
throw new RuntimeException("Package manager has died", e); throw e.rethrowAsRuntimeException();
} }
} }
@@ -825,7 +824,7 @@ public class ApplicationPackageManager extends PackageManager {
flags, flags,
userId); userId);
} catch (RemoteException e) { } catch (RemoteException e) {
throw new RuntimeException("Package manager has died", e); throw e.rethrowAsRuntimeException();
} }
} }
@@ -843,7 +842,7 @@ public class ApplicationPackageManager extends PackageManager {
flags, flags,
mContext.getUserId()); mContext.getUserId());
} catch (RemoteException e) { } catch (RemoteException e) {
throw new RuntimeException("Package manager has died", e); throw e.rethrowAsRuntimeException();
} }
} }
@@ -856,7 +855,7 @@ public class ApplicationPackageManager extends PackageManager {
flags, flags,
userId); userId);
} catch (RemoteException e) { } catch (RemoteException e) {
throw new RuntimeException("Package manager has died", e); throw e.rethrowAsRuntimeException();
} }
} }
@@ -872,7 +871,7 @@ public class ApplicationPackageManager extends PackageManager {
return mPM.queryIntentContentProviders(intent, return mPM.queryIntentContentProviders(intent,
intent.resolveTypeIfNeeded(mContext.getContentResolver()), flags, userId); intent.resolveTypeIfNeeded(mContext.getContentResolver()), flags, userId);
} catch (RemoteException e) { } catch (RemoteException e) {
throw new RuntimeException("Package manager has died", e); throw e.rethrowAsRuntimeException();
} }
} }
@@ -892,7 +891,7 @@ public class ApplicationPackageManager extends PackageManager {
try { try {
return mPM.resolveContentProvider(name, flags, userId); return mPM.resolveContentProvider(name, flags, userId);
} catch (RemoteException e) { } catch (RemoteException e) {
throw new RuntimeException("Package manager has died", e); throw e.rethrowAsRuntimeException();
} }
} }
@@ -904,7 +903,7 @@ public class ApplicationPackageManager extends PackageManager {
= mPM.queryContentProviders(processName, uid, flags); = mPM.queryContentProviders(processName, uid, flags);
return slice != null ? slice.getList() : null; return slice != null ? slice.getList() : null;
} catch (RemoteException e) { } catch (RemoteException e) {
throw new RuntimeException("Package manager has died", e); throw e.rethrowAsRuntimeException();
} }
} }
@@ -919,7 +918,7 @@ public class ApplicationPackageManager extends PackageManager {
return ii; return ii;
} }
} catch (RemoteException e) { } catch (RemoteException e) {
throw new RuntimeException("Package manager has died", e); throw e.rethrowAsRuntimeException();
} }
throw new NameNotFoundException(className.toString()); throw new NameNotFoundException(className.toString());
@@ -931,7 +930,7 @@ public class ApplicationPackageManager extends PackageManager {
try { try {
return mPM.queryInstrumentation(targetPackage, flags); return mPM.queryInstrumentation(targetPackage, flags);
} catch (RemoteException e) { } catch (RemoteException e) {
throw new RuntimeException("Package manager has died", e); throw e.rethrowAsRuntimeException();
} }
} }
@@ -1198,7 +1197,7 @@ public class ApplicationPackageManager extends PackageManager {
return getResourcesForApplication(ai); return getResourcesForApplication(ai);
} }
} catch (RemoteException e) { } catch (RemoteException e) {
throw new RuntimeException("Package manager has died", e); throw e.rethrowAsRuntimeException();
} }
throw new NameNotFoundException("Package " + appPackageName + " doesn't exist"); throw new NameNotFoundException("Package " + appPackageName + " doesn't exist");
} }
@@ -1213,7 +1212,7 @@ public class ApplicationPackageManager extends PackageManager {
} }
return mCachedSafeMode != 0; return mCachedSafeMode != 0;
} catch (RemoteException e) { } catch (RemoteException e) {
throw new RuntimeException("Package manager has died", e); throw e.rethrowAsRuntimeException();
} }
} }
@@ -1229,7 +1228,7 @@ public class ApplicationPackageManager extends PackageManager {
mPM.addOnPermissionsChangeListener(delegate); mPM.addOnPermissionsChangeListener(delegate);
mPermissionListeners.put(listener, delegate); mPermissionListeners.put(listener, delegate);
} catch (RemoteException e) { } catch (RemoteException e) {
throw new RuntimeException("Package manager has died", e); throw e.rethrowAsRuntimeException();
} }
} }
} }
@@ -1243,7 +1242,7 @@ public class ApplicationPackageManager extends PackageManager {
mPM.removeOnPermissionsChangeListener(delegate); mPM.removeOnPermissionsChangeListener(delegate);
mPermissionListeners.remove(listener); mPermissionListeners.remove(listener);
} catch (RemoteException e) { } catch (RemoteException e) {
throw new RuntimeException("Package manager has died", e); throw e.rethrowAsRuntimeException();
} }
} }
} }
@@ -1544,7 +1543,8 @@ public class ApplicationPackageManager extends PackageManager {
try { try {
mPM.installPackageAsUser(originPath, observer.getBinder(), flags, installerPackageName, mPM.installPackageAsUser(originPath, observer.getBinder(), flags, installerPackageName,
verificationParams, null, userId); verificationParams, null, userId);
} catch (RemoteException ignored) { } catch (RemoteException e) {
throw e.rethrowAsRuntimeException();
} }
} }
@@ -1563,8 +1563,7 @@ public class ApplicationPackageManager extends PackageManager {
} }
return res; return res;
} catch (RemoteException e) { } catch (RemoteException e) {
// Should never happen! throw e.rethrowAsRuntimeException();
throw new NameNotFoundException("Package " + packageName + " doesn't exist");
} }
} }
@@ -1573,7 +1572,7 @@ public class ApplicationPackageManager extends PackageManager {
try { try {
mPM.verifyPendingInstall(id, response); mPM.verifyPendingInstall(id, response);
} catch (RemoteException e) { } catch (RemoteException e) {
// Should never happen! throw e.rethrowAsRuntimeException();
} }
} }
@@ -1583,7 +1582,7 @@ public class ApplicationPackageManager extends PackageManager {
try { try {
mPM.extendVerificationTimeout(id, verificationCodeAtTimeout, millisecondsToDelay); mPM.extendVerificationTimeout(id, verificationCodeAtTimeout, millisecondsToDelay);
} catch (RemoteException e) { } catch (RemoteException e) {
// Should never happen! throw e.rethrowAsRuntimeException();
} }
} }
@@ -1592,7 +1591,7 @@ public class ApplicationPackageManager extends PackageManager {
try { try {
mPM.verifyIntentFilter(id, verificationCode, outFailedDomains); mPM.verifyIntentFilter(id, verificationCode, outFailedDomains);
} catch (RemoteException e) { } catch (RemoteException e) {
// Should never happen! throw e.rethrowAsRuntimeException();
} }
} }
@@ -1601,8 +1600,7 @@ public class ApplicationPackageManager extends PackageManager {
try { try {
return mPM.getIntentVerificationStatus(packageName, userId); return mPM.getIntentVerificationStatus(packageName, userId);
} catch (RemoteException e) { } catch (RemoteException e) {
// Should never happen! throw e.rethrowAsRuntimeException();
return PackageManager.INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_UNDEFINED;
} }
} }
@@ -1611,8 +1609,7 @@ public class ApplicationPackageManager extends PackageManager {
try { try {
return mPM.updateIntentVerificationStatus(packageName, status, userId); return mPM.updateIntentVerificationStatus(packageName, status, userId);
} catch (RemoteException e) { } catch (RemoteException e) {
// Should never happen! throw e.rethrowAsRuntimeException();
return false;
} }
} }
@@ -1621,8 +1618,7 @@ public class ApplicationPackageManager extends PackageManager {
try { try {
return mPM.getIntentFilterVerifications(packageName); return mPM.getIntentFilterVerifications(packageName);
} catch (RemoteException e) { } catch (RemoteException e) {
// Should never happen! throw e.rethrowAsRuntimeException();
return null;
} }
} }
@@ -1631,8 +1627,7 @@ public class ApplicationPackageManager extends PackageManager {
try { try {
return mPM.getAllIntentFilters(packageName); return mPM.getAllIntentFilters(packageName);
} catch (RemoteException e) { } catch (RemoteException e) {
// Should never happen! throw e.rethrowAsRuntimeException();
return null;
} }
} }
@@ -1641,8 +1636,7 @@ public class ApplicationPackageManager extends PackageManager {
try { try {
return mPM.getDefaultBrowserPackageName(userId); return mPM.getDefaultBrowserPackageName(userId);
} catch (RemoteException e) { } catch (RemoteException e) {
// Should never happen! throw e.rethrowAsRuntimeException();
return null;
} }
} }
@@ -1651,8 +1645,7 @@ public class ApplicationPackageManager extends PackageManager {
try { try {
return mPM.setDefaultBrowserPackageName(packageName, userId); return mPM.setDefaultBrowserPackageName(packageName, userId);
} catch (RemoteException e) { } catch (RemoteException e) {
// Should never happen! throw e.rethrowAsRuntimeException();
return false;
} }
} }
@@ -1662,7 +1655,7 @@ public class ApplicationPackageManager extends PackageManager {
try { try {
mPM.setInstallerPackageName(targetPackage, installerPackageName); mPM.setInstallerPackageName(targetPackage, installerPackageName);
} catch (RemoteException e) { } catch (RemoteException e) {
// Should never happen! throw e.rethrowAsRuntimeException();
} }
} }
@@ -1671,9 +1664,8 @@ public class ApplicationPackageManager extends PackageManager {
try { try {
return mPM.getInstallerPackageName(packageName); return mPM.getInstallerPackageName(packageName);
} catch (RemoteException e) { } catch (RemoteException e) {
// Should never happen! throw e.rethrowAsRuntimeException();
} }
return null;
} }
@Override @Override
@@ -1796,7 +1788,7 @@ public class ApplicationPackageManager extends PackageManager {
return false; return false;
} }
} catch (RemoteException e) { } catch (RemoteException e) {
throw new RuntimeException("Package manager has died", e); throw e.rethrowAsRuntimeException();
} }
// Otherwise we can move to any private volume // Otherwise we can move to any private volume
@@ -1874,7 +1866,7 @@ public class ApplicationPackageManager extends PackageManager {
try { try {
mPM.deletePackageAsUser(packageName, observer, userId, flags); mPM.deletePackageAsUser(packageName, observer, userId, flags);
} catch (RemoteException e) { } catch (RemoteException e) {
// Should never happen! throw e.rethrowAsRuntimeException();
} }
} }
@@ -1884,7 +1876,7 @@ public class ApplicationPackageManager extends PackageManager {
try { try {
mPM.clearApplicationUserData(packageName, observer, mContext.getUserId()); mPM.clearApplicationUserData(packageName, observer, mContext.getUserId());
} catch (RemoteException e) { } catch (RemoteException e) {
// Should never happen! throw e.rethrowAsRuntimeException();
} }
} }
@Override @Override
@@ -1893,7 +1885,7 @@ public class ApplicationPackageManager extends PackageManager {
try { try {
mPM.deleteApplicationCacheFiles(packageName, observer); mPM.deleteApplicationCacheFiles(packageName, observer);
} catch (RemoteException e) { } catch (RemoteException e) {
// Should never happen! throw e.rethrowAsRuntimeException();
} }
} }
@@ -1903,7 +1895,7 @@ public class ApplicationPackageManager extends PackageManager {
try { try {
mPM.freeStorageAndNotify(volumeUuid, idealStorageSize, observer); mPM.freeStorageAndNotify(volumeUuid, idealStorageSize, observer);
} catch (RemoteException e) { } catch (RemoteException e) {
// Should never happen! throw e.rethrowAsRuntimeException();
} }
} }
@@ -1912,7 +1904,7 @@ public class ApplicationPackageManager extends PackageManager {
try { try {
mPM.freeStorage(volumeUuid, freeStorageSize, pi); mPM.freeStorage(volumeUuid, freeStorageSize, pi);
} catch (RemoteException e) { } catch (RemoteException e) {
// Should never happen! throw e.rethrowAsRuntimeException();
} }
} }
@@ -1922,9 +1914,8 @@ public class ApplicationPackageManager extends PackageManager {
try { try {
return mPM.setPackagesSuspendedAsUser(packageNames, suspended, userId); return mPM.setPackagesSuspendedAsUser(packageNames, suspended, userId);
} catch (RemoteException e) { } catch (RemoteException e) {
// Should never happen! throw e.rethrowAsRuntimeException();
} }
return packageNames;
} }
@Override @Override
@@ -1932,9 +1923,8 @@ public class ApplicationPackageManager extends PackageManager {
try { try {
return mPM.isPackageSuspendedForUser(packageName, userId); return mPM.isPackageSuspendedForUser(packageName, userId);
} catch (RemoteException e) { } catch (RemoteException e) {
// Should never happen! throw e.rethrowAsRuntimeException();
} }
return false;
} }
@Override @Override
@@ -1943,7 +1933,7 @@ public class ApplicationPackageManager extends PackageManager {
try { try {
mPM.getPackageSizeInfo(packageName, userHandle, observer); mPM.getPackageSizeInfo(packageName, userHandle, observer);
} catch (RemoteException e) { } catch (RemoteException e) {
// Should never happen! throw e.rethrowAsRuntimeException();
} }
} }
@Override @Override
@@ -1951,7 +1941,7 @@ public class ApplicationPackageManager extends PackageManager {
try { try {
mPM.addPackageToPreferred(packageName); mPM.addPackageToPreferred(packageName);
} catch (RemoteException e) { } catch (RemoteException e) {
// Should never happen! throw e.rethrowAsRuntimeException();
} }
} }
@@ -1960,7 +1950,7 @@ public class ApplicationPackageManager extends PackageManager {
try { try {
mPM.removePackageFromPreferred(packageName); mPM.removePackageFromPreferred(packageName);
} catch (RemoteException e) { } catch (RemoteException e) {
// Should never happen! throw e.rethrowAsRuntimeException();
} }
} }
@@ -1969,9 +1959,8 @@ public class ApplicationPackageManager extends PackageManager {
try { try {
return mPM.getPreferredPackages(flags); return mPM.getPreferredPackages(flags);
} catch (RemoteException e) { } catch (RemoteException e) {
// Should never happen! throw e.rethrowAsRuntimeException();
} }
return new ArrayList<PackageInfo>();
} }
@Override @Override
@@ -1980,7 +1969,7 @@ public class ApplicationPackageManager extends PackageManager {
try { try {
mPM.addPreferredActivity(filter, match, set, activity, mContext.getUserId()); mPM.addPreferredActivity(filter, match, set, activity, mContext.getUserId());
} catch (RemoteException e) { } catch (RemoteException e) {
// Should never happen! throw e.rethrowAsRuntimeException();
} }
} }
@@ -1990,7 +1979,7 @@ public class ApplicationPackageManager extends PackageManager {
try { try {
mPM.addPreferredActivity(filter, match, set, activity, userId); mPM.addPreferredActivity(filter, match, set, activity, userId);
} catch (RemoteException e) { } catch (RemoteException e) {
// Should never happen! throw e.rethrowAsRuntimeException();
} }
} }
@@ -2000,7 +1989,7 @@ public class ApplicationPackageManager extends PackageManager {
try { try {
mPM.replacePreferredActivity(filter, match, set, activity, mContext.getUserId()); mPM.replacePreferredActivity(filter, match, set, activity, mContext.getUserId());
} catch (RemoteException e) { } catch (RemoteException e) {
// Should never happen! throw e.rethrowAsRuntimeException();
} }
} }
@@ -2011,7 +2000,7 @@ public class ApplicationPackageManager extends PackageManager {
try { try {
mPM.replacePreferredActivity(filter, match, set, activity, userId); mPM.replacePreferredActivity(filter, match, set, activity, userId);
} catch (RemoteException e) { } catch (RemoteException e) {
// Should never happen! throw e.rethrowAsRuntimeException();
} }
} }
@@ -2020,7 +2009,7 @@ public class ApplicationPackageManager extends PackageManager {
try { try {
mPM.clearPackagePreferredActivities(packageName); mPM.clearPackagePreferredActivities(packageName);
} catch (RemoteException e) { } catch (RemoteException e) {
// Should never happen! throw e.rethrowAsRuntimeException();
} }
} }
@@ -2030,9 +2019,8 @@ public class ApplicationPackageManager extends PackageManager {
try { try {
return mPM.getPreferredActivities(outFilters, outActivities, packageName); return mPM.getPreferredActivities(outFilters, outActivities, packageName);
} catch (RemoteException e) { } catch (RemoteException e) {
// Should never happen! throw e.rethrowAsRuntimeException();
} }
return 0;
} }
@Override @Override
@@ -2040,9 +2028,8 @@ public class ApplicationPackageManager extends PackageManager {
try { try {
return mPM.getHomeActivities(outActivities); return mPM.getHomeActivities(outActivities);
} catch (RemoteException e) { } catch (RemoteException e) {
// Should never happen! throw e.rethrowAsRuntimeException();
} }
return null;
} }
@Override @Override
@@ -2051,7 +2038,7 @@ public class ApplicationPackageManager extends PackageManager {
try { try {
mPM.setComponentEnabledSetting(componentName, newState, flags, mContext.getUserId()); mPM.setComponentEnabledSetting(componentName, newState, flags, mContext.getUserId());
} catch (RemoteException e) { } catch (RemoteException e) {
// Should never happen! throw e.rethrowAsRuntimeException();
} }
} }
@@ -2060,9 +2047,8 @@ public class ApplicationPackageManager extends PackageManager {
try { try {
return mPM.getComponentEnabledSetting(componentName, mContext.getUserId()); return mPM.getComponentEnabledSetting(componentName, mContext.getUserId());
} catch (RemoteException e) { } catch (RemoteException e) {
// Should never happen! throw e.rethrowAsRuntimeException();
} }
return PackageManager.COMPONENT_ENABLED_STATE_DEFAULT;
} }
@Override @Override
@@ -2072,7 +2058,7 @@ public class ApplicationPackageManager extends PackageManager {
mPM.setApplicationEnabledSetting(packageName, newState, flags, mPM.setApplicationEnabledSetting(packageName, newState, flags,
mContext.getUserId(), mContext.getOpPackageName()); mContext.getUserId(), mContext.getOpPackageName());
} catch (RemoteException e) { } catch (RemoteException e) {
// Should never happen! throw e.rethrowAsRuntimeException();
} }
} }
@@ -2081,9 +2067,8 @@ public class ApplicationPackageManager extends PackageManager {
try { try {
return mPM.getApplicationEnabledSetting(packageName, mContext.getUserId()); return mPM.getApplicationEnabledSetting(packageName, mContext.getUserId());
} catch (RemoteException e) { } catch (RemoteException e) {
// Should never happen! throw e.rethrowAsRuntimeException();
} }
return PackageManager.COMPONENT_ENABLED_STATE_DEFAULT;
} }
@Override @Override
@@ -2092,20 +2077,18 @@ public class ApplicationPackageManager extends PackageManager {
try { try {
return mPM.setApplicationHiddenSettingAsUser(packageName, hidden, return mPM.setApplicationHiddenSettingAsUser(packageName, hidden,
user.getIdentifier()); user.getIdentifier());
} catch (RemoteException re) { } catch (RemoteException e) {
// Should never happen! throw e.rethrowAsRuntimeException();
} }
return false;
} }
@Override @Override
public boolean getApplicationHiddenSettingAsUser(String packageName, UserHandle user) { public boolean getApplicationHiddenSettingAsUser(String packageName, UserHandle user) {
try { try {
return mPM.getApplicationHiddenSettingAsUser(packageName, user.getIdentifier()); return mPM.getApplicationHiddenSettingAsUser(packageName, user.getIdentifier());
} catch (RemoteException re) { } catch (RemoteException e) {
// Should never happen! throw e.rethrowAsRuntimeException();
} }
return false;
} }
/** @hide */ /** @hide */
@@ -2113,26 +2096,22 @@ public class ApplicationPackageManager extends PackageManager {
public KeySet getKeySetByAlias(String packageName, String alias) { public KeySet getKeySetByAlias(String packageName, String alias) {
Preconditions.checkNotNull(packageName); Preconditions.checkNotNull(packageName);
Preconditions.checkNotNull(alias); Preconditions.checkNotNull(alias);
KeySet ks;
try { try {
ks = mPM.getKeySetByAlias(packageName, alias); return mPM.getKeySetByAlias(packageName, alias);
} catch (RemoteException e) { } catch (RemoteException e) {
return null; throw e.rethrowAsRuntimeException();
} }
return ks;
} }
/** @hide */ /** @hide */
@Override @Override
public KeySet getSigningKeySet(String packageName) { public KeySet getSigningKeySet(String packageName) {
Preconditions.checkNotNull(packageName); Preconditions.checkNotNull(packageName);
KeySet ks;
try { try {
ks = mPM.getSigningKeySet(packageName); return mPM.getSigningKeySet(packageName);
} catch (RemoteException e) { } catch (RemoteException e) {
return null; throw e.rethrowAsRuntimeException();
} }
return ks;
} }
/** @hide */ /** @hide */
@@ -2143,7 +2122,7 @@ public class ApplicationPackageManager extends PackageManager {
try { try {
return mPM.isPackageSignedByKeySet(packageName, ks); return mPM.isPackageSignedByKeySet(packageName, ks);
} catch (RemoteException e) { } catch (RemoteException e) {
return false; throw e.rethrowAsRuntimeException();
} }
} }
@@ -2155,7 +2134,7 @@ public class ApplicationPackageManager extends PackageManager {
try { try {
return mPM.isPackageSignedByKeySetExactly(packageName, ks); return mPM.isPackageSignedByKeySetExactly(packageName, ks);
} catch (RemoteException e) { } catch (RemoteException e) {
return false; throw e.rethrowAsRuntimeException();
} }
} }
@@ -2167,9 +2146,8 @@ public class ApplicationPackageManager extends PackageManager {
try { try {
return mPM.getVerifierDeviceIdentity(); return mPM.getVerifierDeviceIdentity();
} catch (RemoteException e) { } catch (RemoteException e) {
// Should never happen! throw e.rethrowAsRuntimeException();
} }
return null;
} }
/** /**
@@ -2180,7 +2158,7 @@ public class ApplicationPackageManager extends PackageManager {
try { try {
return mPM.isUpgrade(); return mPM.isUpgrade();
} catch (RemoteException e) { } catch (RemoteException e) {
return false; throw e.rethrowAsRuntimeException();
} }
} }
@@ -2218,7 +2196,7 @@ public class ApplicationPackageManager extends PackageManager {
mPM.addCrossProfileIntentFilter(filter, mContext.getOpPackageName(), mPM.addCrossProfileIntentFilter(filter, mContext.getOpPackageName(),
sourceUserId, targetUserId, flags); sourceUserId, targetUserId, flags);
} catch (RemoteException e) { } catch (RemoteException e) {
// Should never happen! throw e.rethrowAsRuntimeException();
} }
} }
@@ -2230,7 +2208,7 @@ public class ApplicationPackageManager extends PackageManager {
try { try {
mPM.clearCrossProfileIntentFilters(sourceUserId, mContext.getOpPackageName()); mPM.clearCrossProfileIntentFilters(sourceUserId, mContext.getOpPackageName());
} catch (RemoteException e) { } catch (RemoteException e) {
// Should never happen! throw e.rethrowAsRuntimeException();
} }
} }

View File

@@ -36,7 +36,6 @@ import android.graphics.Rect;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.os.storage.StorageManager; import android.os.storage.StorageManager;
import android.provider.Settings; import android.provider.Settings;
import android.util.Log;
import android.view.WindowManager.LayoutParams; import android.view.WindowManager.LayoutParams;
import com.android.internal.R; import com.android.internal.R;
@@ -700,8 +699,7 @@ public class UserManager {
try { try {
return mService.getUserInfo(getUserHandle()).name; return mService.getUserInfo(getUserHandle()).name;
} catch (RemoteException re) { } catch (RemoteException re) {
Log.w(TAG, "Could not get user name", re); throw re.rethrowAsRuntimeException();
return "";
} }
} }
@@ -771,8 +769,7 @@ public class UserManager {
try { try {
return mService.isRestricted(); return mService.isRestricted();
} catch (RemoteException re) { } catch (RemoteException re) {
Log.w(TAG, "Could not check if user is limited ", re); throw re.rethrowAsRuntimeException();
return false;
} }
} }
@@ -784,8 +781,7 @@ public class UserManager {
try { try {
return mService.canHaveRestrictedProfile(userId); return mService.canHaveRestrictedProfile(userId);
} catch (RemoteException re) { } catch (RemoteException re) {
Log.w(TAG, "Could not check if user can have restricted profile", re); throw re.rethrowAsRuntimeException();
return false;
} }
} }
@@ -847,8 +843,8 @@ public class UserManager {
public boolean isUserRunning(int userId) { public boolean isUserRunning(int userId) {
try { try {
return ActivityManagerNative.getDefault().isUserRunning(userId, 0); return ActivityManagerNative.getDefault().isUserRunning(userId, 0);
} catch (RemoteException e) { } catch (RemoteException re) {
return false; throw re.rethrowAsRuntimeException();
} }
} }
@@ -864,8 +860,8 @@ public class UserManager {
// TODO: reconcile stopped vs stopping? // TODO: reconcile stopped vs stopping?
return ActivityManagerNative.getDefault().isUserRunning( return ActivityManagerNative.getDefault().isUserRunning(
user.getIdentifier(), ActivityManager.FLAG_OR_STOPPED); user.getIdentifier(), ActivityManager.FLAG_OR_STOPPED);
} catch (RemoteException e) { } catch (RemoteException re) {
return false; throw re.rethrowAsRuntimeException();
} }
} }
@@ -893,8 +889,8 @@ public class UserManager {
try { try {
return ActivityManagerNative.getDefault().isUserRunning( return ActivityManagerNative.getDefault().isUserRunning(
user.getIdentifier(), ActivityManager.FLAG_AND_LOCKED); user.getIdentifier(), ActivityManager.FLAG_AND_LOCKED);
} catch (RemoteException e) { } catch (RemoteException re) {
return false; throw re.rethrowAsRuntimeException();
} }
} }
@@ -922,8 +918,8 @@ public class UserManager {
try { try {
return ActivityManagerNative.getDefault().isUserRunning( return ActivityManagerNative.getDefault().isUserRunning(
user.getIdentifier(), ActivityManager.FLAG_AND_UNLOCKED); user.getIdentifier(), ActivityManager.FLAG_AND_UNLOCKED);
} catch (RemoteException e) { } catch (RemoteException re) {
return false; throw re.rethrowAsRuntimeException();
} }
} }
@@ -968,8 +964,7 @@ public class UserManager {
try { try {
return mService.getUserInfo(userHandle); return mService.getUserInfo(userHandle);
} catch (RemoteException re) { } catch (RemoteException re) {
Log.w(TAG, "Could not get user info", re); throw re.rethrowAsRuntimeException();
return null;
} }
} }
@@ -990,8 +985,7 @@ public class UserManager {
try { try {
return mService.getUserRestrictions(userHandle.getIdentifier()); return mService.getUserRestrictions(userHandle.getIdentifier());
} catch (RemoteException re) { } catch (RemoteException re) {
Log.w(TAG, "Could not get user restrictions", re); throw re.rethrowAsRuntimeException();
return Bundle.EMPTY;
} }
} }
@@ -1007,9 +1001,7 @@ public class UserManager {
try { try {
return mService.hasBaseUserRestriction(restrictionKey, userHandle.getIdentifier()); return mService.hasBaseUserRestriction(restrictionKey, userHandle.getIdentifier());
} catch (RemoteException re) { } catch (RemoteException re) {
Log.w(TAG, "Could not get base user restrictions for user " + throw re.rethrowAsRuntimeException();
userHandle.getIdentifier(), re);
return false;
} }
} }
@@ -1065,7 +1057,7 @@ public class UserManager {
try { try {
mService.setUserRestriction(key, value, userHandle.getIdentifier()); mService.setUserRestriction(key, value, userHandle.getIdentifier());
} catch (RemoteException re) { } catch (RemoteException re) {
Log.w(TAG, "Could not set user restriction", re); throw re.rethrowAsRuntimeException();
} }
} }
@@ -1092,8 +1084,7 @@ public class UserManager {
return mService.hasUserRestriction(restrictionKey, return mService.hasUserRestriction(restrictionKey,
userHandle.getIdentifier()); userHandle.getIdentifier());
} catch (RemoteException re) { } catch (RemoteException re) {
Log.w(TAG, "Could not check user restrictions", re); throw re.rethrowAsRuntimeException();
return false;
} }
} }
@@ -1147,7 +1138,7 @@ public class UserManager {
mService.setUserRestriction(DISALLOW_OUTGOING_CALLS, true, user.id); mService.setUserRestriction(DISALLOW_OUTGOING_CALLS, true, user.id);
} }
} catch (RemoteException re) { } catch (RemoteException re) {
Log.w(TAG, "Could not create a user", re); throw re.rethrowAsRuntimeException();
} }
return user; return user;
} }
@@ -1167,7 +1158,7 @@ public class UserManager {
Settings.Secure.SKIP_FIRST_USE_HINTS, "1", guest.id); Settings.Secure.SKIP_FIRST_USE_HINTS, "1", guest.id);
} }
} catch (RemoteException re) { } catch (RemoteException re) {
Log.w(TAG, "Could not create a user", re); throw re.rethrowAsRuntimeException();
} }
return guest; return guest;
} }
@@ -1188,8 +1179,7 @@ public class UserManager {
try { try {
return mService.createProfileForUser(name, flags, userHandle); return mService.createProfileForUser(name, flags, userHandle);
} catch (RemoteException re) { } catch (RemoteException re) {
Log.w(TAG, "Could not create a user", re); throw re.rethrowAsRuntimeException();
return null;
} }
} }
@@ -1211,10 +1201,9 @@ public class UserManager {
UserHandle.of(user.id)); UserHandle.of(user.id));
} }
return user; return user;
} catch (RemoteException e) { } catch (RemoteException re) {
Log.w(TAG, "Could not create a restricted profile", e); throw re.rethrowAsRuntimeException();
} }
return null;
} }
/** /**
@@ -1282,8 +1271,7 @@ public class UserManager {
try { try {
return mService.getSeedAccountName(); return mService.getSeedAccountName();
} catch (RemoteException re) { } catch (RemoteException re) {
Log.w(TAG, "Could not get the seed account name", re); throw re.rethrowAsRuntimeException();
return null;
} }
} }
@@ -1297,8 +1285,7 @@ public class UserManager {
try { try {
return mService.getSeedAccountType(); return mService.getSeedAccountType();
} catch (RemoteException re) { } catch (RemoteException re) {
Log.w(TAG, "Could not get the seed account type", re); throw re.rethrowAsRuntimeException();
return null;
} }
} }
@@ -1314,8 +1301,7 @@ public class UserManager {
try { try {
return mService.getSeedAccountOptions(); return mService.getSeedAccountOptions();
} catch (RemoteException re) { } catch (RemoteException re) {
Log.w(TAG, "Could not get the seed account options", re); throw re.rethrowAsRuntimeException();
return null;
} }
} }
@@ -1336,7 +1322,7 @@ public class UserManager {
mService.setSeedAccountData(userId, accountName, accountType, accountOptions, mService.setSeedAccountData(userId, accountName, accountType, accountOptions,
/* persist= */ true); /* persist= */ true);
} catch (RemoteException re) { } catch (RemoteException re) {
Log.w(TAG, "Could not set the seed account data", re); throw re.rethrowAsRuntimeException();
} }
} }
@@ -1349,7 +1335,7 @@ public class UserManager {
try { try {
mService.clearSeedAccountData(); mService.clearSeedAccountData();
} catch (RemoteException re) { } catch (RemoteException re) {
Log.w(TAG, "Could not clear the seed account data", re); throw re.rethrowAsRuntimeException();
} }
} }
@@ -1364,8 +1350,7 @@ public class UserManager {
try { try {
return mService.markGuestForDeletion(userHandle); return mService.markGuestForDeletion(userHandle);
} catch (RemoteException re) { } catch (RemoteException re) {
Log.w(TAG, "Could not mark guest for deletion", re); throw re.rethrowAsRuntimeException();
return false;
} }
} }
@@ -1384,8 +1369,8 @@ public class UserManager {
public void setUserEnabled(@UserIdInt int userHandle) { public void setUserEnabled(@UserIdInt int userHandle) {
try { try {
mService.setUserEnabled(userHandle); mService.setUserEnabled(userHandle);
} catch (RemoteException e) { } catch (RemoteException re) {
Log.w(TAG, "Could not enable the profile", e); throw re.rethrowAsRuntimeException();
} }
} }
@@ -1407,8 +1392,7 @@ public class UserManager {
try { try {
return mService.getUsers(false); return mService.getUsers(false);
} catch (RemoteException re) { } catch (RemoteException re) {
Log.w(TAG, "Could not get user list", re); throw re.rethrowAsRuntimeException();
return null;
} }
} }
@@ -1430,8 +1414,7 @@ public class UserManager {
} }
return result; return result;
} catch (RemoteException re) { } catch (RemoteException re) {
Log.w(TAG, "Could not get users list", re); throw re.rethrowAsRuntimeException();
return null;
} }
} }
@@ -1447,8 +1430,7 @@ public class UserManager {
try { try {
return mService.getUserAccount(userHandle); return mService.getUserAccount(userHandle);
} catch (RemoteException re) { } catch (RemoteException re) {
Log.w(TAG, "Could not get user account", re); throw re.rethrowAsRuntimeException();
return null;
} }
} }
@@ -1464,7 +1446,7 @@ public class UserManager {
try { try {
mService.setUserAccount(userHandle, accountName); mService.setUserAccount(userHandle, accountName);
} catch (RemoteException re) { } catch (RemoteException re) {
Log.w(TAG, "Could not set user account", re); throw re.rethrowAsRuntimeException();
} }
} }
@@ -1479,8 +1461,7 @@ public class UserManager {
try { try {
return mService.getPrimaryUser(); return mService.getPrimaryUser();
} catch (RemoteException re) { } catch (RemoteException re) {
Log.w(TAG, "Could not get Primary user", re); throw re.rethrowAsRuntimeException();
return null;
} }
} }
@@ -1517,8 +1498,7 @@ public class UserManager {
try { try {
return mService.canAddMoreManagedProfiles(userId, allowedToRemoveOne); return mService.canAddMoreManagedProfiles(userId, allowedToRemoveOne);
} catch (RemoteException re) { } catch (RemoteException re) {
Log.w(TAG, "Could not check if we can add more managed profiles", re); throw re.rethrowAsRuntimeException();
return false;
} }
} }
@@ -1537,8 +1517,7 @@ public class UserManager {
try { try {
return mService.getProfiles(userHandle, false /* enabledOnly */); return mService.getProfiles(userHandle, false /* enabledOnly */);
} catch (RemoteException re) { } catch (RemoteException re) {
Log.w(TAG, "Could not get user list", re); throw re.rethrowAsRuntimeException();
return null;
} }
} }
@@ -1553,8 +1532,7 @@ public class UserManager {
try { try {
return mService.isSameProfileGroup(userId, otherUserId); return mService.isSameProfileGroup(userId, otherUserId);
} catch (RemoteException re) { } catch (RemoteException re) {
Log.w(TAG, "Could not get user list", re); throw re.rethrowAsRuntimeException();
return false;
} }
} }
@@ -1572,8 +1550,7 @@ public class UserManager {
try { try {
return mService.getProfiles(userHandle, true /* enabledOnly */); return mService.getProfiles(userHandle, true /* enabledOnly */);
} catch (RemoteException re) { } catch (RemoteException re) {
Log.w(TAG, "Could not get user list", re); throw re.rethrowAsRuntimeException();
return null;
} }
} }
@@ -1589,8 +1566,7 @@ public class UserManager {
try { try {
users = mService.getProfiles(UserHandle.myUserId(), true /* enabledOnly */); users = mService.getProfiles(UserHandle.myUserId(), true /* enabledOnly */);
} catch (RemoteException re) { } catch (RemoteException re) {
Log.w(TAG, "Could not get user list", re); throw re.rethrowAsRuntimeException();
return null;
} }
for (UserInfo info : users) { for (UserInfo info : users) {
UserHandle userHandle = new UserHandle(info.id); UserHandle userHandle = new UserHandle(info.id);
@@ -1610,8 +1586,7 @@ public class UserManager {
try { try {
return mService.getCredentialOwnerProfile(userHandle); return mService.getCredentialOwnerProfile(userHandle);
} catch (RemoteException re) { } catch (RemoteException re) {
Log.w(TAG, "Could not get credential owner", re); throw re.rethrowAsRuntimeException();
return -1;
} }
} }
@@ -1625,8 +1600,7 @@ public class UserManager {
try { try {
return mService.getProfileParent(userHandle); return mService.getProfileParent(userHandle);
} catch (RemoteException re) { } catch (RemoteException re) {
Log.w(TAG, "Could not get profile parent", re); throw re.rethrowAsRuntimeException();
return null;
} }
} }
@@ -1640,8 +1614,8 @@ public class UserManager {
public void setQuietModeEnabled(@UserIdInt int userHandle, boolean enableQuietMode) { public void setQuietModeEnabled(@UserIdInt int userHandle, boolean enableQuietMode) {
try { try {
mService.setQuietModeEnabled(userHandle, enableQuietMode); mService.setQuietModeEnabled(userHandle, enableQuietMode);
} catch (RemoteException e) { } catch (RemoteException re) {
Log.w(TAG, "Could not change the profile's quiet mode", e); throw re.rethrowAsRuntimeException();
} }
} }
@@ -1654,10 +1628,9 @@ public class UserManager {
public boolean isQuietModeEnabled(UserHandle userHandle) { public boolean isQuietModeEnabled(UserHandle userHandle) {
try { try {
return mService.isQuietModeEnabled(userHandle.getIdentifier()); return mService.isQuietModeEnabled(userHandle.getIdentifier());
} catch (RemoteException e) { } catch (RemoteException re) {
Log.w(TAG, "Could not query the profile's quiet mode", e); throw re.rethrowAsRuntimeException();
} }
return false;
} }
/** /**
@@ -1742,8 +1715,7 @@ public class UserManager {
try { try {
return mService.getUsers(excludeDying); return mService.getUsers(excludeDying);
} catch (RemoteException re) { } catch (RemoteException re) {
Log.w(TAG, "Could not get user list", re); throw re.rethrowAsRuntimeException();
return null;
} }
} }
@@ -1757,8 +1729,7 @@ public class UserManager {
try { try {
return mService.removeUser(userHandle); return mService.removeUser(userHandle);
} catch (RemoteException re) { } catch (RemoteException re) {
Log.w(TAG, "Could not remove user ", re); throw re.rethrowAsRuntimeException();
return false;
} }
} }
@@ -1774,7 +1745,7 @@ public class UserManager {
try { try {
mService.setUserName(userHandle, name); mService.setUserName(userHandle, name);
} catch (RemoteException re) { } catch (RemoteException re) {
Log.w(TAG, "Could not set the user name ", re); throw re.rethrowAsRuntimeException();
} }
} }
@@ -1788,7 +1759,7 @@ public class UserManager {
try { try {
mService.setUserIcon(userHandle, icon); mService.setUserIcon(userHandle, icon);
} catch (RemoteException re) { } catch (RemoteException re) {
Log.w(TAG, "Could not set the user icon ", re); throw re.rethrowAsRuntimeException();
} }
} }
@@ -1813,7 +1784,7 @@ public class UserManager {
} }
} }
} catch (RemoteException re) { } catch (RemoteException re) {
Log.w(TAG, "Could not get the user icon ", re); throw re.rethrowAsRuntimeException();
} }
return null; return null;
} }
@@ -1869,9 +1840,8 @@ public class UserManager {
try { try {
return mService.getUserSerialNumber(userHandle); return mService.getUserSerialNumber(userHandle);
} catch (RemoteException re) { } catch (RemoteException re) {
Log.w(TAG, "Could not get serial number for user " + userHandle); throw re.rethrowAsRuntimeException();
} }
return -1;
} }
/** /**
@@ -1887,9 +1857,8 @@ public class UserManager {
try { try {
return mService.getUserHandle(userSerialNumber); return mService.getUserHandle(userSerialNumber);
} catch (RemoteException re) { } catch (RemoteException re) {
Log.w(TAG, "Could not get userHandle for user " + userSerialNumber); throw re.rethrowAsRuntimeException();
} }
return -1;
} }
/** /**
@@ -1915,9 +1884,8 @@ public class UserManager {
try { try {
return mService.getApplicationRestrictions(packageName); return mService.getApplicationRestrictions(packageName);
} catch (RemoteException re) { } catch (RemoteException re) {
Log.w(TAG, "Could not get application restrictions for package " + packageName); throw re.rethrowAsRuntimeException();
} }
return null;
} }
/** /**
@@ -1927,9 +1895,8 @@ public class UserManager {
try { try {
return mService.getApplicationRestrictionsForUser(packageName, user.getIdentifier()); return mService.getApplicationRestrictionsForUser(packageName, user.getIdentifier());
} catch (RemoteException re) { } catch (RemoteException re) {
Log.w(TAG, "Could not get application restrictions for user " + user.getIdentifier()); throw re.rethrowAsRuntimeException();
} }
return null;
} }
/** /**
@@ -1940,7 +1907,7 @@ public class UserManager {
try { try {
mService.setApplicationRestrictions(packageName, restrictions, user.getIdentifier()); mService.setApplicationRestrictions(packageName, restrictions, user.getIdentifier());
} catch (RemoteException re) { } catch (RemoteException re) {
Log.w(TAG, "Could not set application restrictions for user " + user.getIdentifier()); throw re.rethrowAsRuntimeException();
} }
} }
@@ -1964,7 +1931,7 @@ public class UserManager {
try { try {
mService.setDefaultGuestRestrictions(restrictions); mService.setDefaultGuestRestrictions(restrictions);
} catch (RemoteException re) { } catch (RemoteException re) {
Log.w(TAG, "Could not set guest restrictions"); throw re.rethrowAsRuntimeException();
} }
} }
@@ -1976,9 +1943,8 @@ public class UserManager {
try { try {
return mService.getDefaultGuestRestrictions(); return mService.getDefaultGuestRestrictions();
} catch (RemoteException re) { } catch (RemoteException re) {
Log.w(TAG, "Could not set guest restrictions"); throw re.rethrowAsRuntimeException();
} }
return new Bundle();
} }
/** /**
@@ -1991,8 +1957,7 @@ public class UserManager {
try { try {
return mService.getUserCreationTime(userHandle.getIdentifier()); return mService.getUserCreationTime(userHandle.getIdentifier());
} catch (RemoteException re) { } catch (RemoteException re) {
Log.w(TAG, "Could not get user creation time", re); throw re.rethrowAsRuntimeException();
return 0;
} }
} }
@@ -2008,8 +1973,7 @@ public class UserManager {
try { try {
return mService.someUserHasSeedAccount(accountName, accountType); return mService.someUserHasSeedAccount(accountName, accountType);
} catch (RemoteException re) { } catch (RemoteException re) {
Log.w(TAG, "Could not check seed accounts", re); throw re.rethrowAsRuntimeException();
return false;
} }
} }
} }