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

@@ -16,12 +16,19 @@
package com.android.settings.bluetooth;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothProfile;
import android.content.Context;
import android.media.AudioManager;
import androidx.annotation.VisibleForTesting;
import android.os.Bundle;
import android.util.Log;
import androidx.annotation.VisibleForTesting;
import androidx.preference.Preference;
import com.android.settings.R;
import com.android.settings.connecteddevice.DevicePreferenceCallback;
import com.android.settings.core.SubSettingLauncher;
import com.android.settings.dashboard.DashboardFragment;
import com.android.settingslib.bluetooth.CachedBluetoothDevice;
import com.android.settingslib.bluetooth.LocalBluetoothManager;
@@ -116,4 +123,20 @@ public class ConnectedBluetoothDeviceUpdater extends BluetoothDeviceUpdater {
}
return isFilterMatched;
}
@Override
protected void addPreference(CachedBluetoothDevice cachedDevice) {
super.addPreference(cachedDevice);
final BluetoothDevice device = cachedDevice.getDevice();
if (mPreferenceMap.containsKey(device)) {
final BluetoothDevicePreference btPreference =
(BluetoothDevicePreference) mPreferenceMap.get(device);
btPreference.setOnGearClickListener(null);
btPreference.hideSecondTarget(true);
btPreference.setOnPreferenceClickListener((Preference p) -> {
launchDeviceDetails(p);
return true;
});
}
}
}