Merge "Handle cached bluetooth device with stylus pref" into main
This commit is contained in:
committed by
Android (Google) Code Review
commit
e8f6a7572c
@@ -108,10 +108,15 @@ public class StylusDevicesController extends AbstractPreferenceController implem
|
||||
return null;
|
||||
}
|
||||
|
||||
boolean doesStylusSupportTailButton = mInputDevice.hasKeys(
|
||||
KeyEvent.KEYCODE_STYLUS_BUTTON_TAIL)[0];
|
||||
if (!doesStylusSupportTailButton) {
|
||||
return null;
|
||||
// Check if the connected stylus supports the tail button. A connected device is when input
|
||||
// device is available (mInputDevice != null). For a cached device (mInputDevice == null)
|
||||
// there isn't way to check if the device supports the button so assume it does.
|
||||
if (mInputDevice != null) {
|
||||
boolean doesStylusSupportTailButton =
|
||||
mInputDevice.hasKeys(KeyEvent.KEYCODE_STYLUS_BUTTON_TAIL)[0];
|
||||
if (!doesStylusSupportTailButton) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
Preference pref = preference == null ? new Preference(mContext) : preference;
|
||||
|
||||
Reference in New Issue
Block a user