From 5a15745ff622e4549e41550febfd583070043796 Mon Sep 17 00:00:00 2001 From: Maurice Lam Date: Fri, 15 Jul 2016 12:33:52 -0700 Subject: [PATCH] Support hardware colors for fingerprint video Bug: 28745754 Change-Id: Id86c2a6d882d4c4c4d1981da58de3e4c2059a50c --- .../FingerprintLocationAnimationVideoView.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/com/android/settings/fingerprint/FingerprintLocationAnimationVideoView.java b/src/com/android/settings/fingerprint/FingerprintLocationAnimationVideoView.java index 2593e333042..9f122868fd3 100644 --- a/src/com/android/settings/fingerprint/FingerprintLocationAnimationVideoView.java +++ b/src/com/android/settings/fingerprint/FingerprintLocationAnimationVideoView.java @@ -41,7 +41,6 @@ public class FingerprintLocationAnimationVideoView extends TextureView public FingerprintLocationAnimationVideoView(Context context, AttributeSet attrs) { super(context, attrs); - } @Override @@ -52,6 +51,10 @@ public class FingerprintLocationAnimationVideoView extends TextureView super.onMeasure(widthMeasureSpec, MeasureSpec.makeMeasureSpec(height, MeasureSpec.EXACTLY)); } + protected Uri getFingerprintLocationAnimation() { + return resourceEntryToUri(getContext(), R.raw.fingerprint_location_animation); + } + @Override protected void onFinishInflate() { super.onFinishInflate(); @@ -62,7 +65,7 @@ public class FingerprintLocationAnimationVideoView extends TextureView public void onSurfaceTextureAvailable(SurfaceTexture surfaceTexture, int width, int height) { setVisibility(View.INVISIBLE); - Uri videoUri = resourceEntryToUri(mContext, R.raw.fingerprint_location_animation); + Uri videoUri = getFingerprintLocationAnimation(); if (mMediaPlayer != null) { mMediaPlayer.release(); } @@ -110,7 +113,7 @@ public class FingerprintLocationAnimationVideoView extends TextureView }); } - private static Uri resourceEntryToUri (Context context, int id) { + protected static Uri resourceEntryToUri (Context context, int id) { Resources res = context.getResources(); return Uri.parse(ContentResolver.SCHEME_ANDROID_RESOURCE + "://" + res.getResourcePackageName(id) + '/' +