Merge "Not relying on activity manager when choosing a touch consumer." into ub-launcher3-master
This commit is contained in:
committed by
Android (Google) Code Review
commit
1ebf6f5d77
@@ -45,6 +45,7 @@ import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.view.View;
|
||||
|
||||
import com.android.launcher3.BaseActivity;
|
||||
import com.android.launcher3.BaseDraggingActivity;
|
||||
import com.android.launcher3.DeviceProfile;
|
||||
import com.android.launcher3.Launcher;
|
||||
@@ -114,6 +115,11 @@ public interface ActivityControlHelper<T extends BaseDraggingActivity> {
|
||||
@Nullable
|
||||
T getCreatedActivity();
|
||||
|
||||
default boolean isResumed() {
|
||||
BaseDraggingActivity activity = getCreatedActivity();
|
||||
return activity != null && activity.hasBeenResumed();
|
||||
}
|
||||
|
||||
@UiThread
|
||||
@Nullable
|
||||
RecentsView getVisibleRecentsView();
|
||||
|
||||
@@ -249,7 +249,7 @@ public class TouchInteractionService extends Service {
|
||||
if (runningTaskInfo == null && !forceToLauncher) {
|
||||
return TouchConsumer.NO_OP;
|
||||
} else if (forceToLauncher ||
|
||||
runningTaskInfo.topActivity.equals(mOverviewCommandHelper.overviewComponent)) {
|
||||
mOverviewCommandHelper.getActivityControlHelper().isResumed()) {
|
||||
return OverviewTouchConsumer.newInstance(
|
||||
mOverviewCommandHelper.getActivityControlHelper(), false, mTouchInteractionLog);
|
||||
} else {
|
||||
@@ -257,10 +257,10 @@ public class TouchInteractionService extends Service {
|
||||
tracker = VelocityTracker.obtain();
|
||||
}
|
||||
return new OtherActivityTouchConsumer(this, runningTaskInfo, mRecentsModel,
|
||||
mOverviewCommandHelper.overviewIntent,
|
||||
mOverviewCommandHelper.getActivityControlHelper(), mMainThreadExecutor,
|
||||
mBackgroundThreadChoreographer, downHitTarget, mOverviewCallbacks,
|
||||
mTaskOverlayFactory, mInputConsumer, tracker, mTouchInteractionLog);
|
||||
mOverviewCommandHelper.overviewIntent,
|
||||
mOverviewCommandHelper.getActivityControlHelper(), mMainThreadExecutor,
|
||||
mBackgroundThreadChoreographer, downHitTarget, mOverviewCallbacks,
|
||||
mTaskOverlayFactory, mInputConsumer, tracker, mTouchInteractionLog);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user