Merge "Allow bugreport only after server-side config loaded" into tm-qpr-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
95ffd81e8f
@@ -27,6 +27,7 @@ import android.content.Intent;
|
|||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
import android.content.pm.ResolveInfo;
|
import android.content.pm.ResolveInfo;
|
||||||
import android.os.ParcelUuid;
|
import android.os.ParcelUuid;
|
||||||
|
import android.provider.DeviceConfig;
|
||||||
|
|
||||||
import com.android.internal.telephony.TelephonyStatsLog;
|
import com.android.internal.telephony.TelephonyStatsLog;
|
||||||
import com.android.internal.util.IndentingPrintWriter;
|
import com.android.internal.util.IndentingPrintWriter;
|
||||||
@@ -57,6 +58,9 @@ import java.util.concurrent.ConcurrentHashMap;
|
|||||||
public final class AnomalyReporter {
|
public final class AnomalyReporter {
|
||||||
private static final String TAG = "AnomalyReporter";
|
private static final String TAG = "AnomalyReporter";
|
||||||
|
|
||||||
|
private static final String KEY_IS_TELEPHONY_ANOMALY_REPORT_ENABLED =
|
||||||
|
"is_telephony_anomaly_report_enabled";
|
||||||
|
|
||||||
private static Context sContext = null;
|
private static Context sContext = null;
|
||||||
|
|
||||||
private static Map<UUID, Integer> sEvents = new ConcurrentHashMap<>();
|
private static Map<UUID, Integer> sEvents = new ConcurrentHashMap<>();
|
||||||
@@ -101,6 +105,12 @@ 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;
|
||||||
|
|||||||
Reference in New Issue
Block a user