diff options
| author | android-build-team Robot <android-build-team-robot@google.com> | 2021-04-28 01:35:24 +0000 |
|---|---|---|
| committer | android-build-team Robot <android-build-team-robot@google.com> | 2021-04-28 01:35:29 +0000 |
| commit | b3a7fe1f46f9284321a7007933a18d46dc6d97b7 (patch) | |
| tree | 2241aff18b97a39ce9424ce3d6a8fa260e66c2d3 | |
| parent | 2f1b07002ce09f4cb242331fe0e9e18bb384dcec (diff) | |
| parent | b1ebd14d75f23d1b1eaa3219e9d98a742dacb135 (diff) | |
| download | platform_packages_apps_CellBroadcastReceiver-android11-mainline-cellbroadcast-release.tar.gz platform_packages_apps_CellBroadcastReceiver-android11-mainline-cellbroadcast-release.tar.bz2 platform_packages_apps_CellBroadcastReceiver-android11-mainline-cellbroadcast-release.zip | |
Make change and version bump to aml_cbr_302000000 for mainline module file: apex/apex_manifest.jsonandroid-mainline-11.0.0_r37android11-mainline-cellbroadcast-release
Change-Id: Ib31a133482a57418900521280ad0b76b63e0caae
| -rw-r--r-- | apex/apex_manifest.json | 2 | ||||
| -rw-r--r-- | res/layout/cell_broadcast_alert.xml | 4 | ||||
| -rw-r--r-- | res/values-mcc440-mnc11/config.xml | 2 | ||||
| -rw-r--r-- | res/values/config.xml | 2 | ||||
| -rw-r--r-- | res/values/overlayable.xml | 2 | ||||
| -rw-r--r-- | src/com/android/cellbroadcastreceiver/CellBroadcastSettings.java | 23 |
6 files changed, 23 insertions, 12 deletions
diff --git a/apex/apex_manifest.json b/apex/apex_manifest.json index 1a74fd13c..64396a612 100644 --- a/apex/apex_manifest.json +++ b/apex/apex_manifest.json @@ -1,4 +1,4 @@ { "name": "com.android.cellbroadcast", - "version": 301900000 + "version": 302000000 }
\ No newline at end of file diff --git a/res/layout/cell_broadcast_alert.xml b/res/layout/cell_broadcast_alert.xml index dfb45b353..bff3c7b9e 100644 --- a/res/layout/cell_broadcast_alert.xml +++ b/res/layout/cell_broadcast_alert.xml @@ -113,11 +113,13 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" - android:gravity="end" + android:gravity="center_horizontal" android:measureWithLargestChild="true"> <Button android:id="@+id/dismissButton" android:layout_width="wrap_content" android:layout_weight="0" + android:paddingLeft="100dp" + android:paddingRight="100dp" android:maxLines="2" style="?android:attr/buttonBarButtonStyle" android:text="@string/button_dismiss" diff --git a/res/values-mcc440-mnc11/config.xml b/res/values-mcc440-mnc11/config.xml index b49083cad..75d4b493c 100644 --- a/res/values-mcc440-mnc11/config.xml +++ b/res/values-mcc440-mnc11/config.xml @@ -25,7 +25,7 @@ <!-- 0x1104 for other disasters --> <item>0x1104:rat=gsm, type=other, emergency=true</item> <!-- 0xA808 for other purposes --> - <item>0xA808:rat=gsm, type=other, emergency=true, scope=carrier</item> + <item>0xA808:rat=gsm, type=other, emergency=true</item> </string-array> <string-array name="additional_cbs_channels_strings" translatable="false"> <item>0xA807:rat=gsm, emergency=false</item> diff --git a/res/values/config.xml b/res/values/config.xml index ee0c284db..30ecdbd1b 100644 --- a/res/values/config.xml +++ b/res/values/config.xml @@ -31,6 +31,8 @@ <bool name="show_amber_alert_settings">true</bool> <!-- Whether to show test settings --> <bool name="show_test_settings">true</bool> + <!-- Whether to show vibration settings --> + <bool name="show_vibration_settings">true</bool> <!-- Whether to append date-time to the alert title --> <bool name="show_date_time_title">false</bool> <!-- if appending date-time to alert title, whether to include year --> diff --git a/res/values/overlayable.xml b/res/values/overlayable.xml index fa1653a2c..33b053d4e 100644 --- a/res/values/overlayable.xml +++ b/res/values/overlayable.xml @@ -134,6 +134,8 @@ messages)--> <item type="bool" name="show_alert_speech_setting" /> <item type="bool" name="show_main_switch_settings" /> + <!-- Whether to show vibration toggle. some tablet devices does not support vibration --> + <item type="bool" name="show_vibration_settings" /> <!-- Whether to enable alert handling during active voice call. OEMs overriding this value should note that some countries require that it be turned off by default (e.g. JP).--> diff --git a/src/com/android/cellbroadcastreceiver/CellBroadcastSettings.java b/src/com/android/cellbroadcastreceiver/CellBroadcastSettings.java index e731abf8f..cdb5ed5a9 100644 --- a/src/com/android/cellbroadcastreceiver/CellBroadcastSettings.java +++ b/src/com/android/cellbroadcastreceiver/CellBroadcastSettings.java @@ -434,12 +434,7 @@ public class CellBroadcastSettings extends Activity { // check if area update was disabled if (pref.getKey().equals(KEY_ENABLE_AREA_UPDATE_INFO_ALERTS)) { boolean isEnabledAlert = (Boolean) newValue; - Intent areaInfoIntent = new Intent(AREA_INFO_UPDATE_ACTION); - areaInfoIntent.putExtra(AREA_INFO_UPDATE_ENABLED_EXTRA, - isEnabledAlert); - // sending broadcast protected by the permission which is only - // granted for CBR mainline module. - getContext().sendBroadcast(areaInfoIntent, CBR_MODULE_PERMISSION); + notifyAreaInfoUpdate(isEnabledAlert); } // Notify backup manager a backup pass is needed. @@ -655,9 +650,9 @@ public class CellBroadcastSettings extends Activity { // override DND default is turned off. // In some countries, override DND is always on, which means vibration is always on. // In that case, no need to show vibration toggle for users. - mEnableVibrateCheckBox.setVisible( - res.getBoolean(R.bool.show_override_dnd_settings) - || !res.getBoolean(R.bool.override_dnd)); + mEnableVibrateCheckBox.setVisible(res.getBoolean(R.bool.show_vibration_settings) + && (res.getBoolean(R.bool.show_override_dnd_settings) || + !res.getBoolean(R.bool.override_dnd))); } if (mAlertsHeader != null) { mAlertsHeader.setVisible( @@ -722,6 +717,7 @@ public class CellBroadcastSettings extends Activity { if (mAreaUpdateInfoCheckBox != null) { mAreaUpdateInfoCheckBox.setEnabled(alertsEnabled); mAreaUpdateInfoCheckBox.setChecked(alertsEnabled); + notifyAreaInfoUpdate(alertsEnabled); } if (mEmergencyAlertsCheckBox != null) { mEmergencyAlertsCheckBox.setEnabled(alertsEnabled); @@ -749,6 +745,15 @@ public class CellBroadcastSettings extends Activity { } } + private void notifyAreaInfoUpdate(boolean enabled) { + Intent areaInfoIntent = new Intent(AREA_INFO_UPDATE_ACTION); + areaInfoIntent.putExtra(AREA_INFO_UPDATE_ENABLED_EXTRA, enabled); + // sending broadcast protected by the permission which is only + // granted for CBR mainline module. + getContext().sendBroadcast(areaInfoIntent, CBR_MODULE_PERMISSION); + } + + @Override public void onResume() { super.onResume(); |
