remove HIDE_SOFT_INPUT permission

This commit is contained in:
Helium314 2024-02-10 18:55:30 +01:00
parent 7ea85d597b
commit b872975189
4 changed files with 0 additions and 61 deletions

View file

@ -114,16 +114,6 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
static final long DELAY_WAIT_FOR_DICTIONARY_LOAD_MILLIS = TimeUnit.SECONDS.toMillis(2);
static final long DELAY_DEALLOCATE_MEMORY_MILLIS = TimeUnit.SECONDS.toMillis(10);
/**
* A broadcast intent action to hide the software keyboard.
*/
static final String ACTION_HIDE_SOFT_INPUT = "helium314.keyboard.latin.HIDE_SOFT_INPUT";
/**
* A custom permission for external apps to send {@link #ACTION_HIDE_SOFT_INPUT}.
*/
static final String PERMISSION_HIDE_SOFT_INPUT = "helium314.keyboard.latin.HIDE_SOFT_INPUT";
/**
* The name of the scheme used by the Package Manager to warn of a new package installation,
* replacement or removal.
@ -165,25 +155,6 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
private final BroadcastReceiver mDictionaryDumpBroadcastReceiver =
new DictionaryDumpBroadcastReceiver(this);
final static class HideSoftInputReceiver extends BroadcastReceiver {
private final InputMethodService mIms;
public HideSoftInputReceiver(InputMethodService ims) {
mIms = ims;
}
@Override
public void onReceive(Context context, Intent intent) {
final String action = intent.getAction();
if (ACTION_HIDE_SOFT_INPUT.equals(action)) {
mIms.requestHideSelf(0 /* flags */);
} else {
Log.e(TAG, "Unexpected intent " + intent);
}
}
}
final HideSoftInputReceiver mHideSoftInputReceiver = new HideSoftInputReceiver(this);
final static class RestartAfterDeviceUnlockReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
@ -632,11 +603,6 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
dictDumpFilter.addAction(DictionaryDumpBroadcastReceiver.DICTIONARY_DUMP_INTENT_ACTION);
ContextCompat.registerReceiver(this, mDictionaryDumpBroadcastReceiver, dictDumpFilter, ContextCompat.RECEIVER_NOT_EXPORTED);
final IntentFilter hideSoftInputFilter = new IntentFilter();
hideSoftInputFilter.addAction(ACTION_HIDE_SOFT_INPUT);
ContextCompat.registerReceiver(this, mHideSoftInputReceiver, hideSoftInputFilter, PERMISSION_HIDE_SOFT_INPUT,
null /* scheduler */, ContextCompat.RECEIVER_EXPORTED);
final IntentFilter restartAfterUnlockFilter = new IntentFilter();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
restartAfterUnlockFilter.addAction(Intent.ACTION_USER_UNLOCKED);
@ -749,7 +715,6 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
mClipboardHistoryManager.onDestroy();
mDictionaryFacilitator.closeDictionaries();
mSettings.onDestroy();
unregisterReceiver(mHideSoftInputReceiver);
unregisterReceiver(mRingerModeChangeReceiver);
unregisterReceiver(mDictionaryPackInstallReceiver);
unregisterReceiver(mDictionaryDumpBroadcastReceiver);