[RESTRICT AUTOMERGE] Use mTelephonyManager to test the testHasCarrierPrivileges()

The TelephonyManager instance returned by TelephonyManager.getDefault()
has no valid subId, and will cause the testHasCarrierPrivileges() to
pass with UICC SIM card.

Bug: 123239506
Test: run cts -m CtsTelephonyTestCases -t android.telephony.cts.SimRestrictedApisTest

Merged-in: I4077e96af3f9502310ce69a0df1506676773d24b
Change-Id: I4077e96af3f9502310ce69a0df1506676773d24b
(cherry picked from commit 3e5ade9df8c3b0a1fd09a4762433b943a01e0902)
diff --git a/tests/tests/telephony/src/android/telephony/cts/SimRestrictedApisTest.java b/tests/tests/telephony/src/android/telephony/cts/SimRestrictedApisTest.java
index 61c02db..e370a75 100644
--- a/tests/tests/telephony/src/android/telephony/cts/SimRestrictedApisTest.java
+++ b/tests/tests/telephony/src/android/telephony/cts/SimRestrictedApisTest.java
@@ -247,7 +247,7 @@
      * Tests that the test apk doesn't have carrier previliges.
      */
     public void testHasCarrierPrivileges() {
-        if (TelephonyManager.getDefault().hasCarrierPrivileges()) {
+        if (mTelephonyManager.hasCarrierPrivileges()) {
             fail("App unexpectedly has carrier privileges");
         }
     }