Improve Bluetooth pairing dialog & contact sharing toggle

Before change: https://screenshot.googleplex.com/Agr29KTvgptbsag
After change: https://screenshot.googleplex.com/ArjiavkFAFiuCTR

Bug: 274521434
Test: RunSettingsRoboTests
Change-Id: Ib896b70bc219de128b733b75249bf80e3389f221
This commit is contained in:
Haijie Hong
2023-08-08 13:15:38 +08:00
parent 317bfca133
commit 21b075770e
5 changed files with 48 additions and 21 deletions

View File

@@ -156,6 +156,7 @@ public class BluetoothDetailsProfilesController extends BluetoothDetailsControll
} else if (profile instanceof PbapServerProfile) {
profilePref.setChecked(device.getPhonebookAccessPermission()
== BluetoothDevice.ACCESS_ALLOWED);
profilePref.setSummary(profile.getSummaryResourceForDevice(mCachedDevice.getDevice()));
} else if (profile instanceof PanProfile) {
profilePref.setChecked(profile.getConnectionStatus(device) ==
BluetoothProfile.STATE_CONNECTED);

View File

@@ -33,6 +33,7 @@ import android.view.inputmethod.InputMethodManager;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.EditText;
import android.widget.Switch;
import android.widget.TextView;
import androidx.annotation.VisibleForTesting;
@@ -339,11 +340,9 @@ public class BluetoothPairingDialogFragment extends InstrumentedDialogFragment i
TextView pairingViewCaption = (TextView) view.findViewById(R.id.pairing_caption);
TextView pairingViewContent = (TextView) view.findViewById(R.id.pairing_subhead);
TextView messagePairing = (TextView) view.findViewById(R.id.pairing_code_message);
CheckBox contactSharing = (CheckBox) view.findViewById(
Switch contactSharing = (Switch) view.findViewById(
R.id.phonebook_sharing_message_confirm_pin);
contactSharing.setText(getString(R.string.bluetooth_pairing_shares_phonebook));
contactSharing.setVisibility(
view.findViewById(R.id.phonebook_sharing).setVisibility(
mPairingController.isContactSharingVisible() ? View.VISIBLE : View.GONE);
mPairingController.setContactSharingState();
contactSharing.setChecked(mPairingController.getContactSharingState());