treble_patches: Update all patches per BlissRoms Source
Change-Id: I1371da94679a6c859e08f86b4a17b14281dfae81
Signed-off-by: Jackeagle <jackeagle102@gmail.com>
diff --git a/patches/platform_frameworks_base/0026-Revert-Revert-CameraServiceProxy-Add-client-API-leve.patch b/patches/platform_frameworks_base/0026-Revert-Revert-CameraServiceProxy-Add-client-API-leve.patch
new file mode 100644
index 0000000..1a22278
--- /dev/null
+++ b/patches/platform_frameworks_base/0026-Revert-Revert-CameraServiceProxy-Add-client-API-leve.patch
@@ -0,0 +1,100 @@
+From 291679ee3ce0959101b2b905208e0275d3d463a9 Mon Sep 17 00:00:00 2001
+From: Jackeagle <jackeagle102@gmail.com>
+Date: Sat, 20 Oct 2018 12:13:12 -0400
+Subject: [PATCH 26/26] Revert "Revert "CameraServiceProxy: Add client API
+ level to log metrics""
+
+This reverts commit 7c97b7bb8b1b7f87974fcd13c1ae267288ca3e79.
+---
+ proto/src/metrics_constants.proto | 5 +++++
+ .../com/android/server/camera/CameraServiceProxy.java | 16 ++++++++++------
+ 2 files changed, 15 insertions(+), 6 deletions(-)
+
+diff --git a/proto/src/metrics_constants.proto b/proto/src/metrics_constants.proto
+index 62f9377..e568b12 100644
+--- a/proto/src/metrics_constants.proto
++++ b/proto/src/metrics_constants.proto
+@@ -5447,6 +5447,11 @@ message MetricsEvent {
+ // OS: P
+ PACKAGE_OPTIMIZATION_COMPILATION_REASON = 1321;
+
++ // FIELD: The camera API level used.
++ // CATEGORY: CAMERA
++ // OS: P
++ FIELD_CAMERA_API_LEVEL = 1322;
++
+ // OPEN: Settings > Battery > Battery tip > Battery tip Dialog
+ // CATEGORY: SETTINGS
+ // OS: P
+diff --git a/services/core/java/com/android/server/camera/CameraServiceProxy.java b/services/core/java/com/android/server/camera/CameraServiceProxy.java
+index 45d2375..0ee55ed 100644
+--- a/services/core/java/com/android/server/camera/CameraServiceProxy.java
++++ b/services/core/java/com/android/server/camera/CameraServiceProxy.java
+@@ -103,13 +103,15 @@ public class CameraServiceProxy extends SystemService
+ private static class CameraUsageEvent {
+ public final int mCameraFacing;
+ public final String mClientName;
++ public final int mAPILevel;
+
+ private boolean mCompleted;
+ private long mDurationOrStartTimeMs; // Either start time, or duration once completed
+
+- public CameraUsageEvent(int facing, String clientName) {
++ public CameraUsageEvent(int facing, String clientName, int apiLevel) {
+ mCameraFacing = facing;
+ mClientName = clientName;
++ mAPILevel = apiLevel;
+ mDurationOrStartTimeMs = SystemClock.elapsedRealtime();
+ mCompleted = false;
+ }
+@@ -173,7 +175,7 @@ public class CameraServiceProxy extends SystemService
+
+ @Override
+ public void notifyCameraState(String cameraId, int newCameraState, int facing,
+- String clientName) {
++ String clientName, int apiLevel) {
+ if (Binder.getCallingUid() != Process.CAMERASERVER_UID) {
+ Slog.e(TAG, "Calling UID: " + Binder.getCallingUid() + " doesn't match expected " +
+ " camera service UID!");
+@@ -182,9 +184,9 @@ public class CameraServiceProxy extends SystemService
+ String state = cameraStateToString(newCameraState);
+ String facingStr = cameraFacingToString(facing);
+ if (DEBUG) Slog.v(TAG, "Camera " + cameraId + " facing " + facingStr + " state now " +
+- state + " for client " + clientName);
++ state + " for client " + clientName + " API Level " + apiLevel);
+
+- updateActivityCount(cameraId, newCameraState, facing, clientName);
++ updateActivityCount(cameraId, newCameraState, facing, clientName, apiLevel);
+ }
+ };
+
+@@ -303,6 +305,7 @@ public class CameraServiceProxy extends SystemService
+ .setType(MetricsEvent.TYPE_ACTION)
+ .setSubtype(subtype)
+ .setLatency(e.getDuration())
++ .addTaggedData(MetricsEvent.FIELD_CAMERA_API_LEVEL, e.mAPILevel)
+ .setPackageName(e.mClientName);
+ mLogger.write(l);
+ }
+@@ -383,7 +386,8 @@ public class CameraServiceProxy extends SystemService
+ return true;
+ }
+
+- private void updateActivityCount(String cameraId, int newCameraState, int facing, String clientName) {
++ private void updateActivityCount(String cameraId, int newCameraState, int facing,
++ String clientName, int apiLevel) {
+ synchronized(mLock) {
+ // Update active camera list and notify NFC if necessary
+ boolean wasEmpty = mActiveCameraUsage.isEmpty();
+@@ -391,7 +395,7 @@ public class CameraServiceProxy extends SystemService
+ case ICameraServiceProxy.CAMERA_STATE_OPEN:
+ break;
+ case ICameraServiceProxy.CAMERA_STATE_ACTIVE:
+- CameraUsageEvent newEvent = new CameraUsageEvent(facing, clientName);
++ CameraUsageEvent newEvent = new CameraUsageEvent(facing, clientName, apiLevel);
+ CameraUsageEvent oldEvent = mActiveCameraUsage.put(cameraId, newEvent);
+ if (oldEvent != null) {
+ Slog.w(TAG, "Camera " + cameraId + " was already marked as active");
+--
+2.7.4
+