Merge "AnomalyReport catch any exception when try to read deviceConfig" into tm-qpr-dev am: f60a915197
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20003467 Change-Id: Iaadcca45292b0a75886cbc6bfa84a2a3c9eb7d7a Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -105,17 +105,23 @@ public final class AnomalyReporter {
|
|||||||
* @param carrierId the carrier of the id associated with this event.
|
* @param carrierId the carrier of the id associated with this event.
|
||||||
*/
|
*/
|
||||||
public static void reportAnomaly(@NonNull UUID eventId, String description, int carrierId) {
|
public static void reportAnomaly(@NonNull UUID eventId, String description, int carrierId) {
|
||||||
// Don't report if the server-side flag isn't loaded, as it implies other anomaly report
|
|
||||||
// related config hasn't loaded.
|
|
||||||
boolean isAnomalyReportEnabledFromServer = DeviceConfig.getBoolean(
|
|
||||||
DeviceConfig.NAMESPACE_TELEPHONY, KEY_IS_TELEPHONY_ANOMALY_REPORT_ENABLED, false);
|
|
||||||
if (!isAnomalyReportEnabledFromServer) return;
|
|
||||||
|
|
||||||
if (sContext == null) {
|
if (sContext == null) {
|
||||||
Rlog.w(TAG, "AnomalyReporter not yet initialized, dropping event=" + eventId);
|
Rlog.w(TAG, "AnomalyReporter not yet initialized, dropping event=" + eventId);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Don't report if the server-side flag isn't loaded, as it implies other anomaly report
|
||||||
|
// related config hasn't loaded.
|
||||||
|
try {
|
||||||
|
boolean isAnomalyReportEnabledFromServer = DeviceConfig.getBoolean(
|
||||||
|
DeviceConfig.NAMESPACE_TELEPHONY, KEY_IS_TELEPHONY_ANOMALY_REPORT_ENABLED,
|
||||||
|
false);
|
||||||
|
if (!isAnomalyReportEnabledFromServer) return;
|
||||||
|
} catch (Exception e) {
|
||||||
|
Rlog.w(TAG, "Unable to read device config, dropping event=" + eventId);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
TelephonyStatsLog.write(
|
TelephonyStatsLog.write(
|
||||||
TELEPHONY_ANOMALY_DETECTED,
|
TELEPHONY_ANOMALY_DETECTED,
|
||||||
carrierId,
|
carrierId,
|
||||||
|
|||||||
Reference in New Issue
Block a user