Merge "Log instead of throw exception when pkg not found" into sc-dev am: e90ea3aaba

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14537490

Change-Id: I57a8e19e3699cfa3f74eb1e8a90eafabea940439
This commit is contained in:
TreeHugger Robot
2021-05-14 01:44:58 +00:00
committed by Automerger Merge Worker

View File

@@ -220,9 +220,9 @@ public final class AppHibernationService extends SystemService {
final Map<String, UserLevelState> packageStates = mUserStates.get(userId);
final UserLevelState pkgState = packageStates.get(packageName);
if (pkgState == null) {
throw new IllegalArgumentException(
String.format("Package %s is not installed for user %s",
packageName, userId));
Slog.e(TAG, String.format("Package %s is not installed for user %s",
packageName, userId));
return false;
}
return pkgState.hibernated;
}
@@ -275,9 +275,9 @@ public final class AppHibernationService extends SystemService {
final Map<String, UserLevelState> packageStates = mUserStates.get(userId);
final UserLevelState pkgState = packageStates.get(packageName);
if (pkgState == null) {
throw new IllegalArgumentException(
String.format("Package %s is not installed for user %s",
packageName, userId));
Slog.e(TAG, String.format("Package %s is not installed for user %s",
packageName, userId));
return;
}
if (pkgState.hibernated == isHibernating) {
@@ -320,8 +320,8 @@ public final class AppHibernationService extends SystemService {
synchronized (mLock) {
GlobalLevelState state = mGlobalHibernationStates.get(packageName);
if (state == null) {
throw new IllegalArgumentException(
String.format("Package %s is not installed for any user", packageName));
Slog.e(TAG, String.format("Package %s is not installed for any user", packageName));
return;
}
if (state.hibernated != isHibernating) {
if (isHibernating) {