Revert "Pass down whether iterating through tasks in overview is..."
Revert submission 20956764-alt_tab_forward Reason for revert: Actually we dont need these changes after all. SHIFT doesn't matter in the initial tab to overview. The subsequent tabs are handled by RecentsView and we already have a check on shift Reverted changes: /q/submissionid:20956764-alt_tab_forward Change-Id: Iaf62d47b239a680c84df2f226fd36484a36b84dd
This commit is contained in:
@@ -53,7 +53,7 @@ oneway interface IStatusBar
|
||||
boolean showImeSwitcher);
|
||||
void setWindowState(int display, int window, int state);
|
||||
|
||||
void showRecentApps(boolean triggeredFromAltTab, boolean forward);
|
||||
void showRecentApps(boolean triggeredFromAltTab);
|
||||
void hideRecentApps(boolean triggeredFromAltTab, boolean triggeredFromHomeKey);
|
||||
void toggleRecentApps();
|
||||
void toggleSplitScreen();
|
||||
|
||||
@@ -37,7 +37,7 @@ oneway interface IOverviewProxy {
|
||||
/**
|
||||
* Sent when overview is to be shown.
|
||||
*/
|
||||
void onOverviewShown(boolean triggeredFromAltTab, boolean forward) = 7;
|
||||
void onOverviewShown(boolean triggeredFromAltTab) = 7;
|
||||
|
||||
/**
|
||||
* Sent when overview is to be hidden.
|
||||
|
||||
@@ -59,11 +59,11 @@ public class OverviewProxyRecentsImpl implements RecentsImplementation {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showRecentApps(boolean triggeredFromAltTab, boolean forward) {
|
||||
public void showRecentApps(boolean triggeredFromAltTab) {
|
||||
IOverviewProxy overviewProxy = mOverviewProxyService.getProxy();
|
||||
if (overviewProxy != null) {
|
||||
try {
|
||||
overviewProxy.onOverviewShown(triggeredFromAltTab, forward);
|
||||
overviewProxy.onOverviewShown(triggeredFromAltTab);
|
||||
} catch (RemoteException e) {
|
||||
Log.e(TAG, "Failed to send overview show event to launcher.", e);
|
||||
}
|
||||
|
||||
@@ -65,14 +65,14 @@ public class Recents implements CoreStartable, CommandQueue.Callbacks {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showRecentApps(boolean triggeredFromAltTab, boolean forward) {
|
||||
public void showRecentApps(boolean triggeredFromAltTab) {
|
||||
// Ensure the device has been provisioned before allowing the user to interact with
|
||||
// recents
|
||||
if (!isUserSetup()) {
|
||||
return;
|
||||
}
|
||||
|
||||
mImpl.showRecentApps(triggeredFromAltTab, forward);
|
||||
mImpl.showRecentApps(triggeredFromAltTab);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -31,7 +31,7 @@ public interface RecentsImplementation {
|
||||
|
||||
default void preloadRecentApps() {}
|
||||
default void cancelPreloadRecentApps() {}
|
||||
default void showRecentApps(boolean triggeredFromAltTab, boolean forward) {}
|
||||
default void showRecentApps(boolean triggeredFromAltTab) {}
|
||||
default void hideRecentApps(boolean triggeredFromAltTab, boolean triggeredFromHomeKey) {}
|
||||
default void toggleRecentApps() {}
|
||||
|
||||
|
||||
@@ -224,7 +224,7 @@ public class CommandQueue extends IStatusBar.Stub implements
|
||||
*/
|
||||
default void setImeWindowStatus(int displayId, IBinder token, int vis,
|
||||
@BackDispositionMode int backDisposition, boolean showImeSwitcher) { }
|
||||
default void showRecentApps(boolean triggeredFromAltTab, boolean forward) { }
|
||||
default void showRecentApps(boolean triggeredFromAltTab) { }
|
||||
default void hideRecentApps(boolean triggeredFromAltTab, boolean triggeredFromHomeKey) { }
|
||||
default void toggleRecentApps() { }
|
||||
default void toggleSplitScreen() { }
|
||||
@@ -686,11 +686,11 @@ public class CommandQueue extends IStatusBar.Stub implements
|
||||
}
|
||||
}
|
||||
|
||||
public void showRecentApps(boolean triggeredFromAltTab, boolean forward) {
|
||||
public void showRecentApps(boolean triggeredFromAltTab) {
|
||||
synchronized (mLock) {
|
||||
mHandler.removeMessages(MSG_SHOW_RECENT_APPS);
|
||||
mHandler.obtainMessage(MSG_SHOW_RECENT_APPS, triggeredFromAltTab ? 1 : 0,
|
||||
forward ? 1 : 0, null).sendToTarget();
|
||||
mHandler.obtainMessage(MSG_SHOW_RECENT_APPS, triggeredFromAltTab ? 1 : 0, 0,
|
||||
null).sendToTarget();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1384,7 +1384,7 @@ public class CommandQueue extends IStatusBar.Stub implements
|
||||
break;
|
||||
case MSG_SHOW_RECENT_APPS:
|
||||
for (int i = 0; i < mCallbacks.size(); i++) {
|
||||
mCallbacks.get(i).showRecentApps(msg.arg1 != 0, msg.arg2 != 0);
|
||||
mCallbacks.get(i).showRecentApps(msg.arg1 != 0);
|
||||
}
|
||||
break;
|
||||
case MSG_HIDE_RECENT_APPS:
|
||||
|
||||
@@ -209,9 +209,9 @@ public class CommandQueueTest extends SysuiTestCase {
|
||||
|
||||
@Test
|
||||
public void testShowRecentApps() {
|
||||
mCommandQueue.showRecentApps(true, false);
|
||||
mCommandQueue.showRecentApps(true);
|
||||
waitForIdleSync();
|
||||
verify(mCallbacks).showRecentApps(eq(true), eq(false));
|
||||
verify(mCallbacks).showRecentApps(eq(true));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -661,7 +661,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
|
||||
dispatchMediaKeyRepeatWithWakeLock((KeyEvent)msg.obj);
|
||||
break;
|
||||
case MSG_DISPATCH_SHOW_RECENTS:
|
||||
showRecents();
|
||||
showRecentApps(false);
|
||||
break;
|
||||
case MSG_DISPATCH_SHOW_GLOBAL_ACTIONS:
|
||||
showGlobalActionsInternal();
|
||||
@@ -2910,7 +2910,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
|
||||
break;
|
||||
case KeyEvent.KEYCODE_RECENT_APPS:
|
||||
if (down && repeatCount == 0) {
|
||||
showRecents();
|
||||
showRecentApps(false /* triggeredFromAltTab */);
|
||||
}
|
||||
return key_consumed;
|
||||
case KeyEvent.KEYCODE_APP_SWITCH:
|
||||
@@ -3094,23 +3094,22 @@ public class PhoneWindowManager implements WindowManagerPolicy {
|
||||
}
|
||||
break;
|
||||
case KeyEvent.KEYCODE_TAB:
|
||||
if (down) {
|
||||
if (event.isMetaPressed()) {
|
||||
if (!keyguardOn && isUserSetupComplete()) {
|
||||
showRecents();
|
||||
if (down && event.isMetaPressed()) {
|
||||
if (!keyguardOn && isUserSetupComplete()) {
|
||||
showRecentApps(false);
|
||||
return key_consumed;
|
||||
}
|
||||
} else if (down && repeatCount == 0) {
|
||||
// Display task switcher for ALT-TAB.
|
||||
if (mRecentAppsHeldModifiers == 0 && !keyguardOn && isUserSetupComplete()) {
|
||||
final int shiftlessModifiers =
|
||||
event.getModifiers() & ~KeyEvent.META_SHIFT_MASK;
|
||||
if (KeyEvent.metaStateHasModifiers(
|
||||
shiftlessModifiers, KeyEvent.META_ALT_ON)) {
|
||||
mRecentAppsHeldModifiers = shiftlessModifiers;
|
||||
showRecentApps(true);
|
||||
return key_consumed;
|
||||
}
|
||||
} else {
|
||||
// Display task switcher for ALT-TAB.
|
||||
if (mRecentAppsHeldModifiers == 0 && !keyguardOn && isUserSetupComplete()) {
|
||||
final int modifiers = event.getModifiers();
|
||||
if (KeyEvent.metaStateHasModifiers(modifiers, KeyEvent.META_ALT_ON)) {
|
||||
mRecentAppsHeldModifiers = modifiers;
|
||||
showRecentsFromAltTab(KeyEvent.metaStateHasModifiers(modifiers,
|
||||
KeyEvent.META_SHIFT_ON));
|
||||
return key_consumed;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -3647,19 +3646,11 @@ public class PhoneWindowManager implements WindowManagerPolicy {
|
||||
mHandler.obtainMessage(MSG_DISPATCH_SHOW_RECENTS).sendToTarget();
|
||||
}
|
||||
|
||||
private void showRecents() {
|
||||
private void showRecentApps(boolean triggeredFromAltTab) {
|
||||
mPreloadedRecentApps = false; // preloading no longer needs to be canceled
|
||||
StatusBarManagerInternal statusbar = getStatusBarManagerInternal();
|
||||
if (statusbar != null) {
|
||||
statusbar.showRecentApps(false /* triggeredFromAltTab */, false /* forward */);
|
||||
}
|
||||
}
|
||||
|
||||
private void showRecentsFromAltTab(boolean forward) {
|
||||
mPreloadedRecentApps = false; // preloading no longer needs to be canceled
|
||||
StatusBarManagerInternal statusbar = getStatusBarManagerInternal();
|
||||
if (statusbar != null) {
|
||||
statusbar.showRecentApps(true /* triggeredFromAltTab */, forward);
|
||||
statusbar.showRecentApps(triggeredFromAltTab);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ public interface StatusBarManagerInternal {
|
||||
|
||||
void cancelPreloadRecentApps();
|
||||
|
||||
void showRecentApps(boolean triggeredFromAltTab, boolean forward);
|
||||
void showRecentApps(boolean triggeredFromAltTab);
|
||||
|
||||
void hideRecentApps(boolean triggeredFromAltTab, boolean triggeredFromHomeKey);
|
||||
|
||||
|
||||
@@ -454,10 +454,10 @@ public class StatusBarManagerService extends IStatusBarService.Stub implements D
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showRecentApps(boolean triggeredFromAltTab, boolean forward) {
|
||||
public void showRecentApps(boolean triggeredFromAltTab) {
|
||||
if (mBar != null) {
|
||||
try {
|
||||
mBar.showRecentApps(triggeredFromAltTab, forward);
|
||||
mBar.showRecentApps(triggeredFromAltTab);
|
||||
} catch (RemoteException ex) {}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user