Unrestrict SMS/PHONE app if it been set active
If an app been set default SMS/PHONE app, we need to unrestrict this app. This CL extract a common function and invoke it when necessary. Change-Id: Id29c5138438aa6f6f22cdd9c4ecf336de8481782 Fixes: 80305978 Test: robotests
This commit is contained in:
@@ -407,6 +407,16 @@ public class BatteryUtils {
|
||||
packageName) == AppOpsManager.MODE_IGNORED;
|
||||
}
|
||||
|
||||
public boolean clearForceAppStandby(String packageName) {
|
||||
final int uid = getPackageUid(packageName);
|
||||
if (uid != UID_NULL && isForceAppStandbyEnabled(uid, packageName)) {
|
||||
setForceAppStandby(uid, packageName, AppOpsManager.MODE_ALLOWED);
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public void initBatteryStatsHelper(BatteryStatsHelper statsHelper, Bundle bundle,
|
||||
UserManager userManager) {
|
||||
statsHelper.create(bundle);
|
||||
|
Reference in New Issue
Block a user