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

Commit 0707378f authored by Zoey Chen's avatar Zoey Chen Committed by Android (Google) Code Review
Browse files

Merge "[5G] Implement Physical Channel Listener"

parents ea870400 bcdb260b
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -48401,7 +48401,8 @@ package android.telephony {
    method public boolean isVoiceCapable();
    method public boolean isVoicemailVibrationEnabled(android.telecom.PhoneAccountHandle);
    method public boolean isWorldPhone();
    method public void listen(android.telephony.PhoneStateListener, int);
    method @Deprecated public void listen(android.telephony.PhoneStateListener, int);
    method public void listen(long, @NonNull android.telephony.PhoneStateListener);
    method @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) public void requestCellInfoUpdate(@NonNull java.util.concurrent.Executor, @NonNull android.telephony.TelephonyManager.CellInfoCallback);
    method @RequiresPermission(allOf={android.Manifest.permission.MODIFY_PHONE_STATE, android.Manifest.permission.ACCESS_FINE_LOCATION}) public android.telephony.NetworkScan requestNetworkScan(android.telephony.NetworkScanRequest, java.util.concurrent.Executor, android.telephony.TelephonyScanManager.NetworkScanCallback);
    method public void sendDialerSpecialCode(String);
+18 −0
Original line number Diff line number Diff line
@@ -10882,6 +10882,7 @@ package android.telephony {
    method @Deprecated public void onOutgoingEmergencyCall(@NonNull android.telephony.emergency.EmergencyNumber);
    method public void onOutgoingEmergencyCall(@NonNull android.telephony.emergency.EmergencyNumber, int);
    method public void onOutgoingEmergencySms(@NonNull android.telephony.emergency.EmergencyNumber);
    method public void onPhysicalChannelConfigurationChanged(@NonNull java.util.List<android.telephony.PhysicalChannelConfig>);
    method @RequiresPermission("android.permission.READ_PRECISE_PHONE_STATE") public void onPreciseCallStateChanged(@NonNull android.telephony.PreciseCallState);
    method public void onRadioPowerStateChanged(int);
    method public void onSrvccStateChanged(int);
@@ -10889,12 +10890,29 @@ package android.telephony {
    field @RequiresPermission("android.permission.READ_PRECISE_PHONE_STATE") public static final int LISTEN_CALL_ATTRIBUTES_CHANGED = 67108864; // 0x4000000
    field @RequiresPermission(android.Manifest.permission.READ_ACTIVE_EMERGENCY_SESSION) public static final int LISTEN_OUTGOING_EMERGENCY_CALL = 268435456; // 0x10000000
    field @RequiresPermission(android.Manifest.permission.READ_ACTIVE_EMERGENCY_SESSION) public static final int LISTEN_OUTGOING_EMERGENCY_SMS = 536870912; // 0x20000000
    field @RequiresPermission(android.Manifest.permission.READ_PRECISE_PHONE_STATE) public static final long LISTEN_PHYSICAL_CHANNEL_CONFIGURATION = 4294967296L; // 0x100000000L
    field @RequiresPermission("android.permission.READ_PRECISE_PHONE_STATE") public static final int LISTEN_PRECISE_CALL_STATE = 2048; // 0x800
    field @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public static final int LISTEN_RADIO_POWER_STATE_CHANGED = 8388608; // 0x800000
    field @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public static final int LISTEN_SRVCC_STATE_CHANGED = 16384; // 0x4000
    field @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public static final int LISTEN_VOICE_ACTIVATION_STATE = 131072; // 0x20000
  }
  public final class PhysicalChannelConfig implements android.os.Parcelable {
    method public int describeContents();
    method public int getCellBandwidthDownlink();
    method public int getChannelNumber();
    method public int getConnectionStatus();
    method public int getNetworkType();
    method @IntRange(from=0, to=1007) public int getPhysicalCellId();
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field public static final int CHANNEL_NUMBER_UNKNOWN = -1; // 0xffffffff
    field public static final int CONNECTION_PRIMARY_SERVING = 1; // 0x1
    field public static final int CONNECTION_SECONDARY_SERVING = 2; // 0x2
    field public static final int CONNECTION_UNKNOWN = -1; // 0xffffffff
    field @NonNull public static final android.os.Parcelable.Creator<android.telephony.PhysicalChannelConfig> CREATOR;
    field public static final int PHYSICAL_CELL_ID_UNKNOWN = -1; // 0xffffffff
  }
  public final class PreciseCallState implements android.os.Parcelable {
    ctor public PreciseCallState(int, int, int, int, int);
    method public int describeContents();
+31 −0
Original line number Diff line number Diff line
@@ -486,6 +486,16 @@ public class PhoneStateListener {
    @RequiresPermission(Manifest.permission.READ_PRECISE_PHONE_STATE)
    public static final int LISTEN_BARRING_INFO = 0x80000000;

    /**
     *  Listen for changes to the physical channel configuration.
     *
     * @see #onPhysicalChannelConfigurationChanged
     * @hide
     */
    @SystemApi
    @RequiresPermission(android.Manifest.permission.READ_PRECISE_PHONE_STATE)
    public static final long LISTEN_PHYSICAL_CHANNEL_CONFIGURATION = 0x100000000L;

    /*
     * Subscription used to listen to the phone state changes
     * @hide
@@ -1144,6 +1154,18 @@ public class PhoneStateListener {
        // default implementation empty
    }

    /**
     * Callback invoked when the current physical channel configuration has changed
     *
     * @param configs List of the current {@link PhysicalChannelConfig}s
     * @hide
     */
    @SystemApi
    public void onPhysicalChannelConfigurationChanged(
            @NonNull List<PhysicalChannelConfig> configs) {
        // default implementation empty
    }

    /**
     * The callback methods need to be called on the handler thread where
     * this object was created.  If the binder did that for us it'd be nice.
@@ -1447,6 +1469,15 @@ public class PhoneStateListener {
            Binder.withCleanCallingIdentity(
                    () -> mExecutor.execute(() -> psl.onBarringInfoChanged(barringInfo)));
        }

        public void onPhysicalChannelConfigurationChanged(List<PhysicalChannelConfig> configs) {
            PhoneStateListener psl = mPhoneStateListenerWeakRef.get();
            if (psl == null) return;

            Binder.withCleanCallingIdentity(
                    () -> mExecutor.execute(
                            () -> psl.onPhysicalChannelConfigurationChanged(configs)));
        }
    }


+16 −1
Original line number Diff line number Diff line
@@ -211,7 +211,7 @@ public class TelephonyRegistryManager {
     * @param notifyNow Whether to notify instantly
     */
    public void listenForSubscriber(int subId, @NonNull String pkg, @NonNull String featureId,
            @NonNull PhoneStateListener listener, int events, boolean notifyNow) {
            @NonNull PhoneStateListener listener, long events, boolean notifyNow) {
        try {
            // subId from PhoneStateListener is deprecated Q on forward, use the subId from
            // TelephonyManager instance. Keep using subId from PhoneStateListener for pre-Q.
@@ -754,4 +754,19 @@ public class TelephonyRegistryManager {
        }
    }

    /**
     * Notify {@link PhysicalChannelConfig} has changed for a specific subscription.
     *
     * @param subId the subId
     * @param configs a list of {@link PhysicalChannelConfig}, the configs of physical channel.
     */
    public void notifyPhysicalChannelConfigurationForSubscriber(
            int subId, List<PhysicalChannelConfig> configs) {
        try {
            sRegistry.notifyPhysicalChannelConfigurationForSubscriber(subId, configs);
        } catch (RemoteException ex) {
            // system server crash
        }
    }

}
+3 −0
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ import android.telephony.CellInfo;
import android.telephony.DataConnectionRealTimeInfo;
import android.telephony.TelephonyDisplayInfo;
import android.telephony.PhoneCapability;
import android.telephony.PhysicalChannelConfig;
import android.telephony.PreciseCallState;
import android.telephony.PreciseDataConnectionState;
import android.telephony.ServiceState;
@@ -68,4 +69,6 @@ oneway interface IPhoneStateListener {
    void onRegistrationFailed(in CellIdentity cellIdentity,
             String chosenPlmn, int domain, int causeCode, int additionalCauseCode);
    void onBarringInfoChanged(in BarringInfo barringInfo);
    void onPhysicalChannelConfigurationChanged(in List<PhysicalChannelConfig> configs);

}
Loading