From 1835f13c4eac260be66c0b0766ec314671e82f12 Mon Sep 17 00:00:00 2001 From: Zoey Chen Date: Thu, 15 Apr 2021 17:45:27 +0800 Subject: [PATCH] [Telephoy] Add phone Id to support DSDS Bug: 185451283 Test: atest TelephonyRegistryTest Change-Id: I6bf2285e37366ca517a3ea16194a203371e44964 --- core/java/android/telephony/TelephonyRegistryManager.java | 7 ++++--- .../com/android/internal/telephony/ITelephonyRegistry.aidl | 2 +- .../core/java/com/android/server/TelephonyRegistry.java | 6 +++--- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/core/java/android/telephony/TelephonyRegistryManager.java b/core/java/android/telephony/TelephonyRegistryManager.java index 340fa406bbb7e..4b18c5aae614d 100644 --- a/core/java/android/telephony/TelephonyRegistryManager.java +++ b/core/java/android/telephony/TelephonyRegistryManager.java @@ -796,13 +796,14 @@ public class TelephonyRegistryManager { /** * Notify {@link PhysicalChannelConfig} has changed for a specific subscription. * + * @param slotIndex for which physical channel configs changed. * @param subId the subId * @param configs a list of {@link PhysicalChannelConfig}, the configs of physical channel. */ - public void notifyPhysicalChannelConfigForSubscriber( - int subId, List configs) { + public void notifyPhysicalChannelConfigForSubscriber(int slotIndex, int subId, + List configs) { try { - sRegistry.notifyPhysicalChannelConfigForSubscriber(subId, configs); + sRegistry.notifyPhysicalChannelConfigForSubscriber(slotIndex, subId, configs); } catch (RemoteException ex) { // system server crash } diff --git a/core/java/com/android/internal/telephony/ITelephonyRegistry.aidl b/core/java/com/android/internal/telephony/ITelephonyRegistry.aidl index e438d39e42f64..a0a0f3276b99e 100644 --- a/core/java/com/android/internal/telephony/ITelephonyRegistry.aidl +++ b/core/java/com/android/internal/telephony/ITelephonyRegistry.aidl @@ -92,7 +92,7 @@ interface ITelephonyRegistry { void notifyRegistrationFailed(int slotIndex, int subId, in CellIdentity cellIdentity, String chosenPlmn, int domain, int causeCode, int additionalCauseCode); void notifyBarringInfoChanged(int slotIndex, int subId, in BarringInfo barringInfo); - void notifyPhysicalChannelConfigForSubscriber(in int subId, + void notifyPhysicalChannelConfigForSubscriber(in int phoneId, in int subId, in List configs); void notifyDataEnabled(in int phoneId, int subId, boolean enabled, int reason); void notifyAllowedNetworkTypesChanged(in int phoneId, in int subId, in int reason, in long allowedNetworkType); diff --git a/services/core/java/com/android/server/TelephonyRegistry.java b/services/core/java/com/android/server/TelephonyRegistry.java index 98bfa28d64159..2d486c47d3c81 100644 --- a/services/core/java/com/android/server/TelephonyRegistry.java +++ b/services/core/java/com/android/server/TelephonyRegistry.java @@ -2551,11 +2551,12 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub { * Send a notification to registrants that the configs of physical channel has changed for * a particular subscription. * + * @param phoneId the phone id. * @param subId the subId * @param configs a list of {@link PhysicalChannelConfig}, the configs of physical channel. */ - public void notifyPhysicalChannelConfigForSubscriber( - int subId, List configs) { + public void notifyPhysicalChannelConfigForSubscriber(int phoneId, int subId, + List configs) { if (!checkNotifyPermission("notifyPhysicalChannelConfig()")) { return; } @@ -2567,7 +2568,6 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub { } synchronized (mRecords) { - int phoneId = SubscriptionManager.getPhoneId(subId); if (validatePhoneId(phoneId)) { mPhysicalChannelConfigs.set(phoneId, configs); for (Record r : mRecords) {