From 8a57efb7eb627c20bc43a8007a95652247720118 Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Tue, 22 Jul 2014 12:09:38 -0700 Subject: [PATCH 1/4] Don't throw RemoteException in public RemoteCallVideoClient APIs. - Hide constructor. - No longer implements IBinder.DeathRecipient. - Catch RemoteExceptions instead of throwing RemoteExceptions. Change-Id: Iaa049cab9e24120d3ea732e1ede78cc6fcd0ad71 --- api/current.txt | 15 ++--- .../telecomm/RemoteCallVideoClient.java | 66 ++++++++++++------- 2 files changed, 50 insertions(+), 31 deletions(-) diff --git a/api/current.txt b/api/current.txt index 37008e43dd68c..a407abc707e40 100644 --- a/api/current.txt +++ b/api/current.txt @@ -28706,14 +28706,13 @@ package android.telecomm { field public static final android.os.Parcelable.Creator CREATOR; } - public class RemoteCallVideoClient implements android.os.IBinder.DeathRecipient { - method public void binderDied(); - method public void handleCallSessionEvent(int) throws android.os.RemoteException; - method public void handleCameraCapabilitiesChange(android.telecomm.CallCameraCapabilities) throws android.os.RemoteException; - method public void receiveSessionModifyRequest(android.telecomm.VideoCallProfile) throws android.os.RemoteException; - method public void receiveSessionModifyResponse(int, android.telecomm.VideoCallProfile, android.telecomm.VideoCallProfile) throws android.os.RemoteException; - method public void updateCallDataUsage(int) throws android.os.RemoteException; - method public void updatePeerDimensions(int, int) throws android.os.RemoteException; + public class RemoteCallVideoClient { + method public void handleCallSessionEvent(int); + method public void handleCameraCapabilitiesChange(android.telecomm.CallCameraCapabilities); + method public void receiveSessionModifyRequest(android.telecomm.VideoCallProfile); + method public void receiveSessionModifyResponse(int, android.telecomm.VideoCallProfile, android.telecomm.VideoCallProfile); + method public void updateCallDataUsage(int); + method public void updatePeerDimensions(int, int); } public class RemoteCallVideoProvider { diff --git a/telecomm/java/android/telecomm/RemoteCallVideoClient.java b/telecomm/java/android/telecomm/RemoteCallVideoClient.java index 80248318b7ff9..08d1391fc689e 100644 --- a/telecomm/java/android/telecomm/RemoteCallVideoClient.java +++ b/telecomm/java/android/telecomm/RemoteCallVideoClient.java @@ -26,17 +26,20 @@ import com.android.internal.telecomm.ICallVideoClient; /** * Remote class to invoke callbacks in InCallUI related to supporting video in calls. */ -public class RemoteCallVideoClient implements IBinder.DeathRecipient { +public class RemoteCallVideoClient { private final ICallVideoClient mCallVideoClient; + private IBinder.DeathRecipient mDeathRecipient = new IBinder.DeathRecipient() { + @Override + public void binderDied() { + mCallVideoClient.asBinder().unlinkToDeath(this, 0); + } + }; + + /** {@hide} */ RemoteCallVideoClient(ICallVideoClient callVideoProvider) throws RemoteException { mCallVideoClient = callVideoProvider; - mCallVideoClient.asBinder().linkToDeath(this, 0); - } - - @Override - public void binderDied() { - mCallVideoClient.asBinder().unlinkToDeath(this, 0); + mCallVideoClient.asBinder().linkToDeath(mDeathRecipient, 0); } /** @@ -49,9 +52,11 @@ public class RemoteCallVideoClient implements IBinder.DeathRecipient { * * @param videoCallProfile The requested video call profile. */ - public void receiveSessionModifyRequest(VideoCallProfile videoCallProfile) - throws RemoteException { - mCallVideoClient.receiveSessionModifyRequest(videoCallProfile); + public void receiveSessionModifyRequest(VideoCallProfile videoCallProfile) { + try { + mCallVideoClient.receiveSessionModifyRequest(videoCallProfile); + } catch (RemoteException e) { + } } /** @@ -66,9 +71,13 @@ public class RemoteCallVideoClient implements IBinder.DeathRecipient { * @param requestedProfile The original request which was sent to the remote device. * @param responseProfile The actual profile changes made by the remote device. */ - public void receiveSessionModifyResponse(int status, VideoCallProfile requestedProfile, - VideoCallProfile responseProfile) throws RemoteException { - mCallVideoClient.receiveSessionModifyResponse(status, requestedProfile, responseProfile); + public void receiveSessionModifyResponse( + int status, VideoCallProfile requestedProfile, VideoCallProfile responseProfile) { + try { + mCallVideoClient.receiveSessionModifyResponse( + status, requestedProfile, responseProfile); + } catch (RemoteException e) { + } } /** @@ -81,8 +90,11 @@ public class RemoteCallVideoClient implements IBinder.DeathRecipient { * * @param event The event. */ - public void handleCallSessionEvent(int event) throws RemoteException { - mCallVideoClient.handleCallSessionEvent(event); + public void handleCallSessionEvent(int event) { + try { + mCallVideoClient.handleCallSessionEvent(event); + } catch (RemoteException e) { + } } /** @@ -92,8 +104,11 @@ public class RemoteCallVideoClient implements IBinder.DeathRecipient { * @param width The updated peer video width. * @param height The updated peer video height. */ - public void updatePeerDimensions(int width, int height) throws RemoteException { - mCallVideoClient.updatePeerDimensions(width, height); + public void updatePeerDimensions(int width, int height) { + try { + mCallVideoClient.updatePeerDimensions(width, height); + } catch (RemoteException e) { + } } /** @@ -101,8 +116,11 @@ public class RemoteCallVideoClient implements IBinder.DeathRecipient { * * @param dataUsage The updated data usage. */ - public void updateCallDataUsage(int dataUsage) throws RemoteException { - mCallVideoClient.updateCallDataUsage(dataUsage); + public void updateCallDataUsage(int dataUsage) { + try { + mCallVideoClient.updateCallDataUsage(dataUsage); + } catch (RemoteException e) { + } } /** @@ -110,8 +128,10 @@ public class RemoteCallVideoClient implements IBinder.DeathRecipient { * * @param callCameraCapabilities The changed camera capabilities. */ - public void handleCameraCapabilitiesChange(CallCameraCapabilities callCameraCapabilities) - throws RemoteException { - mCallVideoClient.handleCameraCapabilitiesChange(callCameraCapabilities); + public void handleCameraCapabilitiesChange(CallCameraCapabilities callCameraCapabilities) { + try { + mCallVideoClient.handleCameraCapabilitiesChange(callCameraCapabilities); + } catch (RemoteException e) { + } } -} +} \ No newline at end of file From b7c014c291eff2a97f32ce1ae7e42bd8f825c74c Mon Sep 17 00:00:00 2001 From: RoboErik Date: Tue, 22 Jul 2014 15:58:22 -0700 Subject: [PATCH 2/4] Move return out of debug conditional Accidentally put the return for not sending volume changes into the debug conditional. bug:16379124 Change-Id: I473f6fdf7577ca26559ab9b02f4dc0613ef702e3 --- .../core/java/com/android/server/media/MediaSessionService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/media/MediaSessionService.java b/services/core/java/com/android/server/media/MediaSessionService.java index a2dd15ed03d1c..b0ccd622715ad 100644 --- a/services/core/java/com/android/server/media/MediaSessionService.java +++ b/services/core/java/com/android/server/media/MediaSessionService.java @@ -776,8 +776,8 @@ public class MediaSessionService extends SystemService implements Monitor { if ((flags & AudioManager.FLAG_ACTIVE_MEDIA_ONLY) != 0) { if (DEBUG) { Log.d(TAG, "No active session to adjust, skipping media only volume event"); - return; } + return; } try { mAudioService.adjustSuggestedStreamVolume(direction, suggestedStream, flags, From 7ea62ba97b4645fe0c21e9c2df73503c259db62a Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Tue, 22 Jul 2014 16:30:37 -0700 Subject: [PATCH 3/4] Always enable HW layers on task views. (Bug 15986310) - Use color filter to apply dim to the task view layer - Fixing bug where you would see a flash of the task view when animating out of Recents. --- .../systemui/recents/views/TaskBarView.java | 18 ++--- .../systemui/recents/views/TaskStackView.java | 70 ++----------------- .../views/TaskStackViewTouchHandler.java | 28 -------- .../systemui/recents/views/TaskView.java | 46 +++--------- .../recents/views/TaskViewTransform.java | 11 ++- 5 files changed, 27 insertions(+), 146 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/TaskBarView.java b/packages/SystemUI/src/com/android/systemui/recents/views/TaskBarView.java index fbfad5cdbade6..fd636edcd1b28 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/views/TaskBarView.java +++ b/packages/SystemUI/src/com/android/systemui/recents/views/TaskBarView.java @@ -22,6 +22,7 @@ import android.graphics.Canvas; import android.graphics.Paint; import android.graphics.PorterDuff; import android.graphics.PorterDuffXfermode; +import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.Drawable; import android.graphics.drawable.RippleDrawable; import android.util.AttributeSet; @@ -52,7 +53,6 @@ class TaskBarView extends FrameLayout { boolean mIsFullscreen; - Paint mLayerPaint = new Paint(); static Paint sHighlightPaint; public TaskBarView(Context context) { @@ -167,7 +167,11 @@ class TaskBarView extends FrameLayout { mActivityDescription.setText(t.activityLabel); } // Try and apply the system ui tint - setBackgroundColor(t.colorPrimary); + int existingBgColor = (getBackground() instanceof ColorDrawable) ? + ((ColorDrawable) getBackground()).getColor() : 0; + if (existingBgColor != t.colorPrimary) { + setBackgroundColor(t.colorPrimary); + } mActivityDescription.setTextColor(t.useLightOnPrimaryColor ? mConfig.taskBarViewLightTextColor : mConfig.taskBarViewDarkTextColor); mDismissButton.setImageDrawable(t.useLightOnPrimaryColor ? @@ -252,14 +256,4 @@ class TaskBarView extends FrameLayout { mDismissButton.setAlpha(1f); } } - - /** Enable the hw layers on this task view */ - void enableHwLayers() { - mDismissButton.setLayerType(View.LAYER_TYPE_HARDWARE, mLayerPaint); - } - - /** Disable the hw layers on this task view */ - void disableHwLayers() { - mDismissButton.setLayerType(View.LAYER_TYPE_NONE, mLayerPaint); - } } diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java b/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java index d84a40f4e55c3..1c8ae31992a6a 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java +++ b/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java @@ -100,13 +100,15 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal LayoutInflater mInflater; // A convenience runnable to return all views to the pool - // XXX: After this is set, we should mark this task stack view as disabled and check that in synchronize model Runnable mReturnAllViewsToPoolRunnable = new Runnable() { @Override public void run() { int childCount = getChildCount(); for (int i = childCount - 1; i >= 0; i--) { - mViewPool.returnViewToPool((TaskView) getChildAt(i)); + TaskView tv = (TaskView) getChildAt(i); + mViewPool.returnViewToPool(tv); + // Also hide the view since we don't need it anymore + tv.setVisibility(View.INVISIBLE); } } }; @@ -133,33 +135,6 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal } } }); - mHwLayersTrigger = new ReferenceCountedTrigger(getContext(), new Runnable() { - @Override - public void run() { - // Enable hw layers on each of the children - int childCount = getChildCount(); - for (int i = 0; i < childCount; i++) { - TaskView tv = (TaskView) getChildAt(i); - tv.enableHwLayers(); - } - } - }, new Runnable() { - @Override - public void run() { - // Disable hw layers on each of the children - int childCount = getChildCount(); - for (int i = 0; i < childCount; i++) { - TaskView tv = (TaskView) getChildAt(i); - tv.disableHwLayers(); - } - } - }, new Runnable() { - @Override - public void run() { - new Throwable("Invalid hw layers ref count").printStackTrace(); - Console.logError(getContext(), "Invalid HW layers ref count"); - } - }); } /** Sets the callbacks */ @@ -435,17 +410,8 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal int curScroll = getStackScroll(); int newScroll = Math.max(mMinScroll, Math.min(mMaxScroll, curScroll)); if (newScroll != curScroll) { - // Enable hw layers on the stack - addHwLayersRefCount("animateBoundScroll"); - // Start a new scroll animation - animateScroll(curScroll, newScroll, new Runnable() { - @Override - public void run() { - // Disable hw layers on the stack - decHwLayersRefCount("animateBoundScroll"); - } - }); + animateScroll(curScroll, newScroll, null); } return mScrollAnimator; } @@ -490,8 +456,6 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal if (!mScroller.isFinished()) { // Abort the scroller mScroller.abortAnimation(); - // And disable hw layers on the stack - decHwLayersRefCount("flingScroll"); } } @@ -615,17 +579,6 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal focusTask(mFocusedTaskIndex, true); } - /** Enables the hw layers and increments the hw layer requirement ref count */ - void addHwLayersRefCount(String reason) { - mHwLayersTrigger.increment(); - } - - /** Decrements the hw layer requirement ref count and disables the hw layers when we don't - need them anymore. */ - void decHwLayersRefCount(String reason) { - mHwLayersTrigger.decrement(); - } - @Override public boolean onInterceptTouchEvent(MotionEvent ev) { return mTouchHandler.onInterceptTouchEvent(ev); @@ -641,11 +594,6 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal if (mScroller.computeScrollOffset()) { setStackScroll(mScroller.getCurrY()); invalidate(); - - // If we just finished scrolling, then disable the hw layers - if (mScroller.isFinished()) { - decHwLayersRefCount("finishedFlingScroll"); - } } } @@ -969,9 +917,6 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal // Detach the view from the hierarchy detachViewFromParent(tv); - // Disable HW layers - tv.disableHwLayers(); - // Reset the view properties tv.resetViewProperties(); } @@ -1015,11 +960,6 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal } else { attachViewToParent(tv, insertIndex, tv.getLayoutParams()); } - - // Enable hw layers on this view if hw layers are enabled on the stack - if (mHwLayersTrigger.getCount() > 0) { - tv.enableHwLayers(); - } } @Override diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackViewTouchHandler.java b/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackViewTouchHandler.java index 191dc37b662f7..b83f9cc265466 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackViewTouchHandler.java +++ b/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackViewTouchHandler.java @@ -148,8 +148,6 @@ class TaskStackViewTouchHandler implements SwipeHelper.Callback { if (parent != null) { parent.requestDisallowInterceptTouchEvent(true); } - // Enable HW layers - mSv.addHwLayersRefCount("stackScroll"); } mLastMotionX = x; @@ -160,10 +158,6 @@ class TaskStackViewTouchHandler implements SwipeHelper.Callback { case MotionEvent.ACTION_UP: { // Animate the scroll back if we've cancelled mSv.animateBoundScroll(); - // Disable HW layers - if (mIsScrolling) { - mSv.decHwLayersRefCount("stackScroll"); - } // Reset the drag state and the velocity tracker mIsScrolling = false; mActivePointerId = INACTIVE_POINTER_ID; @@ -241,8 +235,6 @@ class TaskStackViewTouchHandler implements SwipeHelper.Callback { if (parent != null) { parent.requestDisallowInterceptTouchEvent(true); } - // Enable HW layers - mSv.addHwLayersRefCount("stackScroll"); } } if (mIsScrolling) { @@ -271,8 +263,6 @@ class TaskStackViewTouchHandler implements SwipeHelper.Callback { int velocity = (int) velocityTracker.getYVelocity(mActivePointerId); if (mIsScrolling && (Math.abs(velocity) > mMinimumVelocity)) { - // Enable HW layers on the stack - mSv.addHwLayersRefCount("flingScroll"); // XXX: Make this animation a function of the velocity AND distance int overscrollRange = (int) (Math.min(1f, Math.abs((float) velocity / mMaximumVelocity)) * @@ -291,10 +281,6 @@ class TaskStackViewTouchHandler implements SwipeHelper.Callback { mSv.animateBoundScroll(); } - if (mIsScrolling) { - // Disable HW layers - mSv.decHwLayersRefCount("stackScroll"); - } mActivePointerId = INACTIVE_POINTER_ID; mIsScrolling = false; mTotalScrollMotion = 0; @@ -315,10 +301,6 @@ class TaskStackViewTouchHandler implements SwipeHelper.Callback { break; } case MotionEvent.ACTION_CANCEL: { - if (mIsScrolling) { - // Disable HW layers - mSv.decHwLayersRefCount("stackScroll"); - } if (mSv.isScrollOutOfBounds()) { // Animate the scroll back into bounds // XXX: Make this animation a function of the velocity OR distance @@ -351,8 +333,6 @@ class TaskStackViewTouchHandler implements SwipeHelper.Callback { TaskView tv = (TaskView) v; // Disable clipping with the stack while we are swiping tv.setClipViewInStack(false); - // Enable HW layers on that task - tv.enableHwLayers(); // Disallow touch events from this task view tv.setTouchEnabled(false); // Hide the footer @@ -372,10 +352,6 @@ class TaskStackViewTouchHandler implements SwipeHelper.Callback { @Override public void onChildDismissed(View v) { TaskView tv = (TaskView) v; - // Disable HW layers on that task - if (mSv.mHwLayersTrigger.getCount() == 0) { - tv.disableHwLayers(); - } // Re-enable clipping with the stack (we will reuse this view) tv.setClipViewInStack(true); // Re-enable touch events from this task view @@ -387,10 +363,6 @@ class TaskStackViewTouchHandler implements SwipeHelper.Callback { @Override public void onSnapBackCompleted(View v) { TaskView tv = (TaskView) v; - // Disable HW layers on that task - if (mSv.mHwLayersTrigger.getCount() == 0) { - tv.disableHwLayers(); - } // Re-enable clipping with the stack tv.setClipViewInStack(true); // Re-enable touch events from this task view diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/TaskView.java b/packages/SystemUI/src/com/android/systemui/recents/views/TaskView.java index d1b33f376517c..259706bd51ecd 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/views/TaskView.java +++ b/packages/SystemUI/src/com/android/systemui/recents/views/TaskView.java @@ -22,7 +22,10 @@ import android.animation.ObjectAnimator; import android.animation.ValueAnimator; import android.content.Context; import android.graphics.Canvas; +import android.graphics.Color; import android.graphics.Paint; +import android.graphics.PorterDuff; +import android.graphics.PorterDuffColorFilter; import android.graphics.Rect; import android.util.AttributeSet; import android.view.View; @@ -34,8 +37,6 @@ import com.android.systemui.recents.Constants; import com.android.systemui.recents.RecentsConfiguration; import com.android.systemui.recents.model.Task; -// XXX: In debug mode, we should override invalidate() and check the layout type (do this in TaskStackView as well) - /* A task view */ public class TaskView extends FrameLayout implements Task.TaskCallbacks, TaskFooterView.TaskFooterViewCallbacks, View.OnClickListener, View.OnLongClickListener { @@ -53,6 +54,7 @@ public class TaskView extends FrameLayout implements Task.TaskCallbacks, int mDim; int mMaxDim; AccelerateInterpolator mDimInterpolator = new AccelerateInterpolator(); + PorterDuffColorFilter mDimColorFilter = new PorterDuffColorFilter(0, PorterDuff.Mode.MULTIPLY); Task mTask; boolean mTaskDataLoaded; @@ -96,9 +98,8 @@ public class TaskView extends FrameLayout implements Task.TaskCallbacks, mMaxDim = mConfig.taskStackMaxDim; mClipViewInStack = true; mViewBounds = new AnimateableViewBounds(this, mConfig.taskViewRoundedCornerRadiusPx); - setWillNotDraw(false); - setDim(getDim()); setOutlineProvider(mViewBounds); + setDim(getDim()); } /** Set callback */ @@ -164,7 +165,7 @@ public class TaskView extends FrameLayout implements Task.TaskCallbacks, } // Apply the transform - toTransform.applyToTaskView(this, duration, mConfig.fastOutSlowInInterpolator, + toTransform.applyToTaskView(this, duration, mConfig.fastOutSlowInInterpolator, false, mUpdateDimListener); } @@ -262,7 +263,6 @@ public class TaskView extends FrameLayout implements Task.TaskCallbacks, AlternateRecentsComponent.consumeLastScreenshot(); } }) - .withLayer() .start(); } else { // Otherwise, just enable the thumbnail clip @@ -316,7 +316,6 @@ public class TaskView extends FrameLayout implements Task.TaskCallbacks, .setUpdateListener(null) .setInterpolator(mConfig.quintOutInterpolator) .setDuration(mConfig.taskViewEnterFromHomeDuration) - .withLayer() .withEndAction(new Runnable() { @Override public void run() { @@ -348,7 +347,6 @@ public class TaskView extends FrameLayout implements Task.TaskCallbacks, .setUpdateListener(null) .setInterpolator(mConfig.fastOutLinearInInterpolator) .setDuration(mConfig.taskViewExitToHomeDuration) - .withLayer() .withEndAction(ctx.postAnimationTrigger.decrementAsRunnable()) .start(); ctx.postAnimationTrigger.increment(); @@ -384,7 +382,6 @@ public class TaskView extends FrameLayout implements Task.TaskCallbacks, .setUpdateListener(null) .setInterpolator(mConfig.fastOutSlowInInterpolator) .setDuration(mConfig.taskViewRemoveAnimDuration) - .withLayer() .withEndAction(new Runnable() { @Override public void run() { @@ -466,7 +463,10 @@ public class TaskView extends FrameLayout implements Task.TaskCallbacks, /** Returns the current dim. */ public void setDim(int dim) { mDim = dim; - postInvalidateOnAnimation(); + int inverse = 255 - mDim; + mDimColorFilter.setColor(Color.argb(0xFF, inverse, inverse, inverse)); + mLayerPaint.setColorFilter(mDimColorFilter); + setLayerType(LAYER_TYPE_HARDWARE, mLayerPaint); } /** Returns the current dim. */ @@ -490,16 +490,6 @@ public class TaskView extends FrameLayout implements Task.TaskCallbacks, /**** View drawing ****/ - @Override - public void draw(Canvas canvas) { - super.draw(canvas); - - // Apply the dim if necessary - if (mDim > 0) { - canvas.drawColor(mDim << 24); - } - } - @Override protected boolean drawChild(Canvas canvas, View child, long drawingTime) { if (mIsStub && (child != mBarView)) { @@ -509,20 +499,6 @@ public class TaskView extends FrameLayout implements Task.TaskCallbacks, return super.drawChild(canvas, child, drawingTime); } - /** Enable the hw layers on this task view */ - void enableHwLayers() { - mThumbnailView.setLayerType(View.LAYER_TYPE_HARDWARE, mLayerPaint); - mBarView.enableHwLayers(); - mFooterView.setLayerType(View.LAYER_TYPE_HARDWARE, mLayerPaint); - } - - /** Disable the hw layers on this task view */ - void disableHwLayers() { - mThumbnailView.setLayerType(View.LAYER_TYPE_NONE, mLayerPaint); - mBarView.disableHwLayers(); - mFooterView.setLayerType(View.LAYER_TYPE_NONE, mLayerPaint); - } - /**** View focus state ****/ /** @@ -640,7 +616,7 @@ public class TaskView extends FrameLayout implements Task.TaskCallbacks, /**** View.OnClickListener Implementation ****/ @Override - public void onClick(final View v) { + public void onClick(final View v) { // We purposely post the handler delayed to allow for the touch feedback to draw final TaskView tv = this; postDelayed(new Runnable() { diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/TaskViewTransform.java b/packages/SystemUI/src/com/android/systemui/recents/views/TaskViewTransform.java index d583c20748160..aeb4fe41a5b83 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/views/TaskViewTransform.java +++ b/packages/SystemUI/src/com/android/systemui/recents/views/TaskViewTransform.java @@ -83,12 +83,12 @@ public class TaskViewTransform { } /** Applies this transform to a view. */ - public void applyToTaskView(View v, int duration, Interpolator interp, + public void applyToTaskView(View v, int duration, Interpolator interp, boolean allowLayers, ValueAnimator.AnimatorUpdateListener scaleUpdateListener) { // Check to see if any properties have changed, and update the task view if (duration > 0) { ViewPropertyAnimator anim = v.animate(); - boolean useLayers = false; + boolean requiresLayers = false; // Animate to the final state if (hasTranslationYChangedFrom(v.getTranslationY())) { @@ -102,14 +102,14 @@ public class TaskViewTransform { anim.scaleX(scale) .scaleY(scale) .setUpdateListener(scaleUpdateListener); - useLayers = true; + requiresLayers = true; } if (hasAlphaChangedFrom(v.getAlpha())) { // Use layers if we animate alpha anim.alpha(alpha); - useLayers = true; + requiresLayers = true; } - if (useLayers) { + if (requiresLayers && allowLayers) { anim.withLayer(); } anim.setStartDelay(startDelay) @@ -146,7 +146,6 @@ public class TaskViewTransform { v.setScaleX(1f); v.setScaleY(1f); v.setAlpha(1f); - v.invalidate(); } @Override From 7db8687d579c47ca5e45f3c50d39f0b324d11c22 Mon Sep 17 00:00:00 2001 From: Antoine Labour Date: Wed, 23 Jul 2014 21:15:48 -0700 Subject: [PATCH 4/4] WindowManager: fix clipping The animation code has some logic to avoid committing a new clip rect when it hasn't changed. However, when we destroy the SurfaceControl and recreate it later, we failed to reset the cached value, so if the clip rect hasn't changed, we never set it on the new SurfaceControl. This patch resets the cached value when creating the SurfaceControl. Change-Id: I355576709834dd80994c7564330a234b182800e6 --- .../core/java/com/android/server/wm/WindowStateAnimator.java | 1 + 1 file changed, 1 insertion(+) diff --git a/services/core/java/com/android/server/wm/WindowStateAnimator.java b/services/core/java/com/android/server/wm/WindowStateAnimator.java index 49d4ae90462e0..24fc4a82e18b2 100644 --- a/services/core/java/com/android/server/wm/WindowStateAnimator.java +++ b/services/core/java/com/android/server/wm/WindowStateAnimator.java @@ -735,6 +735,7 @@ class WindowStateAnimator { mSurfaceX = 0; mSurfaceY = 0; w.mLastSystemDecorRect.set(0, 0, 0, 0); + mLastClipRect.set(0, 0, 0, 0); // Set up surface control with initial size. try {