[Hide DCK devices] Hide DCK devices from settings app (other devices section).

Set preferences of DCK devices to be invisible in other devices section.

Test: atest: com.android.settings.bluetooth.ConnectedBluetoothDeviceUpdaterTest
Bug: 322285078
Change-Id: I13572250f6e1d6b1562a052a0c25e8af60eba9cd
This commit is contained in:
Ze Li
2024-01-31 13:50:16 +08:00
parent 25128d1102
commit b68ccb0d79
2 changed files with 122 additions and 1 deletions

View File

@@ -24,6 +24,8 @@ import android.util.Log;
import androidx.preference.Preference;
import com.android.settings.connecteddevice.DevicePreferenceCallback;
import com.android.settings.flags.Flags;
import com.android.settingslib.bluetooth.BluetoothUtils;
import com.android.settingslib.bluetooth.CachedBluetoothDevice;
/**
@@ -95,6 +97,15 @@ 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;
}
}
return isFilterMatched;
}