Open the settings page for a specific physical keyboard
1. Check open from a notification 2. Check open from Bluetooth entry 3. If the inputDeviceIdentifier is not null, open the next page directly. 4. Add extra to record the class of sender for the future metrics. Demo: http://screencast/cast/NDU4MTYxOTIzMTg4MzI2NHxiYTQ0ODE5Ny02YQ Bug: 269212353 Test: manual, atest [Pass] atest KeyboardSettingsPreferenceControllerTest [Pass] atest PhysicalKeyboardPreferenceControllerTest Change-Id: Ie874003260896bbb949806623913e70486e4731d
This commit is contained in:
committed by
Daniel Huang
parent
9a40a296cc
commit
cc749159df
@@ -23,6 +23,7 @@ import android.hardware.input.InputManager;
|
||||
import android.hardware.input.KeyboardLayout;
|
||||
import android.os.Bundle;
|
||||
import android.os.UserHandle;
|
||||
import android.util.Log;
|
||||
import android.view.InputDevice;
|
||||
import android.view.inputmethod.InputMethodInfo;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
@@ -59,10 +60,19 @@ public class NewKeyboardLayoutEnabledLocalesFragment extends DashboardFragment
|
||||
public void onActivityCreated(final Bundle icicle) {
|
||||
super.onActivityCreated(icicle);
|
||||
Bundle arguments = getArguments();
|
||||
final String title =
|
||||
arguments.getString(NewKeyboardSettingsUtils.EXTRA_KEYBOARD_DEVICE_NAME);
|
||||
mInputDeviceIdentifier =
|
||||
arguments.getParcelable(NewKeyboardSettingsUtils.EXTRA_INPUT_DEVICE_IDENTIFIER);
|
||||
if (mInputDeviceIdentifier == null) {
|
||||
Log.e(TAG, "The inputDeviceIdentifier should not be null");
|
||||
return;
|
||||
}
|
||||
InputDevice inputDevice =
|
||||
NewKeyboardSettingsUtils.getInputDevice(mIm, mInputDeviceIdentifier);
|
||||
if (inputDevice == null) {
|
||||
Log.e(TAG, "inputDevice is null");
|
||||
return;
|
||||
}
|
||||
final String title = inputDevice.getName();
|
||||
getActivity().setTitle(title);
|
||||
updateCheckedState();
|
||||
}
|
||||
|
Reference in New Issue
Block a user