Merge "Enforce declared permissions on getCellularBatteryStats() and getWifiBatteryStats()" into sc-dev am: 7c36b86be4

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

Change-Id: Ic72520995fcc6f5f2b08b22302d70a8a84c2732b
This commit is contained in:
TreeHugger Robot
2021-06-15 01:03:56 +00:00
committed by Automerger Merge Worker

View File

@@ -2499,6 +2499,7 @@ public final class BatteryStatsService extends IBatteryStats.Stub
* @hide
*/
public CellularBatteryStats getCellularBatteryStats() {
enforceCallingPermission();
// Wait for the completion of pending works if there is any
awaitCompletion();
synchronized (mStats) {
@@ -2511,6 +2512,7 @@ public final class BatteryStatsService extends IBatteryStats.Stub
* @hide
*/
public WifiBatteryStats getWifiBatteryStats() {
enforceCallingPermission();
// Wait for the completion of pending works if there is any
awaitCompletion();
synchronized (mStats) {