Merge "Revert "Add anomaly reports to check if IMEI is null."" into tm-qpr-dev

This commit is contained in:
TreeHugger Robot
2022-09-21 01:14:57 +00:00
committed by Android (Google) Code Review

View File

@@ -190,9 +190,6 @@ public class TelephonyManager {
@EnabledAfter(targetSdkVersion = Build.VERSION_CODES.Q)
private static final long CALLBACK_ON_MORE_ERROR_CODE_CHANGE = 130595455L;
// Null IMEI anomaly uuid
private static final UUID IMEI_ANOMALY_UUID = UUID.fromString(
"83905f14-6455-450c-be29-8206f0427fe9");
/**
* The key to use when placing the result of {@link #requestModemActivityInfo(ResultReceiver)}
* into the ResultReceiver Bundle.
@@ -2135,11 +2132,7 @@ public class TelephonyManager {
@RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE)
@RequiresFeature(PackageManager.FEATURE_TELEPHONY_GSM)
public String getImei() {
String imei = getImei(getSlotIndex());
if (imei == null) {
AnomalyReporter.reportAnomaly(IMEI_ANOMALY_UUID, "getImei: IMEI is null.");
}
return imei;
return getImei(getSlotIndex());
}
/**
@@ -2182,10 +2175,7 @@ public class TelephonyManager {
@RequiresFeature(PackageManager.FEATURE_TELEPHONY_GSM)
public String getImei(int slotIndex) {
ITelephony telephony = getITelephony();
if (telephony == null) {
AnomalyReporter.reportAnomaly(IMEI_ANOMALY_UUID, "getImei: telephony is null");
return null;
}
if (telephony == null) return null;
try {
return telephony.getImeiForSlot(slotIndex, getOpPackageName(), getAttributionTag());