mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-19 02:38:20 +00:00
Revert^2 "Moving taskbar lifecycle to TouchInteractionService"
430465a3d5
Bug: 187353581
Change-Id: I7b2280d16adfafd3e85ffc1d22e32d0c00d12b67
This commit is contained in:
@@ -16,7 +16,8 @@
|
||||
|
||||
package com.android.launcher3.taskbar;
|
||||
|
||||
import android.content.Context;
|
||||
import static android.view.Display.DEFAULT_DISPLAY;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
|
||||
@@ -53,11 +54,10 @@ public class TaskbarNavButtonController {
|
||||
static final int BUTTON_RECENTS = BUTTON_HOME << 1;
|
||||
static final int BUTTON_IME_SWITCH = BUTTON_RECENTS << 1;
|
||||
|
||||
private final TouchInteractionService mService;
|
||||
|
||||
private final Context mContext;
|
||||
|
||||
public TaskbarNavButtonController(Context context) {
|
||||
mContext = context;
|
||||
public TaskbarNavButtonController(TouchInteractionService service) {
|
||||
mService = service;
|
||||
}
|
||||
|
||||
public void onButtonClick(@TaskbarButton int buttonType) {
|
||||
@@ -78,13 +78,13 @@ public class TaskbarNavButtonController {
|
||||
}
|
||||
|
||||
private void navigateHome() {
|
||||
mContext.startActivity(new Intent(Intent.ACTION_MAIN)
|
||||
mService.startActivity(new Intent(Intent.ACTION_MAIN)
|
||||
.addCategory(Intent.CATEGORY_HOME)
|
||||
.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK));
|
||||
}
|
||||
|
||||
private void navigateToOverview() {
|
||||
TouchInteractionService.getInstance().getOverviewCommandHelper()
|
||||
mService.getOverviewCommandHelper()
|
||||
.addCommand(OverviewCommandHelper.TYPE_SHOW);
|
||||
}
|
||||
|
||||
@@ -93,8 +93,8 @@ public class TaskbarNavButtonController {
|
||||
}
|
||||
|
||||
private void showIMESwitcher() {
|
||||
mContext.getSystemService(InputMethodManager.class).showInputMethodPickerFromSystem(
|
||||
true /* showAuxiliarySubtypes */, mContext.getDisplayId());
|
||||
mService.getSystemService(InputMethodManager.class)
|
||||
.showInputMethodPickerFromSystem(true /* showAuxiliarySubtypes */,
|
||||
DEFAULT_DISPLAY);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user