Loading core/java/android/hardware/CameraSessionStats.java +12 −0 Original line number Diff line number Diff line Loading @@ -64,6 +64,7 @@ public class CameraSessionStats implements Parcelable { private ArrayList<CameraStreamStats> mStreamStats; private String mUserTag; private int mVideoStabilizationMode; private boolean mUsedUltraWide; private int mSessionIndex; private CameraExtensionSessionStats mCameraExtensionSessionStats; Loading @@ -82,6 +83,7 @@ public class CameraSessionStats implements Parcelable { mDeviceError = false; mStreamStats = new ArrayList<CameraStreamStats>(); mVideoStabilizationMode = -1; mUsedUltraWide = false; mSessionIndex = 0; mCameraExtensionSessionStats = new CameraExtensionSessionStats(); } Loading @@ -102,6 +104,8 @@ public class CameraSessionStats implements Parcelable { mSessionType = sessionType; mInternalReconfigure = internalReconfigure; mStreamStats = new ArrayList<CameraStreamStats>(); mVideoStabilizationMode = -1; mUsedUltraWide = false; mSessionIndex = sessionIdx; mCameraExtensionSessionStats = new CameraExtensionSessionStats(); } Loading Loading @@ -147,6 +151,7 @@ public class CameraSessionStats implements Parcelable { dest.writeTypedList(mStreamStats); dest.writeString(mUserTag); dest.writeInt(mVideoStabilizationMode); dest.writeBoolean(mUsedUltraWide); dest.writeInt(mSessionIndex); mCameraExtensionSessionStats.writeToParcel(dest, 0); } Loading @@ -173,6 +178,9 @@ public class CameraSessionStats implements Parcelable { mUserTag = in.readString(); mVideoStabilizationMode = in.readInt(); mUsedUltraWide = in.readBoolean(); mSessionIndex = in.readInt(); mCameraExtensionSessionStats = CameraExtensionSessionStats.CREATOR.createFromParcel(in); } Loading Loading @@ -245,6 +253,10 @@ public class CameraSessionStats implements Parcelable { return mVideoStabilizationMode; } public boolean getUsedUltraWide() { return mUsedUltraWide; } public int getSessionIndex() { return mSessionIndex; } Loading services/core/java/com/android/server/camera/CameraServiceProxy.java +16 −5 Original line number Diff line number Diff line Loading @@ -77,6 +77,7 @@ import android.view.WindowManagerGlobal; import com.android.framework.protobuf.nano.MessageNano; import com.android.internal.R; import com.android.internal.annotations.GuardedBy; import com.android.internal.camera.flags.Flags; import com.android.internal.util.FrameworkStatsLog; import com.android.server.LocalServices; import com.android.server.ServiceThread; Loading Loading @@ -244,6 +245,7 @@ public class CameraServiceProxy extends SystemService public List<CameraStreamStats> mStreamStats; public String mUserTag; public int mVideoStabilizationMode; public boolean mUsedUltraWide; public final long mLogId; public final int mSessionIndex; Loading Loading @@ -271,7 +273,8 @@ public class CameraServiceProxy extends SystemService public void markCompleted(int internalReconfigure, long requestCount, long resultErrorCount, boolean deviceError, List<CameraStreamStats> streamStats, String userTag, int videoStabilizationMode, CameraExtensionSessionStats extStats) { int videoStabilizationMode, boolean usedUltraWide, CameraExtensionSessionStats extStats) { if (mCompleted) { return; } Loading @@ -284,6 +287,7 @@ public class CameraServiceProxy extends SystemService mStreamStats = streamStats; mUserTag = userTag; mVideoStabilizationMode = videoStabilizationMode; mUsedUltraWide = usedUltraWide; mExtSessionStats = extStats; if (CameraServiceProxy.DEBUG) { Slog.v(TAG, "A camera facing " + cameraFacingToString(mCameraFacing) + Loading Loading @@ -873,6 +877,10 @@ public class CameraServiceProxy extends SystemService streamCount = e.mStreamStats.size(); } if (CameraServiceProxy.DEBUG) { String ultrawideDebug = Flags.logUltrawideUsage() ? ", wideAngleUsage " + e.mUsedUltraWide : ""; Slog.v(TAG, "CAMERA_ACTION_EVENT: action " + e.mAction + " clientName " + e.mClientName + ", duration " + e.getDuration() Loading @@ -889,6 +897,7 @@ public class CameraServiceProxy extends SystemService + ", streamCount is " + streamCount + ", userTag is " + e.mUserTag + ", videoStabilizationMode " + e.mVideoStabilizationMode + ultrawideDebug + ", logId " + e.mLogId + ", sessionIndex " + e.mSessionIndex + ", mExtSessionStats {type " + extensionType Loading Loading @@ -952,8 +961,9 @@ public class CameraServiceProxy extends SystemService MessageNano.toByteArray(streamProtos[2]), MessageNano.toByteArray(streamProtos[3]), MessageNano.toByteArray(streamProtos[4]), e.mUserTag, e.mVideoStabilizationMode, e.mLogId, e.mSessionIndex, extensionType, extensionIsAdvanced); e.mUserTag, e.mVideoStabilizationMode, e.mLogId, e.mSessionIndex, extensionType, extensionIsAdvanced, e.mUsedUltraWide); } } Loading Loading @@ -1148,6 +1158,7 @@ public class CameraServiceProxy extends SystemService List<CameraStreamStats> streamStats = cameraState.getStreamStats(); String userTag = cameraState.getUserTag(); int videoStabilizationMode = cameraState.getVideoStabilizationMode(); boolean usedUltraWide = Flags.logUltrawideUsage() ? cameraState.getUsedUltraWide() : false; long logId = cameraState.getLogId(); int sessionIdx = cameraState.getSessionIndex(); CameraExtensionSessionStats extSessionStats = cameraState.getExtensionSessionStats(); Loading Loading @@ -1205,7 +1216,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*/"", /*videoStabilizationMode*/-1, /*userTag*/"", /*videoStabilizationMode*/-1, /*usedUltraWide*/false, new CameraExtensionSessionStats()); mCameraUsageHistory.add(oldEvent); } Loading @@ -1217,7 +1228,7 @@ public class CameraServiceProxy extends SystemService doneEvent.markCompleted(internalReconfigureCount, requestCount, resultErrorCount, deviceError, streamStats, userTag, videoStabilizationMode, extSessionStats); videoStabilizationMode, usedUltraWide, extSessionStats); mCameraUsageHistory.add(doneEvent); // Do not double count device error deviceError = false; Loading Loading
core/java/android/hardware/CameraSessionStats.java +12 −0 Original line number Diff line number Diff line Loading @@ -64,6 +64,7 @@ public class CameraSessionStats implements Parcelable { private ArrayList<CameraStreamStats> mStreamStats; private String mUserTag; private int mVideoStabilizationMode; private boolean mUsedUltraWide; private int mSessionIndex; private CameraExtensionSessionStats mCameraExtensionSessionStats; Loading @@ -82,6 +83,7 @@ public class CameraSessionStats implements Parcelable { mDeviceError = false; mStreamStats = new ArrayList<CameraStreamStats>(); mVideoStabilizationMode = -1; mUsedUltraWide = false; mSessionIndex = 0; mCameraExtensionSessionStats = new CameraExtensionSessionStats(); } Loading @@ -102,6 +104,8 @@ public class CameraSessionStats implements Parcelable { mSessionType = sessionType; mInternalReconfigure = internalReconfigure; mStreamStats = new ArrayList<CameraStreamStats>(); mVideoStabilizationMode = -1; mUsedUltraWide = false; mSessionIndex = sessionIdx; mCameraExtensionSessionStats = new CameraExtensionSessionStats(); } Loading Loading @@ -147,6 +151,7 @@ public class CameraSessionStats implements Parcelable { dest.writeTypedList(mStreamStats); dest.writeString(mUserTag); dest.writeInt(mVideoStabilizationMode); dest.writeBoolean(mUsedUltraWide); dest.writeInt(mSessionIndex); mCameraExtensionSessionStats.writeToParcel(dest, 0); } Loading @@ -173,6 +178,9 @@ public class CameraSessionStats implements Parcelable { mUserTag = in.readString(); mVideoStabilizationMode = in.readInt(); mUsedUltraWide = in.readBoolean(); mSessionIndex = in.readInt(); mCameraExtensionSessionStats = CameraExtensionSessionStats.CREATOR.createFromParcel(in); } Loading Loading @@ -245,6 +253,10 @@ public class CameraSessionStats implements Parcelable { return mVideoStabilizationMode; } public boolean getUsedUltraWide() { return mUsedUltraWide; } public int getSessionIndex() { return mSessionIndex; } Loading
services/core/java/com/android/server/camera/CameraServiceProxy.java +16 −5 Original line number Diff line number Diff line Loading @@ -77,6 +77,7 @@ import android.view.WindowManagerGlobal; import com.android.framework.protobuf.nano.MessageNano; import com.android.internal.R; import com.android.internal.annotations.GuardedBy; import com.android.internal.camera.flags.Flags; import com.android.internal.util.FrameworkStatsLog; import com.android.server.LocalServices; import com.android.server.ServiceThread; Loading Loading @@ -244,6 +245,7 @@ public class CameraServiceProxy extends SystemService public List<CameraStreamStats> mStreamStats; public String mUserTag; public int mVideoStabilizationMode; public boolean mUsedUltraWide; public final long mLogId; public final int mSessionIndex; Loading Loading @@ -271,7 +273,8 @@ public class CameraServiceProxy extends SystemService public void markCompleted(int internalReconfigure, long requestCount, long resultErrorCount, boolean deviceError, List<CameraStreamStats> streamStats, String userTag, int videoStabilizationMode, CameraExtensionSessionStats extStats) { int videoStabilizationMode, boolean usedUltraWide, CameraExtensionSessionStats extStats) { if (mCompleted) { return; } Loading @@ -284,6 +287,7 @@ public class CameraServiceProxy extends SystemService mStreamStats = streamStats; mUserTag = userTag; mVideoStabilizationMode = videoStabilizationMode; mUsedUltraWide = usedUltraWide; mExtSessionStats = extStats; if (CameraServiceProxy.DEBUG) { Slog.v(TAG, "A camera facing " + cameraFacingToString(mCameraFacing) + Loading Loading @@ -873,6 +877,10 @@ public class CameraServiceProxy extends SystemService streamCount = e.mStreamStats.size(); } if (CameraServiceProxy.DEBUG) { String ultrawideDebug = Flags.logUltrawideUsage() ? ", wideAngleUsage " + e.mUsedUltraWide : ""; Slog.v(TAG, "CAMERA_ACTION_EVENT: action " + e.mAction + " clientName " + e.mClientName + ", duration " + e.getDuration() Loading @@ -889,6 +897,7 @@ public class CameraServiceProxy extends SystemService + ", streamCount is " + streamCount + ", userTag is " + e.mUserTag + ", videoStabilizationMode " + e.mVideoStabilizationMode + ultrawideDebug + ", logId " + e.mLogId + ", sessionIndex " + e.mSessionIndex + ", mExtSessionStats {type " + extensionType Loading Loading @@ -952,8 +961,9 @@ public class CameraServiceProxy extends SystemService MessageNano.toByteArray(streamProtos[2]), MessageNano.toByteArray(streamProtos[3]), MessageNano.toByteArray(streamProtos[4]), e.mUserTag, e.mVideoStabilizationMode, e.mLogId, e.mSessionIndex, extensionType, extensionIsAdvanced); e.mUserTag, e.mVideoStabilizationMode, e.mLogId, e.mSessionIndex, extensionType, extensionIsAdvanced, e.mUsedUltraWide); } } Loading Loading @@ -1148,6 +1158,7 @@ public class CameraServiceProxy extends SystemService List<CameraStreamStats> streamStats = cameraState.getStreamStats(); String userTag = cameraState.getUserTag(); int videoStabilizationMode = cameraState.getVideoStabilizationMode(); boolean usedUltraWide = Flags.logUltrawideUsage() ? cameraState.getUsedUltraWide() : false; long logId = cameraState.getLogId(); int sessionIdx = cameraState.getSessionIndex(); CameraExtensionSessionStats extSessionStats = cameraState.getExtensionSessionStats(); Loading Loading @@ -1205,7 +1216,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*/"", /*videoStabilizationMode*/-1, /*userTag*/"", /*videoStabilizationMode*/-1, /*usedUltraWide*/false, new CameraExtensionSessionStats()); mCameraUsageHistory.add(oldEvent); } Loading @@ -1217,7 +1228,7 @@ public class CameraServiceProxy extends SystemService doneEvent.markCompleted(internalReconfigureCount, requestCount, resultErrorCount, deviceError, streamStats, userTag, videoStabilizationMode, extSessionStats); videoStabilizationMode, usedUltraWide, extSessionStats); mCameraUsageHistory.add(doneEvent); // Do not double count device error deviceError = false; Loading