Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ab557c98 authored by Jordan Liu's avatar Jordan Liu
Browse files

Use SubscriptionId instead of SubId

Rename the methods and arguments in ServiceStateTable to use
SubscriptionId instead of SubId.

Fixes: 35766624
Test: Existing unit tests pass
Change-Id: Ic837535b431c19d952e065b742d678152afafd57
Merged-In: Ic837535b431c19d952e065b742d678152afafd57
parent ad9c0373
Loading
Loading
Loading
Loading
+7 −6
Original line number Diff line number Diff line
@@ -3007,12 +3007,12 @@ public final class Telephony {
         * Note, however, that using a {@link JobService} does not guarantee timely delivery of
         * updates to the {@link Uri}.
         *
         * @param subId the subId to receive updates on
         * @param subscriptionId the subscriptionId to receive updates on
         * @param field the ServiceState field to receive updates on
         * @return the Uri used to observe {@link ServiceState} changes
         */
        public static Uri getUriForSubIdAndField(int subId, String field) {
            return CONTENT_URI.buildUpon().appendEncodedPath(String.valueOf(subId))
        public static Uri getUriForSubscriptionIdAndField(int subscriptionId, String field) {
            return CONTENT_URI.buildUpon().appendEncodedPath(String.valueOf(subscriptionId))
                    .appendEncodedPath(field).build();
        }

@@ -3026,11 +3026,12 @@ public final class Telephony {
         * Note, however, that using a {@link JobService} does not guarantee timely delivery of
         * updates to the {@link Uri}.
         *
         * @param subId the subId to receive updates on
         * @param subscriptionId the subscriptionId to receive updates on
         * @return the Uri used to observe {@link ServiceState} changes
         */
        public static Uri getUriForSubId(int subId) {
            return CONTENT_URI.buildUpon().appendEncodedPath(String.valueOf(subId)).build();
        public static Uri getUriForSubscriptionId(int subscriptionId) {
            return CONTENT_URI.buildUpon()
                    .appendEncodedPath(String.valueOf(subscriptionId)).build();
        }

        /**
+4 −3
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@
package com.android.internal.telephony;

import static android.provider.Telephony.ServiceStateTable.getContentValuesForServiceState;
import static android.provider.Telephony.ServiceStateTable.getUriForSubId;
import static android.provider.Telephony.ServiceStateTable.getUriForSubscriptionId;

import static com.android.internal.telephony.CarrierActionAgent.CARRIER_ACTION_SET_RADIO_ENABLED;

@@ -2859,7 +2859,8 @@ public class ServiceStateTracker extends Handler {
            mPhone.notifyServiceStateChanged(mSS);

            // insert into ServiceStateProvider. This will trigger apps to wake through JobScheduler
            mPhone.getContext().getContentResolver().insert(getUriForSubId(mPhone.getSubId()),
            mPhone.getContext().getContentResolver()
                    .insert(getUriForSubscriptionId(mPhone.getSubId()),
                            getContentValuesForServiceState(mSS));

            TelephonyMetrics.getInstance().writeServiceStateChanged(mPhone.getPhoneId(), mSS);