Remove the gear icon and change tapping event

* For fix the conflicts in pi-dev, cherry pick the ag/3944480 in
  master and merge the conflict.
* Remove the gear icon in "currently connected" section.
* Change the tapping event in "currently connected" section.
  When tapping device in this section, take user to device detail page.
* Add test to verify when ConnectedBluetoothDeviceUpdater add preference
  the shouldHideSecondTarget() is return true.

Bug: 78490845
Test: make -j40 RunSettingsRoboTests
Change-Id: I25f8455def3c38e24dea9af9e9e29ba37c250f67
This commit is contained in:
hughchen
2018-04-24 15:46:30 +08:00
parent bb2c8a3147
commit 7ef4fd8085
4 changed files with 68 additions and 20 deletions

View File

@@ -56,6 +56,7 @@ public final class BluetoothDevicePreference extends GearPreference implements
private AlertDialog mDisconnectDialog;
private String contentDescription = null;
private boolean mHideSecondTarget = false;
/* Talk-back descriptions for various BT icons */
Resources mResources;
@@ -86,7 +87,8 @@ public final class BluetoothDevicePreference extends GearPreference implements
protected boolean shouldHideSecondTarget() {
return mCachedDevice == null
|| mCachedDevice.getBondState() != BluetoothDevice.BOND_BONDED
|| mUserManager.hasUserRestriction(DISALLOW_CONFIG_BLUETOOTH);
|| mUserManager.hasUserRestriction(DISALLOW_CONFIG_BLUETOOTH)
|| mHideSecondTarget;
}
@Override
@@ -112,6 +114,10 @@ public final class BluetoothDevicePreference extends GearPreference implements
return mCachedDevice;
}
public void hideSecondTarget(boolean hideSecondTarget) {
mHideSecondTarget = hideSecondTarget;
}
public void onDeviceAttributesChanged() {
/*
* The preference framework takes care of making sure the value has