Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a1430e0a authored by Wonsik Kim's avatar Wonsik Kim Committed by android-build-merger
Browse files

Merge \"Refine fingerprint animation handling\" into nyc-mr1-dev

am: 534d6443

Change-Id: I39dee0085df38c687831057710645277a3d4ac96
parents b51d45ae 534d6443
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -56,11 +56,20 @@ public class FingerprintLocationAnimationVideoView extends TextureView
    protected void onFinishInflate() {
        super.onFinishInflate();
        setSurfaceTextureListener(new SurfaceTextureListener() {
            private SurfaceTexture mTextureToDestroy = null;

            @Override
            public void onSurfaceTextureAvailable(SurfaceTexture surfaceTexture, int width,
                    int height) {
                setVisibility(View.INVISIBLE);
                Uri videoUri = resourceEntryToUri(mContext, R.raw.fingerprint_location_animation);
                if (mMediaPlayer != null) {
                    mMediaPlayer.release();
                }
                if (mTextureToDestroy != null) {
                    mTextureToDestroy.release();
                    mTextureToDestroy = null;
                }
                mMediaPlayer = MediaPlayer.create(mContext, videoUri);
                mMediaPlayer.setSurface(new Surface(surfaceTexture));
                mMediaPlayer.setOnPreparedListener(new OnPreparedListener() {
@@ -91,6 +100,7 @@ public class FingerprintLocationAnimationVideoView extends TextureView

            @Override
            public boolean onSurfaceTextureDestroyed(SurfaceTexture surfaceTexture) {
                mTextureToDestroy = surfaceTexture;
                return false;
            }