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

Commit cf66c06c authored by Sarah Chin's avatar Sarah Chin Committed by Gerrit Code Review
Browse files

Merge changes from topic "displayinfo"

* changes:
  Move override logic from SysUI to Telephony
  Added telephony display info support
parents 5dc0d90a 05c4fe13
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -45210,6 +45210,19 @@ package android.telephony {
    field @NonNull public static final android.os.Parcelable.Creator<android.telephony.ClosedSubscriberGroupInfo> CREATOR;
  }
  public final class DisplayInfo implements android.os.Parcelable {
    method public int describeContents();
    method public int getNetworkType();
    method public int getOverrideNetworkType();
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.telephony.DisplayInfo> CREATOR;
    field public static final int OVERRIDE_NETWORK_TYPE_LTE_ADVANCED_PRO = 2; // 0x2
    field public static final int OVERRIDE_NETWORK_TYPE_LTE_CA = 1; // 0x1
    field public static final int OVERRIDE_NETWORK_TYPE_NONE = 0; // 0x0
    field public static final int OVERRIDE_NETWORK_TYPE_NR_NSA = 3; // 0x3
    field public static final int OVERRIDE_NETWORK_TYPE_NR_NSA_MMWAVE = 4; // 0x4
  }
  public class IccOpenLogicalChannelResponse implements android.os.Parcelable {
    method public int describeContents();
    method public int getChannel();
@@ -45435,6 +45448,7 @@ package android.telephony {
    method public void onDataActivity(int);
    method public void onDataConnectionStateChanged(int);
    method public void onDataConnectionStateChanged(int, int);
    method @RequiresPermission("android.permission.READ_PHONE_STATE") public void onDisplayInfoChanged(@NonNull android.telephony.DisplayInfo);
    method @RequiresPermission("android.permission.READ_PRECISE_PHONE_STATE") public void onImsCallDisconnectCauseChanged(@NonNull android.telephony.ims.ImsReasonInfo);
    method public void onMessageWaitingIndicatorChanged(boolean);
    method @RequiresPermission("android.permission.MODIFY_PHONE_STATE") public void onPreciseDataConnectionStateChanged(@NonNull android.telephony.PreciseDataConnectionState);
@@ -45451,6 +45465,7 @@ package android.telephony {
    field public static final int LISTEN_CELL_LOCATION = 16; // 0x10
    field public static final int LISTEN_DATA_ACTIVITY = 128; // 0x80
    field public static final int LISTEN_DATA_CONNECTION_STATE = 64; // 0x40
    field public static final int LISTEN_DISPLAY_INFO_CHANGED = 1048576; // 0x100000
    field public static final int LISTEN_EMERGENCY_NUMBER_LIST = 16777216; // 0x1000000
    field @RequiresPermission("android.permission.READ_PRECISE_PHONE_STATE") public static final int LISTEN_IMS_CALL_DISCONNECT_CAUSES = 134217728; // 0x8000000
    field public static final int LISTEN_MESSAGE_WAITING_INDICATOR = 4; // 0x4
+31 −0
Original line number Diff line number Diff line
@@ -300,6 +300,13 @@ public class PhoneStateListener {
     */
    public static final int LISTEN_USER_MOBILE_DATA_STATE                  = 0x00080000;

    /**
     *  Listen for display info changed event.
     *
     *  @see #onDisplayInfoChanged
     */
    public static final int LISTEN_DISPLAY_INFO_CHANGED = 0x00100000;

    /**
     *  Listen for changes to the phone capability.
     *
@@ -836,6 +843,21 @@ public class PhoneStateListener {
        // default implementation empty
    }

    /**
     * Callback invoked when the display info has changed on the registered subscription.
     * <p> The {@link DisplayInfo} contains status information shown to the user based on
     * carrier policy.
     *
     * Requires Permission: {@link android.Manifest.permission#READ_PHONE_STATE} or that the calling
     * app has carrier privileges (see {@link TelephonyManager#hasCarrierPrivileges}).
     *
     * @param displayInfo The display information.
     */
    @RequiresPermission((android.Manifest.permission.READ_PHONE_STATE))
    public void onDisplayInfoChanged(@NonNull DisplayInfo displayInfo) {
        // default implementation empty
    }

    /**
     * Callback invoked when the current emergency number list has changed on the registered
     * subscription.
@@ -1201,6 +1223,15 @@ public class PhoneStateListener {
                            () -> psl.onUserMobileDataStateChanged(enabled)));
        }

        public void onDisplayInfoChanged(DisplayInfo displayInfo) {
            PhoneStateListener psl = mPhoneStateListenerWeakRef.get();
            if (psl == null) return;

            Binder.withCleanCallingIdentity(
                    () -> mExecutor.execute(
                            () -> psl.onDisplayInfoChanged(displayInfo)));
        }

        public void onOemHookRawEvent(byte[] rawData) {
            PhoneStateListener psl = mPhoneStateListenerWeakRef.get();
            if (psl == null) return;
+18 −0
Original line number Diff line number Diff line
@@ -535,6 +535,24 @@ public class TelephonyRegistryManager {
        }
    }

    /**
     * Notify display info changed.
     *
     * @param slotIndex The SIM slot index for which display info has changed. Can be
     * derived from {@code subscriptionId} except when {@code subscriptionId} is invalid, such as
     * when the device is in emergency-only mode.
     * @param subscriptionId Subscription id for which display network info has changed.
     * @param displayInfo The display info.
     */
    public void notifyDisplayInfoChanged(int slotIndex, int subscriptionId,
            @NonNull DisplayInfo displayInfo) {
        try {
            sRegistry.notifyDisplayInfoChanged(slotIndex, subscriptionId, displayInfo);
        } catch (RemoteException ex) {
            // system process is dead
        }
    }

    /**
     * Notify IMS call disconnect causes which contains {@link android.telephony.ims.ImsReasonInfo}.
     *
+2 −0
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ import android.telephony.CallAttributes;
import android.telephony.CellIdentity;
import android.telephony.CellInfo;
import android.telephony.DataConnectionRealTimeInfo;
import android.telephony.DisplayInfo;
import android.telephony.PhoneCapability;
import android.telephony.PreciseCallState;
import android.telephony.PreciseDataConnectionState;
@@ -53,6 +54,7 @@ oneway interface IPhoneStateListener {
    void onOemHookRawEvent(in byte[] rawData);
    void onCarrierNetworkChange(in boolean active);
    void onUserMobileDataStateChanged(in boolean enabled);
    void onDisplayInfoChanged(in DisplayInfo displayInfo);
    void onPhoneCapabilityChanged(in PhoneCapability capability);
    void onActiveDataSubIdChanged(in int subId);
    void onRadioPowerStateChanged(in int state);
+2 −0
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ import android.net.NetworkCapabilities;
import android.telephony.CallQuality;
import android.telephony.CellIdentity;
import android.telephony.CellInfo;
import android.telephony.DisplayInfo;
import android.telephony.ims.ImsReasonInfo;
import android.telephony.PhoneCapability;
import android.telephony.PhysicalChannelConfig;
@@ -87,6 +88,7 @@ interface ITelephonyRegistry {
    void notifyOpportunisticSubscriptionInfoChanged();
    void notifyCarrierNetworkChange(in boolean active);
    void notifyUserMobileDataStateChangedForPhoneId(in int phoneId, in int subId, in boolean state);
    void notifyDisplayInfoChanged(int slotIndex, int subId, in DisplayInfo displayInfo);
    void notifyPhoneCapabilityChanged(in PhoneCapability capability);
    void notifyActiveDataSubIdChanged(int activeDataSubId);
    void notifyRadioPowerStateChanged(in int phoneId, in int subId, in int state);
Loading