Merge "Returns null not empty string if MEID is not available"

This commit is contained in:
Treehugger Robot
2019-10-30 00:21:50 +00:00
committed by Gerrit Code Review

View File

@@ -1887,7 +1887,12 @@ public class TelephonyManager {
if (telephony == null) return null; if (telephony == null) return null;
try { try {
return telephony.getMeidForSlot(slotIndex, getOpPackageName()); String meid = telephony.getMeidForSlot(slotIndex, getOpPackageName());
if (TextUtils.isEmpty(meid)) {
Log.d(TAG, "getMeid: return null because MEID is not available");
return null;
}
return meid;
} catch (RemoteException ex) { } catch (RemoteException ex) {
return null; return null;
} catch (NullPointerException ex) { } catch (NullPointerException ex) {