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

Commit ac0a904a authored by Rahul Sabnis's avatar Rahul Sabnis Committed by Gerrit Code Review
Browse files

Merge "Temporarily comment out usages of PropertyInvalidatedCache while it is...

Merge "Temporarily comment out usages of PropertyInvalidatedCache while it is being moved to module-utils"
parents bc1dcbb0 3cd3844c
Loading
Loading
Loading
Loading
+10 −8
Original line number Diff line number Diff line
@@ -198,7 +198,7 @@ class AdapterProperties {
    AdapterProperties(AdapterService service) {
        mService = service;
        mAdapter = BluetoothAdapter.getDefaultAdapter();
        invalidateBluetoothCaches();
        //invalidateBluetoothCaches();
    }

    public void init(RemoteDevices remoteDevices) {
@@ -240,7 +240,7 @@ class AdapterProperties {
        filter.addAction(BluetoothPbapClient.ACTION_CONNECTION_STATE_CHANGED);
        mService.registerReceiver(mReceiver, filter);
        mReceiverRegistered = true;
        invalidateBluetoothCaches();
        //invalidateBluetoothCaches();
    }

    public void cleanup() {
@@ -252,8 +252,9 @@ class AdapterProperties {
        }
        mService = null;
        mBondedDevices.clear();
        invalidateBluetoothCaches();
        //invalidateBluetoothCaches();
    }
    /*
    private static void invalidateGetProfileConnectionStateCache() {
        BluetoothAdapter.invalidateGetProfileConnectionStateCache();
    }
@@ -272,6 +273,7 @@ class AdapterProperties {
        invalidateGetConnectionStateCache();
        invalidateGetBondStateCache();
    }
     */

    @Override
    public Object clone() throws CloneNotSupportedException {
@@ -409,7 +411,7 @@ class AdapterProperties {
     */
    void setConnectionState(int connectionState) {
        mConnectionState = connectionState;
        invalidateGetConnectionStateCache();
        //invalidateGetConnectionStateCache();
    }

    /**
@@ -629,7 +631,7 @@ class AdapterProperties {
                    debugLog("Failed to remove device: " + device);
                }
            }
            invalidateGetBondStateCache();
            //invalidateGetBondStateCache();
        } catch (Exception ee) {
            Log.w(TAG, "onBondStateChanged: Exception ", ee);
        }
@@ -858,7 +860,7 @@ class AdapterProperties {

        if (update) {
            mProfileConnectionState.put(profile, new Pair<Integer, Integer>(newHashState, numDev));
            invalidateGetProfileConnectionStateCache();
            //invalidateGetProfileConnectionStateCache();
        }
    }

@@ -1004,7 +1006,7 @@ class AdapterProperties {
                + mIsLePeriodicAdvertisingSyncTransferSenderSupported
                + " mIsLeConnectedIsochronousStreamCentralSupported = "
                + mIsLeConnectedIsochronousStreamCentralSupported);
        invalidateIsOffloadedFilteringSupportedCache();
        //invalidateIsOffloadedFilteringSupportedCache();
    }

    private void updateDynamicAudioBufferSupport(byte[] val) {
@@ -1037,7 +1039,7 @@ class AdapterProperties {
            // Reset adapter and profile connection states
            setConnectionState(BluetoothAdapter.STATE_DISCONNECTED);
            mProfileConnectionState.clear();
            invalidateGetProfileConnectionStateCache();
            //invalidateGetProfileConnectionStateCache();
            mProfilesConnected = 0;
            mProfilesConnecting = 0;
            mProfilesDisconnecting = 0;
+9 −5
Original line number Diff line number Diff line
@@ -524,7 +524,7 @@ public class AdapterService extends Service {

        setAdapterService(this);

        invalidateBluetoothCaches();
        //invalidateBluetoothCaches();

        // First call to getSharedPreferences will result in a file read into
        // memory cache. Call it here asynchronously to avoid potential ANR
@@ -714,9 +714,11 @@ public class AdapterService extends Service {
        setProfileServiceState(GattService.class, BluetoothAdapter.STATE_OFF);
    }

    /*
    private void invalidateBluetoothGetStateCache() {
        BluetoothAdapter.invalidateBluetoothGetStateCache();
    }
     */

    void updateLeAudioProfileServiceState(boolean isCisCentralSupported) {
        if (isCisCentralSupported) {
@@ -737,7 +739,7 @@ public class AdapterService extends Service {

    void updateAdapterState(int prevState, int newState) {
        mAdapterProperties.setState(newState);
        invalidateBluetoothGetStateCache();
        //invalidateBluetoothGetStateCache();
        if (mCallbacks != null) {
            int n = mCallbacks.beginBroadcast();
            debugLog("updateAdapterState() - Broadcasting state " + BluetoothAdapter.nameForState(
@@ -835,7 +837,7 @@ public class AdapterService extends Service {
        clearAdapterService(this);

        mCleaningUp = true;
        invalidateBluetoothCaches();
        //invalidateBluetoothCaches();

        unregisterReceiver(mAlarmBroadcastReceiver);

@@ -930,6 +932,7 @@ public class AdapterService extends Service {
        }
    }

    /*
    private void invalidateBluetoothCaches() {
        BluetoothAdapter.invalidateGetProfileConnectionStateCache();
        BluetoothAdapter.invalidateIsOffloadedFilteringSupportedCache();
@@ -937,6 +940,7 @@ public class AdapterService extends Service {
        BluetoothAdapter.invalidateBluetoothGetStateCache();
        BluetoothAdapter.invalidateGetAdapterConnectionStateCache();
    }
     */

    private void setProfileServiceState(Class service, int state) {
        if (state == BluetoothAdapter.STATE_ON) {
@@ -1264,8 +1268,8 @@ public class AdapterService extends Service {

        AdapterServiceBinder(AdapterService svc) {
            mService = svc;
            mService.invalidateBluetoothGetStateCache();
            BluetoothAdapter.getDefaultAdapter().disableBluetoothGetStateCache();
            //mService.invalidateBluetoothGetStateCache();
            //BluetoothAdapter.getDefaultAdapter().disableBluetoothGetStateCache();
        }

        public void cleanup() {