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

Commit 760aa617 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Revert "Add the LCE system API"" into sc-dev am: 3f31bd05

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13878517

Change-Id: Ib797a3e8332e2057060825dbda0133914693c53e
parents 65bab11d 3f31bd05
Loading
Loading
Loading
Loading
+1 −18
Original line number Original line Diff line number Diff line
@@ -11025,19 +11025,6 @@ package android.telephony {
    field @NonNull public static final android.os.Parcelable.Creator<android.telephony.ImsiEncryptionInfo> CREATOR;
    field @NonNull public static final android.os.Parcelable.Creator<android.telephony.ImsiEncryptionInfo> CREATOR;
  }
  }
  public final class LinkCapacityEstimate implements android.os.Parcelable {
    ctor public LinkCapacityEstimate(int, int, int);
    method public int describeContents();
    method public int getDownlinkCapacityKbps();
    method public int getType();
    method public int getUplinkCapacityKbps();
    field @NonNull public static final android.os.Parcelable.Creator<android.telephony.LinkCapacityEstimate> CREATOR;
    field public static final int INVALID = -1; // 0xffffffff
    field public static final int LCE_TYPE_COMBINED = 2; // 0x2
    field public static final int LCE_TYPE_PRIMARY = 0; // 0x0
    field public static final int LCE_TYPE_SECONDARY = 1; // 0x1
  }
  public final class LteVopsSupportInfo implements android.os.Parcelable {
  public final class LteVopsSupportInfo implements android.os.Parcelable {
    ctor public LteVopsSupportInfo(int, int);
    ctor public LteVopsSupportInfo(int, int);
    method public int describeContents();
    method public int describeContents();
@@ -11550,7 +11537,6 @@ package android.telephony {
    field @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public static final int EVENT_EMERGENCY_NUMBER_LIST_CHANGED = 25; // 0x19
    field @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public static final int EVENT_EMERGENCY_NUMBER_LIST_CHANGED = 25; // 0x19
    field @RequiresPermission(android.Manifest.permission.READ_PRECISE_PHONE_STATE) public static final int EVENT_IMS_CALL_DISCONNECT_CAUSE_CHANGED = 28; // 0x1c
    field @RequiresPermission(android.Manifest.permission.READ_PRECISE_PHONE_STATE) public static final int EVENT_IMS_CALL_DISCONNECT_CAUSE_CHANGED = 28; // 0x1c
    field @RequiresPermission(android.Manifest.permission.READ_CALL_LOG) public static final int EVENT_LEGACY_CALL_STATE_CHANGED = 36; // 0x24
    field @RequiresPermission(android.Manifest.permission.READ_CALL_LOG) public static final int EVENT_LEGACY_CALL_STATE_CHANGED = 36; // 0x24
    field @RequiresPermission(android.Manifest.permission.READ_PRECISE_PHONE_STATE) public static final int EVENT_LINK_CAPACITY_ESTIMATE_CHANGED = 37; // 0x25
    field @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public static final int EVENT_MESSAGE_WAITING_INDICATOR_CHANGED = 3; // 0x3
    field @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public static final int EVENT_MESSAGE_WAITING_INDICATOR_CHANGED = 3; // 0x3
    field @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public static final int EVENT_OEM_HOOK_RAW = 15; // 0xf
    field @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public static final int EVENT_OEM_HOOK_RAW = 15; // 0xf
    field @RequiresPermission(android.Manifest.permission.READ_ACTIVE_EMERGENCY_SESSION) public static final int EVENT_OUTGOING_EMERGENCY_CALL = 29; // 0x1d
    field @RequiresPermission(android.Manifest.permission.READ_ACTIVE_EMERGENCY_SESSION) public static final int EVENT_OUTGOING_EMERGENCY_CALL = 29; // 0x1d
@@ -11581,10 +11567,6 @@ package android.telephony {
    method @RequiresPermission(android.Manifest.permission.READ_PRECISE_PHONE_STATE) public void onDataEnabledChanged(boolean, int);
    method @RequiresPermission(android.Manifest.permission.READ_PRECISE_PHONE_STATE) public void onDataEnabledChanged(boolean, int);
  }
  }
  public static interface TelephonyCallback.LinkCapacityEstimateChangedListener {
    method @RequiresPermission(android.Manifest.permission.READ_PRECISE_PHONE_STATE) public void onLinkCapacityEstimateChanged(@NonNull java.util.List<android.telephony.LinkCapacityEstimate>);
  }
  public static interface TelephonyCallback.OutgoingEmergencyCallListener {
  public static interface TelephonyCallback.OutgoingEmergencyCallListener {
    method @RequiresPermission(android.Manifest.permission.READ_ACTIVE_EMERGENCY_SESSION) public void onOutgoingEmergencyCall(@NonNull android.telephony.emergency.EmergencyNumber, int);
    method @RequiresPermission(android.Manifest.permission.READ_ACTIVE_EMERGENCY_SESSION) public void onOutgoingEmergencyCall(@NonNull android.telephony.emergency.EmergencyNumber, int);
  }
  }
@@ -11656,6 +11638,7 @@ package android.telephony {
    method @Nullable @RequiresPermission(android.Manifest.permission.INTERACT_ACROSS_USERS) public android.content.ComponentName getAndUpdateDefaultRespondViaMessageApplication();
    method @Nullable @RequiresPermission(android.Manifest.permission.INTERACT_ACROSS_USERS) public android.content.ComponentName getAndUpdateDefaultRespondViaMessageApplication();
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public void getCallForwarding(int, @NonNull java.util.concurrent.Executor, @NonNull android.telephony.TelephonyManager.CallForwardingInfoCallback);
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public void getCallForwarding(int, @NonNull java.util.concurrent.Executor, @NonNull android.telephony.TelephonyManager.CallForwardingInfoCallback);
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public void getCallWaitingStatus(@NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer<java.lang.Integer>);
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public void getCallWaitingStatus(@NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer<java.lang.Integer>);
    method @NonNull @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public android.telephony.CarrierBandwidth getCarrierBandwidth();
    method @Nullable @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public android.telephony.ImsiEncryptionInfo getCarrierInfoForImsiEncryption(int);
    method @Nullable @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public android.telephony.ImsiEncryptionInfo getCarrierInfoForImsiEncryption(int);
    method public java.util.List<java.lang.String> getCarrierPackageNamesForIntent(android.content.Intent);
    method public java.util.List<java.lang.String> getCarrierPackageNamesForIntent(android.content.Intent);
    method public java.util.List<java.lang.String> getCarrierPackageNamesForIntentAndPhone(android.content.Intent, int);
    method public java.util.List<java.lang.String> getCarrierPackageNamesForIntentAndPhone(android.content.Intent, int);
+0 −7
Original line number Original line Diff line number Diff line
@@ -1261,8 +1261,6 @@ public class PhoneStateListener {
        // default implementation empty
        // default implementation empty
    }
    }




    /**
    /**
     * The callback methods need to be called on the handler thread where
     * 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.
     * this object was created.  If the binder did that for us it'd be nice.
@@ -1581,11 +1579,6 @@ public class PhoneStateListener {
        public void onAllowedNetworkTypesChanged(int reason, long allowedNetworkType) {
        public void onAllowedNetworkTypesChanged(int reason, long allowedNetworkType) {
            // default implementation empty
            // default implementation empty
        }
        }

        public void onLinkCapacityEstimateChanged(
                List<LinkCapacityEstimate> linkCapacityEstimateList) {
            // default implementation empty
        }
    }
    }


    private void log(String s) {
    private void log(String s) {
+1 −47
Original line number Original line Diff line number Diff line
@@ -565,21 +565,6 @@ public class TelephonyCallback {
    @RequiresPermission(android.Manifest.permission.READ_CALL_LOG)
    @RequiresPermission(android.Manifest.permission.READ_CALL_LOG)
    public static final int EVENT_LEGACY_CALL_STATE_CHANGED = 36;
    public static final int EVENT_LEGACY_CALL_STATE_CHANGED = 36;



    /**
     * Event for changes to the link capacity estimate (LCE)
     *
     * <p>Requires permission {@link android.Manifest.permission#READ_PRECISE_PHONE_STATE}
     *
     * @see LinkCapacityEstimateChangedListener#onLinkCapacityEstimateChanged
     *
     * @hide
     */
    @SystemApi
    @RequiresPermission(Manifest.permission.READ_PRECISE_PHONE_STATE)
    public static final int EVENT_LINK_CAPACITY_ESTIMATE_CHANGED = 37;


    /**
    /**
     * @hide
     * @hide
     */
     */
@@ -619,8 +604,7 @@ public class TelephonyCallback {
            EVENT_PHYSICAL_CHANNEL_CONFIG_CHANGED,
            EVENT_PHYSICAL_CHANNEL_CONFIG_CHANGED,
            EVENT_DATA_ENABLED_CHANGED,
            EVENT_DATA_ENABLED_CHANGED,
            EVENT_ALLOWED_NETWORK_TYPE_LIST_CHANGED,
            EVENT_ALLOWED_NETWORK_TYPE_LIST_CHANGED,
            EVENT_LEGACY_CALL_STATE_CHANGED,
            EVENT_LEGACY_CALL_STATE_CHANGED
            EVENT_LINK_CAPACITY_ESTIMATE_CHANGED
    })
    })
    @Retention(RetentionPolicy.SOURCE)
    @Retention(RetentionPolicy.SOURCE)
    public @interface TelephonyEvent {
    public @interface TelephonyEvent {
@@ -1386,25 +1370,6 @@ public class TelephonyCallback {
            @TelephonyManager.DataEnabledReason int reason);
            @TelephonyManager.DataEnabledReason int reason);
    }
    }


    /**
     * Interface for link capacity estimate changed listener.
     *
     * @hide
     */
    @SystemApi
    public interface LinkCapacityEstimateChangedListener {
        /**
         * Callback invoked when the link capacity estimate (LCE) changes
         *
         * @param linkCapacityEstimateList a list of {@link LinkCapacityEstimate}
         * The list size is at least 1.
         * In case of a dual connected network, the list size could be 2.
         * Use {@link LinkCapacityEstimate#getType()} to get the type of each element.
         */
        @RequiresPermission(Manifest.permission.READ_PRECISE_PHONE_STATE)
        void onLinkCapacityEstimateChanged(
                @NonNull List<LinkCapacityEstimate> linkCapacityEstimateList);
    }


    /**
    /**
     * The callback methods need to be called on the handler thread where
     * The callback methods need to be called on the handler thread where
@@ -1753,16 +1718,5 @@ public class TelephonyCallback {
                            () -> listener.onAllowedNetworkTypesChanged(reason,
                            () -> listener.onAllowedNetworkTypesChanged(reason,
                                    allowedNetworkType)));
                                    allowedNetworkType)));
        }
        }

        public void onLinkCapacityEstimateChanged(
                List<LinkCapacityEstimate> linkCapacityEstimateList) {
            LinkCapacityEstimateChangedListener listener =
                    (LinkCapacityEstimateChangedListener) mTelephonyCallbackWeakRef.get();
            if (listener == null) return;

            Binder.withCleanCallingIdentity(
                    () -> mExecutor.execute(() -> listener.onLinkCapacityEstimateChanged(
                            linkCapacityEstimateList)));
        }
    }
    }
}
}
+1 −19
Original line number Original line Diff line number Diff line
@@ -842,23 +842,9 @@ public class TelephonyRegistryManager {
        }
        }
    }
    }


    /**
     * Notify that the link capacity estimate has changed.
     * @param slotIndex for the phone object that gets the updated link capacity estimate
     * @param subId for subscription that gets the updated link capacity estimate
     * @param linkCapacityEstimateList a list of {@link  LinkCapacityEstimate}
     */
    public void notifyLinkCapacityEstimateChanged(int slotIndex, int subId,
            List<LinkCapacityEstimate> linkCapacityEstimateList) {
        try {
            sRegistry.notifyLinkCapacityEstimateChanged(slotIndex, subId, linkCapacityEstimateList);
        } catch (RemoteException ex) {
            // system server crash
        }
    }

    public @NonNull Set<Integer> getEventsFromCallback(
    public @NonNull Set<Integer> getEventsFromCallback(
            @NonNull TelephonyCallback telephonyCallback) {
            @NonNull TelephonyCallback telephonyCallback) {

        Set<Integer> eventList = new ArraySet<>();
        Set<Integer> eventList = new ArraySet<>();


        if (telephonyCallback instanceof TelephonyCallback.ServiceStateListener) {
        if (telephonyCallback instanceof TelephonyCallback.ServiceStateListener) {
@@ -990,10 +976,6 @@ public class TelephonyRegistryManager {
            eventList.add(TelephonyCallback.EVENT_ALLOWED_NETWORK_TYPE_LIST_CHANGED);
            eventList.add(TelephonyCallback.EVENT_ALLOWED_NETWORK_TYPE_LIST_CHANGED);
        }
        }


        if (telephonyCallback instanceof TelephonyCallback.LinkCapacityEstimateChangedListener) {
            eventList.add(TelephonyCallback.EVENT_LINK_CAPACITY_ESTIMATE_CHANGED);
        }

        return eventList;
        return eventList;
    }
    }


+0 −2
Original line number Original line Diff line number Diff line
@@ -21,7 +21,6 @@ import android.telephony.CallAttributes;
import android.telephony.CellIdentity;
import android.telephony.CellIdentity;
import android.telephony.CellInfo;
import android.telephony.CellInfo;
import android.telephony.DataConnectionRealTimeInfo;
import android.telephony.DataConnectionRealTimeInfo;
import android.telephony.LinkCapacityEstimate;
import android.telephony.TelephonyDisplayInfo;
import android.telephony.TelephonyDisplayInfo;
import android.telephony.PhoneCapability;
import android.telephony.PhoneCapability;
import android.telephony.PhysicalChannelConfig;
import android.telephony.PhysicalChannelConfig;
@@ -74,5 +73,4 @@ oneway interface IPhoneStateListener {
    void onPhysicalChannelConfigChanged(in List<PhysicalChannelConfig> configs);
    void onPhysicalChannelConfigChanged(in List<PhysicalChannelConfig> configs);
    void onDataEnabledChanged(boolean enabled, int reason);
    void onDataEnabledChanged(boolean enabled, int reason);
    void onAllowedNetworkTypesChanged(in int reason, in long allowedNetworkType);
    void onAllowedNetworkTypesChanged(in int reason, in long allowedNetworkType);
    void onLinkCapacityEstimateChanged(in List<LinkCapacityEstimate> linkCapacityEstimateList);
}
}
Loading