Merge "Add mock modem service operations in Telephony"
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index f12ac52..a2ee607 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -239,6 +239,7 @@
<uses-permission android:name="android.permission.READ_PROJECTION_STATE"/>
<!-- Needed to access TelephonyProvider SIMINFO table. -->
<uses-permission android:name="android.permission.ACCESS_TELEPHONY_SIMINFO_DB"/>
+ <uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<permission android:name="com.android.phone.permission.ACCESS_LAST_KNOWN_CELL_ID"
android:label="Access last known cell identity."
diff --git a/src/com/android/phone/CarrierConfigLoader.java b/src/com/android/phone/CarrierConfigLoader.java
index 45ca974..8a007b6 100644
--- a/src/com/android/phone/CarrierConfigLoader.java
+++ b/src/com/android/phone/CarrierConfigLoader.java
@@ -349,7 +349,7 @@
try {
ICarrierService carrierService =
ICarrierService.Stub.asInterface(conn.service);
- carrierService.getCarrierConfig(carrierId, resultReceiver);
+ carrierService.getCarrierConfig(phoneId, carrierId, resultReceiver);
logdWithLocalLog("Fetch config for default app: "
+ mPlatformCarrierConfigPackage
+ " carrierid: " + carrierId.toString());
@@ -489,7 +489,7 @@
try {
ICarrierService carrierService =
ICarrierService.Stub.asInterface(conn.service);
- carrierService.getCarrierConfig(carrierId, resultReceiver);
+ carrierService.getCarrierConfig(phoneId, carrierId, resultReceiver);
logdWithLocalLog("Fetch config for carrier app: "
+ getCarrierPackageForPhoneId(phoneId)
+ " carrierid: " + carrierId.toString());
@@ -657,7 +657,7 @@
try {
ICarrierService carrierService =
ICarrierService.Stub.asInterface(conn.service);
- carrierService.getCarrierConfig(null, resultReceiver);
+ carrierService.getCarrierConfig(phoneId, null, resultReceiver);
logdWithLocalLog("Fetch no sim config from default app: "
+ mPlatformCarrierConfigPackage);
} catch (RemoteException e) {
diff --git a/src/com/android/phone/settings/RadioInfo.java b/src/com/android/phone/settings/RadioInfo.java
index 17adef3..6728138 100644
--- a/src/com/android/phone/settings/RadioInfo.java
+++ b/src/com/android/phone/settings/RadioInfo.java
@@ -1125,24 +1125,28 @@
& TelephonyManager.NETWORK_TYPE_BITMASK_NR) == 0) {
return;
}
-
ServiceState ss = serviceState;
if (ss == null && mPhone != null) {
ss = mPhone.getServiceState();
}
if (ss != null) {
+ boolean isNrSa = ss.getDataNetworkType() == TelephonyManager.NETWORK_TYPE_NR;
NetworkRegistrationInfo nri = ss.getNetworkRegistrationInfo(
NetworkRegistrationInfo.DOMAIN_PS, AccessNetworkConstants.TRANSPORT_TYPE_WWAN);
if (nri != null) {
DataSpecificRegistrationInfo dsri = nri.getDataSpecificInfo();
if (dsri != null) {
- mEndcAvailable.setText(dsri.isEnDcAvailable ? "True" : "False");
- mDcnrRestricted.setText(dsri.isDcNrRestricted ? "True" : "False");
- mNrAvailable.setText(dsri.isNrAvailable ? "True" : "False");
+ mEndcAvailable.setText(isNrSa ? "N/A"
+ : dsri.isEnDcAvailable ? "True" : "False");
+ mDcnrRestricted.setText(isNrSa ? "N/A"
+ : dsri.isDcNrRestricted ? "True" : "False");
+ mNrAvailable.setText(isNrSa ? "N/A" : dsri.isNrAvailable ? "True" : "False");
}
}
- mNrState.setText(NetworkRegistrationInfo.nrStateToString(ss.getNrState()));
- mNrFrequency.setText(ServiceState.frequencyRangeToString(ss.getNrFrequencyRange()));
+ mNrState.setText(isNrSa ? "N/A"
+ : NetworkRegistrationInfo.nrStateToString(ss.getNrState()));
+ mNrFrequency.setText(isNrSa ? "N/A"
+ : ServiceState.frequencyRangeToString(ss.getNrFrequencyRange()));
}
Executor simpleExecutor = (r) -> r.run();