Merge "Enforce declared permissions on getCellularBatteryStats() and getWifiBatteryStats()" into sc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
7c36b86be4
@@ -2499,6 +2499,7 @@ public final class BatteryStatsService extends IBatteryStats.Stub
|
|||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
public CellularBatteryStats getCellularBatteryStats() {
|
public CellularBatteryStats getCellularBatteryStats() {
|
||||||
|
enforceCallingPermission();
|
||||||
// Wait for the completion of pending works if there is any
|
// Wait for the completion of pending works if there is any
|
||||||
awaitCompletion();
|
awaitCompletion();
|
||||||
synchronized (mStats) {
|
synchronized (mStats) {
|
||||||
@@ -2511,6 +2512,7 @@ public final class BatteryStatsService extends IBatteryStats.Stub
|
|||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
public WifiBatteryStats getWifiBatteryStats() {
|
public WifiBatteryStats getWifiBatteryStats() {
|
||||||
|
enforceCallingPermission();
|
||||||
// Wait for the completion of pending works if there is any
|
// Wait for the completion of pending works if there is any
|
||||||
awaitCompletion();
|
awaitCompletion();
|
||||||
synchronized (mStats) {
|
synchronized (mStats) {
|
||||||
|
|||||||
Reference in New Issue
Block a user