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

Commit 367358ec authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "fix bluetooth puller + bluetooth adapter may be lost, in which case we...

Merge "fix bluetooth puller + bluetooth adapter may be lost, in which case we should try to get it again"
parents 62d8fc25 c2d6544e
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -113,7 +113,6 @@ public class StatsCompanionService extends IStatsCompanionService.Stub {
        new StatFs(Environment.getRootDirectory().getAbsolutePath());
    private final StatFs mStatFsTemp =
        new StatFs(Environment.getDownloadCacheDirectory().getAbsolutePath());
    private final BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter();

    public StatsCompanionService(Context context) {
        super();
@@ -677,12 +676,13 @@ public class StatsCompanionService extends IStatsCompanionService.Stub {
    }

    private synchronized BluetoothActivityEnergyInfo pullBluetoothData() {
        final BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter();
      if (adapter != null) {
        SynchronousResultReceiver bluetoothReceiver = null;
        bluetoothReceiver = new SynchronousResultReceiver("bluetooth");
        SynchronousResultReceiver bluetoothReceiver = new SynchronousResultReceiver("bluetooth");
        adapter.requestControllerActivityEnergyInfo(bluetoothReceiver);
        return awaitControllerInfo(bluetoothReceiver);
      } else {
          Slog.e(TAG, "Failed to get bluetooth adapter!");
        return null;
      }
    }