mirror of
https://github.com/Helium314/HeliBoard.git
synced 2025-04-23 07:39:11 +00:00
remove HIDE_SOFT_INPUT permission
This commit is contained in:
parent
7ea85d597b
commit
b872975189
4 changed files with 0 additions and 61 deletions
|
@ -1,7 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<!--
|
|
||||||
SPDX-License-Identifier: GPL-3.0-only
|
|
||||||
-->
|
|
||||||
<resources>
|
|
||||||
<string name="hide_soft_input_permission">helium314.keyboard.latin.debug.HIDE_SOFT_INPUT</string>
|
|
||||||
</resources>
|
|
|
@ -13,23 +13,6 @@ SPDX-License-Identifier: Apache-2.0 AND GPL-3.0-only
|
||||||
<uses-permission android:name="android.permission.WRITE_USER_DICTIONARY" />
|
<uses-permission android:name="android.permission.WRITE_USER_DICTIONARY" />
|
||||||
<uses-permission android:name="android.permission.READ_CONTACTS" />
|
<uses-permission android:name="android.permission.READ_CONTACTS" />
|
||||||
|
|
||||||
<!-- 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="helium314.keyboard.latin.HIDE_SOFT_INPUT"/>
|
|
||||||
}
|
|
||||||
</pre>
|
|
||||||
then call {@link android.content.Context#sendBroadcast(Intent)} as follows:
|
|
||||||
<pre>
|
|
||||||
{@code
|
|
||||||
sendBroadcast(new Intent("helium314.keyboard.latin.HIDE_SOFT_INPUT")
|
|
||||||
.setPackage("helium314.keyboard.latin"));
|
|
||||||
}
|
|
||||||
</pre> -->
|
|
||||||
<permission android:name="@string/hide_soft_input_permission"
|
|
||||||
android:protectionLevel="signature" />
|
|
||||||
|
|
||||||
<application android:label="@string/english_ime_name"
|
<application android:label="@string/english_ime_name"
|
||||||
android:name="helium314.keyboard.latin.App"
|
android:name="helium314.keyboard.latin.App"
|
||||||
android:icon="@mipmap/ic_launcher"
|
android:icon="@mipmap/ic_launcher"
|
||||||
|
|
|
@ -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_WAIT_FOR_DICTIONARY_LOAD_MILLIS = TimeUnit.SECONDS.toMillis(2);
|
||||||
static final long DELAY_DEALLOCATE_MEMORY_MILLIS = TimeUnit.SECONDS.toMillis(10);
|
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,
|
* The name of the scheme used by the Package Manager to warn of a new package installation,
|
||||||
* replacement or removal.
|
* replacement or removal.
|
||||||
|
@ -165,25 +155,6 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
|
||||||
private final BroadcastReceiver mDictionaryDumpBroadcastReceiver =
|
private final BroadcastReceiver mDictionaryDumpBroadcastReceiver =
|
||||||
new DictionaryDumpBroadcastReceiver(this);
|
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 {
|
final static class RestartAfterDeviceUnlockReceiver extends BroadcastReceiver {
|
||||||
@Override
|
@Override
|
||||||
public void onReceive(Context context, Intent intent) {
|
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);
|
dictDumpFilter.addAction(DictionaryDumpBroadcastReceiver.DICTIONARY_DUMP_INTENT_ACTION);
|
||||||
ContextCompat.registerReceiver(this, mDictionaryDumpBroadcastReceiver, dictDumpFilter, ContextCompat.RECEIVER_NOT_EXPORTED);
|
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();
|
final IntentFilter restartAfterUnlockFilter = new IntentFilter();
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
|
||||||
restartAfterUnlockFilter.addAction(Intent.ACTION_USER_UNLOCKED);
|
restartAfterUnlockFilter.addAction(Intent.ACTION_USER_UNLOCKED);
|
||||||
|
@ -749,7 +715,6 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
|
||||||
mClipboardHistoryManager.onDestroy();
|
mClipboardHistoryManager.onDestroy();
|
||||||
mDictionaryFacilitator.closeDictionaries();
|
mDictionaryFacilitator.closeDictionaries();
|
||||||
mSettings.onDestroy();
|
mSettings.onDestroy();
|
||||||
unregisterReceiver(mHideSoftInputReceiver);
|
|
||||||
unregisterReceiver(mRingerModeChangeReceiver);
|
unregisterReceiver(mRingerModeChangeReceiver);
|
||||||
unregisterReceiver(mDictionaryPackInstallReceiver);
|
unregisterReceiver(mDictionaryPackInstallReceiver);
|
||||||
unregisterReceiver(mDictionaryDumpBroadcastReceiver);
|
unregisterReceiver(mDictionaryDumpBroadcastReceiver);
|
||||||
|
|
|
@ -77,8 +77,6 @@
|
||||||
<!-- Description for Arabic (PC) subtype. -->
|
<!-- Description for Arabic (PC) subtype. -->
|
||||||
<string name="subtype_arabic_pc" translatable="false">%s (PC)</string>
|
<string name="subtype_arabic_pc" translatable="false">%s (PC)</string>
|
||||||
|
|
||||||
<!-- permission name as string to avoid issues with debug build -->
|
|
||||||
<string name="hide_soft_input_permission">helium314.keyboard.latin.HIDE_SOFT_INPUT</string>
|
|
||||||
<!-- App slogan-->
|
<!-- App slogan-->
|
||||||
<string name="app_slogan" translatable="false">100% FOSS keyboard, based on AOSP.</string>
|
<string name="app_slogan" translatable="false">100% FOSS keyboard, based on AOSP.</string>
|
||||||
<!-- default value for auto-day/night setting -->
|
<!-- default value for auto-day/night setting -->
|
||||||
|
|
Loading…
Add table
Reference in a new issue