Use supported locale replace the result from sim info.
- Current sim locale use Sim info to get corresponding sim locale, but
it may not completely match current supported locale.
e.g.
The result of TelephonyManager#getSimLocale is zh-TW.
Supported lcoale only has zh-Hant-TW.
- Hence, when SetupWizard use TelephonyManager#getSimLocale, it will
set a non-matched locale to device and make user confuse.
Bug: b/244017408
Test: atest passed
Test: Maunal test passed
Change-Id: Id29bd66c14d7a5415b3d5b2905a2301846780c70
diff --git a/tests/src/com/android/TelephonyTestBase.java b/tests/src/com/android/TelephonyTestBase.java
index 09abb15..ffda81b 100644
--- a/tests/src/com/android/TelephonyTestBase.java
+++ b/tests/src/com/android/TelephonyTestBase.java
@@ -24,7 +24,9 @@
import com.android.internal.telephony.PhoneConfigurationManager;
-import org.mockito.MockitoAnnotations;
+import org.junit.Rule;
+import org.mockito.junit.MockitoJUnit;
+import org.mockito.junit.MockitoRule;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.Executor;
@@ -34,11 +36,11 @@
* Helper class to load Mockito Resources into a test.
*/
public class TelephonyTestBase {
+ @Rule public final MockitoRule mocks = MockitoJUnit.rule();
protected TestContext mContext;
public void setUp() throws Exception {
- MockitoAnnotations.initMocks(this);
mContext = spy(new TestContext());
// Set up the looper if it does not exist on the test thread.
if (Looper.myLooper() == null) {