Snap for 5726885 from 93bd85cf55 to qt-qpr1-release

Change-Id: Id1a25c3361dee610516a1f2e11b465e7ad68bef7
This commit is contained in:
android-build-team Robot
2019-07-13 23:17:49 +00:00
7 changed files with 29 additions and 31 deletions
@@ -505,7 +505,8 @@ public class WindowTransformSwipeHandler<T extends BaseDraggingActivity>
initAnimFactory.run();
}
}
AbstractFloatingView.closeAllOpenViews(activity, mWasLauncherAlreadyVisible);
AbstractFloatingView.closeAllOpenViewsExcept(activity, mWasLauncherAlreadyVisible,
AbstractFloatingView.TYPE_LISTENER);
if (mWasLauncherAlreadyVisible) {
mStateCallback.setState(STATE_LAUNCHER_DRAWN);
@@ -472,6 +472,11 @@ public abstract class RecentsView<T extends BaseActivity> extends PagedView impl
}
}
@Override
protected boolean shouldBlockGestures(MotionEvent ev) {
return Utilities.shouldDisableGestures(ev);
}
@Override
public boolean onTouchEvent(MotionEvent ev) {
super.onTouchEvent(ev);
@@ -15,7 +15,6 @@
*/
package com.android.quickstep;
import android.app.ActivityManager;
import android.content.Context;
import android.content.pm.PackageManager;
import android.os.UserManager;
@@ -23,29 +22,17 @@ import android.util.Log;
import com.android.launcher3.BuildConfig;
import com.android.launcher3.MainProcessInitializer;
import com.android.launcher3.Utilities;
import com.android.systemui.shared.system.ThreadedRendererCompat;
@SuppressWarnings("unused")
public class QuickstepProcessInitializer extends MainProcessInitializer {
private static final String TAG = "QuickstepProcessInitializer";
private static final int HEAP_LIMIT_MB = 250;
public QuickstepProcessInitializer(Context context) { }
@Override
protected void init(Context context) {
if (Utilities.IS_DEBUG_DEVICE) {
try {
// Trigger a heap dump if the PSS reaches beyond the target heap limit
final ActivityManager am = context.getSystemService(ActivityManager.class);
am.setWatchHeapLimit(HEAP_LIMIT_MB * 1024 * 1024);
} catch (SecurityException e) {
// Do nothing
}
}
// Workaround for b/120550382, an external app can cause the launcher process to start for
// a work profile user which we do not support. Disable the application immediately when we
// detect this to be the case.
+7 -3
View File
@@ -952,10 +952,14 @@ public class Launcher extends BaseDraggingActivity implements LauncherExterns,
mHandler.removeCallbacks(mHandleDeferredResume);
Utilities.postAsyncCallback(mHandler, mHandleDeferredResume);
for (OnResumeCallback cb : mOnResumeCallbacks) {
cb.onLauncherResume();
if (!mOnResumeCallbacks.isEmpty()) {
final ArrayList<OnResumeCallback> resumeCallbacks = new ArrayList<>(mOnResumeCallbacks);
mOnResumeCallbacks.clear();
for (int i = resumeCallbacks.size() - 1; i >= 0; i--) {
resumeCallbacks.get(i).onLauncherResume();
}
resumeCallbacks.clear();
}
mOnResumeCallbacks.clear();
if (mLauncherCallbacks != null) {
mLauncherCallbacks.onResume();
+6 -3
View File
@@ -16,7 +16,6 @@
package com.android.launcher3;
import static com.android.launcher3.Utilities.shouldDisableGestures;
import static com.android.launcher3.compat.AccessibilityManagerCompat.isAccessibilityEnabled;
import static com.android.launcher3.compat.AccessibilityManagerCompat.isObservedEventType;
import static com.android.launcher3.config.FeatureFlags.QUICKSTEP_SPRINGS;
@@ -847,7 +846,7 @@ public abstract class PagedView<T extends View & PageIndicator> extends ViewGrou
*/
// Skip touch handling if there are no pages to swipe
if (getChildCount() <= 0 || shouldDisableGestures(ev)) return false;
if (getChildCount() <= 0 || shouldBlockGestures(ev)) return false;
acquireVelocityTrackerAndAddMovement(ev);
@@ -1092,10 +1091,14 @@ public abstract class PagedView<T extends View & PageIndicator> extends ViewGrou
mAllowOverScroll = enable;
}
protected boolean shouldBlockGestures(MotionEvent ev) {
return false;
}
@Override
public boolean onTouchEvent(MotionEvent ev) {
// Skip touch handling if there are no pages to swipe
if (getChildCount() <= 0 || shouldDisableGestures(ev)) return false;
if (getChildCount() <= 0 || shouldBlockGestures(ev)) return false;
acquireVelocityTrackerAndAddMovement(ev);
@@ -224,12 +224,10 @@ public abstract class BaseDragLayer<T extends Context & ActivityContext>
if (child instanceof AbstractFloatingView) {
// Handles the case where the view is removed without being properly closed.
// This can happen if something goes wrong during a state change/transition.
postDelayed(() -> {
AbstractFloatingView floatingView = (AbstractFloatingView) child;
if (floatingView.isOpen()) {
floatingView.close(false);
}
}, SINGLE_FRAME_MS);
AbstractFloatingView floatingView = (AbstractFloatingView) child;
if (floatingView.isOpen()) {
postDelayed(() -> floatingView.close(false), SINGLE_FRAME_MS);
}
}
}
@@ -574,17 +574,17 @@ public class FloatingIconView extends View implements
if (cancellationSignal.isCanceled()) {
return;
}
if (mIconLoadResult.isIconLoaded) {
setIcon(originalView, mIconLoadResult.drawable, mIconLoadResult.badge,
mIconLoadResult.iconOffset);
}
setIcon(originalView, mIconLoadResult.drawable, mIconLoadResult.badge,
mIconLoadResult.iconOffset);
// Delay swapping views until the icon is loaded to prevent a flash.
setVisibility(VISIBLE);
originalView.setVisibility(INVISIBLE);
};
mLoadIconSignal = cancellationSignal;
}
}
mLoadIconSignal = cancellationSignal;
}
private void setBackgroundDrawableBounds(float scale) {