Merge "Delete AndroidManifest meta-data for dump_provider Bug: 144953948" into ub-launcher3-master
diff --git a/protos/launcher_dump.proto b/protos/launcher_dump.proto
deleted file mode 100644
index dc8fbda..0000000
--- a/protos/launcher_dump.proto
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright (C) 2017 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.
- */
-syntax = "proto2";
-
-option java_package = "com.android.launcher3.model";
-option java_outer_classname = "LauncherDumpProto";
-
-package model;
-
-message DumpTarget {
- enum Type {
- NONE = 0;
- ITEM = 1;
- CONTAINER = 2;
- }
-
- optional Type type = 1;
- optional int32 page_id = 2;
- optional int32 grid_x = 3;
- optional int32 grid_y = 4;
-
- // For container types only
- optional ContainerType container_type = 5;
-
- // For item types only
- optional ItemType item_type = 6;
-
- optional string package_name = 7; // All ItemTypes except UNKNOWN type
- optional string component = 8; // All ItemTypes except UNKNOWN type
- optional string item_id = 9; // For Pinned Shortcuts and appWidgetId
-
- optional int32 span_x = 10 [default = 1];// Used for ItemType.WIDGET
- optional int32 span_y = 11 [default = 1];// Used for ItemType.WIDGET
- optional UserType user_type = 12;
-}
-
-// Used to define what type of item a Target would represent.
-enum ItemType {
- UNKNOWN_ITEMTYPE = 0; // Launcher specific items
- APP_ICON = 1; // Regular app icons
- WIDGET = 2; // Elements from AppWidgetManager
- SHORTCUT = 3; // ShortcutManager
-}
-
-// Used to define what type of container a Target would represent.
-enum ContainerType {
- UNKNOWN_CONTAINERTYPE = 0;
- WORKSPACE = 1;
- HOTSEAT = 2;
- FOLDER = 3;
-}
-
-// Used to define what type of control a Target would represent.
-enum UserType {
- DEFAULT = 0;
- WORK = 1;
-}
-
-// Main message;
-message LauncherImpression {
- repeated DumpTarget targets = 1;
-}
diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/FallbackSwipeHandler.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/FallbackSwipeHandler.java
index ea5561b..da73bc0 100644
--- a/quickstep/recents_ui_overrides/src/com/android/quickstep/FallbackSwipeHandler.java
+++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/FallbackSwipeHandler.java
@@ -166,6 +166,7 @@
super.onActivityInit(alreadyOnHome);
mActivity = mActivityInterface.getCreatedActivity();
mRecentsView = mActivity.getOverviewPanel();
+ mRecentsView.setOnPageTransitionEndCallback(null);
linkRecentsViewScroll();
mRecentsView.setDisallowScrollToClearAll(true);
mRecentsView.getClearAllButton().setVisibilityAlpha(0);
@@ -434,7 +435,12 @@
@Override
public void onAnimationSuccess(Animator animator) {
- finishAnimationTargetSetAnimationComplete();
+ if (mRecentsView != null) {
+ mRecentsView.setOnPageTransitionEndCallback(FallbackSwipeHandler.this
+ ::finishAnimationTargetSetAnimationComplete);
+ } else {
+ finishAnimationTargetSetAnimationComplete();
+ }
mFinishAnimation = null;
}
};
diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/LauncherSwipeHandler.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/LauncherSwipeHandler.java
index 5bac844..804bc95 100644
--- a/quickstep/recents_ui_overrides/src/com/android/quickstep/LauncherSwipeHandler.java
+++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/LauncherSwipeHandler.java
@@ -29,6 +29,7 @@
import static com.android.quickstep.GestureState.GestureEndTarget.NEW_TASK;
import static com.android.quickstep.GestureState.GestureEndTarget.RECENTS;
import static com.android.quickstep.GestureState.STATE_END_TARGET_ANIMATION_FINISHED;
+import static com.android.quickstep.GestureState.STATE_RECENTS_SCROLLING_FINISHED;
import static com.android.quickstep.MultiStateCallback.DEBUG_STATES;
import static com.android.quickstep.SysUINavigationMode.Mode.TWO_BUTTONS;
import static com.android.quickstep.util.ShelfPeekAnim.ShelfAnimState.HIDE;
@@ -244,7 +245,11 @@
| STATE_GESTURE_STARTED,
this::setupLauncherUiAfterSwipeUpToRecentsAnimation);
- mGestureState.runOnceAtState(STATE_END_TARGET_ANIMATION_FINISHED, this::onEndTargetSet);
+ mGestureState.runOnceAtState(STATE_END_TARGET_ANIMATION_FINISHED,
+ this::continueComputingRecentsScrollIfNecessary);
+ mGestureState.runOnceAtState(STATE_END_TARGET_ANIMATION_FINISHED
+ | STATE_RECENTS_SCROLLING_FINISHED,
+ this::onSettledOnEndTarget);
mStateCallback.runOnceAtState(STATE_HANDLER_INVALIDATED, this::invalidateHandler);
mStateCallback.runOnceAtState(STATE_LAUNCHER_PRESENT | STATE_HANDLER_INVALIDATED,
@@ -283,6 +288,7 @@
}
mRecentsView = activity.getOverviewPanel();
+ mRecentsView.setOnPageTransitionEndCallback(null);
linkRecentsViewScroll();
addLiveTileOverlay();
@@ -505,16 +511,22 @@
}
private void buildAnimationController() {
- if (mGestureState.getEndTarget() == HOME || mHasLauncherTransitionControllerStarted) {
- // We don't want a new mLauncherTransitionController if
- // mGestureState.getEndTarget() == HOME (it has its own animation) or if we're already
- // animating the current controller.
+ if (!canCreateNewOrUpdateExistingLauncherTransitionController()) {
return;
}
initTransitionEndpoints(mActivity.getDeviceProfile());
mAnimationFactory.createActivityInterface(mTransitionDragLength);
}
+ /**
+ * We don't want to change mLauncherTransitionController if mGestureState.getEndTarget() == HOME
+ * (it has its own animation) or if we're already animating the current controller.
+ * @return Whether we can create the launcher controller or update its progress.
+ */
+ private boolean canCreateNewOrUpdateExistingLauncherTransitionController() {
+ return mGestureState.getEndTarget() != HOME && !mHasLauncherTransitionControllerStarted;
+ }
+
@Override
public WindowInsets onApplyWindowInsets(View view, WindowInsets windowInsets) {
WindowInsets result = view.onApplyWindowInsets(windowInsets);
@@ -558,15 +570,12 @@
}
}
- if (mLauncherTransitionController == null || mLauncherTransitionController
- .getAnimationPlayer().isStarted()) {
- return;
- }
updateLauncherTransitionProgress();
}
private void updateLauncherTransitionProgress() {
- if (mGestureState.getEndTarget() == HOME) {
+ if (mLauncherTransitionController == null
+ || !canCreateNewOrUpdateExistingLauncherTransitionController()) {
return;
}
// Normalize the progress to 0 to 1, as the animation controller will clamp it to that
@@ -696,7 +705,7 @@
}
}
- private void onEndTargetSet() {
+ private void onSettledOnEndTarget() {
switch (mGestureState.getEndTarget()) {
case HOME:
mStateCallback.setState(STATE_SCALED_CONTROLLER_HOME | STATE_CAPTURE_SCREENSHOT);
@@ -859,13 +868,17 @@
if (mDeviceState.isFullyGesturalNavMode()) {
setShelfState(ShelfAnimState.OVERVIEW, interpolator, duration);
}
- } else if (endTarget == NEW_TASK || endTarget == LAST_TASK) {
- // Let RecentsView handle the scrolling to the task, which we launch in startNewTask()
- // or resumeLastTask().
- if (mRecentsView != null) {
- duration = Math.max(duration, mRecentsView.getScroller().getDuration());
- }
}
+
+ // Let RecentsView handle the scrolling to the task, which we launch in startNewTask()
+ // or resumeLastTask().
+ if (mRecentsView != null) {
+ mRecentsView.setOnPageTransitionEndCallback(
+ () -> mGestureState.setState(STATE_RECENTS_SCROLLING_FINISHED));
+ } else {
+ mGestureState.setState(STATE_RECENTS_SCROLLING_FINISHED);
+ }
+
animateToProgress(startShift, endShift, duration, interpolator, endTarget, velocityPxPerMs);
}
@@ -949,11 +962,7 @@
ValueAnimator windowAnim = mCurrentShift.animateToValue(start, end);
windowAnim.setDuration(duration).setInterpolator(interpolator);
windowAnim.addUpdateListener(valueAnimator -> {
- if (mRecentsView != null && mRecentsView.getVisibility() != View.VISIBLE) {
- // Views typically don't compute scroll when invisible as an optimization,
- // but in our case we need to since the window offset depends on the scroll.
- mRecentsView.computeScroll();
- }
+ computeRecentsScrollIfInvisible();
});
windowAnim.addListener(new AnimationSuccessListener() {
@Override
@@ -1005,6 +1014,21 @@
mHasLauncherTransitionControllerStarted = true;
}
+ private void computeRecentsScrollIfInvisible() {
+ if (mRecentsView != null && mRecentsView.getVisibility() != View.VISIBLE) {
+ // Views typically don't compute scroll when invisible as an optimization,
+ // but in our case we need to since the window offset depends on the scroll.
+ mRecentsView.computeScroll();
+ }
+ }
+
+ private void continueComputingRecentsScrollIfNecessary() {
+ if (!mGestureState.hasState(STATE_RECENTS_SCROLLING_FINISHED)) {
+ computeRecentsScrollIfInvisible();
+ mRecentsView.post(this::continueComputingRecentsScrollIfNecessary);
+ }
+ }
+
/**
* Creates an animation that transforms the current app window into the home app.
* @param startProgress The progress of {@link #mCurrentShift} to start the window from.
diff --git a/quickstep/src/com/android/quickstep/GestureState.java b/quickstep/src/com/android/quickstep/GestureState.java
index f7e40ca..631df4c 100644
--- a/quickstep/src/com/android/quickstep/GestureState.java
+++ b/quickstep/src/com/android/quickstep/GestureState.java
@@ -105,6 +105,10 @@
public static final int STATE_RECENTS_ANIMATION_ENDED =
getFlagForIndex("STATE_RECENTS_ANIMATION_ENDED");
+ // Called when RecentsView stops scrolling and settles on a TaskView.
+ public static final int STATE_RECENTS_SCROLLING_FINISHED =
+ getFlagForIndex("STATE_RECENTS_SCROLLING_FINISHED");
+
// Needed to interact with the current activity
private final Intent mHomeIntent;
diff --git a/quickstep/src/com/android/quickstep/util/ImageActionUtils.java b/quickstep/src/com/android/quickstep/util/ImageActionUtils.java
index 7760255..f5fbf28 100644
--- a/quickstep/src/com/android/quickstep/util/ImageActionUtils.java
+++ b/quickstep/src/com/android/quickstep/util/ImageActionUtils.java
@@ -21,6 +21,8 @@
import static com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR;
+import android.content.ClipData;
+import android.content.ClipDescription;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
@@ -152,13 +154,16 @@
if (intent == null) {
intent = new Intent();
}
+ ClipData clipdata = new ClipData(new ClipDescription("content",
+ new String[]{ClipDescription.MIMETYPE_TEXT_PLAIN}),
+ new ClipData.Item(uri));
intent.setAction(Intent.ACTION_SEND)
.setComponent(null)
.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
.setType("image/png")
- .setData(uri)
.setFlags(FLAG_GRANT_READ_URI_PERMISSION)
- .putExtra(Intent.EXTRA_STREAM, uri);
+ .putExtra(Intent.EXTRA_STREAM, uri)
+ .setClipData(clipdata);
return new Intent[]{Intent.createChooser(intent, null).addFlags(FLAG_ACTIVITY_NEW_TASK)};
}
}
diff --git a/src/com/android/launcher3/PagedView.java b/src/com/android/launcher3/PagedView.java
index e38631d..7d7739e 100644
--- a/src/com/android/launcher3/PagedView.java
+++ b/src/com/android/launcher3/PagedView.java
@@ -50,6 +50,8 @@
import static com.android.launcher3.touch.PagedOrientationHandler.VIEW_SCROLL_BY;
import static com.android.launcher3.touch.PagedOrientationHandler.VIEW_SCROLL_TO;
+import androidx.annotation.Nullable;
+
import com.android.launcher3.anim.Interpolators;
import com.android.launcher3.compat.AccessibilityManagerCompat;
import com.android.launcher3.config.FeatureFlags;
@@ -133,6 +135,7 @@
protected int mActivePointerId = INVALID_POINTER;
protected boolean mIsPageInTransition = false;
+ private Runnable mOnPageTransitionEndCallback;
protected float mSpringOverScroll;
@@ -391,6 +394,22 @@
AccessibilityManagerCompat.sendScrollFinishedEventToTest(getContext());
AccessibilityManagerCompat.sendCustomAccessibilityEvent(getPageAt(mCurrentPage),
AccessibilityEvent.TYPE_VIEW_FOCUSED, null);
+ if (mOnPageTransitionEndCallback != null) {
+ mOnPageTransitionEndCallback.run();
+ mOnPageTransitionEndCallback = null;
+ }
+ }
+
+ /**
+ * Sets a callback to run once when the scrolling finishes. If there is currently
+ * no page in transition, then the callback is called immediately.
+ */
+ public void setOnPageTransitionEndCallback(@Nullable Runnable callback) {
+ if (mIsPageInTransition || callback == null) {
+ mOnPageTransitionEndCallback = callback;
+ } else {
+ callback.run();
+ }
}
protected int getUnboundedScroll() {
diff --git a/src/com/android/launcher3/logging/DumpTargetWrapper.java b/src/com/android/launcher3/logging/DumpTargetWrapper.java
deleted file mode 100644
index 067bdfd..0000000
--- a/src/com/android/launcher3/logging/DumpTargetWrapper.java
+++ /dev/null
@@ -1,169 +0,0 @@
-/*
- * Copyright (C) 2017 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.launcher3.logging;
-
-import static com.android.launcher3.LauncherSettings.Favorites.ITEM_TYPE_DEEP_SHORTCUT;
-
-import android.content.ComponentName;
-import android.os.Process;
-import android.text.TextUtils;
-
-import com.android.launcher3.ItemInfo;
-import com.android.launcher3.LauncherAppWidgetInfo;
-import com.android.launcher3.LauncherSettings;
-import com.android.launcher3.WorkspaceItemInfo;
-import com.android.launcher3.model.nano.LauncherDumpProto;
-import com.android.launcher3.model.nano.LauncherDumpProto.ContainerType;
-import com.android.launcher3.model.nano.LauncherDumpProto.DumpTarget;
-import com.android.launcher3.model.nano.LauncherDumpProto.ItemType;
-import com.android.launcher3.model.nano.LauncherDumpProto.UserType;
-import com.android.launcher3.util.ShortcutUtil;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * This class can be used when proto definition doesn't support nesting.
- */
-public class DumpTargetWrapper {
- DumpTarget node;
- ArrayList<DumpTargetWrapper> children;
-
- public DumpTargetWrapper() {
- children = new ArrayList<>();
- }
-
- public DumpTargetWrapper(int containerType, int id) {
- this();
- node = newContainerTarget(containerType, id);
- }
-
- public DumpTargetWrapper(ItemInfo info) {
- this();
- node = newItemTarget(info);
- }
-
- public DumpTarget getDumpTarget() {
- return node;
- }
-
- public void add(DumpTargetWrapper child) {
- children.add(child);
- }
-
- public List<DumpTarget> getFlattenedList() {
- ArrayList<DumpTarget> list = new ArrayList<>();
- list.add(node);
- if (!children.isEmpty()) {
- for(DumpTargetWrapper t: children) {
- list.addAll(t.getFlattenedList());
- }
- list.add(node); // add a delimiter empty object
- }
- return list;
- }
- public DumpTarget newItemTarget(ItemInfo info) {
- DumpTarget dt = new DumpTarget();
- dt.type = DumpTarget.Type.ITEM;
- if (info == null) {
- return dt;
- }
- switch (info.itemType) {
- case LauncherSettings.Favorites.ITEM_TYPE_APPLICATION:
- dt.itemType = ItemType.APP_ICON;
- break;
- case LauncherSettings.Favorites.ITEM_TYPE_APPWIDGET:
- dt.itemType = ItemType.WIDGET;
- break;
- case ITEM_TYPE_DEEP_SHORTCUT:
- case LauncherSettings.Favorites.ITEM_TYPE_SHORTCUT:
- dt.itemType = ItemType.SHORTCUT;
- break;
- default:
- dt.itemType = ItemType.UNKNOWN_ITEMTYPE;
- break;
- }
- return dt;
- }
-
- public DumpTarget newContainerTarget(int type, int id) {
- DumpTarget dt = new DumpTarget();
- dt.type = DumpTarget.Type.CONTAINER;
- dt.containerType = type;
- dt.pageId = id;
- return dt;
- }
-
- public static String getDumpTargetStr(DumpTarget t) {
- if (t == null){
- return "";
- }
- switch (t.type) {
- case LauncherDumpProto.DumpTarget.Type.ITEM:
- return getItemStr(t);
- case LauncherDumpProto.DumpTarget.Type.CONTAINER:
- String str = LoggerUtils.getFieldName(t.containerType, ContainerType.class);
- if (t.containerType == ContainerType.WORKSPACE) {
- str += " id=" + t.pageId;
- } else if (t.containerType == ContainerType.FOLDER) {
- str += " grid(" + t.gridX + "," + t.gridY+ ")";
- }
- return str;
- default:
- return "UNKNOWN TARGET TYPE";
- }
- }
-
- private static String getItemStr(DumpTarget t) {
- if (t == null) {
- return "";
- }
- String typeStr = LoggerUtils.getFieldName(t.itemType, ItemType.class);
- if (!TextUtils.isEmpty(t.packageName)) {
- typeStr += ", package=" + t.packageName;
- }
- if (!TextUtils.isEmpty(t.component)) {
- typeStr += ", component=" + t.component;
- }
- return typeStr + ", grid(" + t.gridX + "," + t.gridY + "), span(" + t.spanX + "," + t.spanY
- + "), pageIdx=" + t.pageId + " user=" + t.userType;
- }
-
- public DumpTarget writeToDumpTarget(ItemInfo info) {
- if (info == null) {
- return node;
- }
- if (ShortcutUtil.isDeepShortcut(info)) {
- node.component = ((WorkspaceItemInfo) info).getDeepShortcutId();
- } else {
- ComponentName cmp = info.getTargetComponent();
- node.component = cmp == null ? "" : cmp.flattenToString();
- }
- node.packageName = info.getTargetComponent() == null? "":
- info.getTargetComponent().getPackageName();
- if (info instanceof LauncherAppWidgetInfo) {
- node.component = ((LauncherAppWidgetInfo) info).providerName.flattenToString();
- node.packageName = ((LauncherAppWidgetInfo) info).providerName.getPackageName();
- }
-
- node.gridX = info.cellX;
- node.gridY = info.cellY;
- node.spanX = info.spanX;
- node.spanY = info.spanY;
- node.userType = (info.user.equals(Process.myUserHandle()))? UserType.DEFAULT : UserType.WORK;
- return node;
- }
-}
diff --git a/src/com/android/launcher3/model/BgDataModel.java b/src/com/android/launcher3/model/BgDataModel.java
index fdfcef1..206688a 100644
--- a/src/com/android/launcher3/model/BgDataModel.java
+++ b/src/com/android/launcher3/model/BgDataModel.java
@@ -36,10 +36,6 @@
import com.android.launcher3.Workspace;
import com.android.launcher3.WorkspaceItemInfo;
import com.android.launcher3.config.FeatureFlags;
-import com.android.launcher3.logging.DumpTargetWrapper;
-import com.android.launcher3.model.nano.LauncherDumpProto;
-import com.android.launcher3.model.nano.LauncherDumpProto.ContainerType;
-import com.android.launcher3.model.nano.LauncherDumpProto.DumpTarget;
import com.android.launcher3.shortcuts.ShortcutKey;
import com.android.launcher3.shortcuts.ShortcutRequest;
import com.android.launcher3.util.ComponentKey;
@@ -50,11 +46,7 @@
import com.android.launcher3.util.ViewOnDrawExecutor;
import com.android.launcher3.widget.WidgetListRowEntry;
-import com.google.protobuf.nano.MessageNano;
-
import java.io.FileDescriptor;
-import java.io.FileOutputStream;
-import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
@@ -150,10 +142,6 @@
public synchronized void dump(String prefix, FileDescriptor fd, PrintWriter writer,
String[] args) {
- if (Arrays.asList(args).contains("--proto")) {
- dumpProto(prefix, fd, writer, args);
- return;
- }
writer.println(prefix + "Data Model:");
writer.println(prefix + " ---- workspace items ");
for (int i = 0; i < workspaceItems.size(); i++) {
@@ -181,89 +169,6 @@
}
}
- private synchronized void dumpProto(String prefix, FileDescriptor fd, PrintWriter writer,
- String[] args) {
-
- // Add top parent nodes. (L1)
- DumpTargetWrapper hotseat = new DumpTargetWrapper(ContainerType.HOTSEAT, 0);
- IntSparseArrayMap<DumpTargetWrapper> workspaces = new IntSparseArrayMap<>();
- IntArray workspaceScreens = collectWorkspaceScreens();
- for (int i = 0; i < workspaceScreens.size(); i++) {
- workspaces.put(workspaceScreens.get(i),
- new DumpTargetWrapper(ContainerType.WORKSPACE, i));
- }
- DumpTargetWrapper dtw;
- // Add non leaf / non top nodes (L2)
- for (int i = 0; i < folders.size(); i++) {
- FolderInfo fInfo = folders.valueAt(i);
- dtw = new DumpTargetWrapper(ContainerType.FOLDER, folders.size());
- dtw.writeToDumpTarget(fInfo);
- for(WorkspaceItemInfo sInfo: fInfo.contents) {
- DumpTargetWrapper child = new DumpTargetWrapper(sInfo);
- child.writeToDumpTarget(sInfo);
- dtw.add(child);
- }
- if (fInfo.container == LauncherSettings.Favorites.CONTAINER_HOTSEAT) {
- hotseat.add(dtw);
- } else if (fInfo.container == LauncherSettings.Favorites.CONTAINER_DESKTOP) {
- workspaces.get(fInfo.screenId).add(dtw);
- }
- }
- // Add leaf nodes (L3): *Info
- for (int i = 0; i < workspaceItems.size(); i++) {
- ItemInfo info = workspaceItems.get(i);
- if (info instanceof FolderInfo) {
- continue;
- }
- dtw = new DumpTargetWrapper(info);
- dtw.writeToDumpTarget(info);
- if (info.container == LauncherSettings.Favorites.CONTAINER_HOTSEAT) {
- hotseat.add(dtw);
- } else if (info.container == LauncherSettings.Favorites.CONTAINER_DESKTOP) {
- workspaces.get(info.screenId).add(dtw);
- }
- }
- for (int i = 0; i < appWidgets.size(); i++) {
- ItemInfo info = appWidgets.get(i);
- dtw = new DumpTargetWrapper(info);
- dtw.writeToDumpTarget(info);
- if (info.container == LauncherSettings.Favorites.CONTAINER_HOTSEAT) {
- hotseat.add(dtw);
- } else if (info.container == LauncherSettings.Favorites.CONTAINER_DESKTOP) {
- workspaces.get(info.screenId).add(dtw);
- }
- }
-
-
- // Traverse target wrapper
- ArrayList<DumpTarget> targetList = new ArrayList<>();
- targetList.addAll(hotseat.getFlattenedList());
- for (int i = 0; i < workspaces.size(); i++) {
- targetList.addAll(workspaces.valueAt(i).getFlattenedList());
- }
-
- if (Arrays.asList(args).contains("--debug")) {
- for (int i = 0; i < targetList.size(); i++) {
- writer.println(prefix + DumpTargetWrapper.getDumpTargetStr(targetList.get(i)));
- }
- return;
- } else {
- LauncherDumpProto.LauncherImpression proto = new LauncherDumpProto.LauncherImpression();
- proto.targets = new DumpTarget[targetList.size()];
- for (int i = 0; i < targetList.size(); i++) {
- proto.targets[i] = targetList.get(i);
- }
- FileOutputStream fos = new FileOutputStream(fd);
- try {
-
- fos.write(MessageNano.toByteArray(proto));
- Log.d(TAG, MessageNano.toByteArray(proto).length + "Bytes");
- } catch (IOException e) {
- Log.e(TAG, "Exception writing dumpsys --proto", e);
- }
- }
- }
-
public synchronized void removeItem(Context context, ItemInfo... items) {
removeItem(context, Arrays.asList(items));
}
diff --git a/src/com/android/launcher3/util/OverScroller.java b/src/com/android/launcher3/util/OverScroller.java
index 3c398b8..34efb12 100644
--- a/src/com/android/launcher3/util/OverScroller.java
+++ b/src/com/android/launcher3/util/OverScroller.java
@@ -165,6 +165,9 @@
/**
* Returns how long the scroll event will take, in milliseconds.
*
+ * Note that if mScroller.mState == SPRING, this duration is ignored, so can only
+ * serve as an estimate for how long the spring-controlled scroll will take.
+ *
* @return The duration of the scroll in milliseconds.
*/
public final int getDuration() {