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

Commit d8d659ca authored by Nagendra Prasad Nagarle Basavaraju's avatar Nagendra Prasad Nagarle Basavaraju Committed by Android (Google) Code Review
Browse files

Merge "Flagging requirement for notifyDataActivitychanged" into main

parents 80ec6311 6c946443
Loading
Loading
Loading
Loading
+18 −2
Original line number Diff line number Diff line
@@ -487,19 +487,35 @@ public class TelephonyRegistryManager {
        }
    }

    /**
     * Notify changes to activity state changes on certain subscription.
     *
     * @param subId for which data activity state changed.
     * @param dataActivityType indicates the latest data activity type e.g. {@link
     * TelephonyManager#DATA_ACTIVITY_IN}
     */
    public void notifyDataActivityChanged(int subId, @DataActivityType int dataActivityType) {
        try {
            sRegistry.notifyDataActivityForSubscriber(subId, dataActivityType);
        } catch (RemoteException ex) {
            // system process is dead
            throw ex.rethrowFromSystemServer();
        }
    }

    /**
     * Notify changes to activity state changes on certain subscription.
     *
     * @param slotIndex for which data activity changed. Can be derived from subId except
     * when subId is invalid.
     * @param subId for which data activity state changed.
     * @param dataActivityType indicates the latest data activity type e.g, {@link
     * @param dataActivityType indicates the latest data activity type e.g. {@link
     * TelephonyManager#DATA_ACTIVITY_IN}
     */
    public void notifyDataActivityChanged(int slotIndex, int subId,
            @DataActivityType int dataActivityType) {
        try {
            sRegistry.notifyDataActivityForSubscriber(slotIndex, subId, dataActivityType);
            sRegistry.notifyDataActivityForSubscriberWithSlot(slotIndex, subId, dataActivityType);
        } catch (RemoteException ex) {
            // system process is dead
            throw ex.rethrowFromSystemServer();
+2 −1
Original line number Diff line number Diff line
@@ -60,7 +60,8 @@ interface ITelephonyRegistry {
    @UnsupportedAppUsage(maxTargetSdk = 28)
    void notifyCallForwardingChanged(boolean cfi);
    void notifyCallForwardingChangedForSubscriber(in int subId, boolean cfi);
    void notifyDataActivityForSubscriber(int phoneId, int subId, int state);
    void notifyDataActivityForSubscriber(int subId, int state);
    void notifyDataActivityForSubscriberWithSlot(int phoneId, int subId, int state);
    void notifyDataConnectionForSubscriber(
            int phoneId, int subId, in PreciseDataConnectionState preciseState);
    // Uses CellIdentity which is Parcelable here; will convert to CellLocation in client.
+36 −2
Original line number Diff line number Diff line
@@ -2096,16 +2096,50 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
    /**
     * Send a notification to registrants about the data activity state.
     *
     * @param phoneId the phoneId carrying the data connection
     * @param subId the subscriptionId for the data connection
     * @param state indicates the latest data activity type
     * e.g.,{@link TelephonyManager#DATA_ACTIVITY_IN}
     *
     */
    public void notifyDataActivityForSubscriber(int phoneId, int subId, int state) {

    public void notifyDataActivityForSubscriber(int subId, int state) {
        if (!checkNotifyPermission("notifyDataActivity()")) {
            return;
        }
        int phoneId = getPhoneIdFromSubId(subId);
        synchronized (mRecords) {
            if (validatePhoneId(phoneId)) {
                mDataActivity[phoneId] = state;
                for (Record r : mRecords) {
                    // Notify by correct subId.
                    if (r.matchTelephonyCallbackEvent(
                            TelephonyCallback.EVENT_DATA_ACTIVITY_CHANGED)
                            && idMatch(r, subId, phoneId)) {
                        try {
                            r.callback.onDataActivity(state);
                        } catch (RemoteException ex) {
                            mRemoveList.add(r.binder);
                        }
                    }
                }
            }
            handleRemoveListLocked();
        }
    }

    /**
     * Send a notification to registrants about the data activity state.
     *
     * @param phoneId the phoneId carrying the data connection
     * @param subId the subscriptionId for the data connection
     * @param state indicates the latest data activity type
     * e.g.,{@link TelephonyManager#DATA_ACTIVITY_IN}
     *
     */
    public void notifyDataActivityForSubscriberWithSlot(int phoneId, int subId, int state) {
        if (!checkNotifyPermission("notifyDataActivityWithSlot()")) {
            return;
        }

        synchronized (mRecords) {
            if (validatePhoneId(phoneId)) {