Merge "Adds a method to track camera usages"

This commit is contained in:
Changyeon Jo
2022-02-09 14:57:51 +00:00
committed by Android (Google) Code Review

View File

@@ -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.