Merge "ProfcollectForwardingService: Pass usage setting when reporting" into udc-dev am: 57145b116b

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/23181876

Change-Id: I31eb1fdbbdc199ce64a248ad51991ff5936498e7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Yabin Cui
2023-05-12 21:03:04 +00:00
committed by Automerger Merge Worker
4 changed files with 27 additions and 5 deletions

View File

@@ -28,6 +28,8 @@
<!-- Will display the bouncer on one side of the display, and the current user icon and
user switcher on the other side -->
<bool name="config_enableBouncerUserSwitcher">false</bool>
<!-- Will enable custom clocks on the lockscreen -->
<bool name="config_enableLockScreenCustomClocks">true</bool>
<!-- Time to be considered a consecutive fingerprint failure in ms -->
<integer name="fp_consecutive_failure_time_ms">3500</integer>
</resources>

View File

@@ -120,7 +120,12 @@ object Flags {
resourceBooleanFlag(204, R.bool.config_enableBouncerUserSwitcher, "bouncer_user_switcher")
// TODO(b/254512676): Tracking Bug
@JvmField val LOCKSCREEN_CUSTOM_CLOCKS = releasedFlag(207, "lockscreen_custom_clocks")
@JvmField
val LOCKSCREEN_CUSTOM_CLOCKS = resourceBooleanFlag(
207,
R.bool.config_enableLockScreenCustomClocks,
"lockscreen_custom_clocks"
)
// TODO(b/275694445): Tracking Bug
@JvmField

View File

@@ -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)) {

View File

@@ -2539,10 +2539,14 @@ public class UsageStatsService extends SystemService implements
}
@Override
public void reportChooserSelection(String packageName, int userId, String contentType,
String[] annotations, String action) {
public void reportChooserSelection(@NonNull String packageName, int userId,
String contentType, String[] annotations, String action) {
if (packageName == null) {
Slog.w(TAG, "Event report user selecting a null package");
throw new IllegalArgumentException("Package selection must not be null.");
}
// Verify if this package exists before reporting an event for it.
if (mPackageManagerInternal.getPackageUid(packageName, 0, userId) < 0) {
Slog.w(TAG, "Event report user selecting an invalid package");
return;
}