[Temp bonding] Hide rename button from device details page for temp bond device
Test: com.android.settings.bluetooth.AdvancedBluetoothDetailsHeaderControllerTest Bug: 362859132 Flag: com.android.settingslib.flags.enable_temporary_bond_devices_ui Change-Id: I22d54c322029c606425c8f48b091ad1b53e100de
This commit is contained in:
@@ -89,15 +89,19 @@ public class GeneralBluetoothDetailsHeaderController extends BluetoothDetailsCon
|
||||
if (summary != null) {
|
||||
summary.setText(mCachedDevice.getConnectionSummary());
|
||||
}
|
||||
ImageButton renameButton = mLayoutPreference.findViewById(R.id.rename_button);
|
||||
renameButton.setVisibility(View.VISIBLE);
|
||||
renameButton.setOnClickListener(
|
||||
view -> {
|
||||
RemoteDeviceNameDialogFragment.newInstance(mCachedDevice)
|
||||
.show(
|
||||
mFragment.getFragmentManager(),
|
||||
RemoteDeviceNameDialogFragment.TAG);
|
||||
});
|
||||
boolean isTempBond = com.android.settingslib.flags.Flags.enableTemporaryBondDevicesUi()
|
||||
&& BluetoothUtils.isTemporaryBondDevice(mCachedDevice.getDevice());
|
||||
if (!isTempBond) {
|
||||
ImageButton renameButton = mLayoutPreference.findViewById(R.id.rename_button);
|
||||
renameButton.setVisibility(View.VISIBLE);
|
||||
renameButton.setOnClickListener(
|
||||
view -> {
|
||||
RemoteDeviceNameDialogFragment.newInstance(mCachedDevice)
|
||||
.show(
|
||||
mFragment.getFragmentManager(),
|
||||
RemoteDeviceNameDialogFragment.TAG);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user