Loading media/java/android/media/tv/tuner/dvr/DvrRecorder.java +22 −3 Original line number Diff line number Diff line Loading @@ -47,6 +47,7 @@ public class DvrRecorder implements AutoCloseable { private static int sInstantId = 0; private int mSegmentId = 0; private int mOverflow; private Boolean mIsStopped = null; private native int nativeAttachFilter(Filter filter); private native int nativeDetachFilter(Filter filter); Loading Loading @@ -135,7 +136,13 @@ public class DvrRecorder implements AutoCloseable { .write(FrameworkStatsLog.TV_TUNER_DVR_STATUS, mUserId, FrameworkStatsLog.TV_TUNER_DVR_STATUS__TYPE__RECORD, FrameworkStatsLog.TV_TUNER_DVR_STATUS__STATE__STARTED, mSegmentId, 0); return nativeStartDvr(); synchronized (mIsStopped) { int result = nativeStartDvr(); if (result == Tuner.RESULT_SUCCESS) { mIsStopped = false; } return result; } } /** Loading @@ -152,7 +159,13 @@ public class DvrRecorder implements AutoCloseable { .write(FrameworkStatsLog.TV_TUNER_DVR_STATUS, mUserId, FrameworkStatsLog.TV_TUNER_DVR_STATUS__TYPE__RECORD, FrameworkStatsLog.TV_TUNER_DVR_STATUS__STATE__STOPPED, mSegmentId, mOverflow); return nativeStopDvr(); synchronized (mIsStopped) { int result = nativeStopDvr(); if (result == Tuner.RESULT_SUCCESS) { mIsStopped = true; } return result; } } /** Loading @@ -164,8 +177,14 @@ public class DvrRecorder implements AutoCloseable { */ @Result public int flush() { synchronized (mIsStopped) { if (mIsStopped) { return nativeFlushDvr(); } Log.w(TAG, "Cannot flush non-stopped Record DVR."); return Tuner.RESULT_INVALID_STATE; } } /** * Closes the DVR instance to release resources. Loading Loading
media/java/android/media/tv/tuner/dvr/DvrRecorder.java +22 −3 Original line number Diff line number Diff line Loading @@ -47,6 +47,7 @@ public class DvrRecorder implements AutoCloseable { private static int sInstantId = 0; private int mSegmentId = 0; private int mOverflow; private Boolean mIsStopped = null; private native int nativeAttachFilter(Filter filter); private native int nativeDetachFilter(Filter filter); Loading Loading @@ -135,7 +136,13 @@ public class DvrRecorder implements AutoCloseable { .write(FrameworkStatsLog.TV_TUNER_DVR_STATUS, mUserId, FrameworkStatsLog.TV_TUNER_DVR_STATUS__TYPE__RECORD, FrameworkStatsLog.TV_TUNER_DVR_STATUS__STATE__STARTED, mSegmentId, 0); return nativeStartDvr(); synchronized (mIsStopped) { int result = nativeStartDvr(); if (result == Tuner.RESULT_SUCCESS) { mIsStopped = false; } return result; } } /** Loading @@ -152,7 +159,13 @@ public class DvrRecorder implements AutoCloseable { .write(FrameworkStatsLog.TV_TUNER_DVR_STATUS, mUserId, FrameworkStatsLog.TV_TUNER_DVR_STATUS__TYPE__RECORD, FrameworkStatsLog.TV_TUNER_DVR_STATUS__STATE__STOPPED, mSegmentId, mOverflow); return nativeStopDvr(); synchronized (mIsStopped) { int result = nativeStopDvr(); if (result == Tuner.RESULT_SUCCESS) { mIsStopped = true; } return result; } } /** Loading @@ -164,8 +177,14 @@ public class DvrRecorder implements AutoCloseable { */ @Result public int flush() { synchronized (mIsStopped) { if (mIsStopped) { return nativeFlushDvr(); } Log.w(TAG, "Cannot flush non-stopped Record DVR."); return Tuner.RESULT_INVALID_STATE; } } /** * Closes the DVR instance to release resources. Loading