[Safer intents] Input method

To avoid implicit intents, make intents launch explicitly.

Test: build
Bug: 323061508
Change-Id: I8d9e8e2b70c3ef913087b72800cd40e0c3df8164
This commit is contained in:
Jason Chiu
2024-03-25 17:08:09 +08:00
parent 67bfb4141f
commit a18f9e5014
3 changed files with 4 additions and 1 deletions

View File

@@ -53,6 +53,7 @@ public class KeyboardSettingsPreferenceController extends BasePreferenceControll
for (HardKeyboardDeviceInfo hardKeyboardDeviceInfo : newHardKeyboards) {
if (mCachedDevice.getAddress().equals(hardKeyboardDeviceInfo.mBluetoothAddress)) {
Intent intent = new Intent(Settings.ACTION_HARD_KEYBOARD_SETTINGS);
intent.setPackage(mContext.getPackageName());
intent.putExtra(
Settings.EXTRA_ENTRYPOINT, SettingsEnums.CONNECTED_DEVICES_SETTINGS);
intent.putExtra(

View File

@@ -67,6 +67,7 @@ public class PhysicalKeyboardPreferenceController extends AbstractPreferenceCont
return false;
}
Intent intent = new Intent(Settings.ACTION_HARD_KEYBOARD_SETTINGS);
intent.setPackage(mContext.getPackageName());
intent.putExtra(Settings.EXTRA_ENTRYPOINT, SettingsEnums.KEYBOARD_SETTINGS);
mContext.startActivity(intent);
return true;

View File

@@ -191,7 +191,8 @@ public class UserDictionaryListPreferenceController extends BasePreferenceContro
private Preference createUserDictionaryPreference(String locale) {
final String KEY_LOCALE = "locale";
final Preference newPref = new Preference(mScreen.getContext());
final Intent intent = new Intent(USER_DICTIONARY_SETTINGS_INTENT_ACTION);
final Intent intent = new Intent(USER_DICTIONARY_SETTINGS_INTENT_ACTION)
.setPackage(mContext.getPackageName());
if (locale == null) {
newPref.setTitle(Locale.getDefault().getDisplayName());
newPref.setKey(Locale.getDefault().toString());