integrate config_disable_all_cb_messages to settings

In R we introduced a new config (also part of GMS requirement) mainly
for disable emergency alerts on devices which does not support
messaging or voices e.g, data only tablets. If the config is set to
true, framework should not forward any messages to users and hide
emergency alert from settings menu as well.

Bug: 176557108
Test: Manual
Change-Id: I2705839255a8450aa80a1a503a973207fd895a33
This commit is contained in:
Chen Xu
2021-05-20 16:38:36 -07:00
parent c96c5c68d9
commit 34eae091e4

View File

@@ -86,7 +86,11 @@ public class EmergencyBroadcastPreferenceController extends AbstractPreferenceCo
private boolean isCellBroadcastAppLinkEnabled() {
// Enable link to CMAS app settings depending on the value in config.xml.
boolean enabled = mContext.getResources().getBoolean(
com.android.internal.R.bool.config_cellBroadcastAppLinks);
com.android.internal.R.bool.config_cellBroadcastAppLinks) &&
// For data-only tablet devices which need to not forwarding any WEA-alert and hide from
// settings menu.
!mContext.getResources().getBoolean(
com.android.internal.R.bool.config_disable_all_cb_messages);
if (enabled) {
try {
String packageName = CellBroadcastUtils