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

Commit ed5da752 authored by Chiachang Wang's avatar Chiachang Wang Committed by Automerger Merge Worker
Browse files

Merge "Revert "Expose NetworkRegistrationInfo.getNrState() as public API"" am:...

Merge "Revert "Expose NetworkRegistrationInfo.getNrState() as public API"" am: 237d2d47 am: cc717d3c

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

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I68e07cb3f7d369073d4b05433e1c746bc9277095
parents d747ff3d cc717d3c
Loading
Loading
Loading
Loading
+0 −1
Original line number Original line Diff line number Diff line
@@ -40151,7 +40151,6 @@ package android.telephony {
    method @NonNull public java.util.List<java.lang.Integer> getAvailableServices();
    method @NonNull public java.util.List<java.lang.Integer> getAvailableServices();
    method @Nullable public android.telephony.CellIdentity getCellIdentity();
    method @Nullable public android.telephony.CellIdentity getCellIdentity();
    method public int getDomain();
    method public int getDomain();
    method public int getNrState();
    method @Nullable public String getRegisteredPlmn();
    method @Nullable public String getRegisteredPlmn();
    method public int getTransportType();
    method public int getTransportType();
    method public boolean isRegistered();
    method public boolean isRegistered();
+3 −1
Original line number Original line Diff line number Diff line
@@ -52,6 +52,7 @@ public class DataConnectionStats extends BroadcastReceiver {
    private SignalStrength mSignalStrength;
    private SignalStrength mSignalStrength;
    private ServiceState mServiceState;
    private ServiceState mServiceState;
    private int mDataState = TelephonyManager.DATA_DISCONNECTED;
    private int mDataState = TelephonyManager.DATA_DISCONNECTED;
    private int mNrState = NetworkRegistrationInfo.NR_STATE_NONE;


    public DataConnectionStats(Context context, Handler listenerHandler) {
    public DataConnectionStats(Context context, Handler listenerHandler) {
        mContext = context;
        mContext = context;
@@ -99,7 +100,7 @@ public class DataConnectionStats extends BroadcastReceiver {
                : regInfo.getAccessNetworkTechnology();
                : regInfo.getAccessNetworkTechnology();
        // If the device is in NSA NR connection the networkType will report as LTE.
        // If the device is in NSA NR connection the networkType will report as LTE.
        // For cell dwell rate metrics, this should report NR instead.
        // For cell dwell rate metrics, this should report NR instead.
        if (regInfo != null && regInfo.getNrState() == NetworkRegistrationInfo.NR_STATE_CONNECTED) {
        if (mNrState == NetworkRegistrationInfo.NR_STATE_CONNECTED) {
            networkType = TelephonyManager.NETWORK_TYPE_NR;
            networkType = TelephonyManager.NETWORK_TYPE_NR;
        }
        }
        if (DEBUG) Log.d(TAG, String.format("Noting data connection for network type %s: %svisible",
        if (DEBUG) Log.d(TAG, String.format("Noting data connection for network type %s: %svisible",
@@ -171,6 +172,7 @@ public class DataConnectionStats extends BroadcastReceiver {
        @Override
        @Override
        public void onServiceStateChanged(ServiceState state) {
        public void onServiceStateChanged(ServiceState state) {
            mServiceState = state;
            mServiceState = state;
            mNrState = state.getNrState();
            notePhoneDataConnectionState();
            notePhoneDataConnectionState();
        }
        }


+1 −0
Original line number Original line Diff line number Diff line
@@ -371,6 +371,7 @@ public final class NetworkRegistrationInfo implements Parcelable {
     * Get the 5G NR connection state.
     * Get the 5G NR connection state.
     *
     *
     * @return the 5G NR connection state.
     * @return the 5G NR connection state.
     * @hide
     */
     */
    public @NRState int getNrState() {
    public @NRState int getNrState() {
        return mNrState;
        return mNrState;