Loading packages/SystemUI/src/com/android/systemui/fingerprint/FODCircleView.java +56 −23 Original line number Diff line number Diff line Loading @@ -75,6 +75,7 @@ public class FODCircleView extends ImageView implements OnTouchListener { private boolean mIsPulsing; private boolean mIsScreenOn; private boolean mIsViewAdded; private boolean mIsRemoving; private Handler mHandler; Loading Loading @@ -244,6 +245,20 @@ public class FODCircleView extends ImageView implements OnTouchListener { @Override protected void onDraw(Canvas canvas) { super.onDraw(canvas); if (mIsInsideCircle) { canvas.drawCircle(mWidth / 2, mHeight / 2, (float) (mWidth / 2.0f), mPaintFingerprint); } } @Override protected void onLayout(boolean changed, int left, int top, int right, int bottom) { super.onLayout(changed, left, top, right, bottom); // onLayout is a good time to call the HAL because dim layer // added by setDim() should have come into effect // the HAL is expected (if supported) to set the screen brightness // to maximum / minimum immediately when called if (mIsInsideCircle) { if (mIsDreaming) { setAlpha(1.0f); Loading @@ -259,7 +274,6 @@ public class FODCircleView extends ImageView implements OnTouchListener { } mIsPressed = true; } canvas.drawCircle(mWidth / 2, mHeight / 2, (float) (mWidth / 2.0f), mPaintFingerprint); } else { setAlpha(mIsDreaming ? 0.5f : 1.0f); if (mIsPressed) { Loading @@ -273,6 +287,11 @@ public class FODCircleView extends ImageView implements OnTouchListener { } mIsPressed = false; } if (mIsRemoving) { mIsRemoving = false; mWindowManager.removeView(this); } } } Loading Loading @@ -318,6 +337,33 @@ public class FODCircleView extends ImageView implements OnTouchListener { } } @Override protected void onDetachedFromWindow() { super.onDetachedFromWindow(); IFingerprintInscreen daemon = getFingerprintInScreenDaemon(); if (daemon != null) { try { daemon.onHideFODView(); } catch (RemoteException e) { // do nothing } } } @Override protected void onAttachedToWindow() { super.onAttachedToWindow(); IFingerprintInscreen daemon = getFingerprintInScreenDaemon(); if (daemon != null) { try { daemon.onShowFODView(); } catch (RemoteException e) { // do nothing } } } public synchronized IFingerprintInscreen getFingerprintInScreenDaemon() { if (mFingerprintInscreenDaemon == null) { Loading @@ -337,6 +383,12 @@ public class FODCircleView extends ImageView implements OnTouchListener { } public void show() { if (mIsRemoving) { // Last removal hasn't been finished yet mIsRemoving = false; mWindowManager.removeView(this); } if (mIsViewAdded) { return; } Loading Loading @@ -367,15 +419,6 @@ public class FODCircleView extends ImageView implements OnTouchListener { mIsPressed = false; setDim(false); IFingerprintInscreen daemon = getFingerprintInScreenDaemon(); if (daemon != null) { try { daemon.onShowFODView(); } catch (RemoteException e) { // do nothing } } } public void hide() { Loading @@ -384,21 +427,11 @@ public class FODCircleView extends ImageView implements OnTouchListener { } mIsInsideCircle = false; mWindowManager.removeView(this); mIsViewAdded = false; mIsPressed = false; // Postpone removal to next re-layout to avoid blinking mIsRemoving = true; setDim(false); IFingerprintInscreen daemon = getFingerprintInScreenDaemon(); if (daemon != null) { try { daemon.onHideFODView(); } catch (RemoteException e) { // do nothing } } invalidate(); } private void resetPosition() { Loading Loading
packages/SystemUI/src/com/android/systemui/fingerprint/FODCircleView.java +56 −23 Original line number Diff line number Diff line Loading @@ -75,6 +75,7 @@ public class FODCircleView extends ImageView implements OnTouchListener { private boolean mIsPulsing; private boolean mIsScreenOn; private boolean mIsViewAdded; private boolean mIsRemoving; private Handler mHandler; Loading Loading @@ -244,6 +245,20 @@ public class FODCircleView extends ImageView implements OnTouchListener { @Override protected void onDraw(Canvas canvas) { super.onDraw(canvas); if (mIsInsideCircle) { canvas.drawCircle(mWidth / 2, mHeight / 2, (float) (mWidth / 2.0f), mPaintFingerprint); } } @Override protected void onLayout(boolean changed, int left, int top, int right, int bottom) { super.onLayout(changed, left, top, right, bottom); // onLayout is a good time to call the HAL because dim layer // added by setDim() should have come into effect // the HAL is expected (if supported) to set the screen brightness // to maximum / minimum immediately when called if (mIsInsideCircle) { if (mIsDreaming) { setAlpha(1.0f); Loading @@ -259,7 +274,6 @@ public class FODCircleView extends ImageView implements OnTouchListener { } mIsPressed = true; } canvas.drawCircle(mWidth / 2, mHeight / 2, (float) (mWidth / 2.0f), mPaintFingerprint); } else { setAlpha(mIsDreaming ? 0.5f : 1.0f); if (mIsPressed) { Loading @@ -273,6 +287,11 @@ public class FODCircleView extends ImageView implements OnTouchListener { } mIsPressed = false; } if (mIsRemoving) { mIsRemoving = false; mWindowManager.removeView(this); } } } Loading Loading @@ -318,6 +337,33 @@ public class FODCircleView extends ImageView implements OnTouchListener { } } @Override protected void onDetachedFromWindow() { super.onDetachedFromWindow(); IFingerprintInscreen daemon = getFingerprintInScreenDaemon(); if (daemon != null) { try { daemon.onHideFODView(); } catch (RemoteException e) { // do nothing } } } @Override protected void onAttachedToWindow() { super.onAttachedToWindow(); IFingerprintInscreen daemon = getFingerprintInScreenDaemon(); if (daemon != null) { try { daemon.onShowFODView(); } catch (RemoteException e) { // do nothing } } } public synchronized IFingerprintInscreen getFingerprintInScreenDaemon() { if (mFingerprintInscreenDaemon == null) { Loading @@ -337,6 +383,12 @@ public class FODCircleView extends ImageView implements OnTouchListener { } public void show() { if (mIsRemoving) { // Last removal hasn't been finished yet mIsRemoving = false; mWindowManager.removeView(this); } if (mIsViewAdded) { return; } Loading Loading @@ -367,15 +419,6 @@ public class FODCircleView extends ImageView implements OnTouchListener { mIsPressed = false; setDim(false); IFingerprintInscreen daemon = getFingerprintInScreenDaemon(); if (daemon != null) { try { daemon.onShowFODView(); } catch (RemoteException e) { // do nothing } } } public void hide() { Loading @@ -384,21 +427,11 @@ public class FODCircleView extends ImageView implements OnTouchListener { } mIsInsideCircle = false; mWindowManager.removeView(this); mIsViewAdded = false; mIsPressed = false; // Postpone removal to next re-layout to avoid blinking mIsRemoving = true; setDim(false); IFingerprintInscreen daemon = getFingerprintInScreenDaemon(); if (daemon != null) { try { daemon.onHideFODView(); } catch (RemoteException e) { // do nothing } } invalidate(); } private void resetPosition() { Loading