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

Commit 4f42d17a authored by Meng Wang's avatar Meng Wang Committed by Gerrit Code Review
Browse files

Merge "Use Parcelable CellIdentity instead of CellLocation in AIDL."

parents 263e7e62 3d409015
Loading
Loading
Loading
Loading
+3 −6
Original line number Diff line number Diff line
@@ -19,15 +19,14 @@ package com.android.internal.telephony;
import android.annotation.NonNull;
import android.annotation.UnsupportedAppUsage;
import android.content.Context;
import android.os.Bundle;
import android.os.RemoteException;
import android.os.ServiceManager;
import android.telephony.Annotation.DataFailureCause;
import android.telephony.Annotation.RadioPowerState;
import android.telephony.Annotation.SrvccState;
import android.telephony.CallQuality;
import android.telephony.CellIdentity;
import android.telephony.CellInfo;
import android.telephony.CellLocation;
import android.telephony.PhoneCapability;
import android.telephony.PreciseCallState;
import android.telephony.PreciseDataConnectionState;
@@ -142,11 +141,9 @@ public class DefaultPhoneNotifier implements PhoneNotifier {
    }

    @Override
    public void notifyCellLocation(Phone sender, CellLocation cl) {
    public void notifyCellLocation(Phone sender, CellIdentity cellIdentity) {
        int subId = sender.getSubId();
        Bundle data = new Bundle();
        cl.fillInNotifierBundle(data);
        mTelephonyRegistryMgr.notifyCellLocation(subId, data);
        mTelephonyRegistryMgr.notifyCellLocation(subId, cellIdentity);
    }

    @Override
+1 −1
Original line number Diff line number Diff line
@@ -1538,7 +1538,7 @@ public class GsmCdmaCallTracker extends CallTracker {
                    causeCode == CallFailCause.BEARER_NOT_AVAIL ||
                    causeCode == CallFailCause.ERROR_UNSPECIFIED) {

                    CellLocation loc = mPhone.getCellLocation();
                    CellLocation loc = mPhone.getCellIdentity().asCellLocation();
                    int cid = -1;
                    if (loc != null) {
                        if (loc instanceof GsmCellLocation) {
+7 −7
Original line number Diff line number Diff line
@@ -60,7 +60,7 @@ import android.telecom.TelecomManager;
import android.telecom.VideoProfile;
import android.telephony.AccessNetworkConstants;
import android.telephony.CarrierConfigManager;
import android.telephony.CellLocation;
import android.telephony.CellIdentity;
import android.telephony.DataFailCause;
import android.telephony.ImsiEncryptionInfo;
import android.telephony.NetworkScanRequest;
@@ -522,8 +522,8 @@ public class GsmCdmaPhone extends Phone {
    }

    @Override
    public void getCellLocation(WorkSource workSource, Message rspMsg) {
        mSST.requestCellLocation(workSource, rspMsg);
    public void getCellIdentity(WorkSource workSource, Message rspMsg) {
        mSST.requestCellIdentity(workSource, rspMsg);
    }

    @UnsupportedAppUsage
@@ -811,12 +811,12 @@ public class GsmCdmaPhone extends Phone {
    }

    /**
     * Notify that the CellLocation has changed.
     * Notify that the cell location has changed.
     *
     * @param cl the new CellLocation
     * @param cellIdentity the new CellIdentity
     */
    public void notifyLocationChanged(CellLocation cl) {
        mNotifier.notifyCellLocation(this, cl);
    public void notifyLocationChanged(CellIdentity cellIdentity) {
        mNotifier.notifyCellLocation(this, cellIdentity);
    }

    @Override
+5 −6
Original line number Diff line number Diff line
@@ -45,8 +45,8 @@ import android.telephony.Annotation.ApnType;
import android.telephony.Annotation.DataFailureCause;
import android.telephony.CarrierConfigManager;
import android.telephony.CarrierRestrictionRules;
import android.telephony.CellIdentity;
import android.telephony.CellInfo;
import android.telephony.CellLocation;
import android.telephony.ClientRequestStats;
import android.telephony.ImsiEncryptionInfo;
import android.telephony.PhoneStateListener;
@@ -1864,17 +1864,16 @@ public abstract class Phone extends Handler implements PhoneInternalInterface {
    /**
     * @return the current cell location if known
     */
    @UnsupportedAppUsage
    public CellLocation getCellLocation() {
        return getServiceStateTracker().getCellLocation();
    public CellIdentity getCellIdentity() {
        return getServiceStateTracker().getCellIdentity();
    }

    /**
     * @param workSource calling WorkSource
     * @param rspMsg the response message containing the cell location
     */
    public void getCellLocation(WorkSource workSource, Message rspMsg) {
        getServiceStateTracker().requestCellLocation(workSource, rspMsg);
    public void getCellIdentity(WorkSource workSource, Message rspMsg) {
        getServiceStateTracker().requestCellIdentity(workSource, rspMsg);
    }

    /**
+7 −3
Original line number Diff line number Diff line
@@ -21,8 +21,8 @@ import android.telephony.Annotation.DataFailureCause;
import android.telephony.Annotation.RadioPowerState;
import android.telephony.Annotation.SrvccState;
import android.telephony.CallQuality;
import android.telephony.CellIdentity;
import android.telephony.CellInfo;
import android.telephony.CellLocation;
import android.telephony.PhoneCapability;
import android.telephony.PreciseDataConnectionState;
import android.telephony.emergency.EmergencyNumber;
@@ -39,8 +39,12 @@ public interface PhoneNotifier {

    void notifyServiceState(Phone sender);

    /** Notify registrants of the current CellLocation */
    void notifyCellLocation(Phone sender, CellLocation cl);
    /**
     * Notify registrants of the current CellLocation.
     *
     * <p>Use CellIdentity that is Parcellable to pass AIDL; convert to CellLocation in client code.
     */
    void notifyCellLocation(Phone sender, CellIdentity cellIdentity);

    @UnsupportedAppUsage
    void notifySignalStrength(Phone sender);
Loading