Loading android/app/src/com/android/bluetooth/btservice/AdapterProperties.java +12 −4 Original line number Original line Diff line number Diff line Loading @@ -182,12 +182,11 @@ class AdapterProperties { AdapterProperties(AdapterService service) { AdapterProperties(AdapterService service) { mService = service; mService = service; mAdapter = BluetoothAdapter.getDefaultAdapter(); mAdapter = BluetoothAdapter.getDefaultAdapter(); invalidateIsOffloadedFilteringSupportedCache(); invalidateBluetoothCaches(); } } public void init(RemoteDevices remoteDevices) { public void init(RemoteDevices remoteDevices) { mProfileConnectionState.clear(); mProfileConnectionState.clear(); invalidateGetProfileConnectionStateCache(); mRemoteDevices = remoteDevices; mRemoteDevices = remoteDevices; // Get default max connected audio devices from config.xml in frameworks/base/core // Get default max connected audio devices from config.xml in frameworks/base/core Loading Loading @@ -225,18 +224,19 @@ class AdapterProperties { filter.addAction(BluetoothPbapClient.ACTION_CONNECTION_STATE_CHANGED); filter.addAction(BluetoothPbapClient.ACTION_CONNECTION_STATE_CHANGED); mService.registerReceiver(mReceiver, filter); mService.registerReceiver(mReceiver, filter); mReceiverRegistered = true; mReceiverRegistered = true; invalidateBluetoothCaches(); } } public void cleanup() { public void cleanup() { mRemoteDevices = null; mRemoteDevices = null; mProfileConnectionState.clear(); mProfileConnectionState.clear(); invalidateGetProfileConnectionStateCache(); if (mReceiverRegistered) { if (mReceiverRegistered) { mService.unregisterReceiver(mReceiver); mService.unregisterReceiver(mReceiver); mReceiverRegistered = false; mReceiverRegistered = false; } } mService = null; mService = null; mBondedDevices.clear(); mBondedDevices.clear(); invalidateBluetoothCaches(); } } private static void invalidateGetProfileConnectionStateCache() { private static void invalidateGetProfileConnectionStateCache() { Loading @@ -245,6 +245,14 @@ class AdapterProperties { private static void invalidateIsOffloadedFilteringSupportedCache() { private static void invalidateIsOffloadedFilteringSupportedCache() { BluetoothAdapter.invalidateIsOffloadedFilteringSupportedCache(); BluetoothAdapter.invalidateIsOffloadedFilteringSupportedCache(); } } private static void invalidateGetBondStateCache() { BluetoothDevice.invalidateBluetoothGetBondStateCache(); } private static void invalidateBluetoothCaches() { invalidateGetProfileConnectionStateCache(); invalidateIsOffloadedFilteringSupportedCache(); invalidateGetBondStateCache(); } @Override @Override public Object clone() throws CloneNotSupportedException { public Object clone() throws CloneNotSupportedException { Loading Loading @@ -548,7 +556,7 @@ class AdapterProperties { debugLog("Failed to remove device: " + device); debugLog("Failed to remove device: " + device); } } } } BluetoothDevice.invalidateBluetoothGetBondStateCache(); invalidateGetBondStateCache(); } catch (Exception ee) { } catch (Exception ee) { Log.w(TAG, "onBondStateChanged: Exception ", ee); Log.w(TAG, "onBondStateChanged: Exception ", ee); } } Loading android/app/src/com/android/bluetooth/btservice/AdapterService.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -30,6 +30,7 @@ import android.app.ActivityManager; import android.app.AlarmManager; import android.app.AlarmManager; import android.app.AppOpsManager; import android.app.AppOpsManager; import android.app.PendingIntent; import android.app.PendingIntent; import android.app.PropertyInvalidatedCache; import android.app.Service; import android.app.Service; import android.app.admin.DevicePolicyManager; import android.app.admin.DevicePolicyManager; import android.bluetooth.BluetoothActivityEnergyInfo; import android.bluetooth.BluetoothActivityEnergyInfo; Loading Loading @@ -790,7 +791,6 @@ public class AdapterService extends Service { } } private void invalidateBluetoothCaches() { private void invalidateBluetoothCaches() { BluetoothAdapter.invalidateGetProfileConnectionStateCache(); BluetoothAdapter.invalidateGetProfileConnectionStateCache(); BluetoothAdapter.invalidateGetProfileConnectionStateCache(); BluetoothAdapter.invalidateIsOffloadedFilteringSupportedCache(); BluetoothAdapter.invalidateIsOffloadedFilteringSupportedCache(); BluetoothDevice.invalidateBluetoothGetBondStateCache(); BluetoothDevice.invalidateBluetoothGetBondStateCache(); Loading Loading
android/app/src/com/android/bluetooth/btservice/AdapterProperties.java +12 −4 Original line number Original line Diff line number Diff line Loading @@ -182,12 +182,11 @@ class AdapterProperties { AdapterProperties(AdapterService service) { AdapterProperties(AdapterService service) { mService = service; mService = service; mAdapter = BluetoothAdapter.getDefaultAdapter(); mAdapter = BluetoothAdapter.getDefaultAdapter(); invalidateIsOffloadedFilteringSupportedCache(); invalidateBluetoothCaches(); } } public void init(RemoteDevices remoteDevices) { public void init(RemoteDevices remoteDevices) { mProfileConnectionState.clear(); mProfileConnectionState.clear(); invalidateGetProfileConnectionStateCache(); mRemoteDevices = remoteDevices; mRemoteDevices = remoteDevices; // Get default max connected audio devices from config.xml in frameworks/base/core // Get default max connected audio devices from config.xml in frameworks/base/core Loading Loading @@ -225,18 +224,19 @@ class AdapterProperties { filter.addAction(BluetoothPbapClient.ACTION_CONNECTION_STATE_CHANGED); filter.addAction(BluetoothPbapClient.ACTION_CONNECTION_STATE_CHANGED); mService.registerReceiver(mReceiver, filter); mService.registerReceiver(mReceiver, filter); mReceiverRegistered = true; mReceiverRegistered = true; invalidateBluetoothCaches(); } } public void cleanup() { public void cleanup() { mRemoteDevices = null; mRemoteDevices = null; mProfileConnectionState.clear(); mProfileConnectionState.clear(); invalidateGetProfileConnectionStateCache(); if (mReceiverRegistered) { if (mReceiverRegistered) { mService.unregisterReceiver(mReceiver); mService.unregisterReceiver(mReceiver); mReceiverRegistered = false; mReceiverRegistered = false; } } mService = null; mService = null; mBondedDevices.clear(); mBondedDevices.clear(); invalidateBluetoothCaches(); } } private static void invalidateGetProfileConnectionStateCache() { private static void invalidateGetProfileConnectionStateCache() { Loading @@ -245,6 +245,14 @@ class AdapterProperties { private static void invalidateIsOffloadedFilteringSupportedCache() { private static void invalidateIsOffloadedFilteringSupportedCache() { BluetoothAdapter.invalidateIsOffloadedFilteringSupportedCache(); BluetoothAdapter.invalidateIsOffloadedFilteringSupportedCache(); } } private static void invalidateGetBondStateCache() { BluetoothDevice.invalidateBluetoothGetBondStateCache(); } private static void invalidateBluetoothCaches() { invalidateGetProfileConnectionStateCache(); invalidateIsOffloadedFilteringSupportedCache(); invalidateGetBondStateCache(); } @Override @Override public Object clone() throws CloneNotSupportedException { public Object clone() throws CloneNotSupportedException { Loading Loading @@ -548,7 +556,7 @@ class AdapterProperties { debugLog("Failed to remove device: " + device); debugLog("Failed to remove device: " + device); } } } } BluetoothDevice.invalidateBluetoothGetBondStateCache(); invalidateGetBondStateCache(); } catch (Exception ee) { } catch (Exception ee) { Log.w(TAG, "onBondStateChanged: Exception ", ee); Log.w(TAG, "onBondStateChanged: Exception ", ee); } } Loading
android/app/src/com/android/bluetooth/btservice/AdapterService.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -30,6 +30,7 @@ import android.app.ActivityManager; import android.app.AlarmManager; import android.app.AlarmManager; import android.app.AppOpsManager; import android.app.AppOpsManager; import android.app.PendingIntent; import android.app.PendingIntent; import android.app.PropertyInvalidatedCache; import android.app.Service; import android.app.Service; import android.app.admin.DevicePolicyManager; import android.app.admin.DevicePolicyManager; import android.bluetooth.BluetoothActivityEnergyInfo; import android.bluetooth.BluetoothActivityEnergyInfo; Loading Loading @@ -790,7 +791,6 @@ public class AdapterService extends Service { } } private void invalidateBluetoothCaches() { private void invalidateBluetoothCaches() { BluetoothAdapter.invalidateGetProfileConnectionStateCache(); BluetoothAdapter.invalidateGetProfileConnectionStateCache(); BluetoothAdapter.invalidateGetProfileConnectionStateCache(); BluetoothAdapter.invalidateIsOffloadedFilteringSupportedCache(); BluetoothAdapter.invalidateIsOffloadedFilteringSupportedCache(); BluetoothDevice.invalidateBluetoothGetBondStateCache(); BluetoothDevice.invalidateBluetoothGetBondStateCache(); Loading