Remove unused recents fast-toggle/paging code.
- Also remove some unused assets Bug: 67510855 Test: Code removal Change-Id: I770cd430af01deb64f14e3ce30c12497c194dfa2
This commit is contained in:
@@ -1,54 +0,0 @@
|
||||
<!--
|
||||
Copyright (C) 2016 The Android Open Source Project
|
||||
|
||||
Licensed under the Apache License, Version 2 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:height="16dp"
|
||||
android:width="28dp"
|
||||
android:viewportHeight="48"
|
||||
android:viewportWidth="72" >
|
||||
<group
|
||||
android:name="dismiss_all"
|
||||
android:translateX="48"
|
||||
android:translateY="6" >
|
||||
<group
|
||||
android:name="3"
|
||||
android:translateX="-24"
|
||||
android:translateY="36" >
|
||||
<path
|
||||
android:name="rectangle_path_1_2"
|
||||
android:pathData="M -24.0,-6.0 l 48.0,0 l 0,12.0 l -48.0,0 Z"
|
||||
android:fillColor="#FFFFFFFF"
|
||||
android:fillAlpha="1" />
|
||||
</group>
|
||||
<group
|
||||
android:name="2"
|
||||
android:translateX="-12"
|
||||
android:translateY="18" >
|
||||
<path
|
||||
android:name="rectangle_path_1_1"
|
||||
android:pathData="M -24.0,-6.0 l 48.0,0 l 0,12.0 l -48.0,0 Z"
|
||||
android:fillColor="#FFFFFFFF"
|
||||
android:fillAlpha="1" />
|
||||
</group>
|
||||
<group
|
||||
android:name="1" >
|
||||
<path
|
||||
android:name="rectangle_path_1"
|
||||
android:pathData="M -24.0,-6.0 l 48.0,0 l 0,12.0 l -48.0,0 Z"
|
||||
android:fillColor="#FFFFFFFF"
|
||||
android:fillAlpha="1" />
|
||||
</group>
|
||||
</group>
|
||||
</vector>
|
||||
@@ -66,14 +66,6 @@
|
||||
android:alpha="0"
|
||||
android:visibility="gone" />
|
||||
|
||||
<!-- The progress indicator shows if auto-paging is enabled -->
|
||||
<ViewStub android:id="@+id/focus_timer_indicator_stub"
|
||||
android:inflatedId="@+id/focus_timer_indicator"
|
||||
android:layout="@layout/recents_task_view_header_progress_bar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="5dp"
|
||||
android:layout_gravity="bottom" />
|
||||
|
||||
<!-- The app overlay shows as the user long-presses on the app icon -->
|
||||
<ViewStub android:id="@+id/app_overlay_stub"
|
||||
android:inflatedId="@+id/app_overlay"
|
||||
|
||||
@@ -167,12 +167,6 @@
|
||||
<!-- The animation duration for scrolling the stack to a particular item. -->
|
||||
<integer name="recents_animate_task_stack_scroll_duration">200</integer>
|
||||
|
||||
<!-- The animation duration for scrolling the stack to a particular item. -->
|
||||
<integer name="recents_auto_advance_duration">750</integer>
|
||||
|
||||
<!-- The animation duration for subsequent scrolling the stack to a particular item. -->
|
||||
<integer name="recents_subsequent_auto_advance_duration">1000</integer>
|
||||
|
||||
<!-- The delay to enforce between each alt-tab key press. -->
|
||||
<integer name="recents_alt_tab_key_delay">200</integer>
|
||||
|
||||
|
||||
@@ -53,7 +53,6 @@ import com.android.systemui.colorextraction.SysuiColorExtractor;
|
||||
import com.android.systemui.recents.events.EventBus;
|
||||
import com.android.systemui.recents.events.activity.CancelEnterRecentsWindowAnimationEvent;
|
||||
import com.android.systemui.recents.events.activity.ConfigurationChangedEvent;
|
||||
import com.android.systemui.recents.events.activity.DebugFlagsChangedEvent;
|
||||
import com.android.systemui.recents.events.activity.DismissRecentsToHomeAnimationStarted;
|
||||
import com.android.systemui.recents.events.activity.DockedFirstAnimationFrameEvent;
|
||||
import com.android.systemui.recents.events.activity.DockedTopTaskEvent;
|
||||
@@ -61,7 +60,6 @@ import com.android.systemui.recents.events.activity.EnterRecentsWindowAnimationC
|
||||
import com.android.systemui.recents.events.activity.EnterRecentsWindowLastAnimationFrameEvent;
|
||||
import com.android.systemui.recents.events.activity.ExitRecentsWindowFirstAnimationFrameEvent;
|
||||
import com.android.systemui.recents.events.activity.HideRecentsEvent;
|
||||
import com.android.systemui.recents.events.activity.IterateRecentsEvent;
|
||||
import com.android.systemui.recents.events.activity.LaunchTaskFailedEvent;
|
||||
import com.android.systemui.recents.events.activity.LaunchTaskSucceededEvent;
|
||||
import com.android.systemui.recents.events.activity.MultiWindowStateChangedEvent;
|
||||
@@ -85,7 +83,6 @@ import com.android.systemui.recents.events.ui.focus.FocusNextTaskViewEvent;
|
||||
import com.android.systemui.recents.events.ui.focus.FocusPreviousTaskViewEvent;
|
||||
import com.android.systemui.recents.events.ui.focus.NavigateTaskViewEvent;
|
||||
import com.android.systemui.recents.events.ui.focus.NavigateTaskViewEvent.Direction;
|
||||
import com.android.systemui.recents.misc.DozeTrigger;
|
||||
import com.android.systemui.recents.misc.SystemServicesProxy;
|
||||
import com.android.systemui.recents.misc.Utilities;
|
||||
import com.android.systemui.recents.model.RecentsPackageMonitor;
|
||||
@@ -132,7 +129,6 @@ public class RecentsActivity extends Activity implements ViewTreeObserver.OnPreD
|
||||
|
||||
// The trigger to automatically launch the current task
|
||||
private int mFocusTimerDuration;
|
||||
private DozeTrigger mIterateTrigger;
|
||||
private final UserInteractionEvent mUserInteractionEvent = new UserInteractionEvent();
|
||||
|
||||
// Theme and colors
|
||||
@@ -327,13 +323,6 @@ public class RecentsActivity extends Activity implements ViewTreeObserver.OnPreD
|
||||
}
|
||||
|
||||
mLastConfig = new Configuration(Utilities.getAppConfiguration(this));
|
||||
mFocusTimerDuration = getResources().getInteger(R.integer.recents_auto_advance_duration);
|
||||
mIterateTrigger = new DozeTrigger(mFocusTimerDuration, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
dismissRecentsToFocusedTask(MetricsEvent.OVERVIEW_SELECT_TIMEOUT);
|
||||
}
|
||||
});
|
||||
|
||||
// Set the window background
|
||||
mRecentsView.updateBackgroundScrim(getWindow(), isInMultiWindowMode());
|
||||
@@ -502,7 +491,6 @@ public class RecentsActivity extends Activity implements ViewTreeObserver.OnPreD
|
||||
super.onPause();
|
||||
|
||||
mIgnoreAltTabRelease = false;
|
||||
mIterateTrigger.stopDozing();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -605,8 +593,7 @@ public class RecentsActivity extends Activity implements ViewTreeObserver.OnPreD
|
||||
if (backward) {
|
||||
EventBus.getDefault().send(new FocusPreviousTaskViewEvent());
|
||||
} else {
|
||||
EventBus.getDefault().send(
|
||||
new FocusNextTaskViewEvent(0 /* timerIndicatorDuration */));
|
||||
EventBus.getDefault().send(new FocusNextTaskViewEvent());
|
||||
}
|
||||
mLastTabKeyEventTime = SystemClock.elapsedRealtime();
|
||||
|
||||
@@ -664,38 +651,10 @@ public class RecentsActivity extends Activity implements ViewTreeObserver.OnPreD
|
||||
}
|
||||
}
|
||||
|
||||
public final void onBusEvent(IterateRecentsEvent event) {
|
||||
final RecentsDebugFlags debugFlags = Recents.getDebugFlags();
|
||||
|
||||
// Start dozing after the recents button is clicked
|
||||
int timerIndicatorDuration = 0;
|
||||
if (debugFlags.isFastToggleRecentsEnabled()) {
|
||||
timerIndicatorDuration = getResources().getInteger(
|
||||
R.integer.recents_subsequent_auto_advance_duration);
|
||||
|
||||
mIterateTrigger.setDozeDuration(timerIndicatorDuration);
|
||||
if (!mIterateTrigger.isDozing()) {
|
||||
mIterateTrigger.startDozing();
|
||||
} else {
|
||||
mIterateTrigger.poke();
|
||||
}
|
||||
}
|
||||
|
||||
// Focus the next task
|
||||
EventBus.getDefault().send(new FocusNextTaskViewEvent(timerIndicatorDuration));
|
||||
|
||||
MetricsLogger.action(this, MetricsEvent.ACTION_OVERVIEW_PAGE);
|
||||
}
|
||||
|
||||
public final void onBusEvent(RecentsActivityStartingEvent event) {
|
||||
mRecentsStartRequested = true;
|
||||
}
|
||||
|
||||
public final void onBusEvent(UserInteractionEvent event) {
|
||||
// Stop the fast-toggle dozer
|
||||
mIterateTrigger.stopDozing();
|
||||
}
|
||||
|
||||
public final void onBusEvent(HideRecentsEvent event) {
|
||||
if (event.triggeredFromAltTab) {
|
||||
// If we are hiding from releasing Alt-Tab, dismiss Recents to the focused app
|
||||
@@ -817,11 +776,6 @@ public class RecentsActivity extends Activity implements ViewTreeObserver.OnPreD
|
||||
MetricsLogger.count(this, "overview_screen_pinned", 1);
|
||||
}
|
||||
|
||||
public final void onBusEvent(DebugFlagsChangedEvent event) {
|
||||
// Just finish recents so that we can reload the flags anew on the next instantiation
|
||||
finish();
|
||||
}
|
||||
|
||||
public final void onBusEvent(StackViewScrolledEvent event) {
|
||||
// Once the user has scrolled while holding alt-tab, then we should ignore the release of
|
||||
// the key
|
||||
|
||||
@@ -60,12 +60,6 @@ public class RecentsActivityLaunchState {
|
||||
RecentsDebugFlags debugFlags = Recents.getDebugFlags();
|
||||
RecentsActivityLaunchState launchState = Recents.getConfiguration().getLaunchState();
|
||||
if (launchedFromApp) {
|
||||
if (!launchState.launchedWithAltTab && debugFlags.isFastToggleRecentsEnabled()) {
|
||||
// If fast toggling, focus the front most task so that the next tap will launch the
|
||||
// task
|
||||
return numTasks - 1;
|
||||
}
|
||||
|
||||
if (launchState.launchedFromBlacklistedApp) {
|
||||
// If we are launching from a blacklisted app, focus the front most task so that the
|
||||
// next tap will launch the task
|
||||
@@ -80,12 +74,6 @@ public class RecentsActivityLaunchState {
|
||||
// If coming from another app, focus the next task
|
||||
return Math.max(0, numTasks - 2);
|
||||
} else {
|
||||
if (!launchState.launchedWithAltTab && debugFlags.isFastToggleRecentsEnabled()) {
|
||||
// If fast toggling, defer focusing until the next tap (which will automatically
|
||||
// focus the front most task)
|
||||
return -1;
|
||||
}
|
||||
|
||||
// If coming from home, focus the front most task
|
||||
return numTasks - 1;
|
||||
}
|
||||
|
||||
@@ -16,55 +16,16 @@
|
||||
|
||||
package com.android.systemui.recents;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.android.systemui.recents.events.EventBus;
|
||||
import com.android.systemui.recents.events.activity.DebugFlagsChangedEvent;
|
||||
import com.android.systemui.recents.misc.SystemServicesProxy;
|
||||
import com.android.systemui.tuner.TunerService;
|
||||
|
||||
/**
|
||||
* Tunable debug flags
|
||||
*/
|
||||
public class RecentsDebugFlags {
|
||||
|
||||
public static class Static {
|
||||
// Enables debug drawing for the transition thumbnail
|
||||
public static final boolean EnableTransitionThumbnailDebugMode = false;
|
||||
// This disables the bitmap and icon caches
|
||||
public static final boolean DisableBackgroundCache = false;
|
||||
// Enables the button above the stack
|
||||
public static final boolean EnableStackActionButton = true;
|
||||
// Overrides the Tuner flags and enables the timeout
|
||||
private static final boolean EnableFastToggleTimeout = false;
|
||||
// Overrides the Tuner flags and enables the paging via the Recents button
|
||||
private static final boolean EnablePaging = false;
|
||||
// Enables debug thumbnail to be fetched
|
||||
public static final boolean EnableThumbnailDebugMode = false;
|
||||
|
||||
// Disables enter and exit transitions for other tasks for low ram devices
|
||||
public static final boolean DisableRecentsLowRamEnterExitAnimation = false;
|
||||
|
||||
// Enables us to create mock recents tasks
|
||||
public static final boolean EnableMockTasks = false;
|
||||
// Defines the number of mock recents packages to create
|
||||
public static final int MockTasksPackageCount = 3;
|
||||
// Defines the number of mock recents tasks to create
|
||||
public static final int MockTaskCount = 100;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return whether we are enabling fast toggling.
|
||||
*/
|
||||
public boolean isFastToggleRecentsEnabled() {
|
||||
SystemServicesProxy ssp = Recents.getSystemServices();
|
||||
if (ssp.isTouchExplorationEnabled()) {
|
||||
return false;
|
||||
}
|
||||
return Static.EnableFastToggleTimeout;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return whether we are enabling paging.
|
||||
*/
|
||||
public boolean isPagingEnabled() {
|
||||
return Static.EnablePaging;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -408,22 +408,17 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener
|
||||
RecentsConfiguration config = Recents.getConfiguration();
|
||||
RecentsActivityLaunchState launchState = config.getLaunchState();
|
||||
if (!launchState.launchedWithAltTab) {
|
||||
// Has the user tapped quickly?
|
||||
boolean isQuickTap = elapsedTime < ViewConfiguration.getDoubleTapTimeout();
|
||||
if (Recents.getConfiguration().isGridEnabled) {
|
||||
// Has the user tapped quickly?
|
||||
boolean isQuickTap = elapsedTime < ViewConfiguration.getDoubleTapTimeout();
|
||||
if (isQuickTap) {
|
||||
EventBus.getDefault().post(new LaunchNextTaskRequestEvent());
|
||||
} else {
|
||||
EventBus.getDefault().post(new LaunchMostRecentTaskRequestEvent());
|
||||
}
|
||||
} else {
|
||||
if (!debugFlags.isPagingEnabled() || isQuickTap) {
|
||||
// Launch the next focused task
|
||||
EventBus.getDefault().post(new LaunchNextTaskRequestEvent());
|
||||
} else {
|
||||
// Notify recents to move onto the next task
|
||||
EventBus.getDefault().post(new IterateRecentsEvent());
|
||||
}
|
||||
// Launch the next focused task
|
||||
EventBus.getDefault().post(new LaunchNextTaskRequestEvent());
|
||||
}
|
||||
} else {
|
||||
// If the user has toggled it too quickly, then just eat up the event here (it's
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2015 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.systemui.recents.events.activity;
|
||||
|
||||
import com.android.systemui.recents.events.EventBus;
|
||||
|
||||
/**
|
||||
* This is sent when the SystemUI tuner changes a flag.
|
||||
*/
|
||||
public class DebugFlagsChangedEvent extends EventBus.Event {
|
||||
// Simple event
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2015 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.systemui.recents.events.activity;
|
||||
|
||||
import com.android.systemui.recents.events.EventBus;
|
||||
|
||||
/**
|
||||
* This is sent when the user taps on the Overview button to iterate to the next item in the
|
||||
* Recents list.
|
||||
*/
|
||||
public class IterateRecentsEvent extends EventBus.Event {
|
||||
// Simple event
|
||||
}
|
||||
@@ -22,10 +22,5 @@ import com.android.systemui.recents.events.EventBus;
|
||||
* Focuses the next task view in the stack.
|
||||
*/
|
||||
public class FocusNextTaskViewEvent extends EventBus.Event {
|
||||
|
||||
public final int timerIndicatorDuration;
|
||||
|
||||
public FocusNextTaskViewEvent(int timerIndicatorDuration) {
|
||||
this.timerIndicatorDuration = timerIndicatorDuration;
|
||||
}
|
||||
// Simple event
|
||||
}
|
||||
|
||||
@@ -90,6 +90,7 @@ import com.android.systemui.UiOffloadThread;
|
||||
import com.android.systemui.pip.tv.PipMenuActivity;
|
||||
import com.android.systemui.recents.Recents;
|
||||
import com.android.systemui.recents.RecentsDebugFlags;
|
||||
import com.android.systemui.recents.RecentsDebugFlags.Static;
|
||||
import com.android.systemui.recents.RecentsImpl;
|
||||
import com.android.systemui.recents.model.Task;
|
||||
import com.android.systemui.recents.model.ThumbnailData;
|
||||
@@ -337,12 +338,6 @@ public class SystemServicesProxy {
|
||||
UserInfoController userInfoController = Dependency.get(UserInfoController.class);
|
||||
userInfoController.addCallback(mOnUserInfoChangedListener);
|
||||
|
||||
if (RecentsDebugFlags.Static.EnableMockTasks) {
|
||||
// Create a dummy icon
|
||||
mDummyIcon = Bitmap.createBitmap(1, 1, Bitmap.Config.ARGB_8888);
|
||||
mDummyIcon.eraseColor(0xFF999999);
|
||||
}
|
||||
|
||||
Collections.addAll(sRecentsBlacklist,
|
||||
res.getStringArray(R.array.recents_blacklist_array));
|
||||
}
|
||||
@@ -378,39 +373,6 @@ public class SystemServicesProxy {
|
||||
public List<ActivityManager.RecentTaskInfo> getRecentTasks(int numTasks, int userId) {
|
||||
if (mAm == null) return null;
|
||||
|
||||
// If we are mocking, then create some recent tasks
|
||||
if (RecentsDebugFlags.Static.EnableMockTasks) {
|
||||
ArrayList<ActivityManager.RecentTaskInfo> tasks =
|
||||
new ArrayList<ActivityManager.RecentTaskInfo>();
|
||||
int count = Math.min(numTasks, RecentsDebugFlags.Static.MockTaskCount);
|
||||
for (int i = 0; i < count; i++) {
|
||||
// Create a dummy component name
|
||||
int packageIndex = i % RecentsDebugFlags.Static.MockTasksPackageCount;
|
||||
ComponentName cn = new ComponentName("com.android.test" + packageIndex,
|
||||
"com.android.test" + i + ".Activity");
|
||||
String description = "" + i + " - " +
|
||||
Long.toString(Math.abs(new Random().nextLong()), 36);
|
||||
// Create the recent task info
|
||||
ActivityManager.RecentTaskInfo rti = new ActivityManager.RecentTaskInfo();
|
||||
rti.id = rti.persistentId = rti.affiliatedTaskId = i;
|
||||
rti.baseIntent = new Intent();
|
||||
rti.baseIntent.setComponent(cn);
|
||||
rti.description = description;
|
||||
rti.lastActiveTime = i;
|
||||
if (i % 2 == 0) {
|
||||
rti.taskDescription = new ActivityManager.TaskDescription(description,
|
||||
Bitmap.createBitmap(mDummyIcon), null,
|
||||
0xFF000000 | (0xFFFFFF & new Random().nextInt()),
|
||||
0xFF000000 | (0xFFFFFF & new Random().nextInt()),
|
||||
0, 0);
|
||||
} else {
|
||||
rti.taskDescription = new ActivityManager.TaskDescription();
|
||||
}
|
||||
tasks.add(rti);
|
||||
}
|
||||
return tasks;
|
||||
}
|
||||
|
||||
try {
|
||||
List<ActivityManager.RecentTaskInfo> tasks = mIam.getRecentTasks(numTasks,
|
||||
RECENT_IGNORE_UNAVAILABLE, userId).getList();
|
||||
@@ -638,7 +600,7 @@ public class SystemServicesProxy {
|
||||
if (mAm == null) return null;
|
||||
|
||||
// If we are mocking, then just return a dummy thumbnail
|
||||
if (RecentsDebugFlags.Static.EnableMockTasks) {
|
||||
if (Static.EnableTransitionThumbnailDebugMode) {
|
||||
ThumbnailData thumbnailData = new ThumbnailData();
|
||||
thumbnailData.thumbnail = Bitmap.createBitmap(mDummyThumbnailWidth,
|
||||
mDummyThumbnailHeight, Bitmap.Config.ARGB_8888);
|
||||
@@ -684,7 +646,6 @@ public class SystemServicesProxy {
|
||||
/** Removes the task */
|
||||
public void removeTask(final int taskId) {
|
||||
if (mAm == null) return;
|
||||
if (RecentsDebugFlags.Static.EnableMockTasks) return;
|
||||
|
||||
// Remove the task.
|
||||
mUiOffloadThread.submit(() -> {
|
||||
@@ -712,7 +673,6 @@ public class SystemServicesProxy {
|
||||
*/
|
||||
public ActivityInfo getActivityInfo(ComponentName cn, int userId) {
|
||||
if (mIpm == null) return null;
|
||||
if (RecentsDebugFlags.Static.EnableMockTasks) return new ActivityInfo();
|
||||
|
||||
try {
|
||||
return mIpm.getActivityInfo(cn, PackageManager.GET_META_DATA, userId);
|
||||
@@ -729,7 +689,6 @@ public class SystemServicesProxy {
|
||||
*/
|
||||
public ActivityInfo getActivityInfo(ComponentName cn) {
|
||||
if (mPm == null) return null;
|
||||
if (RecentsDebugFlags.Static.EnableMockTasks) return new ActivityInfo();
|
||||
|
||||
try {
|
||||
return mPm.getActivityInfo(cn, PackageManager.GET_META_DATA);
|
||||
@@ -745,11 +704,6 @@ public class SystemServicesProxy {
|
||||
public String getBadgedActivityLabel(ActivityInfo info, int userId) {
|
||||
if (mPm == null) return null;
|
||||
|
||||
// If we are mocking, then return a mock label
|
||||
if (RecentsDebugFlags.Static.EnableMockTasks) {
|
||||
return "Recent Task: " + userId;
|
||||
}
|
||||
|
||||
return getBadgedLabel(info.loadLabel(mPm).toString(), userId);
|
||||
}
|
||||
|
||||
@@ -759,11 +713,6 @@ public class SystemServicesProxy {
|
||||
public String getBadgedApplicationLabel(ApplicationInfo appInfo, int userId) {
|
||||
if (mPm == null) return null;
|
||||
|
||||
// If we are mocking, then return a mock label
|
||||
if (RecentsDebugFlags.Static.EnableMockTasks) {
|
||||
return "Recent Task App: " + userId;
|
||||
}
|
||||
|
||||
return getBadgedLabel(appInfo.loadLabel(mPm).toString(), userId);
|
||||
}
|
||||
|
||||
@@ -773,11 +722,6 @@ public class SystemServicesProxy {
|
||||
*/
|
||||
public String getBadgedContentDescription(ActivityInfo info, int userId,
|
||||
ActivityManager.TaskDescription td, Resources res) {
|
||||
// If we are mocking, then return a mock label
|
||||
if (RecentsDebugFlags.Static.EnableMockTasks) {
|
||||
return "Recent Task Content Description: " + userId;
|
||||
}
|
||||
|
||||
String activityLabel;
|
||||
if (td != null && td.getLabel() != null) {
|
||||
activityLabel = td.getLabel();
|
||||
@@ -798,11 +742,6 @@ public class SystemServicesProxy {
|
||||
public Drawable getBadgedActivityIcon(ActivityInfo info, int userId) {
|
||||
if (mPm == null) return null;
|
||||
|
||||
// If we are mocking, then return a mock label
|
||||
if (RecentsDebugFlags.Static.EnableMockTasks) {
|
||||
return new ColorDrawable(0xFF666666);
|
||||
}
|
||||
|
||||
return mDrawableFactory.getBadgedIcon(info, info.applicationInfo, userId);
|
||||
}
|
||||
|
||||
@@ -813,11 +752,6 @@ public class SystemServicesProxy {
|
||||
public Drawable getBadgedApplicationIcon(ApplicationInfo appInfo, int userId) {
|
||||
if (mPm == null) return null;
|
||||
|
||||
// If we are mocking, then return a mock label
|
||||
if (RecentsDebugFlags.Static.EnableMockTasks) {
|
||||
return new ColorDrawable(0xFF666666);
|
||||
}
|
||||
|
||||
return mDrawableFactory.getBadgedIcon(appInfo, userId);
|
||||
}
|
||||
|
||||
@@ -826,12 +760,6 @@ public class SystemServicesProxy {
|
||||
*/
|
||||
public Drawable getBadgedTaskDescriptionIcon(ActivityManager.TaskDescription taskDescription,
|
||||
int userId, Resources res) {
|
||||
|
||||
// If we are mocking, then return a mock label
|
||||
if (RecentsDebugFlags.Static.EnableMockTasks) {
|
||||
return new ColorDrawable(0xFF666666);
|
||||
}
|
||||
|
||||
Bitmap tdIcon = taskDescription.getInMemoryIcon();
|
||||
if (tdIcon == null) {
|
||||
tdIcon = ActivityManager.TaskDescription.loadTaskDescriptionIcon(
|
||||
@@ -867,11 +795,6 @@ public class SystemServicesProxy {
|
||||
public Drawable getActivityBanner(ActivityInfo info) {
|
||||
if (mPm == null) return null;
|
||||
|
||||
// If we are mocking, then return a mock banner
|
||||
if (RecentsDebugFlags.Static.EnableMockTasks) {
|
||||
return new ColorDrawable(0xFF666666);
|
||||
}
|
||||
|
||||
Drawable banner = info.loadBanner(mPm);
|
||||
return banner;
|
||||
}
|
||||
|
||||
@@ -295,8 +295,6 @@ public class RecentsTaskLoader {
|
||||
context.getColor(R.color.recents_task_view_default_background_color);
|
||||
mMaxThumbnailCacheSize = res.getInteger(R.integer.config_recents_max_thumbnail_count);
|
||||
mMaxIconCacheSize = res.getInteger(R.integer.config_recents_max_icon_count);
|
||||
int iconCacheSize = RecentsDebugFlags.Static.DisableBackgroundCache ? 1 :
|
||||
mMaxIconCacheSize;
|
||||
|
||||
// Create the default assets
|
||||
Bitmap icon = Bitmap.createBitmap(1, 1, Bitmap.Config.ALPHA_8);
|
||||
@@ -308,7 +306,7 @@ public class RecentsTaskLoader {
|
||||
mHighResThumbnailLoader = new HighResThumbnailLoader(Recents.getSystemServices(),
|
||||
Looper.getMainLooper(), Recents.getConfiguration().isLowRamDevice);
|
||||
mLoadQueue = new TaskResourceLoadQueue();
|
||||
mIconCache = new TaskKeyLruCache<>(iconCacheSize, mClearActivityInfoOnEviction);
|
||||
mIconCache = new TaskKeyLruCache<>(mMaxIconCacheSize, mClearActivityInfoOnEviction);
|
||||
mActivityLabelCache = new TaskKeyLruCache<>(numRecentTasks, mClearActivityInfoOnEviction);
|
||||
mContentDescriptionCache = new TaskKeyLruCache<>(numRecentTasks,
|
||||
mClearActivityInfoOnEviction);
|
||||
|
||||
@@ -160,22 +160,20 @@ public class RecentsView extends FrameLayout {
|
||||
mEmptyView = (TextView) inflater.inflate(R.layout.recents_empty, this, false);
|
||||
addView(mEmptyView);
|
||||
|
||||
if (RecentsDebugFlags.Static.EnableStackActionButton) {
|
||||
if (mStackActionButton != null) {
|
||||
removeView(mStackActionButton);
|
||||
}
|
||||
mStackActionButton = (TextView) inflater.inflate(Recents.getConfiguration()
|
||||
.isLowRamDevice
|
||||
? R.layout.recents_low_ram_stack_action_button
|
||||
: R.layout.recents_stack_action_button,
|
||||
this, false);
|
||||
|
||||
mStackButtonShadowRadius = mStackActionButton.getShadowRadius();
|
||||
mStackButtonShadowDistance = new PointF(mStackActionButton.getShadowDx(),
|
||||
mStackActionButton.getShadowDy());
|
||||
mStackButtonShadowColor = mStackActionButton.getShadowColor();
|
||||
addView(mStackActionButton);
|
||||
if (mStackActionButton != null) {
|
||||
removeView(mStackActionButton);
|
||||
}
|
||||
mStackActionButton = (TextView) inflater.inflate(Recents.getConfiguration()
|
||||
.isLowRamDevice
|
||||
? R.layout.recents_low_ram_stack_action_button
|
||||
: R.layout.recents_stack_action_button,
|
||||
this, false);
|
||||
|
||||
mStackButtonShadowRadius = mStackActionButton.getShadowRadius();
|
||||
mStackButtonShadowDistance = new PointF(mStackActionButton.getShadowDx(),
|
||||
mStackActionButton.getShadowDy());
|
||||
mStackButtonShadowColor = mStackActionButton.getShadowColor();
|
||||
addView(mStackActionButton);
|
||||
|
||||
reevaluateStyles();
|
||||
}
|
||||
@@ -358,9 +356,7 @@ public class RecentsView extends FrameLayout {
|
||||
mEmptyView.setText(msgResId);
|
||||
mEmptyView.setVisibility(View.VISIBLE);
|
||||
mEmptyView.bringToFront();
|
||||
if (RecentsDebugFlags.Static.EnableStackActionButton) {
|
||||
mStackActionButton.bringToFront();
|
||||
}
|
||||
mStackActionButton.bringToFront();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -370,9 +366,7 @@ public class RecentsView extends FrameLayout {
|
||||
mEmptyView.setVisibility(View.INVISIBLE);
|
||||
mTaskStackView.setVisibility(View.VISIBLE);
|
||||
mTaskStackView.bringToFront();
|
||||
if (RecentsDebugFlags.Static.EnableStackActionButton) {
|
||||
mStackActionButton.bringToFront();
|
||||
}
|
||||
mStackActionButton.bringToFront();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -420,13 +414,11 @@ public class RecentsView extends FrameLayout {
|
||||
MeasureSpec.makeMeasureSpec(height, MeasureSpec.AT_MOST));
|
||||
}
|
||||
|
||||
if (RecentsDebugFlags.Static.EnableStackActionButton) {
|
||||
// Measure the stack action button within the constraints of the space above the stack
|
||||
Rect buttonBounds = mTaskStackView.mLayoutAlgorithm.getStackActionButtonRect();
|
||||
measureChild(mStackActionButton,
|
||||
MeasureSpec.makeMeasureSpec(buttonBounds.width(), MeasureSpec.AT_MOST),
|
||||
MeasureSpec.makeMeasureSpec(buttonBounds.height(), MeasureSpec.AT_MOST));
|
||||
}
|
||||
// Measure the stack action button within the constraints of the space above the stack
|
||||
Rect buttonBounds = mTaskStackView.mLayoutAlgorithm.getStackActionButtonRect();
|
||||
measureChild(mStackActionButton,
|
||||
MeasureSpec.makeMeasureSpec(buttonBounds.width(), MeasureSpec.AT_MOST),
|
||||
MeasureSpec.makeMeasureSpec(buttonBounds.height(), MeasureSpec.AT_MOST));
|
||||
|
||||
setMeasuredDimension(width, height);
|
||||
}
|
||||
@@ -460,13 +452,11 @@ public class RecentsView extends FrameLayout {
|
||||
mBackgroundScrim.setBounds(left, top, right, bottom);
|
||||
mMultiWindowBackgroundScrim.setBounds(0, 0, mTmpDisplaySize.x, mTmpDisplaySize.y);
|
||||
|
||||
if (RecentsDebugFlags.Static.EnableStackActionButton) {
|
||||
// Layout the stack action button such that its drawable is start-aligned with the
|
||||
// stack, vertically centered in the available space above the stack
|
||||
Rect buttonBounds = getStackActionButtonBoundsFromStackLayout();
|
||||
mStackActionButton.layout(buttonBounds.left, buttonBounds.top, buttonBounds.right,
|
||||
buttonBounds.bottom);
|
||||
}
|
||||
// Layout the stack action button such that its drawable is start-aligned with the
|
||||
// stack, vertically centered in the available space above the stack
|
||||
Rect buttonBounds = getStackActionButtonBoundsFromStackLayout();
|
||||
mStackActionButton.layout(buttonBounds.left, buttonBounds.top, buttonBounds.right,
|
||||
buttonBounds.bottom);
|
||||
|
||||
if (mAwaitingFirstLayout) {
|
||||
mAwaitingFirstLayout = false;
|
||||
@@ -539,10 +529,8 @@ public class RecentsView extends FrameLayout {
|
||||
|
||||
public final void onBusEvent(DismissRecentsToHomeAnimationStarted event) {
|
||||
int taskViewExitToHomeDuration = TaskStackAnimationHelper.EXIT_TO_HOME_TRANSLATION_DURATION;
|
||||
if (RecentsDebugFlags.Static.EnableStackActionButton) {
|
||||
// Hide the stack action button
|
||||
EventBus.getDefault().send(new HideStackActionButtonEvent());
|
||||
}
|
||||
// Hide the stack action button
|
||||
EventBus.getDefault().send(new HideStackActionButtonEvent());
|
||||
animateBackgroundScrim(0f, taskViewExitToHomeDuration);
|
||||
|
||||
if (Recents.getConfiguration().isLowRamDevice) {
|
||||
@@ -717,18 +705,10 @@ public class RecentsView extends FrameLayout {
|
||||
}
|
||||
|
||||
public final void onBusEvent(ShowStackActionButtonEvent event) {
|
||||
if (!RecentsDebugFlags.Static.EnableStackActionButton) {
|
||||
return;
|
||||
}
|
||||
|
||||
showStackActionButton(SHOW_STACK_ACTION_BUTTON_DURATION, event.translate);
|
||||
}
|
||||
|
||||
public final void onBusEvent(HideStackActionButtonEvent event) {
|
||||
if (!RecentsDebugFlags.Static.EnableStackActionButton) {
|
||||
return;
|
||||
}
|
||||
|
||||
hideStackActionButton(HIDE_STACK_ACTION_BUTTON_DURATION, true /* translate */);
|
||||
}
|
||||
|
||||
@@ -744,10 +724,6 @@ public class RecentsView extends FrameLayout {
|
||||
* Shows the stack action button.
|
||||
*/
|
||||
private void showStackActionButton(final int duration, final boolean translate) {
|
||||
if (!RecentsDebugFlags.Static.EnableStackActionButton) {
|
||||
return;
|
||||
}
|
||||
|
||||
final ReferenceCountedTrigger postAnimationTrigger = new ReferenceCountedTrigger();
|
||||
if (mStackActionButton.getVisibility() == View.INVISIBLE) {
|
||||
mStackActionButton.setVisibility(View.VISIBLE);
|
||||
@@ -780,10 +756,6 @@ public class RecentsView extends FrameLayout {
|
||||
* Hides the stack action button.
|
||||
*/
|
||||
private void hideStackActionButton(int duration, boolean translate) {
|
||||
if (!RecentsDebugFlags.Static.EnableStackActionButton) {
|
||||
return;
|
||||
}
|
||||
|
||||
final ReferenceCountedTrigger postAnimationTrigger = new ReferenceCountedTrigger();
|
||||
hideStackActionButton(duration, translate, postAnimationTrigger);
|
||||
postAnimationTrigger.flushLastDecrementRunnables();
|
||||
@@ -794,10 +766,6 @@ public class RecentsView extends FrameLayout {
|
||||
*/
|
||||
private void hideStackActionButton(int duration, boolean translate,
|
||||
final ReferenceCountedTrigger postAnimationTrigger) {
|
||||
if (!RecentsDebugFlags.Static.EnableStackActionButton) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (mStackActionButton.getVisibility() == View.VISIBLE) {
|
||||
if (translate) {
|
||||
mStackActionButton.animate().translationY(mStackActionButton.getMeasuredHeight()
|
||||
|
||||
@@ -669,7 +669,7 @@ public class TaskStackLayoutAlgorithm {
|
||||
public int getInitialFocusState() {
|
||||
RecentsActivityLaunchState launchState = Recents.getConfiguration().getLaunchState();
|
||||
RecentsDebugFlags debugFlags = Recents.getDebugFlags();
|
||||
if (debugFlags.isPagingEnabled() || launchState.launchedWithAltTab) {
|
||||
if (launchState.launchedWithAltTab) {
|
||||
return STATE_FOCUSED;
|
||||
} else {
|
||||
return STATE_UNFOCUSED;
|
||||
|
||||
@@ -57,7 +57,6 @@ import com.android.systemui.recents.events.activity.DismissRecentsToHomeAnimatio
|
||||
import com.android.systemui.recents.events.activity.EnterRecentsWindowAnimationCompletedEvent;
|
||||
import com.android.systemui.recents.events.activity.HideRecentsEvent;
|
||||
import com.android.systemui.recents.events.activity.HideStackActionButtonEvent;
|
||||
import com.android.systemui.recents.events.activity.IterateRecentsEvent;
|
||||
import com.android.systemui.recents.events.activity.LaunchMostRecentTaskRequestEvent;
|
||||
import com.android.systemui.recents.events.activity.LaunchNextTaskRequestEvent;
|
||||
import com.android.systemui.recents.events.activity.LaunchTaskEvent;
|
||||
@@ -1698,15 +1697,11 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal
|
||||
}
|
||||
|
||||
public final void onBusEvent(ShowStackActionButtonEvent event) {
|
||||
if (RecentsDebugFlags.Static.EnableStackActionButton) {
|
||||
mStackActionButtonVisible = true;
|
||||
}
|
||||
mStackActionButtonVisible = true;
|
||||
}
|
||||
|
||||
public final void onBusEvent(HideStackActionButtonEvent event) {
|
||||
if (RecentsDebugFlags.Static.EnableStackActionButton) {
|
||||
mStackActionButtonVisible = false;
|
||||
}
|
||||
mStackActionButtonVisible = false;
|
||||
}
|
||||
|
||||
public final void onBusEvent(LaunchNextTaskRequestEvent event) {
|
||||
@@ -1844,8 +1839,7 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal
|
||||
mStackScroller.stopScroller();
|
||||
mStackScroller.stopBoundScrollAnimation();
|
||||
|
||||
setRelativeFocusedTask(true, false /* stackTasksOnly */, true /* animated */, false,
|
||||
event.timerIndicatorDuration);
|
||||
setRelativeFocusedTask(true, false /* stackTasksOnly */, true /* animated */, false, 0);
|
||||
}
|
||||
|
||||
public final void onBusEvent(FocusPreviousTaskViewEvent event) {
|
||||
@@ -1869,8 +1863,7 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal
|
||||
EventBus.getDefault().send(new FocusPreviousTaskViewEvent());
|
||||
break;
|
||||
case DOWN:
|
||||
EventBus.getDefault().send(
|
||||
new FocusNextTaskViewEvent(0 /* timerIndicatorDuration */));
|
||||
EventBus.getDefault().send(new FocusNextTaskViewEvent());
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1881,7 +1874,7 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal
|
||||
mUIDozeTrigger.poke();
|
||||
|
||||
RecentsDebugFlags debugFlags = Recents.getDebugFlags();
|
||||
if (debugFlags.isFastToggleRecentsEnabled() && mFocusedTask != null) {
|
||||
if (mFocusedTask != null) {
|
||||
TaskView tv = getChildViewForTask(mFocusedTask);
|
||||
if (tv != null) {
|
||||
tv.getHeaderView().cancelFocusTimerIndicator();
|
||||
@@ -1979,13 +1972,6 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal
|
||||
event.getAnimationTrigger().increment();
|
||||
}
|
||||
|
||||
public final void onBusEvent(IterateRecentsEvent event) {
|
||||
if (!mEnterAnimationComplete) {
|
||||
// Cancel the previous task's window transition before animating the focused state
|
||||
EventBus.getDefault().send(new CancelEnterRecentsWindowAnimationEvent(null));
|
||||
}
|
||||
}
|
||||
|
||||
public final void onBusEvent(EnterRecentsWindowAnimationCompletedEvent event) {
|
||||
mEnterAnimationComplete = true;
|
||||
tryStartEnterAnimation();
|
||||
|
||||
@@ -460,17 +460,6 @@ public class TaskViewHeader extends FrameLayout
|
||||
mDismissButton.setClickable(false);
|
||||
((RippleDrawable) mDismissButton.getBackground()).setForceSoftware(true);
|
||||
|
||||
if (Recents.getDebugFlags().isFastToggleRecentsEnabled()) {
|
||||
if (mFocusTimerIndicator == null) {
|
||||
mFocusTimerIndicator = (ProgressBar) Utilities.findViewStubById(this,
|
||||
R.id.focus_timer_indicator_stub).inflate();
|
||||
}
|
||||
mFocusTimerIndicator.getProgressDrawable()
|
||||
.setColorFilter(
|
||||
getSecondaryColor(t.colorPrimary, t.useLightOnPrimaryColor),
|
||||
PorterDuff.Mode.SRC_IN);
|
||||
}
|
||||
|
||||
// In accessibility, a single click on the focused app info button will show it
|
||||
if (touchExplorationEnabled) {
|
||||
mIconView.setContentDescription(t.appInfoDescription);
|
||||
|
||||
Reference in New Issue
Block a user