InputSettings: Physical keyboard settings activity.
This CL adds functionality to trigger the "Physical keyboard"
settings screen via an intent.
Bug: 26943892
Change-Id: Ib4a0be38f94f83672501d5312079d132b2ab717d
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 6d0be05..7ace9c8 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -630,10 +630,21 @@
</activity>
<activity android:name="Settings$KeyboardLayoutPickerActivity"
- android:label="@string/keyboard_layout_picker_title"
- android:clearTaskOnLaunch="true">
+ android:label="@string/keyboard_layout_picker_title"
+ android:clearTaskOnLaunch="true">
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN" />
+ <category android:name="android.intent.category.DEFAULT" />
+ </intent-filter>
+ <meta-data android:name="com.android.settings.FRAGMENT_CLASS"
+ android:value="com.android.settings.inputmethod.KeyboardLayoutPickerFragment2" />
+ </activity>
+
+ <activity android:name="Settings$PhysicalKeyboardActivity"
+ android:label="@string/physical_keyboard_category"
+ android:clearTaskOnLaunch="true">
<intent-filter android:priority="1">
- <action android:name="android.settings.KEYBOARD_LAYOUT_SETTINGS" />
+ <action android:name="android.settings.HARD_KEYBOARD_SETTINGS" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter>
@@ -641,7 +652,7 @@
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<meta-data android:name="com.android.settings.FRAGMENT_CLASS"
- android:value="com.android.settings.inputmethod.KeyboardLayoutPickerFragment2" />
+ android:value="com.android.settings.inputmethod.PhysicalKeyboardFragment" />
</activity>
<!-- Keep compatibility with old shortcuts. -->
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 75be5d4..bca71a2 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -3633,14 +3633,14 @@
<string name="keyboard_and_input_methods_category">Keyboard and input methods</string>
<!-- Title for the 'virtual keyboard' preference sub-screen. [CHAR LIMIT=35] -->
<string name="virtual_keyboard_category">Virtual keyboard</string>
- <!-- Title for the 'physical keyboard' preference sub-screen. [CHAR LIMIT=35] -->
- <string name="physical_keyboard_category">Physical keyboard</string>
<!-- Title for the 'available virtual keyboard' preference sub-screen. [CHAR LIMIT=35] -->
<string name="available_virtual_keyboard_category">Available virtual keyboard</string>
<!-- Title for the button to trigger the 'available virtual keyboard' preference sub-screen. [CHAR LIMIT=35] -->
<string name="add_virtual_keyboard">Add a virtual keyboard</string>
<!-- Title for the 'keyboard assistance' preference category. [CHAR LIMIT=35] -->
<string name="keyboard_assistance_category">Keyboard assistance</string>
+ <!-- Title for the 'physical keyboard' settings screen. [CHAR LIMIT=35] -->
+ <string name="physical_keyboard_title">Physical keyboard</string>
<!-- Title for the 'show virtual keyboard' preference switch. [CHAR LIMIT=35] -->
<string name="show_ime">Show virtual keyboard</string>
<!-- Summary text for the 'add virtual keyboard' preference sub-screen. [CHAR LIMIT=100] -->
diff --git a/res/xml/physical_keyboard_settings.xml b/res/xml/physical_keyboard_settings.xml
index 35f3f04..4de2672 100644
--- a/res/xml/physical_keyboard_settings.xml
+++ b/res/xml/physical_keyboard_settings.xml
@@ -14,7 +14,7 @@
limitations under the License.
-->
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
- android:title="@string/physical_keyboard_category">
+ android:title="@string/physical_keyboard_title">
<!-- Additional preference screens are inserted here programmatically
with low order values to set the key map of each attached keyboard. -->
<PreferenceCategory
diff --git a/src/com/android/settings/Settings.java b/src/com/android/settings/Settings.java
index aeec7f1..4aebe82 100644
--- a/src/com/android/settings/Settings.java
+++ b/src/com/android/settings/Settings.java
@@ -43,6 +43,7 @@
public static class InputMethodAndLanguageSettingsActivity extends SettingsActivity { /* empty */ }
public static class AvailableVirtualKeyboardActivity extends SettingsActivity { /* empty */ }
public static class KeyboardLayoutPickerActivity extends SettingsActivity { /* empty */ }
+ public static class PhysicalKeyboardActivity extends SettingsActivity { /* empty */ }
public static class InputMethodAndSubtypeEnablerActivity extends SettingsActivity { /* empty */ }
public static class SpellCheckersSettingsActivity extends SettingsActivity { /* empty */ }
public static class LocalePickerActivity extends SettingsActivity { /* empty */ }
diff --git a/src/com/android/settings/SettingsActivity.java b/src/com/android/settings/SettingsActivity.java
index 9f86646..c4585d1 100644
--- a/src/com/android/settings/SettingsActivity.java
+++ b/src/com/android/settings/SettingsActivity.java
@@ -81,6 +81,7 @@
import com.android.settings.inputmethod.InputMethodAndLanguageSettings;
import com.android.settings.inputmethod.KeyboardLayoutPickerFragment;
import com.android.settings.inputmethod.KeyboardLayoutPickerFragment2;
+import com.android.settings.inputmethod.PhysicalKeyboardFragment;
import com.android.settings.inputmethod.SpellCheckersSettings;
import com.android.settings.inputmethod.UserDictionaryList;
import com.android.settings.localepicker.LocaleListEditor;
@@ -298,6 +299,7 @@
PaymentSettings.class.getName(),
KeyboardLayoutPickerFragment.class.getName(),
KeyboardLayoutPickerFragment2.class.getName(),
+ PhysicalKeyboardFragment.class.getName(),
ZenModeSettings.class.getName(),
SoundSettings.class.getName(),
ConfigureNotificationSettings.class.getName(),