Merge "Prevent adding tasks to the visible task list." into ub-launcher3-master
diff --git a/quickstep/src/com/android/launcher3/LauncherAppTransitionManagerImpl.java b/quickstep/src/com/android/launcher3/LauncherAppTransitionManagerImpl.java
index 91f74a6..a5af173 100644
--- a/quickstep/src/com/android/launcher3/LauncherAppTransitionManagerImpl.java
+++ b/quickstep/src/com/android/launcher3/LauncherAppTransitionManagerImpl.java
@@ -218,7 +218,7 @@
private LauncherTransitionAnimator composeRecentsLaunchAnimator(View v,
RemoteAnimationTargetCompat[] targets) {
// Ensure recents is actually visible
- if (!mLauncher.getStateManager().getState().overviewUi) {
+ if (!mLauncher.isInState(LauncherState.OVERVIEW)) {
return null;
}
@@ -720,7 +720,7 @@
postAtFrontOfQueueAsynchronously(handler, () -> {
if ((Utilities.getPrefs(mLauncher)
.getBoolean("pref_use_screenshot_for_swipe_up", false)
- && mLauncher.getStateManager().getState().overviewUi)
+ && mLauncher.isInState(LauncherState.OVERVIEW))
|| !launcherIsATargetWithMode(targets, MODE_OPENING)) {
// We use a separate transition for Overview mode. And we can skip the
// animation in cases where Launcher is not in the set of opening targets.
diff --git a/quickstep/src/com/android/launcher3/uioverrides/FastOverviewState.java b/quickstep/src/com/android/launcher3/uioverrides/FastOverviewState.java
deleted file mode 100644
index acd4fc1..0000000
--- a/quickstep/src/com/android/launcher3/uioverrides/FastOverviewState.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright (C) 2018 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.uioverrides;
-
-import com.android.launcher3.Launcher;
-
-/**
- * Extension of overview state used for QuickScrub
- */
-public class FastOverviewState extends OverviewState {
-
- private static final int STATE_FLAGS = FLAG_SHOW_SCRIM | FLAG_DISABLE_RESTORE
- | FLAG_PAGE_BACKGROUNDS | FLAG_DISABLE_INTERACTION | FLAG_OVERVIEW_UI;
-
- private static final boolean DEBUG_DIFFERENT_UI = false;
-
- public FastOverviewState(int id) {
- super(id, STATE_FLAGS);
- }
-
- @Override
- public float getHoseatAlpha(Launcher launcher) {
- if (DEBUG_DIFFERENT_UI) {
- return 0;
- }
- return super.getHoseatAlpha(launcher);
- }
-}
diff --git a/quickstep/src/com/android/launcher3/uioverrides/IgnoreTouchesInQuickScrub.java b/quickstep/src/com/android/launcher3/uioverrides/IgnoreTouchesInQuickScrub.java
new file mode 100644
index 0000000..2d5eb5a
--- /dev/null
+++ b/quickstep/src/com/android/launcher3/uioverrides/IgnoreTouchesInQuickScrub.java
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2018 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.uioverrides;
+
+import android.view.MotionEvent;
+
+import com.android.launcher3.util.TouchController;
+import com.android.quickstep.TouchInteractionService;
+
+/**
+ * Consumes touches when quick scrub is enabled.
+ */
+public class IgnoreTouchesInQuickScrub implements TouchController {
+
+ public IgnoreTouchesInQuickScrub() {
+ }
+
+ @Override
+ public boolean onControllerTouchEvent(MotionEvent ev) {
+ return true;
+ }
+
+ @Override
+ public boolean onControllerInterceptTouchEvent(MotionEvent ev) {
+ return TouchInteractionService.isQuickScrubEnabled();
+ }
+}
diff --git a/quickstep/src/com/android/launcher3/uioverrides/OverviewState.java b/quickstep/src/com/android/launcher3/uioverrides/OverviewState.java
index 3f305e9..77fb842 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/OverviewState.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/OverviewState.java
@@ -34,14 +34,10 @@
public class OverviewState extends LauncherState {
private static final int STATE_FLAGS = FLAG_SHOW_SCRIM | FLAG_WORKSPACE_ICONS_CAN_BE_DRAGGED
- | FLAG_DISABLE_RESTORE | FLAG_PAGE_BACKGROUNDS | FLAG_OVERVIEW_UI;
+ | FLAG_DISABLE_RESTORE | FLAG_PAGE_BACKGROUNDS;
public OverviewState(int id) {
- this(id, STATE_FLAGS);
- }
-
- protected OverviewState(int id, int stateFlags) {
- super(id, ContainerType.TASKSWITCHER, OVERVIEW_TRANSITION_MS, stateFlags);
+ super(id, ContainerType.TASKSWITCHER, OVERVIEW_TRANSITION_MS, STATE_FLAGS);
}
@Override
diff --git a/quickstep/src/com/android/launcher3/uioverrides/RecentsViewStateController.java b/quickstep/src/com/android/launcher3/uioverrides/RecentsViewStateController.java
index 4542431..80ecb92 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/RecentsViewStateController.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/RecentsViewStateController.java
@@ -60,10 +60,10 @@
@Override
public void setState(LauncherState state) {
- mWorkspaceCard.setWorkspaceScrollingEnabled(state.overviewUi);
- setVisibility(state.overviewUi);
- setTransitionProgress(state.overviewUi ? 1 : 0);
- if (state.overviewUi) {
+ mWorkspaceCard.setWorkspaceScrollingEnabled(state == OVERVIEW);
+ setVisibility(state == OVERVIEW);
+ setTransitionProgress(state == OVERVIEW ? 1 : 0);
+ if (state == OVERVIEW) {
for (int i = mRecentsView.getFirstTaskIndex(); i < mRecentsView.getPageCount(); i++) {
((TaskView) mRecentsView.getPageAt(i)).resetVisualProperties();
}
@@ -92,20 +92,20 @@
}
ObjectAnimator progressAnim =
- mTransitionProgress.animateToValue(toState.overviewUi ? 1 : 0);
+ mTransitionProgress.animateToValue(toState == OVERVIEW ? 1 : 0);
progressAnim.setDuration(config.duration);
progressAnim.setInterpolator(Interpolators.LINEAR);
progressAnim.addListener(new AnimationSuccessListener() {
@Override
public void onAnimationSuccess(Animator animator) {
- mWorkspaceCard.setWorkspaceScrollingEnabled(toState.overviewUi);
+ mWorkspaceCard.setWorkspaceScrollingEnabled(toState == OVERVIEW);
mRecentsView.setCurrentPage(mRecentsView.getPageNearestToCenterOfScreen());
}
});
builder.play(progressAnim);
- ObjectAnimator visibilityAnim = animateVisibility(toState.overviewUi);
+ ObjectAnimator visibilityAnim = animateVisibility(toState == OVERVIEW);
visibilityAnim.setDuration(config.duration);
visibilityAnim.setInterpolator(Interpolators.LINEAR);
builder.play(visibilityAnim);
diff --git a/quickstep/src/com/android/launcher3/uioverrides/UiFactory.java b/quickstep/src/com/android/launcher3/uioverrides/UiFactory.java
index 7f98935..71cdd10 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/UiFactory.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/UiFactory.java
@@ -43,11 +43,13 @@
public static TouchController[] createTouchControllers(Launcher launcher) {
if (FeatureFlags.ENABLE_TWO_SWIPE_TARGETS) {
return new TouchController[] {
+ new IgnoreTouchesInQuickScrub(),
new EdgeSwipeController(launcher),
new TwoStepSwipeController(launcher),
new OverviewSwipeController(launcher)};
} else {
return new TouchController[] {
+ new IgnoreTouchesInQuickScrub(),
new TwoStepSwipeController(launcher),
new OverviewSwipeController(launcher)};
}
diff --git a/quickstep/src/com/android/quickstep/TouchInteractionService.java b/quickstep/src/com/android/quickstep/TouchInteractionService.java
index e5af3e5..c166292 100644
--- a/quickstep/src/com/android/quickstep/TouchInteractionService.java
+++ b/quickstep/src/com/android/quickstep/TouchInteractionService.java
@@ -21,8 +21,6 @@
import static android.view.MotionEvent.ACTION_POINTER_DOWN;
import static android.view.MotionEvent.ACTION_POINTER_UP;
import static android.view.MotionEvent.ACTION_UP;
-
-import static com.android.launcher3.LauncherState.FAST_OVERVIEW;
import static com.android.launcher3.LauncherState.OVERVIEW;
import static com.android.quickstep.QuickScrubController.QUICK_SWITCH_START_DURATION;
@@ -119,6 +117,7 @@
@Override
public void onQuickScrubStart() {
mEventQueue.onQuickScrubStart();
+ sQuickScrubEnabled = true;
TraceHelper.partitionSection("SysUiBinder", "onQuickScrubStart");
}
@@ -131,17 +130,23 @@
public void onQuickScrubEnd() {
mEventQueue.onQuickScrubEnd();
TraceHelper.endSection("SysUiBinder", "onQuickScrubEnd");
+ sQuickScrubEnabled = false;
}
};
private final TouchConsumer mNoOpTouchConsumer = (ev) -> {};
private static boolean sConnected = false;
+ private static boolean sQuickScrubEnabled = false;
public static boolean isConnected() {
return sConnected;
}
+ public static boolean isQuickScrubEnabled() {
+ return sQuickScrubEnabled;
+ }
+
private ActivityManagerWrapper mAM;
private RunningTaskInfo mRunningTask;
private RecentsModel mRecentsModel;
@@ -185,6 +190,7 @@
@Override
public void onDestroy() {
sConnected = false;
+ sQuickScrubEnabled = false;
super.onDestroy();
}
@@ -309,7 +315,7 @@
} else if (interactionType == INTERACTION_QUICK_SWITCH) {
onComplete = mQuickScrubController::onQuickSwitch;
}
- mLauncher.getStateManager().goToState(FAST_OVERVIEW, true, 0,
+ mLauncher.getStateManager().goToState(OVERVIEW, true, 0,
QUICK_SWITCH_START_DURATION, onComplete);
};
diff --git a/quickstep/src/com/android/quickstep/WindowTransformSwipeHandler.java b/quickstep/src/com/android/quickstep/WindowTransformSwipeHandler.java
index 25f395f..3198790 100644
--- a/quickstep/src/com/android/quickstep/WindowTransformSwipeHandler.java
+++ b/quickstep/src/com/android/quickstep/WindowTransformSwipeHandler.java
@@ -15,7 +15,6 @@
*/
package com.android.quickstep;
-import static com.android.launcher3.LauncherState.FAST_OVERVIEW;
import static com.android.launcher3.LauncherState.OVERVIEW;
import static com.android.launcher3.allapps.AllAppsTransitionController.ALL_APPS_PROGRESS;
import static com.android.launcher3.anim.Interpolators.LINEAR;
@@ -494,8 +493,6 @@
}
private void onQuickInteractionStart() {
- mLauncher.getStateManager().goToState(FAST_OVERVIEW,
- mWasLauncherAlreadyVisible || mGestureStarted);
mQuickScrubController.onQuickScrubStart(false);
}
diff --git a/res/drawable-v24/ic_setup_shadow.xml b/res/drawable-v24/ic_info_shadow.xml
similarity index 94%
rename from res/drawable-v24/ic_setup_shadow.xml
rename to res/drawable-v24/ic_info_shadow.xml
index 10aeee6..1fe2c46 100644
--- a/res/drawable-v24/ic_setup_shadow.xml
+++ b/res/drawable-v24/ic_info_shadow.xml
@@ -15,5 +15,5 @@
-->
<com.android.launcher3.graphics.ShadowDrawable
xmlns:android="http://schemas.android.com/apk/res/android"
- android:src="@drawable/ic_setting"
+ android:src="@drawable/ic_info_no_shadow"
android:elevation="@dimen/drop_target_shadow_elevation" />
diff --git a/res/drawable/ic_setting.xml b/res/drawable/ic_setting.xml
index 33cd6ce..08eba25 100644
--- a/res/drawable/ic_setting.xml
+++ b/res/drawable/ic_setting.xml
@@ -17,10 +17,9 @@
android:width="@dimen/options_menu_icon_size"
android:height="@dimen/options_menu_icon_size"
android:viewportWidth="48.0"
- android:viewportHeight="48.0"
- android:tint="?android:attr/textColorPrimary" >
+ android:viewportHeight="48.0">
<path
- android:fillColor="#FFFFFFFF"
+ android:fillColor="?android:attr/textColorPrimary"
android:pathData="M42.8,28.4l-3.88-2.9c0.06-0.5,0.08-1,0.08-1.52s-0.02-1.02-0.08-1.52l3.88-2.86c0.84-0.62,1.04-1.88,
0.48-2.82l-3.2-5.52c-0.56-0.96-1.76-1.4-2.72-1l-4.28,1.82c-0.96-0.74-2.02-1.36-3.14-1.84l-0.54-4.4C29.28,4.8,28.28,4,
27.18,4h-6.36c-1.1,0-2.1,0.8-2.22,1.84l-0.52,4.38c-1.14,0.48-2.2,1.1-3.16,1.84l-4.28-1.82c-0.96-0.4-2.16,0.04-2.72,
diff --git a/res/layout/drop_target_bar.xml b/res/layout/drop_target_bar.xml
index 2f21c60..d376bcf 100644
--- a/res/layout/drop_target_bar.xml
+++ b/res/layout/drop_target_bar.xml
@@ -32,8 +32,18 @@
android:gravity="center"
android:text="@string/remove_drop_target_label" />
+ <!-- App Info -->
+ <com.android.launcher3.InfoDropTarget
+ android:id="@+id/info_target_text"
+ style="@style/DropTargetButton"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center"
+ android:gravity="center"
+ android:text="@string/app_info_drop_target_label" />
+
<!-- Uninstall target -->
- <com.android.launcher3.SecondaryDropTarget
+ <com.android.launcher3.UninstallDropTarget
android:id="@+id/uninstall_target_text"
style="@style/DropTargetButton"
android:layout_width="wrap_content"
diff --git a/res/values/config.xml b/res/values/config.xml
index 3f727cf..6821b59 100644
--- a/res/values/config.xml
+++ b/res/values/config.xml
@@ -127,7 +127,7 @@
<!-- Accessibility actions -->
<item type="id" name="action_remove" />
<item type="id" name="action_uninstall" />
- <item type="id" name="action_reconfigure" />
+ <item type="id" name="action_info" />
<item type="id" name="action_add_to_workspace" />
<item type="id" name="action_move" />
<item type="id" name="action_move_to_workspace" />
diff --git a/res/values/drawables.xml b/res/values/drawables.xml
index 1367174..fea17b1 100644
--- a/res/values/drawables.xml
+++ b/res/values/drawables.xml
@@ -14,7 +14,7 @@
limitations under the License.
-->
<resources>
- <drawable name="ic_setup_shadow">@drawable/ic_setting</drawable>
+ <drawable name="ic_info_shadow">@drawable/ic_info_no_shadow</drawable>
<drawable name="ic_remove_shadow">@drawable/ic_remove_no_shadow</drawable>
<drawable name="ic_uninstall_shadow">@drawable/ic_uninstall_no_shadow</drawable>
</resources>
\ No newline at end of file
diff --git a/src/com/android/launcher3/ButtonDropTarget.java b/src/com/android/launcher3/ButtonDropTarget.java
index c866880..19ee0b8 100644
--- a/src/com/android/launcher3/ButtonDropTarget.java
+++ b/src/com/android/launcher3/ButtonDropTarget.java
@@ -108,12 +108,6 @@
setContentDescription(mText);
}
- protected void updateText(int resId) {
- setText(resId);
- mText = getText();
- setContentDescription(mText);
- }
-
protected void setDrawable(int resId) {
// We do not set the drawable in the xml as that inflates two drawables corresponding to
// drawableLeft and drawableStart.
@@ -242,7 +236,9 @@
protected abstract boolean supportsDrop(ItemInfo info);
- public abstract boolean supportsAccessibilityDrop(ItemInfo info, View view);
+ public boolean supportsAccessibilityDrop(ItemInfo info) {
+ return supportsDrop(info);
+ }
@Override
public boolean isDropEnabled() {
@@ -372,6 +368,4 @@
TextUtils.TruncateAt.END);
return !mText.equals(displayedText);
}
-
- public abstract int getControlTypeForLogging();
}
diff --git a/src/com/android/launcher3/DeleteDropTarget.java b/src/com/android/launcher3/DeleteDropTarget.java
index 28d1129..c12ea57 100644
--- a/src/com/android/launcher3/DeleteDropTarget.java
+++ b/src/com/android/launcher3/DeleteDropTarget.java
@@ -24,7 +24,6 @@
import com.android.launcher3.accessibility.LauncherAccessibilityDelegate;
import com.android.launcher3.dragndrop.DragOptions;
import com.android.launcher3.folder.Folder;
-import com.android.launcher3.userevent.nano.LauncherLogProto.ControlType;
public class DeleteDropTarget extends ButtonDropTarget {
@@ -55,7 +54,7 @@
* @return true for items that should have a "Remove" action in accessibility.
*/
@Override
- public boolean supportsAccessibilityDrop(ItemInfo info, View view) {
+ public boolean supportsAccessibilityDrop(ItemInfo info) {
return (info instanceof ShortcutInfo)
|| (info instanceof LauncherAppWidgetInfo)
|| (info instanceof FolderInfo);
@@ -104,9 +103,4 @@
mLauncher.getDragLayer()
.announceForAccessibility(getContext().getString(R.string.item_removed));
}
-
- @Override
- public int getControlTypeForLogging() {
- return ControlType.REMOVE_TARGET;
- }
}
diff --git a/src/com/android/launcher3/InfoDropTarget.java b/src/com/android/launcher3/InfoDropTarget.java
new file mode 100644
index 0000000..e52fd76
--- /dev/null
+++ b/src/com/android/launcher3/InfoDropTarget.java
@@ -0,0 +1,120 @@
+/*
+ * Copyright (C) 2011 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;
+
+import android.content.ActivityNotFoundException;
+import android.content.ComponentName;
+import android.content.Context;
+import android.graphics.Rect;
+import android.os.Bundle;
+import android.provider.Settings;
+import android.util.AttributeSet;
+import android.util.Log;
+import android.widget.Toast;
+
+import com.android.launcher3.accessibility.LauncherAccessibilityDelegate;
+import com.android.launcher3.compat.LauncherAppsCompat;
+import com.android.launcher3.util.Themes;
+
+public class InfoDropTarget extends UninstallDropTarget {
+
+ private static final String TAG = "InfoDropTarget";
+
+ public InfoDropTarget(Context context, AttributeSet attrs) {
+ this(context, attrs, 0);
+ }
+
+ public InfoDropTarget(Context context, AttributeSet attrs, int defStyle) {
+ super(context, attrs, defStyle);
+ }
+
+ @Override
+ protected void setupUi() {
+ // Get the hover color
+ mHoverColor = Themes.getColorAccent(getContext());
+ setDrawable(R.drawable.ic_info_shadow);
+ }
+
+ @Override
+ protected ComponentName performDropAction(ItemInfo item) {
+ return performDropAction(mLauncher, item, null, null);
+ }
+
+ /**
+ * @return Whether the activity was started.
+ */
+ public static boolean startDetailsActivityForInfo(
+ ItemInfo info, Launcher launcher, Rect sourceBounds, Bundle opts) {
+ return performDropAction(launcher, info, sourceBounds, opts) != null;
+ }
+
+ /**
+ * Performs the drop action and returns the target component for the dragObject or null if
+ * the action was not performed.
+ */
+ private static ComponentName performDropAction(Context context, ItemInfo info,
+ Rect sourceBounds, Bundle opts) {
+ if (info instanceof PromiseAppInfo) {
+ PromiseAppInfo promiseAppInfo = (PromiseAppInfo) info;
+ context.startActivity(promiseAppInfo.getMarketIntent(context));
+ return null;
+ }
+ ComponentName componentName = null;
+ if (info instanceof AppInfo) {
+ componentName = ((AppInfo) info).componentName;
+ } else if (info instanceof ShortcutInfo) {
+ componentName = info.getTargetComponent();
+ } else if (info instanceof PendingAddItemInfo) {
+ componentName = ((PendingAddItemInfo) info).componentName;
+ } else if (info instanceof LauncherAppWidgetInfo) {
+ componentName = ((LauncherAppWidgetInfo) info).providerName;
+ }
+ if (componentName != null) {
+ try {
+ LauncherAppsCompat.getInstance(context)
+ .showAppDetailsForProfile(componentName, info.user, sourceBounds, opts);
+ return componentName;
+ } catch (SecurityException | ActivityNotFoundException e) {
+ Toast.makeText(context, R.string.activity_not_found, Toast.LENGTH_SHORT).show();
+ Log.e(TAG, "Unable to launch settings", e);
+ }
+ }
+ return null;
+ }
+
+ @Override
+ public int getAccessibilityAction() {
+ return LauncherAccessibilityDelegate.INFO;
+ }
+
+ @Override
+ protected boolean supportsDrop(ItemInfo info) {
+ // Only show the App Info drop target if developer settings are enabled.
+ boolean developmentSettingsEnabled = Settings.Global.getInt(
+ getContext().getContentResolver(),
+ Settings.Global.DEVELOPMENT_SETTINGS_ENABLED, 0) == 1;
+ if (!developmentSettingsEnabled) {
+ return false;
+ }
+ return info.itemType != LauncherSettings.Favorites.ITEM_TYPE_SHORTCUT &&
+ (info instanceof AppInfo ||
+ (info instanceof ShortcutInfo && !((ShortcutInfo) info).isPromise()) ||
+ (info instanceof LauncherAppWidgetInfo &&
+ ((LauncherAppWidgetInfo) info).restoreStatus == 0) ||
+ info instanceof PendingAddItemInfo);
+ }
+}
diff --git a/src/com/android/launcher3/LauncherAppWidgetProviderInfo.java b/src/com/android/launcher3/LauncherAppWidgetProviderInfo.java
index 80758c9..c713992 100644
--- a/src/com/android/launcher3/LauncherAppWidgetProviderInfo.java
+++ b/src/com/android/launcher3/LauncherAppWidgetProviderInfo.java
@@ -94,12 +94,4 @@
public boolean isCustomWidget() {
return provider.getClassName().startsWith(CLS_CUSTOM_WIDGET_PREFIX);
}
-
- public int getWidgetFeatures() {
- if (Utilities.ATLEAST_P) {
- return widgetFeatures;
- } else {
- return 0;
- }
- }
}
diff --git a/src/com/android/launcher3/LauncherState.java b/src/com/android/launcher3/LauncherState.java
index 54df1da..402d73d 100644
--- a/src/com/android/launcher3/LauncherState.java
+++ b/src/com/android/launcher3/LauncherState.java
@@ -26,7 +26,6 @@
import com.android.launcher3.uioverrides.AllAppsState;
import com.android.launcher3.states.SpringLoadedState;
-import com.android.launcher3.uioverrides.FastOverviewState;
import com.android.launcher3.uioverrides.OverviewState;
import com.android.launcher3.uioverrides.UiFactory;
import com.android.launcher3.userevent.nano.LauncherLogProto.ContainerType;
@@ -47,9 +46,6 @@
protected static final int FLAG_DISABLE_PAGE_CLIPPING = 1 << 5;
protected static final int FLAG_PAGE_BACKGROUNDS = 1 << 6;
protected static final int FLAG_ALL_APPS_SCRIM = 1 << 7;
- protected static final int FLAG_DISABLE_INTERACTION = 1 << 8;
- protected static final int FLAG_OVERVIEW_UI = 1 << 9;
-
protected static final PageAlphaProvider DEFAULT_ALPHA_PROVIDER =
new PageAlphaProvider(ACCEL_2) {
@@ -59,7 +55,7 @@
}
};
- private static final LauncherState[] sAllStates = new LauncherState[5];
+ private static final LauncherState[] sAllStates = new LauncherState[4];
/**
* TODO: Create a separate class for NORMAL state.
@@ -73,8 +69,6 @@
public static final LauncherState OVERVIEW = new OverviewState(3);
- public static final LauncherState FAST_OVERVIEW = new FastOverviewState(4);
-
public final int ordinal;
/**
@@ -120,16 +114,6 @@
*/
public final boolean disablePageClipping;
- /**
- * True if launcher can not be directly interacted in this state;
- */
- public final boolean disableInteraction;
-
- /**
- * True if the state has overview panel visible.
- */
- public final boolean overviewUi;
-
public LauncherState(int id, int containerType, int transitionDuration, int flags) {
this.containerType = containerType;
this.transitionDuration = transitionDuration;
@@ -145,8 +129,6 @@
this.disableRestore = (flags & FLAG_DISABLE_RESTORE) != 0;
this.workspaceIconsCanBeDragged = (flags & FLAG_WORKSPACE_ICONS_CAN_BE_DRAGGED) != 0;
this.disablePageClipping = (flags & FLAG_DISABLE_PAGE_CLIPPING) != 0;
- this.disableInteraction = (flags & FLAG_DISABLE_INTERACTION) != 0;
- this.overviewUi = (flags & FLAG_OVERVIEW_UI) != 0;
this.ordinal = id;
sAllStates[id] = this;
diff --git a/src/com/android/launcher3/SecondaryDropTarget.java b/src/com/android/launcher3/UninstallDropTarget.java
similarity index 61%
rename from src/com/android/launcher3/SecondaryDropTarget.java
rename to src/com/android/launcher3/UninstallDropTarget.java
index 024b4eb..68a441a 100644
--- a/src/com/android/launcher3/SecondaryDropTarget.java
+++ b/src/com/android/launcher3/UninstallDropTarget.java
@@ -1,19 +1,8 @@
package com.android.launcher3;
-import static android.appwidget.AppWidgetManager.INVALID_APPWIDGET_ID;
-import static android.appwidget.AppWidgetProviderInfo.WIDGET_FEATURE_RECONFIGURABLE;
-
import static com.android.launcher3.ItemInfoWithIcon.FLAG_SYSTEM_MASK;
import static com.android.launcher3.ItemInfoWithIcon.FLAG_SYSTEM_NO;
-import static com.android.launcher3.LauncherSettings.Favorites.CONTAINER_DESKTOP;
-import static com.android.launcher3.accessibility.LauncherAccessibilityDelegate.RECONFIGURE;
-import static com.android.launcher3.accessibility.LauncherAccessibilityDelegate.UNINSTALL;
-import static com.android.launcher3.userevent.nano.LauncherLogProto.ControlType.SETTINGS_BUTTON;
-import static com.android.launcher3.userevent.nano.LauncherLogProto.ControlType.UNINSTALL_TARGET;
-import android.appwidget.AppWidgetHostView;
-import android.appwidget.AppWidgetManager;
-import android.appwidget.AppWidgetProviderInfo;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
@@ -31,33 +20,27 @@
import android.widget.Toast;
import com.android.launcher3.Launcher.OnResumeCallback;
+import com.android.launcher3.accessibility.LauncherAccessibilityDelegate;
import com.android.launcher3.compat.LauncherAppsCompat;
import com.android.launcher3.dragndrop.DragOptions;
import com.android.launcher3.userevent.nano.LauncherLogProto.Target;
-import com.android.launcher3.util.Themes;
import java.net.URISyntaxException;
-/**
- * Drop target which provides a secondary option for an item.
- * For app targets: shows as uninstall
- * For configurable widgets: shows as setup
- */
-public class SecondaryDropTarget extends ButtonDropTarget implements OnAlarmListener {
+public class UninstallDropTarget extends ButtonDropTarget implements OnAlarmListener {
- private static final String TAG = "SecondaryDropTarget";
+ private static final String TAG = "UninstallDropTarget";
private static final long CACHE_EXPIRE_TIMEOUT = 5000;
private final ArrayMap<UserHandle, Boolean> mUninstallDisabledCache = new ArrayMap<>(1);
private final Alarm mCacheExpireAlarm;
- private int mCurrentAccessibilityAction = -1;
- public SecondaryDropTarget(Context context, AttributeSet attrs) {
+ public UninstallDropTarget(Context context, AttributeSet attrs) {
this(context, attrs, 0);
}
- public SecondaryDropTarget(Context context, AttributeSet attrs, int defStyle) {
+ public UninstallDropTarget(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
mCacheExpireAlarm = new Alarm();
@@ -67,24 +50,13 @@
@Override
protected void onFinishInflate() {
super.onFinishInflate();
- setupUi(UNINSTALL);
+ setupUi();
}
- private void setupUi(int action) {
- if (action == mCurrentAccessibilityAction) {
- return;
- }
- mCurrentAccessibilityAction = action;
-
- if (action == UNINSTALL) {
- mHoverColor = getResources().getColor(R.color.uninstall_target_hover_tint);
- setDrawable(R.drawable.ic_uninstall_shadow);
- updateText(R.string.uninstall_drop_target_label);
- } else {
- mHoverColor = Themes.getColorAccent(getContext());
- setDrawable(R.drawable.ic_setup_shadow);
- updateText(R.string.gadget_setup_text);
- }
+ protected void setupUi() {
+ // Get the hover color
+ mHoverColor = getResources().getColor(R.color.uninstall_target_hover_tint);
+ setDrawable(R.drawable.ic_uninstall_shadow);
}
@Override
@@ -94,30 +66,11 @@
@Override
public int getAccessibilityAction() {
- return mCurrentAccessibilityAction;
- }
-
- @Override
- public int getControlTypeForLogging() {
- return mCurrentAccessibilityAction == UNINSTALL ? UNINSTALL_TARGET : SETTINGS_BUTTON;
+ return LauncherAccessibilityDelegate.UNINSTALL;
}
@Override
protected boolean supportsDrop(ItemInfo info) {
- return supportsAccessibilityDrop(info, getViewUnderDrag(info));
- }
-
- @Override
- public boolean supportsAccessibilityDrop(ItemInfo info, View view) {
- if (view instanceof AppWidgetHostView) {
- if (getReconfigurableWidgetId(view) != INVALID_APPWIDGET_ID) {
- setupUi(RECONFIGURE);
- return true;
- }
- return false;
- }
-
- setupUi(UNINSTALL);
Boolean uninstallDisabled = mUninstallDisabledCache.get(info.user);
if (uninstallDisabled == null) {
UserManager userManager =
@@ -173,7 +126,7 @@
@Override
public void completeDrop(final DragObject d) {
- ComponentName target = performDropAction(getViewUnderDrag(d.dragInfo), d.dragInfo);
+ ComponentName target = performDropAction(d.dragInfo);
if (d.dragSource instanceof DeferredOnComplete) {
DeferredOnComplete deferred = (DeferredOnComplete) d.dragSource;
if (target != null) {
@@ -185,48 +138,11 @@
}
}
- private View getViewUnderDrag(ItemInfo info) {
- if (info instanceof LauncherAppWidgetInfo && info.container == CONTAINER_DESKTOP &&
- mLauncher.getWorkspace().getDragInfo() != null) {
- return mLauncher.getWorkspace().getDragInfo().cell;
- }
- return null;
- }
-
- /**
- * Verifies that the view is an reconfigurable widget and returns the corresponding widget Id,
- * otherwise return {@code INVALID_APPWIDGET_ID}
- */
- private int getReconfigurableWidgetId(View view) {
- if (!(view instanceof AppWidgetHostView)) {
- return INVALID_APPWIDGET_ID;
- }
- AppWidgetHostView hostView = (AppWidgetHostView) view;
- AppWidgetProviderInfo widgetInfo = hostView.getAppWidgetInfo();
- if (widgetInfo == null || widgetInfo.configure == null) {
- return INVALID_APPWIDGET_ID;
- }
- if ( (LauncherAppWidgetProviderInfo.fromProviderInfo(getContext(), widgetInfo)
- .getWidgetFeatures() & WIDGET_FEATURE_RECONFIGURABLE) == 0) {
- return INVALID_APPWIDGET_ID;
- }
- return hostView.getAppWidgetId();
- }
-
/**
* Performs the drop action and returns the target component for the dragObject or null if
* the action was not performed.
*/
- protected ComponentName performDropAction(View view, ItemInfo info) {
- if (mCurrentAccessibilityAction == RECONFIGURE) {
- int widgetId = getReconfigurableWidgetId(view);
- if (widgetId != INVALID_APPWIDGET_ID) {
- mLauncher.getAppWidgetHost().startConfigActivity(mLauncher, widgetId, -1);
- }
- return null;
- }
- // else: mCurrentAccessibilityAction == UNINSTALL
-
+ protected ComponentName performDropAction(ItemInfo info) {
ComponentName cn = getUninstallTarget(info);
if (cn == null) {
// System applications cannot be installed. For now, show a toast explaining that.
@@ -248,7 +164,7 @@
@Override
public void onAccessibilityDrop(View view, ItemInfo item) {
- performDropAction(view, item);
+ performDropAction(item);
}
/**
@@ -287,7 +203,7 @@
.getApplicationInfo(mPackageName, PackageManager.MATCH_UNINSTALLED_PACKAGES,
mDragObject.dragInfo.user) == null) {
mDragObject.dragSource = mOriginal;
- mOriginal.onDropCompleted(SecondaryDropTarget.this, mDragObject, true);
+ mOriginal.onDropCompleted(UninstallDropTarget.this, mDragObject, true);
} else {
sendFailure();
}
@@ -296,7 +212,7 @@
public void sendFailure() {
mDragObject.dragSource = mOriginal;
mDragObject.cancelled = true;
- mOriginal.onDropCompleted(SecondaryDropTarget.this, mDragObject, false);
+ mOriginal.onDropCompleted(UninstallDropTarget.this, mDragObject, false);
}
}
}
diff --git a/src/com/android/launcher3/accessibility/LauncherAccessibilityDelegate.java b/src/com/android/launcher3/accessibility/LauncherAccessibilityDelegate.java
index 2cd8b1d..3b6fea9 100644
--- a/src/com/android/launcher3/accessibility/LauncherAccessibilityDelegate.java
+++ b/src/com/android/launcher3/accessibility/LauncherAccessibilityDelegate.java
@@ -47,8 +47,8 @@
private static final String TAG = "LauncherAccessibilityDelegate";
public static final int REMOVE = R.id.action_remove;
+ public static final int INFO = R.id.action_info;
public static final int UNINSTALL = R.id.action_uninstall;
- public static final int RECONFIGURE = R.id.action_reconfigure;
protected static final int ADD_TO_WORKSPACE = R.id.action_add_to_workspace;
protected static final int MOVE = R.id.action_move;
protected static final int MOVE_TO_WORKSPACE = R.id.action_move_to_workspace;
@@ -77,10 +77,10 @@
mActions.put(REMOVE, new AccessibilityAction(REMOVE,
launcher.getText(R.string.remove_drop_target_label)));
+ mActions.put(INFO, new AccessibilityAction(INFO,
+ launcher.getText(R.string.app_info_drop_target_label)));
mActions.put(UNINSTALL, new AccessibilityAction(UNINSTALL,
launcher.getText(R.string.uninstall_drop_target_label)));
- mActions.put(RECONFIGURE, new AccessibilityAction(RECONFIGURE,
- launcher.getText(R.string.gadget_setup_text)));
mActions.put(ADD_TO_WORKSPACE, new AccessibilityAction(ADD_TO_WORKSPACE,
launcher.getText(R.string.action_add_to_workspace)));
mActions.put(MOVE, new AccessibilityAction(MOVE,
@@ -110,7 +110,7 @@
}
for (ButtonDropTarget target : mLauncher.getDropTargetBar().getDropTargets()) {
- if (target.supportsAccessibilityDrop(item, host)) {
+ if (target.supportsAccessibilityDrop(item)) {
info.addAction(mActions.get(target.getAccessibilityAction()));
}
}
@@ -222,8 +222,7 @@
return PopupContainerWithArrow.showForIcon((BubbleTextView) host) != null;
} else {
for (ButtonDropTarget dropTarget : mLauncher.getDropTargetBar().getDropTargets()) {
- if (dropTarget.supportsAccessibilityDrop(item, host) &&
- action == dropTarget.getAccessibilityAction()) {
+ if (action == dropTarget.getAccessibilityAction()) {
dropTarget.onAccessibilityDrop(host, item);
return true;
}
diff --git a/src/com/android/launcher3/dragndrop/DragLayer.java b/src/com/android/launcher3/dragndrop/DragLayer.java
index 301070c..7e3335a 100644
--- a/src/com/android/launcher3/dragndrop/DragLayer.java
+++ b/src/com/android/launcher3/dragndrop/DragLayer.java
@@ -172,11 +172,6 @@
return true;
}
- if (mLauncher.getStateManager().getState().disableInteraction) {
- // You Shall Not Pass!!!
- return true;
- }
-
if (mDragController.onControllerInterceptTouchEvent(ev)) {
mActiveController = mDragController;
return true;
diff --git a/src/com/android/launcher3/folder/Folder.java b/src/com/android/launcher3/folder/Folder.java
index b3310c7..993663e 100644
--- a/src/com/android/launcher3/folder/Folder.java
+++ b/src/com/android/launcher3/folder/Folder.java
@@ -930,7 +930,7 @@
int centeredTop = centerY - height / 2;
// We need to bound the folder to the currently visible workspace area
- if (mLauncher.getStateManager().getState().overviewUi) {
+ if (mLauncher.isInState(OVERVIEW)) {
mLauncher.getDragLayer().getDescendantRectRelativeToSelf(mLauncher.getOverviewPanel(),
sTempRect);
} else {
diff --git a/src/com/android/launcher3/logging/LoggerUtils.java b/src/com/android/launcher3/logging/LoggerUtils.java
index d68ac15..c608a23 100644
--- a/src/com/android/launcher3/logging/LoggerUtils.java
+++ b/src/com/android/launcher3/logging/LoggerUtils.java
@@ -20,8 +20,11 @@
import android.view.View;
import com.android.launcher3.ButtonDropTarget;
+import com.android.launcher3.DeleteDropTarget;
+import com.android.launcher3.InfoDropTarget;
import com.android.launcher3.ItemInfo;
import com.android.launcher3.LauncherSettings;
+import com.android.launcher3.UninstallDropTarget;
import com.android.launcher3.userevent.nano.LauncherLogExtensions.TargetExtension;
import com.android.launcher3.userevent.nano.LauncherLogProto.Action;
import com.android.launcher3.userevent.nano.LauncherLogProto.ContainerType;
@@ -162,8 +165,12 @@
return newTarget(Target.Type.CONTAINER);
}
Target t = newTarget(Target.Type.CONTROL);
- if (v instanceof ButtonDropTarget) {
- t.controlType = ((ButtonDropTarget) v).getControlTypeForLogging();
+ if (v instanceof InfoDropTarget) {
+ t.controlType = ControlType.APPINFO_TARGET;
+ } else if (v instanceof UninstallDropTarget) {
+ t.controlType = ControlType.UNINSTALL_TARGET;
+ } else if (v instanceof DeleteDropTarget) {
+ t.controlType = ControlType.REMOVE_TARGET;
}
return t;
}
diff --git a/src/com/android/launcher3/model/WidgetsModel.java b/src/com/android/launcher3/model/WidgetsModel.java
index 9f8f263..1ff0dac 100644
--- a/src/com/android/launcher3/model/WidgetsModel.java
+++ b/src/com/android/launcher3/model/WidgetsModel.java
@@ -1,8 +1,6 @@
package com.android.launcher3.model;
-import static android.appwidget.AppWidgetProviderInfo.WIDGET_FEATURE_HIDE_FROM_PICKER;
-
import android.appwidget.AppWidgetProviderInfo;
import android.content.Context;
import android.content.pm.PackageManager;
@@ -155,11 +153,6 @@
// add and update.
for (WidgetItem item : rawWidgetsShortcuts) {
if (item.widgetInfo != null) {
- if ((item.widgetInfo.getWidgetFeatures() & WIDGET_FEATURE_HIDE_FROM_PICKER) != 0) {
- // Widget is hidden from picker
- continue;
- }
-
// Ensure that all widgets we show can be added on a workspace of this size
int minSpanX = Math.min(item.widgetInfo.spanX, item.widgetInfo.minSpanX);
int minSpanY = Math.min(item.widgetInfo.spanY, item.widgetInfo.minSpanY);
diff --git a/src/com/android/launcher3/popup/SystemShortcut.java b/src/com/android/launcher3/popup/SystemShortcut.java
index 2cc8dfa..32fd063 100644
--- a/src/com/android/launcher3/popup/SystemShortcut.java
+++ b/src/com/android/launcher3/popup/SystemShortcut.java
@@ -9,6 +9,7 @@
import android.view.View;
import com.android.launcher3.AbstractFloatingView;
+import com.android.launcher3.InfoDropTarget;
import com.android.launcher3.ItemInfo;
import com.android.launcher3.Launcher;
import com.android.launcher3.R;
@@ -82,8 +83,7 @@
public void onClick(View view) {
Rect sourceBounds = launcher.getViewBounds(view);
Bundle opts = launcher.getActivityLaunchOptionsAsBundle(view, false);
- new PackageManagerHelper(launcher).startDetailsActivityForInfo(
- itemInfo, sourceBounds, opts);
+ InfoDropTarget.startDetailsActivityForInfo(itemInfo, launcher, sourceBounds, opts);
launcher.getUserEventDispatcher().logActionOnControl(Action.Touch.TAP,
ControlType.APPINFO_TARGET, view);
}
diff --git a/src/com/android/launcher3/util/PackageManagerHelper.java b/src/com/android/launcher3/util/PackageManagerHelper.java
index 0b3b632..81df153 100644
--- a/src/com/android/launcher3/util/PackageManagerHelper.java
+++ b/src/com/android/launcher3/util/PackageManagerHelper.java
@@ -17,8 +17,6 @@
package com.android.launcher3.util;
import android.app.AppOpsManager;
-import android.content.ActivityNotFoundException;
-import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ApplicationInfo;
@@ -26,23 +24,13 @@
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.content.pm.ResolveInfo;
-import android.graphics.Rect;
import android.net.Uri;
import android.os.Build;
-import android.os.Bundle;
import android.os.UserHandle;
import android.text.TextUtils;
-import android.util.Log;
-import android.widget.Toast;
import com.android.launcher3.AppInfo;
-import com.android.launcher3.ItemInfo;
-import com.android.launcher3.Launcher;
-import com.android.launcher3.LauncherAppWidgetInfo;
-import com.android.launcher3.PendingAddItemInfo;
-import com.android.launcher3.PromiseAppInfo;
import com.android.launcher3.R;
-import com.android.launcher3.ShortcutInfo;
import com.android.launcher3.Utilities;
import com.android.launcher3.compat.LauncherAppsCompat;
@@ -54,8 +42,6 @@
*/
public class PackageManagerHelper {
- private static final String TAG = "PackageManagerHelper";
-
private final Context mContext;
private final PackageManager mPm;
private final LauncherAppsCompat mLauncherApps;
@@ -183,35 +169,4 @@
throw new RuntimeException(e);
}
}
-
-
- /**
- * Starts the details activity for {@code info}
- */
- public void startDetailsActivityForInfo(ItemInfo info, Rect sourceBounds, Bundle opts) {
- if (info instanceof PromiseAppInfo) {
- PromiseAppInfo promiseAppInfo = (PromiseAppInfo) info;
- mContext.startActivity(promiseAppInfo.getMarketIntent(mContext));
- return;
- }
- ComponentName componentName = null;
- if (info instanceof AppInfo) {
- componentName = ((AppInfo) info).componentName;
- } else if (info instanceof ShortcutInfo) {
- componentName = info.getTargetComponent();
- } else if (info instanceof PendingAddItemInfo) {
- componentName = ((PendingAddItemInfo) info).componentName;
- } else if (info instanceof LauncherAppWidgetInfo) {
- componentName = ((LauncherAppWidgetInfo) info).providerName;
- }
- if (componentName != null) {
- try {
- mLauncherApps.showAppDetailsForProfile(
- componentName, info.user, sourceBounds, opts);
- } catch (SecurityException | ActivityNotFoundException e) {
- Toast.makeText(mContext, R.string.activity_not_found, Toast.LENGTH_SHORT).show();
- Log.e(TAG, "Unable to launch settings", e);
- }
- }
- }
}
diff --git a/src_ui_overrides/com/android/launcher3/uioverrides/FastOverviewState.java b/src_ui_overrides/com/android/launcher3/uioverrides/FastOverviewState.java
deleted file mode 100644
index 147d194..0000000
--- a/src_ui_overrides/com/android/launcher3/uioverrides/FastOverviewState.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Copyright (C) 2018 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.uioverrides;
-
-/**
- * A dummy overview state
- */
-public class FastOverviewState extends OverviewState {
-
- public FastOverviewState(int id) {
- super(id);
- }
-}
diff --git a/src_ui_overrides/com/android/launcher3/uioverrides/OverviewState.java b/src_ui_overrides/com/android/launcher3/uioverrides/OverviewState.java
index 37d0aa2..14806c0 100644
--- a/src_ui_overrides/com/android/launcher3/uioverrides/OverviewState.java
+++ b/src_ui_overrides/com/android/launcher3/uioverrides/OverviewState.java
@@ -37,7 +37,7 @@
private static final float SCALE_FACTOR = 0.7f;
private static final int STATE_FLAGS = FLAG_SHOW_SCRIM | FLAG_MULTI_PAGE |
- FLAG_DISABLE_PAGE_CLIPPING | FLAG_PAGE_BACKGROUNDS | FLAG_OVERVIEW_UI;
+ FLAG_DISABLE_PAGE_CLIPPING | FLAG_PAGE_BACKGROUNDS;
public OverviewState(int id) {
super(id, ContainerType.WORKSPACE, OVERVIEW_TRANSITION_MS, STATE_FLAGS);
diff --git a/tests/AndroidManifest-common.xml b/tests/AndroidManifest-common.xml
index a54268a..0a29147 100644
--- a/tests/AndroidManifest-common.xml
+++ b/tests/AndroidManifest-common.xml
@@ -33,17 +33,6 @@
android:resource="@xml/appwidget_no_config" />
</receiver>
-
- <receiver
- android:name="com.android.launcher3.testcomponent.AppWdigetHidden"
- android:label="Hidden widget">
- <intent-filter>
- <action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
- </intent-filter>
- <meta-data android:name="android.appwidget.provider"
- android:resource="@xml/appwidget_hidden" />
- </receiver>
-
<receiver
android:name="com.android.launcher3.testcomponent.AppWidgetWithConfig"
android:label="With Config">
diff --git a/tests/res/xml/appwidget_hidden.xml b/tests/res/xml/appwidget_hidden.xml
deleted file mode 100644
index 6f0e006..0000000
--- a/tests/res/xml/appwidget_hidden.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<appwidget-provider
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:minWidth="180dp"
- android:minHeight="110dp"
- android:updatePeriodMillis="86400000"
- android:initialLayout="@layout/test_layout_appwidget_blue"
- android:resizeMode="horizontal|vertical"
- android:widgetFeatures="hide_from_picker"
- android:widgetCategory="home_screen">
-</appwidget-provider>
\ No newline at end of file
diff --git a/tests/res/xml/appwidget_with_config.xml b/tests/res/xml/appwidget_with_config.xml
index 8403689..3e96c6f 100644
--- a/tests/res/xml/appwidget_with_config.xml
+++ b/tests/res/xml/appwidget_with_config.xml
@@ -7,6 +7,5 @@
android:initialLayout="@layout/test_layout_appwidget_blue"
android:configure="com.android.launcher3.testcomponent.WidgetConfigActivity"
android:resizeMode="horizontal|vertical"
- android:widgetFeatures="reconfigurable"
android:widgetCategory="home_screen">
</appwidget-provider>
\ No newline at end of file
diff --git a/tests/src/com/android/launcher3/testcomponent/AppWidgetHidden.java b/tests/src/com/android/launcher3/testcomponent/AppWidgetHidden.java
deleted file mode 100644
index 83492bf..0000000
--- a/tests/src/com/android/launcher3/testcomponent/AppWidgetHidden.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright (C) 2018 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.testcomponent;
-
-import android.appwidget.AppWidgetProvider;
-
-/**
- * A simple app widget without any configuration screen and is hidden in picker.
- */
-public class AppWidgetHidden extends AppWidgetProvider { }