PerformanceManager : Ensure we clear calling identity
When going from perfmanager -> powermanager we need to clear the calling identity otherwise you get : Bad call: specified package android under uid 10031 but it is really 1000 CYNGNOS-786 Change-Id: Iacd310f56d6538b0f7a4779f89b4451f6a203c5b
This commit is contained in:
parent
9c902f898e
commit
61afdc1fd7
@ -189,11 +189,18 @@ public class PerformanceManagerService extends SystemService {
|
|||||||
if (profile == PerformanceManager.PROFILE_POWER_SAVE) {
|
if (profile == PerformanceManager.PROFILE_POWER_SAVE) {
|
||||||
// Handle the case where toggle power saver mode
|
// Handle the case where toggle power saver mode
|
||||||
// failed
|
// failed
|
||||||
if (!mPm.setPowerSaveMode(true)) {
|
long token = Binder.clearCallingIdentity();
|
||||||
return false;
|
try {
|
||||||
|
if (!mPm.setPowerSaveMode(true)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
Binder.restoreCallingIdentity(token);
|
||||||
}
|
}
|
||||||
} else if (mCurrentProfile == PerformanceManager.PROFILE_POWER_SAVE) {
|
} else if (mCurrentProfile == PerformanceManager.PROFILE_POWER_SAVE) {
|
||||||
|
long token = Binder.clearCallingIdentity();
|
||||||
mPm.setPowerSaveMode(false);
|
mPm.setPowerSaveMode(false);
|
||||||
|
Binder.restoreCallingIdentity(token);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user