Revert "Moving taskbar lifecycle to TouchInteractionService"

This reverts commit e215fb730b.

Reason for revert: DroidMonitor-triggered revert due to breakage https://android-build.googleplex.com/builds/tests/view?invocationId=I13700009003387451&testResultId=TR89423459137251402, bug https://buganizer.corp.google.com/issues/188755902

Bug: 188755902
Change-Id: I4650136975b60f311499ee6ff5b27ab9a32d23d6
This commit is contained in:
Kholoud Mohamed
2021-05-20 09:50:23 +00:00
committed by kholoud mohamed
parent bb6f6e5dae
commit 430465a3d5
29 changed files with 981 additions and 947 deletions

View File

@@ -16,8 +16,7 @@
package com.android.launcher3.taskbar;
import static android.view.Display.DEFAULT_DISPLAY;
import android.content.Context;
import android.content.Intent;
import android.view.inputmethod.InputMethodManager;
@@ -54,10 +53,11 @@ public class TaskbarNavButtonController {
static final int BUTTON_RECENTS = BUTTON_HOME << 1;
static final int BUTTON_IME_SWITCH = BUTTON_RECENTS << 1;
private final TouchInteractionService mService;
public TaskbarNavButtonController(TouchInteractionService service) {
mService = service;
private final Context mContext;
public TaskbarNavButtonController(Context context) {
mContext = context;
}
public void onButtonClick(@TaskbarButton int buttonType) {
@@ -78,13 +78,13 @@ public class TaskbarNavButtonController {
}
private void navigateHome() {
mService.startActivity(new Intent(Intent.ACTION_MAIN)
mContext.startActivity(new Intent(Intent.ACTION_MAIN)
.addCategory(Intent.CATEGORY_HOME)
.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK));
}
private void navigateToOverview() {
mService.getOverviewCommandHelper()
TouchInteractionService.getInstance().getOverviewCommandHelper()
.addCommand(OverviewCommandHelper.TYPE_SHOW);
}
@@ -93,8 +93,8 @@ public class TaskbarNavButtonController {
}
private void showIMESwitcher() {
mService.getSystemService(InputMethodManager.class)
.showInputMethodPickerFromSystem(true /* showAuxiliarySubtypes */,
DEFAULT_DISPLAY);
mContext.getSystemService(InputMethodManager.class).showInputMethodPickerFromSystem(
true /* showAuxiliarySubtypes */, mContext.getDisplayId());
}
}