diff --git a/core/java/android/hardware/CameraSessionStats.java b/core/java/android/hardware/CameraSessionStats.java index 9ef63065c0578..cf20459e4df26 100644 --- a/core/java/android/hardware/CameraSessionStats.java +++ b/core/java/android/hardware/CameraSessionStats.java @@ -62,6 +62,7 @@ public class CameraSessionStats implements Parcelable { private float mMaxPreviewFps; private ArrayList mStreamStats; private String mUserTag; + private int mVideoStabilizationMode; public CameraSessionStats() { mFacing = -1; @@ -76,6 +77,7 @@ public class CameraSessionStats implements Parcelable { mResultErrorCount = 0; mDeviceError = false; mStreamStats = new ArrayList(); + mVideoStabilizationMode = -1; } public CameraSessionStats(String cameraId, int facing, int newCameraState, @@ -133,6 +135,7 @@ public class CameraSessionStats implements Parcelable { dest.writeBoolean(mDeviceError); dest.writeTypedList(mStreamStats); dest.writeString(mUserTag); + dest.writeInt(mVideoStabilizationMode); } public void readFromParcel(Parcel in) { @@ -155,6 +158,7 @@ public class CameraSessionStats implements Parcelable { mStreamStats = streamStats; mUserTag = in.readString(); + mVideoStabilizationMode = in.readInt(); } public String getCameraId() { @@ -216,4 +220,8 @@ public class CameraSessionStats implements Parcelable { public String getUserTag() { return mUserTag; } + + public int getVideoStabilizationMode() { + return mVideoStabilizationMode; + } } diff --git a/services/core/java/com/android/server/camera/CameraServiceProxy.java b/services/core/java/com/android/server/camera/CameraServiceProxy.java index bdd5b3d52e736..b425420479f03 100644 --- a/services/core/java/com/android/server/camera/CameraServiceProxy.java +++ b/services/core/java/com/android/server/camera/CameraServiceProxy.java @@ -241,6 +241,7 @@ public class CameraServiceProxy extends SystemService public boolean mDeviceError; public List mStreamStats; public String mUserTag; + public int mVideoStabilizationMode; private long mDurationOrStartTimeMs; // Either start time, or duration once completed @@ -260,7 +261,8 @@ public class CameraServiceProxy extends SystemService public void markCompleted(int internalReconfigure, long requestCount, long resultErrorCount, boolean deviceError, - List streamStats, String userTag) { + List streamStats, String userTag, + int videoStabilizationMode) { if (mCompleted) { return; } @@ -272,6 +274,7 @@ public class CameraServiceProxy extends SystemService mDeviceError = deviceError; mStreamStats = streamStats; mUserTag = userTag; + mVideoStabilizationMode = videoStabilizationMode; if (CameraServiceProxy.DEBUG) { Slog.v(TAG, "A camera facing " + cameraFacingToString(mCameraFacing) + " was in use by " + mClientName + " for " + @@ -809,7 +812,8 @@ public class CameraServiceProxy extends SystemService + ", resultErrorCount " + e.mResultErrorCount + ", deviceError " + e.mDeviceError + ", streamCount is " + streamCount - + ", userTag is " + e.mUserTag); + + ", userTag is " + e.mUserTag + + ", videoStabilizationMode " + e.mVideoStabilizationMode); } // Convert from CameraStreamStats to CameraStreamProto CameraStreamProto[] streamProtos = new CameraStreamProto[MAX_STREAM_STATISTICS]; @@ -867,7 +871,7 @@ public class CameraServiceProxy extends SystemService MessageNano.toByteArray(streamProtos[2]), MessageNano.toByteArray(streamProtos[3]), MessageNano.toByteArray(streamProtos[4]), - e.mUserTag); + e.mUserTag, e.mVideoStabilizationMode); } } @@ -1055,6 +1059,7 @@ public class CameraServiceProxy extends SystemService boolean deviceError = cameraState.getDeviceErrorFlag(); List streamStats = cameraState.getStreamStats(); String userTag = cameraState.getUserTag(); + int videoStabilizationMode = cameraState.getVideoStabilizationMode(); synchronized(mLock) { // Update active camera list and notify NFC if necessary boolean wasEmpty = mActiveCameraUsage.isEmpty(); @@ -1109,7 +1114,7 @@ public class CameraServiceProxy extends SystemService Slog.w(TAG, "Camera " + cameraId + " was already marked as active"); oldEvent.markCompleted(/*internalReconfigure*/0, /*requestCount*/0, /*resultErrorCount*/0, /*deviceError*/false, streamStats, - /*userTag*/""); + /*userTag*/"", /*videoStabilizationMode*/-1); mCameraUsageHistory.add(oldEvent); } break; @@ -1119,7 +1124,8 @@ public class CameraServiceProxy extends SystemService if (doneEvent != null) { doneEvent.markCompleted(internalReconfigureCount, requestCount, - resultErrorCount, deviceError, streamStats, userTag); + resultErrorCount, deviceError, streamStats, userTag, + videoStabilizationMode); mCameraUsageHistory.add(doneEvent); // Check current active camera IDs to see if this package is still