Set title for Bluetooth Details page to "Stylus" for styluses.
Bug: 254835745 Test: BluetoothDeviceDetailsFragmentTest Change-Id: I725877b0bcf44fa7be805e16fb2d695c9d6074dc
This commit is contained in:
@@ -341,9 +341,7 @@ public class BluetoothDeviceDetailsFragment extends RestrictedDashboardFragment
|
|||||||
|
|
||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
void setTitleForInputDevice() {
|
void setTitleForInputDevice() {
|
||||||
// TODO(b/254835745) once source filter for bt stylus merged
|
if (StylusDevicesController.isDeviceStylus(mInputDevice, mCachedDevice)) {
|
||||||
// && mInputDevice.supportsSource(InputDevice.SOURCE_BLUETOOTH_STYLUS))
|
|
||||||
if (mInputDevice != null) {
|
|
||||||
// This will override the default R.string.device_details_title "Device Details"
|
// This will override the default R.string.device_details_title "Device Details"
|
||||||
// that will show on non-stylus bluetooth devices.
|
// that will show on non-stylus bluetooth devices.
|
||||||
// That title is set via the manifest and also from BluetoothDeviceUpdater.
|
// That title is set via the manifest and also from BluetoothDeviceUpdater.
|
||||||
|
@@ -159,7 +159,9 @@ public class BluetoothDeviceDetailsFragmentTest {
|
|||||||
public void getTitle_inputDeviceTitle() {
|
public void getTitle_inputDeviceTitle() {
|
||||||
FeatureFlagUtils.setEnabled(mContext, FeatureFlagUtils.SETTINGS_SHOW_STYLUS_PREFERENCES,
|
FeatureFlagUtils.setEnabled(mContext, FeatureFlagUtils.SETTINGS_SHOW_STYLUS_PREFERENCES,
|
||||||
true);
|
true);
|
||||||
doReturn(mock(InputDevice.class)).when(mFragment).getInputDevice(mContext);
|
InputDevice inputDevice = mock(InputDevice.class);
|
||||||
|
doReturn(true).when(inputDevice).supportsSource(InputDevice.SOURCE_STYLUS);
|
||||||
|
doReturn(inputDevice).when(mFragment).getInputDevice(mContext);
|
||||||
mFragment.onAttach(mContext);
|
mFragment.onAttach(mContext);
|
||||||
|
|
||||||
mFragment.setTitleForInputDevice();
|
mFragment.setTitleForInputDevice();
|
||||||
|
Reference in New Issue
Block a user