Messaging: Remove cell broadcasts
* Packagemanager doesn't tell us about its' availability anymore * It's accessible from notification settings, no need for the app to be able to launch them Change-Id: I10b7742917f8639c94b0187f158cc30156f90e92
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2015 The Android Open Source Project
|
||||
* Copyright (C) 2024 The LineageOS Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -138,27 +139,6 @@ public class PerSubscriptionSettingsActivity extends BugleActionBarActivity {
|
||||
getString(R.string.delivery_reports_pref_key));
|
||||
advancedCategory.removePreference(deliveryReportsPref);
|
||||
}
|
||||
final Preference wirelessAlertPref = findPreference(getString(
|
||||
R.string.wireless_alerts_key));
|
||||
if (!isCellBroadcastAppLinkEnabled()) {
|
||||
advancedCategory.removePreference(wirelessAlertPref);
|
||||
} else {
|
||||
wirelessAlertPref.setOnPreferenceClickListener(
|
||||
new Preference.OnPreferenceClickListener() {
|
||||
@Override
|
||||
public boolean onPreferenceClick(final Preference preference) {
|
||||
try {
|
||||
startActivity(UIIntents.get().getWirelessAlertsIntent());
|
||||
} catch (final ActivityNotFoundException e) {
|
||||
// Handle so we shouldn't crash if the wireless alerts
|
||||
// implementation is broken.
|
||||
LogUtil.e(LogUtil.BUGLE_TAG,
|
||||
"Failed to launch wireless alerts activity", e);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Access Point Names (APNs)
|
||||
final PreferenceScreen apnsScreen =
|
||||
@@ -196,20 +176,6 @@ public class PerSubscriptionSettingsActivity extends BugleActionBarActivity {
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isCellBroadcastAppLinkEnabled() {
|
||||
if (!MmsConfig.get(mSubId).getShowCellBroadcast()) {
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
final PackageManager pm = getActivity().getPackageManager();
|
||||
return pm.getApplicationEnabledSetting(UIIntents.CMAS_COMPONENT)
|
||||
!= PackageManager.COMPONENT_ENABLED_STATE_DISABLED;
|
||||
} catch (final IllegalArgumentException ignored) {
|
||||
// CMAS app not installed.
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private void updateGroupMmsPrefSummary() {
|
||||
final boolean groupMmsEnabled = getPreferenceScreen().getSharedPreferences().getBoolean(
|
||||
mGroupMmsPrefKey, getResources().getBoolean(R.bool.group_mms_pref_default));
|
||||
|
||||
Reference in New Issue
Block a user