mirror of
https://gitlab.futo.org/keyboard/latinime.git
synced 2024-09-28 14:54:30 +01:00
Remove hide soft input permission
This commit is contained in:
parent
83ad0dcf94
commit
fd3a4297ec
@ -27,23 +27,6 @@
|
||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
|
||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_SPECIAL_USE"/>
|
||||
|
||||
<!-- A signature-protected permission to ask AOSP Keyboard to close the software keyboard.
|
||||
To use this, add the following line into calling application's AndroidManifest.xml
|
||||
<pre>
|
||||
{@code
|
||||
<uses-permission android:name="org.futo.inputmethod.latin.HIDE_SOFT_INPUT"/>
|
||||
}
|
||||
</pre>
|
||||
then call {@link android.content.Context#sendBroadcast(Intent)} as follows:
|
||||
<pre>
|
||||
{@code
|
||||
sendBroadcast(new Intent("org.futo.inputmethod.latin.HIDE_SOFT_INPUT")
|
||||
.setPackage("org.futo.inputmethod.latin"));
|
||||
}
|
||||
</pre> -->
|
||||
<permission android:name="org.futo.inputmethod.latin.HIDE_SOFT_INPUT"
|
||||
android:protectionLevel="signature"/>
|
||||
|
||||
<application android:label="@string/english_ime_name"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
|
@ -135,18 +135,6 @@ public class LatinIMELegacy implements KeyboardActionListener,
|
||||
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 =
|
||||
"org.futo.inputmethod.latin.HIDE_SOFT_INPUT";
|
||||
|
||||
/**
|
||||
* A custom permission for external apps to send {@link #ACTION_HIDE_SOFT_INPUT}.
|
||||
*/
|
||||
static final String PERMISSION_HIDE_SOFT_INPUT =
|
||||
"org.futo.inputmethod.latin.HIDE_SOFT_INPUT";
|
||||
|
||||
/**
|
||||
* The name of the scheme used by the Package Manager to warn of a new package installation,
|
||||
* replacement or removal.
|
||||
@ -185,25 +173,6 @@ public class LatinIMELegacy implements KeyboardActionListener,
|
||||
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;
|
||||
|
||||
private AlertDialog mOptionsDialog;
|
||||
|
||||
private final boolean mIsHardwareAcceleratedDrawingEnabled;
|
||||
@ -591,8 +560,6 @@ public class LatinIMELegacy implements KeyboardActionListener,
|
||||
mIsHardwareAcceleratedDrawingEnabled = true;
|
||||
Log.i(TAG, "Hardware accelerated drawing: " + mIsHardwareAcceleratedDrawingEnabled);
|
||||
|
||||
mHideSoftInputReceiver = new HideSoftInputReceiver(mInputMethodService);
|
||||
|
||||
mInputLogic = new InputLogic(this /* LatinIME */,
|
||||
this /* SuggestionStripViewAccessor */, mDictionaryFacilitator);
|
||||
}
|
||||
@ -625,11 +592,6 @@ public class LatinIMELegacy implements KeyboardActionListener,
|
||||
dictDumpFilter.addAction(DictionaryDumpBroadcastReceiver.DICTIONARY_DUMP_INTENT_ACTION);
|
||||
ContextCompat.registerReceiver(mInputMethodService, mDictionaryDumpBroadcastReceiver, dictDumpFilter, ContextCompat.RECEIVER_NOT_EXPORTED);
|
||||
|
||||
final IntentFilter hideSoftInputFilter = new IntentFilter();
|
||||
hideSoftInputFilter.addAction(ACTION_HIDE_SOFT_INPUT);
|
||||
ContextCompat.registerReceiver(mInputMethodService, mHideSoftInputReceiver, hideSoftInputFilter, PERMISSION_HIDE_SOFT_INPUT,
|
||||
null /* scheduler */, ContextCompat.RECEIVER_NOT_EXPORTED);
|
||||
|
||||
StatsUtils.onCreate(mSettings.getCurrent(), mRichImm);
|
||||
}
|
||||
|
||||
@ -733,7 +695,6 @@ public class LatinIMELegacy implements KeyboardActionListener,
|
||||
public void onDestroy() {
|
||||
mDictionaryFacilitator.closeDictionaries();
|
||||
mSettings.onDestroy();
|
||||
mInputMethodService.unregisterReceiver(mHideSoftInputReceiver);
|
||||
mInputMethodService.unregisterReceiver(mRingerModeChangeReceiver);
|
||||
mInputMethodService.unregisterReceiver(mDictionaryDumpBroadcastReceiver);
|
||||
mStatsUtilsManager.onDestroy(mInputMethodService);
|
||||
|
Loading…
Reference in New Issue
Block a user