[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:
Ze Li
2025-01-07 14:38:04 +08:00
parent 0f6baa17c2
commit 205c81ed3a
4 changed files with 39 additions and 11 deletions

View File

@@ -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