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

Commit 62c9d6cb authored by Changyeon Jo's avatar Changyeon Jo Committed by Android (Google) Code Review
Browse files

Merge "Adds a method to track camera usages"

parents c174eb4d 62bcafb3
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.