diff options
| author | 2023-05-11 14:25:22 -0700 | |
|---|---|---|
| committer | 2023-05-12 09:47:46 -0700 | |
| commit | 28f42bba3230d71765278d76b2edda71486a5b75 (patch) | |
| tree | a8241abc546dbaefbd1677dda809f0926d24f38b | |
| parent | c7515ae352abf6caa0da43eb50fffdbc6feb1561 (diff) | |
ProfcollectForwardingService: Pass usage setting when reporting
Bug: 282060259
Test: run am broadcast -a com.android.server.profcollect.UPLOAD_PROFILES
Change-Id: I891d10d023766009903383abb6421f3947f5f612
| -rw-r--r-- | services/profcollect/src/com/android/server/profcollect/ProfcollectForwardingService.java | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/services/profcollect/src/com/android/server/profcollect/ProfcollectForwardingService.java b/services/profcollect/src/com/android/server/profcollect/ProfcollectForwardingService.java index 8f23ae4ff33b..4007672a0599 100644 --- a/services/profcollect/src/com/android/server/profcollect/ProfcollectForwardingService.java +++ b/services/profcollect/src/com/android/server/profcollect/ProfcollectForwardingService.java @@ -34,6 +34,8 @@ import android.os.SystemProperties; import android.os.UpdateEngine; import android.os.UpdateEngineCallback; import android.provider.DeviceConfig; +import android.provider.Settings; +import android.provider.Settings.SettingNotFoundException; import android.util.Log; import com.android.internal.R; @@ -332,8 +334,17 @@ public final class ProfcollectForwardingService extends SystemService { Context context = getContext(); BackgroundThread.get().getThreadHandler().post(() -> { try { + int usageSetting = -1; + try { + // Get "Usage & diagnostics" checkbox status. 1 is for enabled, 0 is for + // disabled. + usageSetting = Settings.Global.getInt(context.getContentResolver(), "multi_cb"); + } catch (SettingNotFoundException e) { + Log.i(LOG_TAG, "Usage setting not found: " + e.getMessage()); + } + // Prepare profile report - String reportName = mIProfcollect.report() + ".zip"; + String reportName = mIProfcollect.report(usageSetting) + ".zip"; if (!context.getResources().getBoolean( R.bool.config_profcollectReportUploaderEnabled)) { |