Merge "24Q3: Remove Flag enable_hide_exclusively_managed_bluetooth_device" into main
This commit is contained in:
committed by
Android (Google) Code Review
commit
aba8de169b
@@ -26,7 +26,6 @@ import androidx.preference.Preference;
|
||||
import com.android.settings.connecteddevice.DevicePreferenceCallback;
|
||||
import com.android.settingslib.bluetooth.BluetoothUtils;
|
||||
import com.android.settingslib.bluetooth.CachedBluetoothDevice;
|
||||
import com.android.settingslib.flags.Flags;
|
||||
|
||||
/**
|
||||
* Controller to maintain connected bluetooth devices
|
||||
@@ -105,14 +104,12 @@ public class ConnectedBluetoothDeviceUpdater extends BluetoothDeviceUpdater {
|
||||
cachedDevice.getName() + ", isFilterMatched : " + isFilterMatched);
|
||||
}
|
||||
}
|
||||
if (Flags.enableHideExclusivelyManagedBluetoothDevice()) {
|
||||
if (BluetoothUtils.isExclusivelyManagedBluetoothDevice(mContext,
|
||||
cachedDevice.getDevice())) {
|
||||
if (DBG) {
|
||||
Log.d(TAG, "isFilterMatched() hide BluetoothDevice with exclusive manager");
|
||||
}
|
||||
return false;
|
||||
if (BluetoothUtils.isExclusivelyManagedBluetoothDevice(mContext,
|
||||
cachedDevice.getDevice())) {
|
||||
if (DBG) {
|
||||
Log.d(TAG, "isFilterMatched() hide BluetoothDevice with exclusive manager");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return isFilterMatched;
|
||||
}
|
||||
|
@@ -40,7 +40,6 @@ import com.android.settingslib.bluetooth.BluetoothUtils
|
||||
import com.android.settingslib.bluetooth.CachedBluetoothDevice
|
||||
import com.android.settingslib.bluetooth.CachedBluetoothDeviceManager
|
||||
import com.android.settingslib.bluetooth.LocalBluetoothManager
|
||||
import com.android.settingslib.flags.Flags
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
@@ -219,13 +218,11 @@ abstract class DeviceListPreferenceFragment(restrictedKey: String?) :
|
||||
)
|
||||
return
|
||||
}
|
||||
if (Flags.enableHideExclusivelyManagedBluetoothDevice()) {
|
||||
if (cachedDevice.device.bondState == BluetoothDevice.BOND_BONDED
|
||||
&& BluetoothUtils.isExclusivelyManagedBluetoothDevice(
|
||||
prefContext, cachedDevice.device)) {
|
||||
Log.d(TAG, "Trying to create preference for a exclusively managed device")
|
||||
return
|
||||
}
|
||||
if (cachedDevice.device.bondState == BluetoothDevice.BOND_BONDED
|
||||
&& BluetoothUtils.isExclusivelyManagedBluetoothDevice(
|
||||
prefContext, cachedDevice.device)) {
|
||||
Log.d(TAG, "Trying to create preference for a exclusively managed device")
|
||||
return
|
||||
}
|
||||
// Only add device preference when it's not found in the map and there's no other state
|
||||
// message showing in the list
|
||||
|
@@ -28,7 +28,6 @@ import com.android.settings.connecteddevice.DevicePreferenceCallback;
|
||||
import com.android.settingslib.bluetooth.BluetoothUtils;
|
||||
import com.android.settingslib.bluetooth.CachedBluetoothDevice;
|
||||
import com.android.settingslib.bluetooth.CachedBluetoothDeviceManager;
|
||||
import com.android.settingslib.flags.Flags;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -107,16 +106,10 @@ public class SavedBluetoothDeviceUpdater extends BluetoothDeviceUpdater
|
||||
+ ", is connected : " + device.isConnected() + ", is profile connected : "
|
||||
+ cachedDevice.isConnected() + ", is exclusively managed : "
|
||||
+ isExclusivelyManaged);
|
||||
if (Flags.enableHideExclusivelyManagedBluetoothDevice()) {
|
||||
return device.getBondState() == BluetoothDevice.BOND_BONDED
|
||||
&& (mShowConnectedDevice || (!device.isConnected()
|
||||
&& isDeviceInCachedDevicesList(cachedDevice)))
|
||||
&& !isExclusivelyManaged;
|
||||
} else {
|
||||
return device.getBondState() == BluetoothDevice.BOND_BONDED
|
||||
&& (mShowConnectedDevice || (!device.isConnected()
|
||||
&& isDeviceInCachedDevicesList(cachedDevice)));
|
||||
}
|
||||
return device.getBondState() == BluetoothDevice.BOND_BONDED
|
||||
&& (mShowConnectedDevice || (!device.isConnected()
|
||||
&& isDeviceInCachedDevicesList(cachedDevice)))
|
||||
&& !isExclusivelyManaged;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user