Merge "Log instead of throw exception when pkg not found" into sc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
e90ea3aaba
@@ -220,9 +220,9 @@ public final class AppHibernationService extends SystemService {
|
|||||||
final Map<String, UserLevelState> packageStates = mUserStates.get(userId);
|
final Map<String, UserLevelState> packageStates = mUserStates.get(userId);
|
||||||
final UserLevelState pkgState = packageStates.get(packageName);
|
final UserLevelState pkgState = packageStates.get(packageName);
|
||||||
if (pkgState == null) {
|
if (pkgState == null) {
|
||||||
throw new IllegalArgumentException(
|
Slog.e(TAG, String.format("Package %s is not installed for user %s",
|
||||||
String.format("Package %s is not installed for user %s",
|
|
||||||
packageName, userId));
|
packageName, userId));
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
return pkgState.hibernated;
|
return pkgState.hibernated;
|
||||||
}
|
}
|
||||||
@@ -275,9 +275,9 @@ public final class AppHibernationService extends SystemService {
|
|||||||
final Map<String, UserLevelState> packageStates = mUserStates.get(userId);
|
final Map<String, UserLevelState> packageStates = mUserStates.get(userId);
|
||||||
final UserLevelState pkgState = packageStates.get(packageName);
|
final UserLevelState pkgState = packageStates.get(packageName);
|
||||||
if (pkgState == null) {
|
if (pkgState == null) {
|
||||||
throw new IllegalArgumentException(
|
Slog.e(TAG, String.format("Package %s is not installed for user %s",
|
||||||
String.format("Package %s is not installed for user %s",
|
|
||||||
packageName, userId));
|
packageName, userId));
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pkgState.hibernated == isHibernating) {
|
if (pkgState.hibernated == isHibernating) {
|
||||||
@@ -320,8 +320,8 @@ public final class AppHibernationService extends SystemService {
|
|||||||
synchronized (mLock) {
|
synchronized (mLock) {
|
||||||
GlobalLevelState state = mGlobalHibernationStates.get(packageName);
|
GlobalLevelState state = mGlobalHibernationStates.get(packageName);
|
||||||
if (state == null) {
|
if (state == null) {
|
||||||
throw new IllegalArgumentException(
|
Slog.e(TAG, String.format("Package %s is not installed for any user", packageName));
|
||||||
String.format("Package %s is not installed for any user", packageName));
|
return;
|
||||||
}
|
}
|
||||||
if (state.hibernated != isHibernating) {
|
if (state.hibernated != isHibernating) {
|
||||||
if (isHibernating) {
|
if (isHibernating) {
|
||||||
|
|||||||
Reference in New Issue
Block a user