diff options
Diffstat (limited to 'src/main/java/de/pixart/messenger')
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/SettingsActivity.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/SettingsActivity.java b/src/main/java/de/pixart/messenger/ui/SettingsActivity.java index 5f8c05097..390c4f6a8 100644 --- a/src/main/java/de/pixart/messenger/ui/SettingsActivity.java +++ b/src/main/java/de/pixart/messenger/ui/SettingsActivity.java @@ -90,6 +90,15 @@ public class SettingsActivity extends XmppActivity implements } } + //this feature is only available on Huawei Android 6. + PreferenceScreen huaweiPreferenceScreen = (PreferenceScreen) mSettingsFragment.findPreference("huawei"); + Intent intent = huaweiPreferenceScreen.getIntent(); + //remove when Api version is above M (Version 6.0) or if the intent is not callable + if (Build.VERSION.SDK_INT > Build.VERSION_CODES.M || !isCallable(intent)) { + PreferenceCategory generalCategory = (PreferenceCategory) mSettingsFragment.findPreference("general"); + generalCategory.removePreference(huaweiPreferenceScreen); + } + if (BuildConfig.FLAVOR != "open") { PreferenceCategory connectionOptions = (PreferenceCategory) mSettingsFragment.findPreference("connection_options"); PreferenceScreen expert = (PreferenceScreen) mSettingsFragment.findPreference("expert"); @@ -181,6 +190,10 @@ public class SettingsActivity extends XmppActivity implements }); } + private boolean isCallable(Intent intent) { + return getPackageManager().queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY).size() > 0; + } + private void deleteOmemoIdentities() { AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setTitle(R.string.pref_delete_omemo_identities); |