diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-11-30 04:15:29 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-11-30 04:15:29 +0000 |
commit | 62d171543904cd095c2eb994854cb95945471fd9 (patch) | |
tree | d4aea6dab8de7e24241258f7d2e14b0b21ea3df6 | |
parent | 735e7cb0fe65162139d3607558a7400312dd7b86 (diff) | |
parent | 4e5bf078cfe84b8cfb2f5344da7d82b730e8ea59 (diff) | |
download | CellBroadcastReceiver-android14-mainline-permission-release.tar.gz |
Snap for 11155123 from 4e5bf078cfe84b8cfb2f5344da7d82b730e8ea59 to mainline-permission-releaseaml_per_341410020android14-mainline-permission-release
Change-Id: Ib9ffbe31db19667db9e97e7d78a8837e3df9b14a
98 files changed, 392 insertions, 418 deletions
diff --git a/res/values-mcc310-mnc590 b/res/values-mcc310-mnc590 index 2edbb94b0..4313b5151 120000 --- a/res/values-mcc310-mnc590 +++ b/res/values-mcc310-mnc590 @@ -1 +1 @@ -values-mcc310-mnc160
\ No newline at end of file +values-mcc310-mnc012
\ No newline at end of file diff --git a/res/values-mcc405-af b/res/values-mcc405-af new file mode 120000 index 000000000..528400bc1 --- /dev/null +++ b/res/values-mcc405-af @@ -0,0 +1 @@ +values-mcc404-af
\ No newline at end of file diff --git a/res/values-mcc405-am b/res/values-mcc405-am new file mode 120000 index 000000000..134369cfa --- /dev/null +++ b/res/values-mcc405-am @@ -0,0 +1 @@ +values-mcc404-am
\ No newline at end of file diff --git a/res/values-mcc405-ar b/res/values-mcc405-ar new file mode 120000 index 000000000..eefefc217 --- /dev/null +++ b/res/values-mcc405-ar @@ -0,0 +1 @@ +values-mcc404-ar
\ No newline at end of file diff --git a/res/values-mcc405-as b/res/values-mcc405-as new file mode 120000 index 000000000..e10434e60 --- /dev/null +++ b/res/values-mcc405-as @@ -0,0 +1 @@ +values-mcc404-as
\ No newline at end of file diff --git a/res/values-mcc405-az b/res/values-mcc405-az new file mode 120000 index 000000000..82f9c145e --- /dev/null +++ b/res/values-mcc405-az @@ -0,0 +1 @@ +values-mcc404-az
\ No newline at end of file diff --git a/res/values-mcc405-b+sr+Latn b/res/values-mcc405-b+sr+Latn new file mode 120000 index 000000000..c32f30cc0 --- /dev/null +++ b/res/values-mcc405-b+sr+Latn @@ -0,0 +1 @@ +values-mcc404-b+sr+Latn
\ No newline at end of file diff --git a/res/values-mcc405-be b/res/values-mcc405-be new file mode 120000 index 000000000..1b7edb67b --- /dev/null +++ b/res/values-mcc405-be @@ -0,0 +1 @@ +values-mcc404-be
\ No newline at end of file diff --git a/res/values-mcc405-bg b/res/values-mcc405-bg new file mode 120000 index 000000000..67bd08cc3 --- /dev/null +++ b/res/values-mcc405-bg @@ -0,0 +1 @@ +values-mcc404-bg
\ No newline at end of file diff --git a/res/values-mcc405-bn b/res/values-mcc405-bn new file mode 120000 index 000000000..f3c911263 --- /dev/null +++ b/res/values-mcc405-bn @@ -0,0 +1 @@ +values-mcc404-bn
\ No newline at end of file diff --git a/res/values-mcc405-bs b/res/values-mcc405-bs new file mode 120000 index 000000000..69faaa56f --- /dev/null +++ b/res/values-mcc405-bs @@ -0,0 +1 @@ +values-mcc404-bs
\ No newline at end of file diff --git a/res/values-mcc405-ca b/res/values-mcc405-ca new file mode 120000 index 000000000..90f25c139 --- /dev/null +++ b/res/values-mcc405-ca @@ -0,0 +1 @@ +values-mcc404-ca
\ No newline at end of file diff --git a/res/values-mcc405-cs b/res/values-mcc405-cs new file mode 120000 index 000000000..5295d5f82 --- /dev/null +++ b/res/values-mcc405-cs @@ -0,0 +1 @@ +values-mcc404-cs
\ No newline at end of file diff --git a/res/values-mcc405-da b/res/values-mcc405-da new file mode 120000 index 000000000..a08ad45f8 --- /dev/null +++ b/res/values-mcc405-da @@ -0,0 +1 @@ +values-mcc404-da
\ No newline at end of file diff --git a/res/values-mcc405-de b/res/values-mcc405-de new file mode 120000 index 000000000..c77e47d8c --- /dev/null +++ b/res/values-mcc405-de @@ -0,0 +1 @@ +values-mcc404-de
\ No newline at end of file diff --git a/res/values-mcc405-el b/res/values-mcc405-el new file mode 120000 index 000000000..0a6ab3816 --- /dev/null +++ b/res/values-mcc405-el @@ -0,0 +1 @@ +values-mcc404-el
\ No newline at end of file diff --git a/res/values-mcc405-en-rAU b/res/values-mcc405-en-rAU new file mode 120000 index 000000000..ae816896e --- /dev/null +++ b/res/values-mcc405-en-rAU @@ -0,0 +1 @@ +values-mcc404-en-rAU
\ No newline at end of file diff --git a/res/values-mcc405-en-rCA b/res/values-mcc405-en-rCA new file mode 120000 index 000000000..e46ef7e94 --- /dev/null +++ b/res/values-mcc405-en-rCA @@ -0,0 +1 @@ +values-mcc404-en-rCA
\ No newline at end of file diff --git a/res/values-mcc405-en-rGB b/res/values-mcc405-en-rGB new file mode 120000 index 000000000..70d2e113a --- /dev/null +++ b/res/values-mcc405-en-rGB @@ -0,0 +1 @@ +values-mcc404-en-rGB
\ No newline at end of file diff --git a/res/values-mcc405-en-rIN b/res/values-mcc405-en-rIN new file mode 120000 index 000000000..48ddd18e2 --- /dev/null +++ b/res/values-mcc405-en-rIN @@ -0,0 +1 @@ +values-mcc404-en-rIN
\ No newline at end of file diff --git a/res/values-mcc405-en-rXC b/res/values-mcc405-en-rXC new file mode 120000 index 000000000..88043b25c --- /dev/null +++ b/res/values-mcc405-en-rXC @@ -0,0 +1 @@ +values-mcc404-en-rXC
\ No newline at end of file diff --git a/res/values-mcc405-es b/res/values-mcc405-es new file mode 120000 index 000000000..aed409730 --- /dev/null +++ b/res/values-mcc405-es @@ -0,0 +1 @@ +values-mcc404-es
\ No newline at end of file diff --git a/res/values-mcc405-es-rUS b/res/values-mcc405-es-rUS new file mode 120000 index 000000000..81d07c952 --- /dev/null +++ b/res/values-mcc405-es-rUS @@ -0,0 +1 @@ +values-mcc404-es-rUS
\ No newline at end of file diff --git a/res/values-mcc405-et b/res/values-mcc405-et new file mode 120000 index 000000000..dd7f22b1b --- /dev/null +++ b/res/values-mcc405-et @@ -0,0 +1 @@ +values-mcc404-et
\ No newline at end of file diff --git a/res/values-mcc405-eu b/res/values-mcc405-eu new file mode 120000 index 000000000..1209b2969 --- /dev/null +++ b/res/values-mcc405-eu @@ -0,0 +1 @@ +values-mcc404-eu
\ No newline at end of file diff --git a/res/values-mcc405-fa b/res/values-mcc405-fa new file mode 120000 index 000000000..a8afe0ac4 --- /dev/null +++ b/res/values-mcc405-fa @@ -0,0 +1 @@ +values-mcc404-fa
\ No newline at end of file diff --git a/res/values-mcc405-fi b/res/values-mcc405-fi new file mode 120000 index 000000000..6fde25011 --- /dev/null +++ b/res/values-mcc405-fi @@ -0,0 +1 @@ +values-mcc404-fi
\ No newline at end of file diff --git a/res/values-mcc405-fr b/res/values-mcc405-fr new file mode 120000 index 000000000..a02cab936 --- /dev/null +++ b/res/values-mcc405-fr @@ -0,0 +1 @@ +values-mcc404-fr
\ No newline at end of file diff --git a/res/values-mcc405-fr-rCA b/res/values-mcc405-fr-rCA new file mode 120000 index 000000000..20b65dc6c --- /dev/null +++ b/res/values-mcc405-fr-rCA @@ -0,0 +1 @@ +values-mcc404-fr-rCA
\ No newline at end of file diff --git a/res/values-mcc405-gl b/res/values-mcc405-gl new file mode 120000 index 000000000..f007e01c5 --- /dev/null +++ b/res/values-mcc405-gl @@ -0,0 +1 @@ +values-mcc404-gl
\ No newline at end of file diff --git a/res/values-mcc405-gu b/res/values-mcc405-gu new file mode 120000 index 000000000..5cc65f533 --- /dev/null +++ b/res/values-mcc405-gu @@ -0,0 +1 @@ +values-mcc404-gu
\ No newline at end of file diff --git a/res/values-mcc405-hi b/res/values-mcc405-hi new file mode 120000 index 000000000..3eeb32511 --- /dev/null +++ b/res/values-mcc405-hi @@ -0,0 +1 @@ +values-mcc404-hi
\ No newline at end of file diff --git a/res/values-mcc405-hr b/res/values-mcc405-hr new file mode 120000 index 000000000..c56983d44 --- /dev/null +++ b/res/values-mcc405-hr @@ -0,0 +1 @@ +values-mcc404-hr
\ No newline at end of file diff --git a/res/values-mcc405-hu b/res/values-mcc405-hu new file mode 120000 index 000000000..1db0970fc --- /dev/null +++ b/res/values-mcc405-hu @@ -0,0 +1 @@ +values-mcc404-hu
\ No newline at end of file diff --git a/res/values-mcc405-hy b/res/values-mcc405-hy new file mode 120000 index 000000000..da1958094 --- /dev/null +++ b/res/values-mcc405-hy @@ -0,0 +1 @@ +values-mcc404-hy
\ No newline at end of file diff --git a/res/values-mcc405-in b/res/values-mcc405-in new file mode 120000 index 000000000..cdd39ace6 --- /dev/null +++ b/res/values-mcc405-in @@ -0,0 +1 @@ +values-mcc404-in
\ No newline at end of file diff --git a/res/values-mcc405-is b/res/values-mcc405-is new file mode 120000 index 000000000..37a2b78d0 --- /dev/null +++ b/res/values-mcc405-is @@ -0,0 +1 @@ +values-mcc404-is
\ No newline at end of file diff --git a/res/values-mcc405-it b/res/values-mcc405-it new file mode 120000 index 000000000..fdf1bf73c --- /dev/null +++ b/res/values-mcc405-it @@ -0,0 +1 @@ +values-mcc404-it
\ No newline at end of file diff --git a/res/values-mcc405-iw b/res/values-mcc405-iw new file mode 120000 index 000000000..8deb3deac --- /dev/null +++ b/res/values-mcc405-iw @@ -0,0 +1 @@ +values-mcc404-iw
\ No newline at end of file diff --git a/res/values-mcc405-ja b/res/values-mcc405-ja new file mode 120000 index 000000000..d69e70c43 --- /dev/null +++ b/res/values-mcc405-ja @@ -0,0 +1 @@ +values-mcc404-ja
\ No newline at end of file diff --git a/res/values-mcc405-ka b/res/values-mcc405-ka new file mode 120000 index 000000000..84d097070 --- /dev/null +++ b/res/values-mcc405-ka @@ -0,0 +1 @@ +values-mcc404-ka
\ No newline at end of file diff --git a/res/values-mcc405-kk b/res/values-mcc405-kk new file mode 120000 index 000000000..23c8a7d45 --- /dev/null +++ b/res/values-mcc405-kk @@ -0,0 +1 @@ +values-mcc404-kk
\ No newline at end of file diff --git a/res/values-mcc405-km b/res/values-mcc405-km new file mode 120000 index 000000000..223ee27b5 --- /dev/null +++ b/res/values-mcc405-km @@ -0,0 +1 @@ +values-mcc404-km
\ No newline at end of file diff --git a/res/values-mcc405-kn b/res/values-mcc405-kn new file mode 120000 index 000000000..adc9df7eb --- /dev/null +++ b/res/values-mcc405-kn @@ -0,0 +1 @@ +values-mcc404-kn
\ No newline at end of file diff --git a/res/values-mcc405-ko b/res/values-mcc405-ko new file mode 120000 index 000000000..8b7a0ba09 --- /dev/null +++ b/res/values-mcc405-ko @@ -0,0 +1 @@ +values-mcc404-ko
\ No newline at end of file diff --git a/res/values-mcc405-ky b/res/values-mcc405-ky new file mode 120000 index 000000000..174d38e1f --- /dev/null +++ b/res/values-mcc405-ky @@ -0,0 +1 @@ +values-mcc404-ky
\ No newline at end of file diff --git a/res/values-mcc405-lo b/res/values-mcc405-lo new file mode 120000 index 000000000..48bf583d6 --- /dev/null +++ b/res/values-mcc405-lo @@ -0,0 +1 @@ +values-mcc404-lo
\ No newline at end of file diff --git a/res/values-mcc405-lt b/res/values-mcc405-lt new file mode 120000 index 000000000..309982685 --- /dev/null +++ b/res/values-mcc405-lt @@ -0,0 +1 @@ +values-mcc404-lt
\ No newline at end of file diff --git a/res/values-mcc405-lv b/res/values-mcc405-lv new file mode 120000 index 000000000..015893ad1 --- /dev/null +++ b/res/values-mcc405-lv @@ -0,0 +1 @@ +values-mcc404-lv
\ No newline at end of file diff --git a/res/values-mcc405-mk b/res/values-mcc405-mk new file mode 120000 index 000000000..879db3138 --- /dev/null +++ b/res/values-mcc405-mk @@ -0,0 +1 @@ +values-mcc404-mk
\ No newline at end of file diff --git a/res/values-mcc405-ml b/res/values-mcc405-ml new file mode 120000 index 000000000..c03b7dd28 --- /dev/null +++ b/res/values-mcc405-ml @@ -0,0 +1 @@ +values-mcc404-ml
\ No newline at end of file diff --git a/res/values-mcc405-mn b/res/values-mcc405-mn new file mode 120000 index 000000000..0bd1789c5 --- /dev/null +++ b/res/values-mcc405-mn @@ -0,0 +1 @@ +values-mcc404-mn
\ No newline at end of file diff --git a/res/values-mcc405-mr b/res/values-mcc405-mr new file mode 120000 index 000000000..467804bf3 --- /dev/null +++ b/res/values-mcc405-mr @@ -0,0 +1 @@ +values-mcc404-mr
\ No newline at end of file diff --git a/res/values-mcc405-ms b/res/values-mcc405-ms new file mode 120000 index 000000000..bb94abf5d --- /dev/null +++ b/res/values-mcc405-ms @@ -0,0 +1 @@ +values-mcc404-ms
\ No newline at end of file diff --git a/res/values-mcc405-my b/res/values-mcc405-my new file mode 120000 index 000000000..d302208f5 --- /dev/null +++ b/res/values-mcc405-my @@ -0,0 +1 @@ +values-mcc404-my
\ No newline at end of file diff --git a/res/values-mcc405-nb b/res/values-mcc405-nb new file mode 120000 index 000000000..98b173444 --- /dev/null +++ b/res/values-mcc405-nb @@ -0,0 +1 @@ +values-mcc404-nb
\ No newline at end of file diff --git a/res/values-mcc405-ne b/res/values-mcc405-ne new file mode 120000 index 000000000..3b51ec1d5 --- /dev/null +++ b/res/values-mcc405-ne @@ -0,0 +1 @@ +values-mcc404-ne
\ No newline at end of file diff --git a/res/values-mcc405-nl b/res/values-mcc405-nl new file mode 120000 index 000000000..c588a07a0 --- /dev/null +++ b/res/values-mcc405-nl @@ -0,0 +1 @@ +values-mcc404-nl
\ No newline at end of file diff --git a/res/values-mcc405-or b/res/values-mcc405-or new file mode 120000 index 000000000..f2530134c --- /dev/null +++ b/res/values-mcc405-or @@ -0,0 +1 @@ +values-mcc404-or
\ No newline at end of file diff --git a/res/values-mcc405-pa b/res/values-mcc405-pa new file mode 120000 index 000000000..55c20f4e4 --- /dev/null +++ b/res/values-mcc405-pa @@ -0,0 +1 @@ +values-mcc404-pa
\ No newline at end of file diff --git a/res/values-mcc405-pl b/res/values-mcc405-pl new file mode 120000 index 000000000..34d819512 --- /dev/null +++ b/res/values-mcc405-pl @@ -0,0 +1 @@ +values-mcc404-pl
\ No newline at end of file diff --git a/res/values-mcc405-pt b/res/values-mcc405-pt new file mode 120000 index 000000000..18e9284ff --- /dev/null +++ b/res/values-mcc405-pt @@ -0,0 +1 @@ +values-mcc404-pt
\ No newline at end of file diff --git a/res/values-mcc405-pt-rPT b/res/values-mcc405-pt-rPT new file mode 120000 index 000000000..e0b0799c6 --- /dev/null +++ b/res/values-mcc405-pt-rPT @@ -0,0 +1 @@ +values-mcc404-pt-rPT
\ No newline at end of file diff --git a/res/values-mcc405-ro b/res/values-mcc405-ro new file mode 120000 index 000000000..8a6e5e65c --- /dev/null +++ b/res/values-mcc405-ro @@ -0,0 +1 @@ +values-mcc404-ro
\ No newline at end of file diff --git a/res/values-mcc405-ru b/res/values-mcc405-ru new file mode 120000 index 000000000..68d99cc37 --- /dev/null +++ b/res/values-mcc405-ru @@ -0,0 +1 @@ +values-mcc404-ru
\ No newline at end of file diff --git a/res/values-mcc405-si b/res/values-mcc405-si new file mode 120000 index 000000000..03045903f --- /dev/null +++ b/res/values-mcc405-si @@ -0,0 +1 @@ +values-mcc404-si
\ No newline at end of file diff --git a/res/values-mcc405-sk b/res/values-mcc405-sk new file mode 120000 index 000000000..cbc1c4bba --- /dev/null +++ b/res/values-mcc405-sk @@ -0,0 +1 @@ +values-mcc404-sk
\ No newline at end of file diff --git a/res/values-mcc405-sl b/res/values-mcc405-sl new file mode 120000 index 000000000..506c71dce --- /dev/null +++ b/res/values-mcc405-sl @@ -0,0 +1 @@ +values-mcc404-sl
\ No newline at end of file diff --git a/res/values-mcc405-sq b/res/values-mcc405-sq new file mode 120000 index 000000000..18ede96b3 --- /dev/null +++ b/res/values-mcc405-sq @@ -0,0 +1 @@ +values-mcc404-sq
\ No newline at end of file diff --git a/res/values-mcc405-sr b/res/values-mcc405-sr new file mode 120000 index 000000000..13b224940 --- /dev/null +++ b/res/values-mcc405-sr @@ -0,0 +1 @@ +values-mcc404-sr
\ No newline at end of file diff --git a/res/values-mcc405-sv b/res/values-mcc405-sv new file mode 120000 index 000000000..a169545e3 --- /dev/null +++ b/res/values-mcc405-sv @@ -0,0 +1 @@ +values-mcc404-sv
\ No newline at end of file diff --git a/res/values-mcc405-sw b/res/values-mcc405-sw new file mode 120000 index 000000000..6ddb2ca52 --- /dev/null +++ b/res/values-mcc405-sw @@ -0,0 +1 @@ +values-mcc404-sw
\ No newline at end of file diff --git a/res/values-mcc405-ta b/res/values-mcc405-ta new file mode 120000 index 000000000..588bf494a --- /dev/null +++ b/res/values-mcc405-ta @@ -0,0 +1 @@ +values-mcc404-ta
\ No newline at end of file diff --git a/res/values-mcc405-te b/res/values-mcc405-te new file mode 120000 index 000000000..c19de518e --- /dev/null +++ b/res/values-mcc405-te @@ -0,0 +1 @@ +values-mcc404-te
\ No newline at end of file diff --git a/res/values-mcc405-th b/res/values-mcc405-th new file mode 120000 index 000000000..157062ca8 --- /dev/null +++ b/res/values-mcc405-th @@ -0,0 +1 @@ +values-mcc404-th
\ No newline at end of file diff --git a/res/values-mcc405-tl b/res/values-mcc405-tl new file mode 120000 index 000000000..032629f9b --- /dev/null +++ b/res/values-mcc405-tl @@ -0,0 +1 @@ +values-mcc404-tl
\ No newline at end of file diff --git a/res/values-mcc405-tr b/res/values-mcc405-tr new file mode 120000 index 000000000..3957803aa --- /dev/null +++ b/res/values-mcc405-tr @@ -0,0 +1 @@ +values-mcc404-tr
\ No newline at end of file diff --git a/res/values-mcc405-uk b/res/values-mcc405-uk new file mode 120000 index 000000000..eaea84500 --- /dev/null +++ b/res/values-mcc405-uk @@ -0,0 +1 @@ +values-mcc404-uk
\ No newline at end of file diff --git a/res/values-mcc405-ur b/res/values-mcc405-ur new file mode 120000 index 000000000..d7b706451 --- /dev/null +++ b/res/values-mcc405-ur @@ -0,0 +1 @@ +values-mcc404-ur
\ No newline at end of file diff --git a/res/values-mcc405-uz b/res/values-mcc405-uz new file mode 120000 index 000000000..7be21f1d8 --- /dev/null +++ b/res/values-mcc405-uz @@ -0,0 +1 @@ +values-mcc404-uz
\ No newline at end of file diff --git a/res/values-mcc405-vi b/res/values-mcc405-vi new file mode 120000 index 000000000..bf8109f8a --- /dev/null +++ b/res/values-mcc405-vi @@ -0,0 +1 @@ +values-mcc404-vi
\ No newline at end of file diff --git a/res/values-mcc405-zh-rCN b/res/values-mcc405-zh-rCN new file mode 120000 index 000000000..846f281fb --- /dev/null +++ b/res/values-mcc405-zh-rCN @@ -0,0 +1 @@ +values-mcc404-zh-rCN
\ No newline at end of file diff --git a/res/values-mcc405-zh-rHK b/res/values-mcc405-zh-rHK new file mode 120000 index 000000000..246e53c4b --- /dev/null +++ b/res/values-mcc405-zh-rHK @@ -0,0 +1 @@ +values-mcc404-zh-rHK
\ No newline at end of file diff --git a/res/values-mcc405-zh-rTW b/res/values-mcc405-zh-rTW new file mode 120000 index 000000000..aefb52549 --- /dev/null +++ b/res/values-mcc405-zh-rTW @@ -0,0 +1 @@ +values-mcc404-zh-rTW
\ No newline at end of file diff --git a/res/values-mcc405-zu b/res/values-mcc405-zu new file mode 120000 index 000000000..a821f2582 --- /dev/null +++ b/res/values-mcc405-zu @@ -0,0 +1 @@ +values-mcc404-zu
\ No newline at end of file diff --git a/res/values-mcc440-mnc20/config.xml b/res/values-mcc440-mnc20/config.xml index ee877aa10..3bdcd9edb 100644 --- a/res/values-mcc440-mnc20/config.xml +++ b/res/values-mcc440-mnc20/config.xml @@ -19,13 +19,6 @@ <string-array name="etws_test_alerts_range_strings" translatable="false"> <item>0x1103:rat=gsm, emergency=true, debug_build=true</item> </string-array> - <string-array name="additional_cbs_channels_strings" translatable="false"> - <item>0xA800:type=etws_earthquake, emergency=true, scope=carrier</item> - <item>0xAFEE:type=etws_tsunami, emergency=true, scope=carrier</item> - <item>0xAC00-0xAFED:type=other, emergency=true, scope=carrier</item> - <item>0xA802:type=test, emergency=true, scope=carrier</item> - <item>0xA804:type=test, emergency=true, scope=carrier</item> - </string-array> <!-- Whether to show test settings --> <bool name="show_test_settings">false</bool> <bool name="allow_testing_mode_on_user_build">false</bool> diff --git a/src/com/android/cellbroadcastreceiver/CellBroadcastAlertDialog.java b/src/com/android/cellbroadcastreceiver/CellBroadcastAlertDialog.java index 543651b6d..e78db5790 100644 --- a/src/com/android/cellbroadcastreceiver/CellBroadcastAlertDialog.java +++ b/src/com/android/cellbroadcastreceiver/CellBroadcastAlertDialog.java @@ -922,8 +922,12 @@ public class CellBroadcastAlertDialog extends Activity { ((TextView) findViewById(R.id.dismissButton)).setText(dismissButtonText); - setPictogram(context, message); + + if (this.hasWindowFocus()) { + Configuration config = res.getConfiguration(); + setPictogramAreaLayout(config.orientation); + } } /** diff --git a/src/com/android/cellbroadcastreceiver/CellBroadcastAlertReminder.java b/src/com/android/cellbroadcastreceiver/CellBroadcastAlertReminder.java index 49eed8284..0868674b4 100644 --- a/src/com/android/cellbroadcastreceiver/CellBroadcastAlertReminder.java +++ b/src/com/android/cellbroadcastreceiver/CellBroadcastAlertReminder.java @@ -28,6 +28,7 @@ import android.content.Intent; import android.content.SharedPreferences; import android.content.pm.PackageManager; import android.content.res.Resources; +import android.media.AudioAttributes; import android.media.AudioManager; import android.media.Ringtone; import android.media.RingtoneManager; @@ -123,7 +124,15 @@ public class CellBroadcastAlertReminder extends Service { if (enableVibration) { // Vibrate for 500ms. Vibrator vibrator = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE); - vibrator.vibrate(VibrationEffect.createOneShot(500, VibrationEffect.DEFAULT_AMPLITUDE)); + if (vibrator != null) { + AudioAttributes.Builder attrBuilder = new AudioAttributes.Builder(); + attrBuilder.setUsage(AudioAttributes.USAGE_ALARM); + AudioAttributes attr = attrBuilder.build(); + vibrator.vibrate(VibrationEffect.createOneShot(500, + VibrationEffect.DEFAULT_AMPLITUDE), attr); + } else { + Log.e(TAG, "vibrator is null"); + } } } diff --git a/src/com/android/cellbroadcastreceiver/CellBroadcastReceiver.java b/src/com/android/cellbroadcastreceiver/CellBroadcastReceiver.java index b39ebbfac..e8b55feb1 100644 --- a/src/com/android/cellbroadcastreceiver/CellBroadcastReceiver.java +++ b/src/com/android/cellbroadcastreceiver/CellBroadcastReceiver.java @@ -272,8 +272,14 @@ public class CellBroadcastReceiver extends BroadcastReceiver { roamingOperator = networkOperator; break; } else if (r.equals("XXX")) { - //match any roaming network, only store mcc - roamingOperator = networkOperator.substring(0, 3); + if (tm.getSimOperator() != null) { + String networkMcc = networkOperator.substring(0, 3); + // empty sim case or inserted sim but different mcc case + if (!tm.getSimOperator().startsWith(networkMcc)) { + //match any roaming network, only store mcc + roamingOperator = networkMcc; + } + } break; } else if (networkOperator.startsWith(r)) { roamingOperator = r; diff --git a/src/com/android/cellbroadcastreceiver/CellBroadcastSettings.java b/src/com/android/cellbroadcastreceiver/CellBroadcastSettings.java index 75a62061d..b3733cc7b 100644 --- a/src/com/android/cellbroadcastreceiver/CellBroadcastSettings.java +++ b/src/com/android/cellbroadcastreceiver/CellBroadcastSettings.java @@ -154,7 +154,8 @@ public class CellBroadcastSettings extends CollapsingToolbarBaseActivity { public static final String KEY_EMERGENCY_ALERT_HISTORY = "emergency_alert_history"; // For top introduction info - private static final String KEY_PREFS_TOP_INTRO = "alert_prefs_top_intro"; + @VisibleForTesting + public static final String KEY_PREFS_TOP_INTRO = "alert_prefs_top_intro"; // Whether to receive alert in second language code public static final String KEY_RECEIVE_CMAS_IN_SECOND_LANGUAGE = diff --git a/tests/compliancetests/assets/emergency_alert_channels.json b/tests/compliancetests/assets/emergency_alert_channels.json index 04afcc591..21cd5c84c 100644 --- a/tests/compliancetests/assets/emergency_alert_channels.json +++ b/tests/compliancetests/assets/emergency_alert_channels.json @@ -11,6 +11,7 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. + { "uae": { "4352": { @@ -43,10 +44,7 @@ "4396": { "title": "Public Safety Alert", "default_value": "true", - "toggle_avail": "true", - "vibration_time": 1, - "sound_time": 7, - "alert_time": 10 + "toggle_avail": "true" }, "4380": { "title": "Test Alert", @@ -93,10 +91,7 @@ "4397": { "title": "Public Safety Alert", "default_value": "true", - "toggle_avail": "true", - "vibration_time": 1, - "sound_time": 7, - "alert_time": 10 + "toggle_avail": "true" }, "4393": { "title": "Test Alert", @@ -190,50 +185,32 @@ "4370": { "title": "Alerta de Emergencia", //"Emergency alert", "default_value": "true", - "toggle_avail": "false", - "vibration_time": 180, - "sound_time": 180, - "alert_time": 180 + "toggle_avail": "false" }, "4383": { "title": "Alerta de Emergencia", //"Emergency alert", "default_value": "true", - "toggle_avail": "false", - "vibration_time": 180, - "sound_time": 180, - "alert_time": 180 + "toggle_avail": "false" }, "4380": { "title": "Alerta de Emergencia – mensaje de Prueba", //"Emergency alert: Test message", "default_value": "true", - "toggle_avail": "false", - "vibration_time": 180, - "sound_time": 180, - "alert_time": 180 + "toggle_avail": "false" }, "4381": { "title": "Alerta de Emergencia – mensaje de Ejercicio / Simulacro", //"Emergency alert: Exercise/Drill message", "default_value": "true", - "toggle_avail": "false", - "vibration_time": 180, - "sound_time": 180, - "alert_time": 180 + "toggle_avail": "false" }, "4382": { "title": "Mensaje Informativo", //"Informative message", "default_value": "true", - "toggle_avail": "false", - "vibration_time": 180, - "sound_time": 180, - "alert_time": 180 + "toggle_avail": "false" }, "4396": { "title": "Alerta de Emergencia", //"Emergency alert", "default_value": "true", "toggle_avail": "false", - "vibration_time": 180, - "sound_time": 180, - "alert_time": 180, "end_channel": "4399" } }, @@ -252,50 +229,32 @@ "4370": { "title": "Alerta de Emergencia", //"Emergency alert", "default_value": "true", - "toggle_avail": "false", - "vibration_time": 180, - "sound_time": 180, - "alert_time": 180 + "toggle_avail": "false" }, "4383": { "title": "Alerta de Emergencia", //"Emergency alert", "default_value": "true", - "toggle_avail": "false", - "vibration_time": 180, - "sound_time": 180, - "alert_time": 180 + "toggle_avail": "false" }, "4380": { "title": "Alerta de Emergencia – mensaje de Prueba", //"Emergency alert: Test message", "default_value": "true", - "toggle_avail": "false", - "vibration_time": 180, - "sound_time": 180, - "alert_time": 180 + "toggle_avail": "false" }, "4381": { "title": "Alerta de Emergencia – mensaje de Ejercicio / Simulacro", //"Emergency alert: Exercise/Drill message", "default_value": "true", - "toggle_avail": "false", - "vibration_time": 180, - "sound_time": 180, - "alert_time": 180 + "toggle_avail": "false" }, "4382": { "title": "Mensaje Informativo", //"Informative message", "default_value": "true", - "toggle_avail": "false", - "vibration_time": 180, - "sound_time": 180, - "alert_time": 180 + "toggle_avail": "false" }, "4396": { "title": "Alerta de Emergencia", // "Emergency alert", "default_value": "true", "toggle_avail": "false", - "vibration_time": 180, - "sound_time": 180, - "alert_time": 180, "end_channel": "4399" } }, @@ -728,43 +687,6 @@ "title": "子供の誘拐(誘拐事件速報)", //"Child abduction (Amber alert)", "default_value": "true", "toggle_avail": "true" - }, - "43008": { - "title": "緊急地震速報", //"Earthquake warning", - "default_value": "true", - "toggle_avail": "false" - }, - "45038": { - "title": "津波警報", //"Tsunami warning", - "default_value": "true", - "toggle_avail": "false", - "warning_type": "02" - }, - "44032": { - "title": "緊急速報メール", //"Emergency warning", - "default_value": "true", - "toggle_avail": "false", - "end_channel": "45037" - }, - "45000": { - "title": "緊急速報メール", //"Emergency warning", - "default_value": "true", - "toggle_avail": "false" - }, - "45037": { - "title": "緊急速報メール", //"Emergency warning", - "default_value": "true", - "toggle_avail": "false" - }, - "43010": { - "title": "ETWS 試験メッセージ", //"ETWS test message", - "default_value": "false", - "toggle_avail": "false" - }, - "43012": { - "title": "ETWS 試験メッセージ", //"ETWS test message", - "default_value": "false", - "toggle_avail": "false" } }, "hongkong": { @@ -949,101 +871,59 @@ "4370": { "title": "Emergency alert", "default_value": "true", - "toggle_avail": "false", - "vibration_time": 190, - "sound_time": 190, - "alert_time": 180, - "offset": 10 + "toggle_avail": "false" }, "919": { "title": "Emergency alert", "default_value": "true", - "toggle_avail": "false", - "vibration_time": 190, - "sound_time": 190, - "alert_time": 180, - "offset": 10 + "toggle_avail": "false" }, "4380": { "title": "Mensaje de prueba", "default_value": "false", - "toggle_avail": "true", - "vibration_time": 1, - "sound_time": 7, - "alert_time": 10 + "toggle_avail": "true" }, "519": { "title": "Test Message", "default_value": "false", - "toggle_avail": "true", - "vibration_time": 1, - "sound_time": 7, - "alert_time": 10 + "toggle_avail": "true" }, "4371": { "title": "Emergency alert: Extreme", "default_value": "true", "toggle_avail": "false", - "vibration_time": 190, - "sound_time": 190, - "alert_time": 180, - "offset": 10, "end_channel": "4372" }, "4373": { "title": "Emergency alert: Severe", "default_value": "true", "toggle_avail": "false", - "vibration_time": 190, - "sound_time": 190, - "alert_time": 180, - "offset": 10, "end_channel": "4378" }, "4379": { "title": "Child abduction (Amber alert)", "default_value": "true", - "toggle_avail": "false", - "vibration_time": 190, - "sound_time": 190, - "alert_time": 180, - "offset": 10 + "toggle_avail": "false" }, "4381": { "title": "Emergency alert (exercise)", "default_value": "false", - "toggle_avail": "false", - "vibration_time": 190, - "sound_time": 190, - "alert_time": 180, - "offset": 10 + "toggle_avail": "false" }, "4382": { "title": "Emergency alert (operator)", "default_value": "false", - "toggle_avail": "false", - "vibration_time": 190, - "sound_time": 190, - "alert_time": 180, - "offset": 10 + "toggle_avail": "false" }, "4383": { "title": "Emergency alert", "default_value": "true", - "toggle_avail": "false", - "vibration_time": 190, - "sound_time": 190, - "alert_time": 180, - "offset": 10 + "toggle_avail": "false" }, "921": { "title": "Emergency alert", "default_value": "true", - "toggle_avail": "false", - "vibration_time": 190, - "sound_time": 190, - "alert_time": 180, - "offset": 10 + "toggle_avail": "false" } }, "korea": { @@ -1061,59 +941,38 @@ "4370": { "title": "위급 재난 문자", //"Critical emergency alert", "default_value": "true", - "toggle_avail": "false", - "vibration_time": 10, - "sound_time": 10, - "alert_time": 10 + "toggle_avail": "false" }, "4383": { "title": "위급 재난 문자", //"Critical emergency alert", "default_value": "true", - "toggle_avail": "false", - "vibration_time": 10, - "sound_time": 10, - "alert_time": 10 + "toggle_avail": "false" }, "4371": { "title": "긴급 재난 문자", //"Emergency alert", "default_value": "true", - "toggle_avail": "true", - "vibration_time": 10, - "sound_time": 10, - "alert_time": 10 + "toggle_avail": "true" }, "4384": { "title": "긴급 재난 문자", //"Emergency alert", "default_value": "true", - "toggle_avail": "true", - "vibration_time": 10, - "sound_time": 10, - "alert_time": 10 + "toggle_avail": "true" }, "4372": { "title": "안전 안내 문자", //"Public safety message", "default_value": "true", - "toggle_avail": "true", - "vibration_time": 1, - "sound_time": 1, - "alert_time": 10 + "toggle_avail": "true" }, "4373": { "title": "안전 안내 문자", //"Public safety message", "default_value": "true", "toggle_avail": "true", - "vibration_time": 1, - "sound_time": 1, - "alert_time": 10, "end_channel": "4379" }, "4385": { "title": "안전 안내 문자", //"Public safety message", "default_value": "true", - "toggle_avail": "true", - "vibration_time": 1, - "sound_time": 1, - "alert_time": 10 + "toggle_avail": "true" }, "40960": { "title": "안전 안내 문자", //"Public safety message", @@ -1138,59 +997,38 @@ "4370": { "title": "위급 재난 문자", //"Critical emergency alert", "default_value": "true", - "toggle_avail": "false", - "vibration_time": 10, - "sound_time": 10, - "alert_time": 10 + "toggle_avail": "false" }, "4383": { "title": "위급 재난 문자", //"Critical emergency alert", "default_value": "true", - "toggle_avail": "false", - "vibration_time": 10, - "sound_time": 10, - "alert_time": 10 + "toggle_avail": "false" }, "4371": { "title": "긴급 재난 문자", //"Emergency alert", "default_value": "true", - "toggle_avail": "true", - "vibration_time": 10, - "sound_time": 10, - "alert_time": 10 + "toggle_avail": "true" }, "4384": { "title": "긴급 재난 문자", //"Emergency alert", "default_value": "true", - "toggle_avail": "true", - "vibration_time": 10, - "sound_time": 10, - "alert_time": 10 + "toggle_avail": "true" }, "4372": { "title": "안전 안내 문자", //"Public safety message", "default_value": "true", - "toggle_avail": "true", - "vibration_time": 1, - "sound_time": 1, - "alert_time": 10 + "toggle_avail": "true" }, "4373": { "title": "안전 안내 문자", //"Public safety message", "default_value": "true", "toggle_avail": "true", - "vibration_time": 1, - "sound_time": 1, - "alert_time": 10, "end_channel": "4379" }, "4385": { "title": "안전 안내 문자", //"Public safety message", "default_value": "true", - "toggle_avail": "true", - "vibration_time": 1, - "sound_time": 1, - "alert_time": 10 + "toggle_avail": "true" }, "40960": { "title": "안전 안내 문자", //"Public safety message", @@ -1215,59 +1053,38 @@ "4370": { "title": "위급 재난 문자", //"Critical emergency alert", "default_value": "true", - "toggle_avail": "false", - "vibration_time": 10, - "sound_time": 10, - "alert_time": 10 + "toggle_avail": "false" }, "4383": { "title": "위급 재난 문자", //"Critical emergency alert", "default_value": "true", - "toggle_avail": "false", - "vibration_time": 10, - "sound_time": 10, - "alert_time": 10 + "toggle_avail": "false" }, "4371": { "title": "긴급 재난 문자", //"Emergency alert", "default_value": "true", - "toggle_avail": "true", - "vibration_time": 10, - "sound_time": 10, - "alert_time": 10 + "toggle_avail": "true" }, "4384": { "title": "긴급 재난 문자", //"Emergency alert", "default_value": "true", - "toggle_avail": "true", - "vibration_time": 10, - "sound_time": 10, - "alert_time": 10 + "toggle_avail": "true" }, "4372": { "title": "안전 안내 문자", //"Public safety message", "default_value": "true", - "toggle_avail": "true", - "vibration_time": 1, - "sound_time": 1, - "alert_time": 10 + "toggle_avail": "true" }, "4373": { "title": "안전 안내 문자", //"Public safety message", "default_value": "true", "toggle_avail": "true", - "vibration_time": 1, - "sound_time": 1, - "alert_time": 10, "end_channel": "4379" }, "4385": { "title": "안전 안내 문자", //"Public safety message", "default_value": "true", - "toggle_avail": "true", - "vibration_time": 1, - "sound_time": 1, - "alert_time": 10 + "toggle_avail": "true" }, "40960": { "title": "안전 안내 문자", //"Public safety message", @@ -1752,18 +1569,12 @@ "911": { "title": "Alert Message", "default_value": "true", - "toggle_avail": "true", - "vibration_time": 1, - "sound_time": 7, - "alert_time": 10 + "toggle_avail": "true" }, "919": { "title": "Alert Message", "default_value": "true", - "toggle_avail": "true", - "vibration_time": 1, - "sound_time": 7, - "alert_time": 10 + "toggle_avail": "true" }, "4371": { "title": "Emergency Alert", @@ -2009,48 +1820,36 @@ "4370": { "title": "Alerta de Protección Civil", //"Civil Protection Alert", "default_value": "true", - "toggle_avail": "false", - "vibration_time": 60, - "sound_time": 65 + "toggle_avail": "false" }, "4383": { "title": "Alerta de Protección Civil", //"Civil Protection Alert", "default_value": "true", "toggle_avail": "false", - "vibration_time": 60, - "sound_time": 65, "filter_language": "language_setting" }, "4371": { "title": "Pre-Alerta de Protección Civil", //"Civil Protection Pre-Alert", "default_value": "false", "toggle_avail": "true", - "vibration_time": 30, - "sound_time": 35, "end_channel": "4372" }, "4384": { "title": "Pre-Alerta de Protección Civil", //"Civil Protection Pre-Alert", "default_value": "false", "toggle_avail": "true", - "vibration_time": 30, - "sound_time": 35, "filter_language": "language_setting", "end_channel": "4385" }, "4380": { "title": "Pruebas", //"Test", "default_value": "false", - "toggle_avail": "false", - "vibration_time": 15, - "sound_time": 20 + "toggle_avail": "false" }, "4393": { "title": "Pruebas", //"Test", "default_value": "false", "toggle_avail": "false", - "vibration_time": 15, - "sound_time": 20, "filter_language": "language_setting" } }, @@ -2069,104 +1868,76 @@ "4370": { "title": "EMERGENCY ALERT / ALERTE", "default_value": "true", - "toggle_avail": "false", - "vibration_time": 8, - "sound_time": 8 + "toggle_avail": "false" }, "4371": { "title": "EMERGENCY ALERT / ALERTE", "default_value": "true", "toggle_avail": "true", - "vibration_time": 8, - "sound_time": 8, "end_channel": "4372" }, "4373": { "title": "EMERGENCY ALERT / ALERTE", "default_value": "true", "toggle_avail": "true", - "vibration_time": 8, - "sound_time": 8, "end_channel": "4378" }, "4379": { "title": "EMERGENCY ALERT / ALERTE", "default_value": "true", - "toggle_avail": "true", - "vibration_time": 8, - "sound_time": 8 + "toggle_avail": "true" }, "4380": { "title": "EMERGENCY ALERT / ALERTE", "default_value": "false", - "toggle_avail": "true", - "vibration_time": 8, - "sound_time": 8 + "toggle_avail": "true" }, "4381": { "title": "EMERGENCY ALERT / ALERTE", "default_value": "false", - "toggle_avail": "true", - "vibration_time": 8, - "sound_time": 8 + "toggle_avail": "true" }, "4382": { "title": "EMERGENCY ALERT / ALERTE", "default_value": "false", - "toggle_avail": "true", - "vibration_time": 8, - "sound_time": 8 + "toggle_avail": "true" }, "4383": { "title": "EMERGENCY ALERT / ALERTE", "default_value": "true", - "toggle_avail": "true", - "vibration_time": 8, - "sound_time": 8 + "toggle_avail": "true" }, "4384": { "title": "EMERGENCY ALERT / ALERTE", "default_value": "true", "toggle_avail": "true", - "vibration_time": 8, - "sound_time": 8, "end_channel": "4385" }, "4386": { "title": "EMERGENCY ALERT / ALERTE", "default_value": "true", "toggle_avail": "true", - "vibration_time": 8, - "sound_time": 8, "end_channel": "4391" }, "4392": { "title": "EMERGENCY ALERT / ALERTE", "default_value": "true", - "toggle_avail": "true", - "vibration_time": 8, - "sound_time": 8 + "toggle_avail": "true" }, "4393": { "title": "EMERGENCY ALERT / ALERTE", "default_value": "false", - "toggle_avail": "true", - "vibration_time": 8, - "sound_time": 8 + "toggle_avail": "true" }, "4394": { "title": "EMERGENCY ALERT / ALERTE", "default_value": "false", - "toggle_avail": "true", - "vibration_time": 8, - "sound_time": 8 + "toggle_avail": "true" }, "4395": { "title": "EMERGENCY ALERT / ALERTE", "default_value": "false", - "toggle_avail": "true", - "vibration_time": 8, - "sound_time": 8 + "toggle_avail": "true" }, "4396": { "title": "", @@ -2190,11 +1961,7 @@ "4370": { "title": "Presidential alert", "default_value": "true", - "toggle_avail": "false", - "vibration_time": 190, - "sound_time": 190, - "alert_time": 180, - "offset": 10 + "toggle_avail": "false" }, "4380": { "title": "Required Monthly Test", @@ -2277,20 +2044,12 @@ "4370": { "title": "Presidential alert", "default_value": "true", - "toggle_avail": "false", - "vibration_time": 190, - "sound_time": 190, - "alert_time": 180, - "offset": 10 + "toggle_avail": "false" }, "919": { "title": "Presidential alert", "default_value": "true", - "toggle_avail": "false", - "vibration_time": 190, - "sound_time": 190, - "alert_time": 180, - "offset": 10 + "toggle_avail": "false" }, "4380": { "title": "Required Monthly Test", @@ -2367,36 +2126,24 @@ "4370": { "title": "Alerta Local de Emergencia", //"Local emergency alert", "default_value": "true", - "toggle_avail": "false", - "vibration_time": 180, - "sound_time": 186, - "alert_time": 180 + "toggle_avail": "false" }, "6400": { "title": "Mensaje Informativo", //"Informative message", "default_value": "true", "toggle_avail": "true", - "vibration_time": 1, - "sound_time": 7, - "alert_time": 10, "alert_type": "notification" }, "4380": { "title": "Mensaje de Prueba", //"Test message", "default_value": "true", "toggle_avail": "true", - "vibration_time": 1, - "sound_time": 7, - "alert_time": 10, "alert_type": "notification" }, "4381": { "title": "Alerta de Emergencia – mensaje de Ejercicio /Simulacro", //"Emergency Alert - Exercise / Drill message", "default_value": "true", "toggle_avail": "true", - "vibration_time": 1, - "sound_time": 7, - "alert_time": 10, "alert_type": "notification" }, "50": { @@ -2425,45 +2172,30 @@ "4370": { "title": "Alerta Local de Emergencia", //"Local emergency alert", "default_value": "true", - "toggle_avail": "false", - "vibration_time": 180, - "sound_time": 186, - "alert_time": 180 + "toggle_avail": "false" }, "6400": { "title": "Mensaje Informativo", //"Informative message", "default_value": "true", "toggle_avail": "true", - "vibration_time": 1, - "sound_time": 7, - "alert_time": 10, "alert_type": "notification" }, "4380": { "title": "Mensaje de Prueba", //"Test message", "default_value": "true", "toggle_avail": "true", - "vibration_time": 1, - "sound_time": 7, - "alert_time": 10, "alert_type": "notification" }, "4381": { "title": "Alerta de Emergencia – mensaje de Ejercicio /Simulacro", //"Emergency Alert - Exercise / Drill message", "default_value": "true", "toggle_avail": "true", - "vibration_time": 1, - "sound_time": 7, - "alert_time": 10, "alert_type": "notification" }, "50": { "title": "Broadcast messages", "default_value": "true", "toggle_avail": "false", - "vibration_time": 1, - "sound_time": 1, - "alert_time": 5, "display":"false" } }, @@ -2559,10 +2291,7 @@ "4370": { "title": "تحذير طارىء", //"Emergency alert", "default_value": "true", - "toggle_avail": "false", - "vibration_time": 30, - "sound_time": 36, - "alert_time": 30 + "toggle_avail": "false" }, "4371": { "title": "رسالة تحذيرية", // "Warning alert", @@ -2602,9 +2331,6 @@ "title": "Warning alert", "default_value": "true", "toggle_avail": "true", - "vibration_time": 1, - "sound_time": 1, - "alert_time": 5, "alert_type":"notification", "end_channel": "4372" }, @@ -2612,9 +2338,6 @@ "title": "Warning alert", "default_value": "true", "toggle_avail": "true", - "vibration_time": 1, - "sound_time": 1, - "alert_time": 5, "alert_type":"notification", "filter_language": "language_setting", "end_channel": "4385" @@ -2623,9 +2346,6 @@ "title": "Warning alert", "default_value": "true", "toggle_avail": "true", - "vibration_time": 1, - "sound_time": 1, - "alert_time": 5, "alert_type":"notification", "filter_language": "language_setting", "end_channel": "922" @@ -2634,9 +2354,6 @@ "title": "Informative message", "default_value": "true", "toggle_avail": "true", - "vibration_time": 1, - "sound_time": 1, - "alert_time": 5, "alert_type":"notification", "end_channel": "4378" }, @@ -2644,9 +2361,6 @@ "title": "Informative message", "default_value": "true", "toggle_avail": "true", - "vibration_time": 1, - "sound_time": 1, - "alert_time": 5, "alert_type":"notification", "filter_language": "language_setting", "end_channel": "4391" @@ -2655,18 +2369,12 @@ "title": "Required Monthly Test", "default_value": "false", "toggle_avail": "true", - "vibration_time": 1, - "sound_time": 1, - "alert_time": 5, "alert_type":"notification" }, "4393": { "title": "Required Monthly Test", "default_value": "false", "toggle_avail": "true", - "vibration_time": 1, - "sound_time": 1, - "alert_time": 5, "alert_type":"notification", "filter_language": "language_setting" }, @@ -2674,18 +2382,12 @@ "title": "Emergency alert (exercise)", "default_value": "false", "toggle_avail": "true", - "vibration_time": 1, - "sound_time": 1, - "alert_time": 5, "alert_type":"notification" }, "4394": { "title": "Emergency alert (exercise)", "default_value": "false", "toggle_avail": "true", - "vibration_time": 1, - "sound_time": 1, - "alert_time": 5, "alert_type":"notification", "filter_language": "language_setting" }, @@ -2693,18 +2395,12 @@ "title": "Public assistance request message", "default_value": "false", "toggle_avail": "true", - "vibration_time": 1, - "sound_time": 1, - "alert_time": 5, "alert_type":"notification" }, "4392": { "title": "Public assistance request message", "default_value": "false", "toggle_avail": "true", - "vibration_time": 1, - "sound_time": 1, - "alert_time": 5, "alert_type":"notification" } }, @@ -2860,32 +2556,24 @@ "4375": { "title": "FR-ALERT : Alerte grave", //"FR-ALERT : Severe alert", "default_value": "true", - "toggle_avail": "true", - "vibration_time": 0, - "sound_time": 0 + "toggle_avail": "true" }, "4388": { "title": "FR-ALERT : Alerte grave", //"FR-ALERT : Severe alert", "default_value": "true", "toggle_avail": "true", - "vibration_time": 0, - "sound_time": 0, "filter_language": "language_setting" }, "4396": { "title": "FR-ALERT : Avertissement", //"FR-ALERT : Warning", "default_value": "true", - "toggle_avail": "true", - "vibration_time": 0, - "sound_time": 0 + "toggle_avail": "true" }, "4397": { "title": "FR-ALERT : Avertissement", //"FR-ALERT : Warning", "default_value": "true", "toggle_avail": "true", - "filter_language": "language_setting", - "vibration_time": 0, - "sound_time": 0 + "filter_language": "language_setting" }, "4379": { "title": "FR-ALERT : Enlèvement", //"FR-ALERT : Kidnapping Alert", @@ -3416,50 +3104,32 @@ "4396": { "title": "Public Safety Alert", "default_value": "true", - "toggle_avail": "true", - "vibration_time": 1, - "sound_time": 7, - "alert_time": 10 + "toggle_avail": "true" }, "4397": { "title": "Public Safety Alert", "default_value": "true", - "toggle_avail": "true", - "vibration_time": 1, - "sound_time": 7, - "alert_time": 10 + "toggle_avail": "true" }, "4398": { "title": "Test Alert", "default_value": "true", - "toggle_avail": "false", - "vibration_time": 1, - "sound_time": 7, - "alert_time": 10 + "toggle_avail": "false" }, "4399": { "title": "Test Alert", "default_value": "true", - "toggle_avail": "false", - "vibration_time": 1, - "sound_time": 7, - "alert_time": 10 + "toggle_avail": "false" }, "4380": { "title": "Test Alert", "default_value": "false", - "toggle_avail": "true", - "vibration_time": 1, - "sound_time": 7, - "alert_time": 10 + "toggle_avail": "true" }, "4393": { "title": "Test Alert", "default_value": "false", - "toggle_avail": "true", - "vibration_time": 1, - "sound_time": 7, - "alert_time": 10 + "toggle_avail": "true" }, "4381": { "title": "Exercise", diff --git a/tests/compliancetests/assets/region_plmn_list.json b/tests/compliancetests/assets/region_plmn_list.json index 13eb90a4a..984d895b7 100644 --- a/tests/compliancetests/assets/region_plmn_list.json +++ b/tests/compliancetests/assets/region_plmn_list.json @@ -212,7 +212,7 @@ "language": "fr" }, "us_vzw": { - "mccmnc": ["310012", "311480"], + "mccmnc": ["310012", "310590", "311480"], "imsi": "310012012345678" }, "us_att": { @@ -220,7 +220,7 @@ "imsi": "310410012345678" }, "us_tmo": { - "mccmnc": ["310160", "310260", "310200", "310210", "310220", "310230", "310240", "310250", "31026", "310260", "310270", "310300", "310310", "310490", "310530", "310590", "310660", "310800", "311660", "311882", "312250"], + "mccmnc": ["310160", "310260", "310200", "310210", "310220", "310230", "310240", "310250", "31026", "310260", "310270", "310300", "310310", "310490", "310530", "310660", "310800", "311660", "311882", "312250"], "imsi": "310160012345678" }, "us_dish": { diff --git a/tests/compliancetests/src/com/android/cellbroadcastreceiver/compliancetests/CellBroadcastBaseTest.java b/tests/compliancetests/src/com/android/cellbroadcastreceiver/compliancetests/CellBroadcastBaseTest.java index a0c47df05..070c5d064 100644 --- a/tests/compliancetests/src/com/android/cellbroadcastreceiver/compliancetests/CellBroadcastBaseTest.java +++ b/tests/compliancetests/src/com/android/cellbroadcastreceiver/compliancetests/CellBroadcastBaseTest.java @@ -93,6 +93,7 @@ public class CellBroadcastBaseTest { protected static String sPackageName = null; protected static IRadioMessagingImpl.CallBackWithExecutor sCallBackWithExecutor = null; + protected static String sBackUpRoamingNetwork = ""; protected static Context getContext() { return InstrumentationRegistry.getInstrumentation().getContext(); @@ -203,6 +204,10 @@ public class CellBroadcastBaseTest { sDevice = UiDevice.getInstance(sInstrumentation); sPackageName = CellBroadcastUtils .getDefaultCellBroadcastReceiverPackageName(getContext()); + + setTestRoamingOperator(true); + enableAirplaneMode(true); + enableAirplaneMode(false); } private static void waitForNotify() { @@ -216,6 +221,17 @@ public class CellBroadcastBaseTest { } } + private static void waitForNotify(int milliSeconds) { + while (sSetChannelIsDone.getCount() > 0) { + try { + sSetChannelIsDone.await(milliSeconds, TimeUnit.MILLISECONDS); + sSetChannelIsDone.countDown(); + } catch (InterruptedException e) { + // do nothing + } + } + } + @AfterClass public static void afterAllTests() throws Exception { logd("CellBroadcastBaseTest#afterAllTests()"); @@ -231,6 +247,8 @@ public class CellBroadcastBaseTest { assertTrue(sMockModemManager.disconnectMockModemService()); sMockModemManager = null; } + + setTestRoamingOperator(false); } @Rule @@ -308,6 +326,47 @@ public class CellBroadcastBaseTest { return result.toArray(new Object[]{}); } + protected static void enableDualSim(boolean enable) throws Exception { + if (enable) { + sDevice.executeShellCommand("root"); + sDevice.executeShellCommand("setprop persist.radio.multisim.config ss"); + sDevice.executeShellCommand("reboot"); + } else { + sDevice.executeShellCommand("root"); + sDevice.executeShellCommand("setprop persist.radio.multisim.config dsds"); + } + } + + protected static void enableAirplaneMode(boolean on) throws Exception { + if (on) { + logd("airplane mode on"); + sDevice.executeShellCommand("settings put global airplane_mode_on 1"); + sDevice.executeShellCommand("am broadcast -a android.intent.action.AIRPLANE_MODE"); + waitForNotify(2000); + } else { + logd("airplane mode off"); + sDevice.executeShellCommand("settings put global airplane_mode_on 0"); + sDevice.executeShellCommand("am broadcast -a android.intent.action.AIRPLANE_MODE"); + waitForNotify(2000); + } + } + + protected static void setTestRoamingOperator(boolean save) throws Exception { + if (save) { + logd("setTestRoamingOperator: 00101"); + sBackUpRoamingNetwork = sDevice.executeShellCommand( + "getprop persist.cellbroadcast.roaming_plmn_supported"); + logd("backup roaming network is " + sBackUpRoamingNetwork); + sDevice.executeShellCommand( + "setprop persist.cellbroadcast.roaming_plmn_supported 00101"); + } else { + logd("restore TestRoamingOperator: " + sBackUpRoamingNetwork); + sDevice.executeShellCommand( + "setprop persist.cellbroadcast.roaming_plmn_supported " + + sBackUpRoamingNetwork); + } + } + protected void setSimInfo(String carrierName, String inputMccMnc) throws Throwable { String mcc = inputMccMnc.substring(0, 3); String mnc = inputMccMnc.substring(3); diff --git a/tests/unit/src/com/android/cellbroadcastreceiver/unit/CellBroadcastActivityTestCase.java b/tests/unit/src/com/android/cellbroadcastreceiver/unit/CellBroadcastActivityTestCase.java index a52e0a6db..87c6ab3aa 100644 --- a/tests/unit/src/com/android/cellbroadcastreceiver/unit/CellBroadcastActivityTestCase.java +++ b/tests/unit/src/com/android/cellbroadcastreceiver/unit/CellBroadcastActivityTestCase.java @@ -35,6 +35,7 @@ import android.view.Display; import java.util.HashMap; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; +import java.util.function.BooleanSupplier; public class CellBroadcastActivityTestCase<T extends Activity> extends ActivityUnitTestCase<T> { @@ -204,4 +205,21 @@ public class CellBroadcastActivityTestCase<T extends Activity> extends ActivityU } } + + protected void waitForChange(BooleanSupplier condition, long timeoutMs) { + CountDownLatch latch = new CountDownLatch(1); + new Thread(() -> { + while (latch.getCount() > 0 && !condition.getAsBoolean()) { + // do nothing + } + latch.countDown(); + }).start(); + + try { + latch.await(timeoutMs, TimeUnit.MILLISECONDS); + } catch (InterruptedException e) { + // do nothing + } + latch.countDown(); + } } diff --git a/tests/unit/src/com/android/cellbroadcastreceiver/unit/CellBroadcastAlertDialogTest.java b/tests/unit/src/com/android/cellbroadcastreceiver/unit/CellBroadcastAlertDialogTest.java index ad1f3fa6a..63c124cae 100644 --- a/tests/unit/src/com/android/cellbroadcastreceiver/unit/CellBroadcastAlertDialogTest.java +++ b/tests/unit/src/com/android/cellbroadcastreceiver/unit/CellBroadcastAlertDialogTest.java @@ -370,16 +370,21 @@ public class CellBroadcastAlertDialogTest extends CellBroadcastAlertDialog activity = startActivity(intent, null, null); waitForMs(100); + ImageView image = activity.findViewById(R.id.pictogramImage); + image.setVisibility(View.VISIBLE); + assertEquals(View.VISIBLE, image.getVisibility()); + // add more messages to list mMessageList.add(CellBroadcastAlertServiceTest.createMessageForCmasMessageClass(12413, - SmsCbConstants.MESSAGE_ID_CMAS_ALERT_CHILD_ABDUCTION_EMERGENCY, - SmsCbConstants.MESSAGE_ID_CMAS_ALERT_CHILD_ABDUCTION_EMERGENCY)); + SmsCbConstants.MESSAGE_ID_ETWS_EARTHQUAKE_WARNING, + SmsCbConstants.MESSAGE_ID_ETWS_EARTHQUAKE_WARNING)); intent.putParcelableArrayListExtra(CellBroadcastAlertService.SMS_CB_MESSAGE_EXTRA, new ArrayList<>(mMessageList)); activity.onNewIntent(intent); verify(mMockedNotificationManager, atLeastOnce()).cancel( eq(CellBroadcastAlertService.NOTIFICATION_ID)); + assertNotNull(image.getLayoutParams()); } public void testAnimationHandler() throws Throwable { diff --git a/tests/unit/src/com/android/cellbroadcastreceiver/unit/CellBroadcastAlertReminderTest.java b/tests/unit/src/com/android/cellbroadcastreceiver/unit/CellBroadcastAlertReminderTest.java index 307cc2734..074ebe547 100644 --- a/tests/unit/src/com/android/cellbroadcastreceiver/unit/CellBroadcastAlertReminderTest.java +++ b/tests/unit/src/com/android/cellbroadcastreceiver/unit/CellBroadcastAlertReminderTest.java @@ -26,6 +26,7 @@ import static org.mockito.Mockito.verify; import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; +import android.media.AudioAttributes; import android.media.AudioManager; import android.os.HandlerThread; import android.preference.PreferenceManager; @@ -120,7 +121,7 @@ public class CellBroadcastAlertReminderTest extends phoneStateListenerHandler.start(); waitUntilReady(); - verify(mMockedVibrator).vibrate(any()); + verify(mMockedVibrator).vibrate(any(), (AudioAttributes) any()); phoneStateListenerHandler.quit(); } @@ -140,7 +141,7 @@ public class CellBroadcastAlertReminderTest extends phoneStateListenerHandler.start(); waitUntilReady(); - verify(mMockedVibrator, never()).vibrate(any()); + verify(mMockedVibrator, never()).vibrate(any(), (AudioAttributes) any()); phoneStateListenerHandler.quit(); } diff --git a/tests/unit/src/com/android/cellbroadcastreceiver/unit/CellBroadcastReceiverTest.java b/tests/unit/src/com/android/cellbroadcastreceiver/unit/CellBroadcastReceiverTest.java index 5c444b6d8..10ae3ad74 100644 --- a/tests/unit/src/com/android/cellbroadcastreceiver/unit/CellBroadcastReceiverTest.java +++ b/tests/unit/src/com/android/cellbroadcastreceiver/unit/CellBroadcastReceiverTest.java @@ -649,6 +649,18 @@ public class CellBroadcastReceiverTest extends CellBroadcastTest { verify(mCellBroadcastReceiver, times(6)).startConfigServiceToEnableChannels(); assertThat(mFakeSharedPreferences.getString( "roaming_operator_supported", "321")).isEqualTo(""); + + // roaming to network operator with different mcc and configured as any mcc match, + // verify to update the network operator, and call enable channel + doReturn("310240").when(mMockTelephonyManager).getNetworkOperator(); + doReturn("310260").when(mMockTelephonyManager).getSimOperator(); + doReturn(new String[] {"XXX"}).when(mResources).getStringArray(anyInt()); + + mCellBroadcastReceiver.onReceive(mContext, mIntent); + + verify(mCellBroadcastReceiver, times(6)).startConfigServiceToEnableChannels(); + assertThat(mFakeSharedPreferences.getString( + "roaming_operator_supported", "")).isEqualTo(""); } @Test diff --git a/tests/unit/src/com/android/cellbroadcastreceiver/unit/CellBroadcastSettingsTest.java b/tests/unit/src/com/android/cellbroadcastreceiver/unit/CellBroadcastSettingsTest.java index b566f33f7..367f04402 100644 --- a/tests/unit/src/com/android/cellbroadcastreceiver/unit/CellBroadcastSettingsTest.java +++ b/tests/unit/src/com/android/cellbroadcastreceiver/unit/CellBroadcastSettingsTest.java @@ -30,6 +30,7 @@ import static org.mockito.Mockito.never; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; +import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; @@ -42,6 +43,7 @@ import android.support.test.uiautomator.UiDevice; import android.telephony.SubscriptionInfo; import android.telephony.SubscriptionManager; +import androidx.preference.Preference; import androidx.preference.PreferenceManager; import androidx.preference.TwoStatePreference; import androidx.test.InstrumentationRegistry; @@ -62,6 +64,7 @@ import org.mockito.Captor; import org.mockito.Mock; import org.mockito.MockitoAnnotations; +import java.lang.reflect.Field; import java.util.Locale; @@ -70,6 +73,13 @@ public class CellBroadcastSettingsTest extends private UiDevice mDevice; private static final long DEVICE_WAIT_TIME = 1000L; + private static final String ROAMING_OPERATOR_SUPPORTED = "roaming_operator_supported"; + private static final String ACTION_TESTING_MODE_CHANGED = + "com.android.cellbroadcastreceiver.intent.ACTION_TESTING_MODE_CHANGED"; + private static final String TESTING_MODE = "testing_mode"; + private static final int PREFERENCE_PUT_TYPE_BOOL = 0; + private static final int PREFERENCE_PUT_TYPE_STRING = 1; + private static final long TEST_TIMEOUT_MILLIS = 1000L; @Captor private ArgumentCaptor<Intent> mIntent; @@ -345,4 +355,106 @@ public class CellBroadcastSettingsTest extends assertFalse(extremeCheckBox.isEnabled()); } + + @Test + public void testTopIntroductionForRoamingSupport() throws Throwable { + String topIntroRoamingText = "test"; + doReturn(topIntroRoamingText).when(mContext.getResources()).getString( + eq(R.string.top_intro_roaming_text)); + setSubscriptionManager(); + setPreference(PREFERENCE_PUT_TYPE_STRING, ROAMING_OPERATOR_SUPPORTED, "XXX"); + + CellBroadcastSettings settings = startActivity(); + + Preference topIntroPreference = settings.mCellBroadcastSettingsFragment.findPreference( + CellBroadcastSettings.KEY_PREFS_TOP_INTRO); + assertEquals(topIntroRoamingText, topIntroPreference.getTitle().toString()); + } + + @Test + public void testDoNotShowTestCheckBox() throws Throwable { + setSubscriptionManager(); + setPreference(PREFERENCE_PUT_TYPE_BOOL, TESTING_MODE, "false"); + doReturn(false).when(mContext.getResources()).getBoolean( + eq(R.bool.show_separate_exercise_settings)); + doReturn(false).when(mContext.getResources()).getBoolean( + eq(R.bool.show_separate_operator_defined_settings)); + CellBroadcastSettings settings = startActivity(); + + TwoStatePreference exerciseTestCheckBox = + settings.mCellBroadcastSettingsFragment.findPreference( + CellBroadcastSettings.KEY_ENABLE_EXERCISE_ALERTS); + TwoStatePreference operatorDefinedCheckBox = + settings.mCellBroadcastSettingsFragment.findPreference( + CellBroadcastSettings.KEY_OPERATOR_DEFINED_ALERTS); + + // received the ACTION_TESTING_MODE_CHANGED, do not show exerciseTestCheckBox & + // operatorDefinedCheckBox + Field fieldTestingModeChangedReceiver = + CellBroadcastSettings.CellBroadcastSettingsFragment.class.getDeclaredField( + "mTestingModeChangedReceiver"); + fieldTestingModeChangedReceiver.setAccessible(true); + BroadcastReceiver broadcastReceiver = + (BroadcastReceiver) fieldTestingModeChangedReceiver.get( + settings.mCellBroadcastSettingsFragment); + broadcastReceiver.onReceive(mContext, new Intent().setAction(ACTION_TESTING_MODE_CHANGED)); + + assertFalse(exerciseTestCheckBox.isVisible()); + assertFalse(operatorDefinedCheckBox.isVisible()); + } + + @Test + public void testShowTestCheckBox() throws Throwable { + setSubscriptionManager(); + setPreference(PREFERENCE_PUT_TYPE_BOOL, TESTING_MODE, "true"); + doReturn(true).when(mContext.getResources()).getBoolean( + eq(R.bool.show_separate_exercise_settings)); + doReturn(true).when(mContext.getResources()).getBoolean( + eq(R.bool.show_separate_operator_defined_settings)); + CellBroadcastSettings settings = startActivity(); + + TwoStatePreference exerciseTestCheckBox = + settings.mCellBroadcastSettingsFragment.findPreference( + CellBroadcastSettings.KEY_ENABLE_EXERCISE_ALERTS); + TwoStatePreference operatorDefinedCheckBox = + settings.mCellBroadcastSettingsFragment.findPreference( + CellBroadcastSettings.KEY_OPERATOR_DEFINED_ALERTS); + + // received the ACTION_TESTING_MODE_CHANGED, show exerciseTestCheckBox & + // operatorDefinedCheckBox + Field fieldTestingModeChangedReceiver = + CellBroadcastSettings.CellBroadcastSettingsFragment.class.getDeclaredField( + "mTestingModeChangedReceiver"); + fieldTestingModeChangedReceiver.setAccessible(true); + BroadcastReceiver broadcastReceiver = + (BroadcastReceiver) fieldTestingModeChangedReceiver.get( + settings.mCellBroadcastSettingsFragment); + broadcastReceiver.onReceive(mContext, new Intent().setAction(ACTION_TESTING_MODE_CHANGED)); + + waitForChange(() -> exerciseTestCheckBox.isVisible(), TEST_TIMEOUT_MILLIS); + assertTrue(exerciseTestCheckBox.isVisible()); + waitForChange(() -> operatorDefinedCheckBox.isVisible(), TEST_TIMEOUT_MILLIS); + assertTrue(operatorDefinedCheckBox.isVisible()); + } + + private void setSubscriptionManager() { + SubscriptionManager mockSubManager = mock(SubscriptionManager.class); + injectSystemService(SubscriptionManager.class, mockSubManager); + SubscriptionInfo mockSubInfo = mock(SubscriptionInfo.class); + doReturn(mockSubInfo).when(mockSubManager).getActiveSubscriptionInfo(anyInt()); + } + + private void setPreference(int putType, String key, String value) { + mContext.injectSharedPreferences(mFakeSharedPreferences); + switch (putType) { + case PREFERENCE_PUT_TYPE_BOOL: + PreferenceManager.getDefaultSharedPreferences(mContext).edit() + .putBoolean(key, Boolean.valueOf(value)).apply(); + break; + case PREFERENCE_PUT_TYPE_STRING: + PreferenceManager.getDefaultSharedPreferences(mContext).edit() + .putString(key, value).apply(); + break; + } + } } |