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

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

Merge "Fix battery level of earbuds bt devices is inconsistent" into sc-dev

parents 5dca7729 bbbae9af
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -175,7 +175,7 @@ public final class BluetoothDevicePreference extends GearPreference {
        mHideSecondTarget = hideSecondTarget;
    }

    private void onPreferenceAttributesChanged() {
    void onPreferenceAttributesChanged() {
        ThreadUtils.postOnBackgroundThread(() -> {
            final Pair<Drawable, String> pair =
                    BluetoothUtils.getBtRainbowDrawableWithDescription(getContext(), mCachedDevice);
+9 −0
Original line number Diff line number Diff line
@@ -317,4 +317,13 @@ public abstract class BluetoothDeviceUpdater implements BluetoothCallback,
        }
        return device.getBondState() == BluetoothDevice.BOND_BONDED && device.isConnected();
    }

    /**
     * Update the attributes of {@link Preference}.
     */
    public void refreshPreference() {
        for (Preference preference : mPreferenceMap.values()) {
            ((BluetoothDevicePreference) preference).onPreferenceAttributesChanged();
        }
    }
}
+1 −0
Original line number Diff line number Diff line
@@ -68,6 +68,7 @@ public class AvailableMediaDeviceGroupController extends BasePreferenceControlle
        }
        mBluetoothDeviceUpdater.registerCallback();
        mLocalBluetoothManager.getEventManager().registerCallback(this);
        mBluetoothDeviceUpdater.refreshPreference();
    }

    @Override
+1 −0
Original line number Diff line number Diff line
@@ -61,6 +61,7 @@ public class ConnectedDeviceGroupController extends BasePreferenceController
        mBluetoothDeviceUpdater.registerCallback();
        mConnectedUsbDeviceUpdater.registerCallback();
        mConnectedDockUpdater.registerCallback();
        mBluetoothDeviceUpdater.refreshPreference();
    }

    @Override
+1 −0
Original line number Diff line number Diff line
@@ -111,6 +111,7 @@ public class PreviouslyConnectedDevicePreferenceController extends BasePreferenc
        mBluetoothDeviceUpdater.registerCallback();
        mSavedDockUpdater.registerCallback();
        mContext.registerReceiver(mReceiver, mIntentFilter);
        mBluetoothDeviceUpdater.refreshPreference();
    }

    @Override
Loading