From ce65922c734521197a2e2f1f5441f0c4d85dbec2 Mon Sep 17 00:00:00 2001 From: andychou Date: Wed, 19 Jun 2019 20:54:32 +0800 Subject: [PATCH] Notify physical channel configuration with phoneId and subId Physical channel configuration may be retrieved before SIM loaded. So configuration will not be able to report via TelephonyRegistry. Therefore, use phoneId to mapping record and notify Bug: 123904518 Test: Manual test and make sure physical channel configuration is displayed in RadioInfo Change-Id: I11c89b9cf68c3f3d7523ad8dfc21520f44fa7ce3 --- .../java/com/android/server/TelephonyRegistry.java | 14 ++++++-------- .../internal/telephony/ITelephonyRegistry.aidl | 3 +-- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/services/core/java/com/android/server/TelephonyRegistry.java b/services/core/java/com/android/server/TelephonyRegistry.java index 1a6faecaecfd6..e66e596d5038c 100644 --- a/services/core/java/com/android/server/TelephonyRegistry.java +++ b/services/core/java/com/android/server/TelephonyRegistry.java @@ -1255,23 +1255,21 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub { } } - public void notifyPhysicalChannelConfiguration(List configs) { - notifyPhysicalChannelConfigurationForSubscriber(SubscriptionManager.DEFAULT_SUBSCRIPTION_ID, - configs); - } - - public void notifyPhysicalChannelConfigurationForSubscriber(int subId, + /** + * Notify physical channel configuration according to subscripton ID and phone ID + */ + public void notifyPhysicalChannelConfigurationForSubscriber(int phoneId, int subId, List configs) { if (!checkNotifyPermission("notifyPhysicalChannelConfiguration()")) { return; } if (VDBG) { - log("notifyPhysicalChannelConfiguration: subId=" + subId + " configs=" + configs); + log("notifyPhysicalChannelConfiguration: subId=" + subId + " phoneId=" + phoneId + + " configs=" + configs); } synchronized (mRecords) { - int phoneId = SubscriptionManager.getPhoneId(subId); if (validatePhoneId(phoneId)) { mPhysicalChannelConfigs.set(phoneId, configs); for (Record r : mRecords) { diff --git a/telephony/java/com/android/internal/telephony/ITelephonyRegistry.aidl b/telephony/java/com/android/internal/telephony/ITelephonyRegistry.aidl index f2f3c2d85fd42..dc026d48c6cfe 100644 --- a/telephony/java/com/android/internal/telephony/ITelephonyRegistry.aidl +++ b/telephony/java/com/android/internal/telephony/ITelephonyRegistry.aidl @@ -68,8 +68,7 @@ interface ITelephonyRegistry { void notifyOtaspChanged(in int subId, in int otaspMode); @UnsupportedAppUsage void notifyCellInfo(in List cellInfo); - void notifyPhysicalChannelConfiguration(in List configs); - void notifyPhysicalChannelConfigurationForSubscriber(in int subId, + void notifyPhysicalChannelConfigurationForSubscriber(in int phoneId, in int subId, in List configs); void notifyPreciseCallState(int phoneId, int subId, int ringingCallState, int foregroundCallState, int backgroundCallState);