Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7328ae4d authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Remove bluetooth state change logging from BatteryStats" into udc-dev am: fda3c4c7

parents 3b15baa6 fda3c4c7
Loading
Loading
Loading
Loading
+2 −10
Original line number Diff line number Diff line
@@ -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();
        }
    }

    /**
+0 −4
Original line number Diff line number Diff line
@@ -219,10 +219,6 @@ interface IBatteryStats {
    @EnforcePermission("BATTERY_STATS")
    long getAwakeTimePlugged();

    @EnforcePermission("BLUETOOTH_CONNECT")
    void noteBluetoothOn(int uid, int reason, String packageName);
    @EnforcePermission("BLUETOOTH_CONNECT")
    void noteBluetoothOff(int uid, int reason, String packageName);
    @EnforcePermission("UPDATE_DEVICE_STATS")
    void noteBleScanStarted(in WorkSource ws, boolean isUnoptimized);
    @EnforcePermission("UPDATE_DEVICE_STATS")
+0 −28
Original line number Diff line number Diff line
@@ -2287,34 +2287,6 @@ public final class BatteryStatsService extends IBatteryStats.Stub
        }
    }

    /**
     * Bluetooth on stat logging
     */
    @Override
    @EnforcePermission(BLUETOOTH_CONNECT)
    public void noteBluetoothOn(int uid, int reason, String packageName) {
        super.noteBluetoothOn_enforcePermission();

        FrameworkStatsLog.write_non_chained(FrameworkStatsLog.BLUETOOTH_ENABLED_STATE_CHANGED,
                Binder.getCallingUid(), null,
                FrameworkStatsLog.BLUETOOTH_ENABLED_STATE_CHANGED__STATE__ENABLED,
                reason, packageName);
    }

    /**
     * Bluetooth off stat logging
     */
    @Override
    @EnforcePermission(BLUETOOTH_CONNECT)
    public void noteBluetoothOff(int uid, int reason, String packageName) {
        super.noteBluetoothOff_enforcePermission();

        FrameworkStatsLog.write_non_chained(FrameworkStatsLog.BLUETOOTH_ENABLED_STATE_CHANGED,
                Binder.getCallingUid(), null,
                FrameworkStatsLog.BLUETOOTH_ENABLED_STATE_CHANGED__STATE__DISABLED,
                reason, packageName);
    }

    @Override
    @EnforcePermission(UPDATE_DEVICE_STATS)
    public void noteBleScanStarted(final WorkSource ws, final boolean isUnoptimized) {