Merge "Remove bluetooth state change logging from BatteryStats" am: 8c7dbeba13 am: 17167ab020
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2586365 Change-Id: Id0f2e2b23b621bda17e05163a5ad41d225d03531 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -520,14 +520,10 @@ public final class BatteryStatsManager {
|
||||
* @param uid calling package uid
|
||||
* @param reason why Bluetooth has been turned on
|
||||
* @param packageName package responsible for this change
|
||||
* @Deprecated Bluetooth self report its state and no longer call this
|
||||
*/
|
||||
@RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)
|
||||
public void reportBluetoothOn(int uid, int reason, @NonNull String packageName) {
|
||||
try {
|
||||
mBatteryStats.noteBluetoothOn(uid, reason, packageName);
|
||||
} catch (RemoteException e) {
|
||||
e.rethrowFromSystemServer();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -536,14 +532,10 @@ public final class BatteryStatsManager {
|
||||
* @param uid calling package uid
|
||||
* @param reason why Bluetooth has been turned on
|
||||
* @param packageName package responsible for this change
|
||||
* @Deprecated Bluetooth self report its state and no longer call this
|
||||
*/
|
||||
@RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)
|
||||
public void reportBluetoothOff(int uid, int reason, @NonNull String packageName) {
|
||||
try {
|
||||
mBatteryStats.noteBluetoothOff(uid, reason, packageName);
|
||||
} catch (RemoteException e) {
|
||||
e.rethrowFromSystemServer();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -145,8 +145,6 @@ interface IBatteryStats {
|
||||
long getAwakeTimeBattery();
|
||||
long getAwakeTimePlugged();
|
||||
|
||||
void noteBluetoothOn(int uid, int reason, String packageName);
|
||||
void noteBluetoothOff(int uid, int reason, String packageName);
|
||||
void noteBleScanStarted(in WorkSource ws, boolean isUnoptimized);
|
||||
void noteBleScanStopped(in WorkSource ws, boolean isUnoptimized);
|
||||
void noteBleScanReset();
|
||||
|
||||
@@ -1985,32 +1985,6 @@ public final class BatteryStatsService extends IBatteryStats.Stub
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Bluetooth on stat logging
|
||||
*/
|
||||
public void noteBluetoothOn(int uid, int reason, String packageName) {
|
||||
if (Binder.getCallingPid() != Process.myPid()) {
|
||||
mContext.enforcePermission(android.Manifest.permission.BLUETOOTH_CONNECT,
|
||||
Binder.getCallingPid(), uid, null);
|
||||
}
|
||||
FrameworkStatsLog.write_non_chained(FrameworkStatsLog.BLUETOOTH_ENABLED_STATE_CHANGED,
|
||||
uid, null, FrameworkStatsLog.BLUETOOTH_ENABLED_STATE_CHANGED__STATE__ENABLED,
|
||||
reason, packageName);
|
||||
}
|
||||
|
||||
/**
|
||||
* Bluetooth off stat logging
|
||||
*/
|
||||
public void noteBluetoothOff(int uid, int reason, String packageName) {
|
||||
if (Binder.getCallingPid() != Process.myPid()) {
|
||||
mContext.enforcePermission(android.Manifest.permission.BLUETOOTH_CONNECT,
|
||||
Binder.getCallingPid(), uid, null);
|
||||
}
|
||||
FrameworkStatsLog.write_non_chained(FrameworkStatsLog.BLUETOOTH_ENABLED_STATE_CHANGED,
|
||||
uid, null, FrameworkStatsLog.BLUETOOTH_ENABLED_STATE_CHANGED__STATE__DISABLED,
|
||||
reason, packageName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void noteBleScanStarted(final WorkSource ws, final boolean isUnoptimized) {
|
||||
enforceCallingPermission();
|
||||
|
||||
Reference in New Issue
Block a user