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

Commit 62bcafb3 authored by Changyeon Jo's avatar Changyeon Jo
Browse files

Adds a method to track camera usages

This CL adds a new method to AppOpsManager for tracking apps' camera
usages.

Bug: 205156620
Bug: 216362856
Test: Successful build
Change-Id: I1bb424208ad422c462c17b822b72b5e87035e061
parent e3c43139
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -51,6 +51,9 @@ public class RecentAppOpsAccess {
    private static final int[] MICROPHONE_OPS = new int[]{
            AppOpsManager.OP_RECORD_AUDIO,
    };
    private static final int[] CAMERA_OPS = new int[]{
            AppOpsManager.OP_CAMERA,
    };


    private static final String TAG = RecentAppOpsAccess.class.getSimpleName();
@@ -98,6 +101,13 @@ public class RecentAppOpsAccess {
        return new RecentAppOpsAccess(context, MICROPHONE_OPS);
    }

    /**
     * Creates an instance of {@link RecentAppOpsAccess} for camera access.
     */
    public static RecentAppOpsAccess createForCamera(Context context) {
        return new RecentAppOpsAccess(context, CAMERA_OPS);
    }

    /**
     * Fills a list of applications which queried for access recently within specified time.
     * Apps are sorted by recency. Apps with more recent accesses are in the front.