Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a06b0144 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "profcollect: Don't hardcode OnCameraOpened skip packages list" into main

parents 36f8cfd9 6fba2844
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -5758,6 +5758,9 @@
    <!-- The action name for the default profcollect report uploader app. -->
    <string name="config_defaultProfcollectReportUploaderAction" translatable="false"></string>

    <!-- Names of packages excluded by Profcollect onCameraOpened observer. -->
    <string-array name="config_profcollectOnCameraOpenedSkipPackages" translatable="false"></string-array>

    <!-- The default value used for RawContacts.ACCOUNT_NAME when contacts are inserted without this
         column set. These contacts are stored locally on the device and will not be removed even
         if no android.account.Account with this name exists. A null string will be used if the
+1 −0
Original line number Diff line number Diff line
@@ -4415,6 +4415,7 @@
  <java-symbol type="bool" name="config_profcollectReportUploaderEnabled" />
  <java-symbol type="string" name="config_defaultProfcollectReportUploaderApp" />
  <java-symbol type="string" name="config_defaultProfcollectReportUploaderAction" />
  <java-symbol type="array" name="config_profcollectOnCameraOpenedSkipPackages" />

  <java-symbol type="string" name="usb_device_resolve_prompt_warn" />

+10 −4
Original line number Diff line number Diff line
@@ -50,6 +50,7 @@ import com.android.server.wm.ActivityMetricsLaunchObserver;
import com.android.server.wm.ActivityMetricsLaunchObserverRegistry;
import com.android.server.wm.ActivityTaskManagerInternal;

import java.util.Arrays;
import java.util.concurrent.ThreadLocalRandom;
import java.util.concurrent.TimeUnit;

@@ -378,10 +379,15 @@ public final class ProfcollectForwardingService extends SystemService {
            @Override
            public void onCameraOpened(String cameraId, String packageId) {
                Log.d(LOG_TAG, "Received camera open event from: " + packageId);
                // Skip face auth and Android System Intelligence, since they trigger way too
                // often.
                if (packageId.startsWith("client.pid")
                        || packageId.equals("com.google.android.as")) {
                // Skip face auth since it triggers way too often.
                if (packageId.startsWith("client.pid")) {
                    return;
                }
                // Additional vendor specific list of apps to skip.
                String[] cameraSkipPackages =
                    getContext().getResources().getStringArray(
                        R.array.config_profcollectOnCameraOpenedSkipPackages);
                if (Arrays.asList(cameraSkipPackages).contains(packageId)) {
                    return;
                }
                // Sample for a fraction of camera events.