Merge "Conditionally add tail button pref" into main
This commit is contained in:
committed by
Android (Google) Code Review
commit
e9c09d9c83
@@ -32,6 +32,7 @@ import android.provider.Settings.Secure;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.InputDevice;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.inputmethod.InputMethodInfo;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
|
||||
@@ -107,6 +108,12 @@ public class StylusDevicesController extends AbstractPreferenceController implem
|
||||
return null;
|
||||
}
|
||||
|
||||
boolean doesStylusSupportTailButton = mInputDevice.hasKeys(
|
||||
KeyEvent.KEYCODE_STYLUS_BUTTON_TAIL)[0];
|
||||
if (!doesStylusSupportTailButton) {
|
||||
return null;
|
||||
}
|
||||
|
||||
Preference pref = preference == null ? new Preference(mContext) : preference;
|
||||
pref.setKey(KEY_DEFAULT_NOTES);
|
||||
pref.setTitle(mContext.getString(R.string.stylus_default_notes_app));
|
||||
|
||||
Reference in New Issue
Block a user