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

Commit 7c30bb8e authored by pengzhicai's avatar pengzhicai
Browse files

Fix String is empty issue

Maybe the string is empty
https://code.google.com/p/android/issues/detail?id=226739



Change-Id: I645ae05a8cbe316e29d9710de0bbba64c0c2275d
Signed-off-by: default avatarpengzhicai <pengzhicai@xiaomi.com>
parent 8bcd1592
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1118,7 +1118,7 @@ public class TelephonyManager {
    private int getPhoneTypeFromProperty(int phoneId) {
        String type = getTelephonyProperty(phoneId,
                TelephonyProperties.CURRENT_ACTIVE_PHONE, null);
        if (type == null || type.equals("")) {
        if (type == null || type.isEmpty()) {
            return getPhoneTypeFromNetworkType(phoneId);
        }
        return Integer.parseInt(type);
@@ -1134,7 +1134,7 @@ public class TelephonyManager {
        // use the system property for default network type.
        // This is a fail safe, and can only happen at first boot.
        String mode = getTelephonyProperty(phoneId, "ro.telephony.default_network", null);
        if (mode != null) {
        if (mode != null && !mode.isEmpty()) {
            return TelephonyManager.getPhoneType(Integer.parseInt(mode));
        }
        return TelephonyManager.PHONE_TYPE_NONE;