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

Commit a6110193 authored by Automerger Merge Worker's avatar Automerger Merge Worker
Browse files

Merge "Use Parcelable CellIdentity instead of CellLocation in AIDL." am: 9bda007c am: a8810053

Change-Id: I14834c28abb17cdc0397950470e45f4e73462dff
parents 870ca866 a8810053
Loading
Loading
Loading
Loading
+28 −0
Original line number Diff line number Diff line
@@ -8126,6 +8126,34 @@ package android.telephony {
    field public static final String CELL_BROADCAST_SERVICE_INTERFACE = "android.telephony.CellBroadcastService";
  }
  public abstract class CellIdentity implements android.os.Parcelable {
    method @NonNull public abstract android.telephony.CellLocation asCellLocation();
  }
  public final class CellIdentityCdma extends android.telephony.CellIdentity {
    method @NonNull public android.telephony.cdma.CdmaCellLocation asCellLocation();
  }
  public final class CellIdentityGsm extends android.telephony.CellIdentity {
    method @NonNull public android.telephony.gsm.GsmCellLocation asCellLocation();
  }
  public final class CellIdentityLte extends android.telephony.CellIdentity {
    method @NonNull public android.telephony.gsm.GsmCellLocation asCellLocation();
  }
  public final class CellIdentityNr extends android.telephony.CellIdentity {
    method @NonNull public android.telephony.CellLocation asCellLocation();
  }
  public final class CellIdentityTdscdma extends android.telephony.CellIdentity {
    method @NonNull public android.telephony.gsm.GsmCellLocation asCellLocation();
  }
  public final class CellIdentityWcdma extends android.telephony.CellIdentity {
    method @NonNull public android.telephony.gsm.GsmCellLocation asCellLocation();
  }
  public final class DataFailCause {
    field public static final int ACCESS_ATTEMPT_ALREADY_IN_PROGRESS = 2219; // 0x8ab
    field public static final int ACCESS_BLOCK = 2087; // 0x827
+5 −3
Original line number Diff line number Diff line
@@ -24,7 +24,6 @@ import android.annotation.TestApi;
import android.annotation.UnsupportedAppUsage;
import android.os.Binder;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.HandlerExecutor;
import android.os.Looper;
@@ -984,8 +983,11 @@ public class PhoneStateListener {
                    () -> mExecutor.execute(() -> psl.onCallForwardingIndicatorChanged(cfi)));
        }

        public void onCellLocationChanged(Bundle bundle) {
            CellLocation location = CellLocation.newFromBundle(bundle);
        public void onCellLocationChanged(CellIdentity cellIdentity) {
            // There is no system/public API to create an CellIdentity in system server,
            // so the server pass a null to indicate an empty initial location.
            CellLocation location =
                    cellIdentity == null ? CellLocation.getEmpty() : cellIdentity.asCellLocation();
            PhoneStateListener psl = mPhoneStateListenerWeakRef.get();
            if (psl == null) return;

+6 −5
Original line number Diff line number Diff line
@@ -22,9 +22,6 @@ import android.annotation.SystemApi;
import android.annotation.TestApi;
import android.content.Context;
import android.os.Binder;
import android.os.Bundle;
import android.os.Handler;
import android.os.HandlerExecutor;
import android.os.RemoteException;
import android.os.ServiceManager;
import android.telephony.Annotation.CallState;
@@ -642,10 +639,14 @@ public class TelephonyRegistryManager {
    }

    /**
     * TODO change from bundle to CellLocation?
     * Notify {@link android.telephony.CellLocation} changed.
     *
     * <p>To be compatible with {@link TelephonyRegistry}, use {@link CellIdentity} which is
     * parcelable, and convert to CellLocation in client code.
     *
     * @hide
     */
    public void notifyCellLocation(int subId, Bundle cellLocation) {
    public void notifyCellLocation(int subId, CellIdentity cellLocation) {
        try {
            sRegistry.notifyCellLocationForSubscriber(subId, cellLocation);
        } catch (RemoteException ex) {
+3 −4
Original line number Diff line number Diff line
@@ -16,8 +16,8 @@

package com.android.internal.telephony;

import android.os.Bundle;
import android.telephony.CallAttributes;
import android.telephony.CellIdentity;
import android.telephony.CellInfo;
import android.telephony.DataConnectionRealTimeInfo;
import android.telephony.PhoneCapability;
@@ -37,8 +37,8 @@ oneway interface IPhoneStateListener {
    void onMessageWaitingIndicatorChanged(boolean mwi);
    void onCallForwardingIndicatorChanged(boolean cfi);

    // we use bundle here instead of CellLocation so it can get the right subclass
    void onCellLocationChanged(in Bundle location);
    // Uses CellIdentity which is Parcelable here; will convert to CellLocation in client.
    void onCellLocationChanged(in CellIdentity location);
    void onCallStateChanged(int state, String incomingNumber);
    void onDataConnectionStateChanged(int state, int networkType);
    void onDataActivity(int direction);
@@ -63,4 +63,3 @@ oneway interface IPhoneStateListener {
    void onCallDisconnectCauseChanged(in int disconnectCause, in int preciseDisconnectCause);
    void onImsCallDisconnectCauseChanged(in ImsReasonInfo imsReasonInfo);
}
+4 −4
Original line number Diff line number Diff line
@@ -19,8 +19,8 @@ package com.android.internal.telephony;
import android.content.Intent;
import android.net.LinkProperties;
import android.net.NetworkCapabilities;
import android.os.Bundle;
import android.telephony.CallQuality;
import android.telephony.CellIdentity;
import android.telephony.CellInfo;
import android.telephony.ims.ImsReasonInfo;
import android.telephony.PhoneCapability;
@@ -67,9 +67,9 @@ interface ITelephonyRegistry {
    @UnsupportedAppUsage
    void notifyDataConnectionFailed(String apnType);
    void notifyDataConnectionFailedForSubscriber(int phoneId, int subId, String apnType);
    @UnsupportedAppUsage(maxTargetSdk = 28)
    void notifyCellLocation(in Bundle cellLocation);
    void notifyCellLocationForSubscriber(in int subId, in Bundle cellLocation);
    // Uses CellIdentity which is Parcelable here; will convert to CellLocation in client.
    void notifyCellLocation(in CellIdentity cellLocation);
    void notifyCellLocationForSubscriber(in int subId, in CellIdentity cellLocation);
    @UnsupportedAppUsage
    void notifyCellInfo(in List<CellInfo> cellInfo);
    void notifyPreciseCallState(int phoneId, int subId, int ringingCallState,
Loading