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

Commit ca757ca9 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Merge cherrypicks of [7650643, 7649176] into qt-release

Change-Id: I74bd2d38a672a84a172b5fdf14462d68dcf0ff1e
parents ea99bd56 cf7f41b0
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -136,8 +136,12 @@ final class PhoneStateMonitor {
    }

    private boolean isLauncherShowing(ActivityManager.RunningTaskInfo runningTaskInfo) {
        if (runningTaskInfo == null) {
            return false;
        } else {
            return runningTaskInfo.topActivity.equals(mDefaultHome);
        }
    }

    private boolean isAppImmersive() {
        return SysUiServiceProvider.getComponent(mContext, StatusBar.class).inImmersiveMode();
+31 −3
Original line number Diff line number Diff line
@@ -2446,7 +2446,21 @@ public class TelephonyManager {
     * @return the NETWORK_TYPE_xxxx for current data connection.
     */
    public @NetworkType int getNetworkType() {
        return getDataNetworkType();
       try {
           ITelephony telephony = getITelephony();
           if (telephony != null) {
               return telephony.getNetworkType();
            } else {
                // This can happen when the ITelephony interface is not up yet.
                return NETWORK_TYPE_UNKNOWN;
            }
        } catch(RemoteException ex) {
            // This shouldn't happen in the normal case
            return NETWORK_TYPE_UNKNOWN;
        } catch (NullPointerException ex) {
            // This could happen before phone restarts due to crashing
            return NETWORK_TYPE_UNKNOWN;
        }
    }

    /**
@@ -2477,9 +2491,23 @@ public class TelephonyManager {
     * @hide
     */
    @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE)
    @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
    @UnsupportedAppUsage
    public int getNetworkType(int subId) {
        return getDataNetworkType(subId);
        try {
            ITelephony telephony = getITelephony();
            if (telephony != null) {
                return telephony.getNetworkTypeForSubscriber(subId, getOpPackageName());
            } else {
                // This can happen when the ITelephony interface is not up yet.
                return NETWORK_TYPE_UNKNOWN;
            }
        } catch (RemoteException ex) {
            // This shouldn't happen in the normal case
            return NETWORK_TYPE_UNKNOWN;
        } catch (NullPointerException ex) {
            // This could happen before phone restarts due to crashing
            return NETWORK_TYPE_UNKNOWN;
        }
    }

    /**