Merge "Invoke home via recents for fallback recents" into sc-v2-dev am: 9b762e9778
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/15430812 Change-Id: Ibfadc5c4a295be844c9a193a9f9a415159f35b8d
This commit is contained in:
@@ -18,7 +18,6 @@ package com.android.launcher3.taskbar;
|
|||||||
|
|
||||||
import static android.view.Display.DEFAULT_DISPLAY;
|
import static android.view.Display.DEFAULT_DISPLAY;
|
||||||
|
|
||||||
import android.content.Intent;
|
|
||||||
import android.view.inputmethod.InputMethodManager;
|
import android.view.inputmethod.InputMethodManager;
|
||||||
|
|
||||||
import androidx.annotation.IntDef;
|
import androidx.annotation.IntDef;
|
||||||
@@ -90,9 +89,7 @@ public class TaskbarNavButtonController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void navigateHome() {
|
private void navigateHome() {
|
||||||
mService.startActivity(new Intent(Intent.ACTION_MAIN)
|
mService.getOverviewCommandHelper().addCommand(OverviewCommandHelper.TYPE_HOME);
|
||||||
.addCategory(Intent.CATEGORY_HOME)
|
|
||||||
.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void navigateToOverview() {
|
private void navigateToOverview() {
|
||||||
|
|||||||
@@ -49,6 +49,7 @@ public class OverviewCommandHelper {
|
|||||||
public static final int TYPE_SHOW_NEXT_FOCUS = 2;
|
public static final int TYPE_SHOW_NEXT_FOCUS = 2;
|
||||||
public static final int TYPE_HIDE = 3;
|
public static final int TYPE_HIDE = 3;
|
||||||
public static final int TYPE_TOGGLE = 4;
|
public static final int TYPE_TOGGLE = 4;
|
||||||
|
public static final int TYPE_HOME = 5;
|
||||||
|
|
||||||
private static final String TRANSITION_NAME = "Transition:toOverview";
|
private static final String TRANSITION_NAME = "Transition:toOverview";
|
||||||
|
|
||||||
@@ -154,6 +155,10 @@ public class OverviewCommandHelper {
|
|||||||
// already hidden
|
// already hidden
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
if (cmd.type == TYPE_HOME) {
|
||||||
|
mService.startActivity(mOverviewComponentObserver.getHomeIntent());
|
||||||
|
return true;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
switch (cmd.type) {
|
switch (cmd.type) {
|
||||||
case TYPE_SHOW:
|
case TYPE_SHOW:
|
||||||
@@ -168,6 +173,9 @@ public class OverviewCommandHelper {
|
|||||||
}
|
}
|
||||||
case TYPE_TOGGLE:
|
case TYPE_TOGGLE:
|
||||||
return launchTask(recents, getNextTask(recents), cmd);
|
return launchTask(recents, getNextTask(recents), cmd);
|
||||||
|
case TYPE_HOME:
|
||||||
|
recents.startHome();
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user