Introducing new variable to enable/disable shortcuts.
Widgets and shortcuts are two different entities but they are controlled by same variable GO_DISABLE_WIDGETS. In this CL I have introduced a new variable GO_DISABLE_SHORTCUTS to enable/disable widgets. Test: Tested manually on device. Bug: 236268654 Change-Id: Ib373b042fbfd0493e6345ef10e5631dbfd96b8c3
This commit is contained in:
1 parent
2d675e8ab0
commit
63ee5d0908
7 files changed
+18
-14
No files matched your search
@@ -16,7 +16,7 @@
|
||||
|
||||
package com.android.launcher3.shortcuts;
|
||||
|
||||
import static com.android.launcher3.model.WidgetsModel.GO_DISABLE_WIDGETS;
|
||||
import static com.android.launcher3.model.WidgetsModel.GO_DISABLE_SHORTCUTS;
|
||||
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
@@ -46,7 +46,7 @@ public class ShortcutRequest {
|
||||
| ShortcutQuery.FLAG_MATCH_MANIFEST;
|
||||
public static final int PINNED = ShortcutQuery.FLAG_MATCH_PINNED;
|
||||
|
||||
private final ShortcutQuery mQuery = GO_DISABLE_WIDGETS ? null : new ShortcutQuery();
|
||||
private final ShortcutQuery mQuery = GO_DISABLE_SHORTCUTS ? null : new ShortcutQuery();
|
||||
|
||||
private final Context mContext;
|
||||
private final UserHandle mUserHandle;
|
||||
@@ -73,7 +73,7 @@ public class ShortcutRequest {
|
||||
* @return A list of ShortcutInfo's associated with the given package.
|
||||
*/
|
||||
public ShortcutRequest forPackage(String packageName, @Nullable List<String> shortcutIds) {
|
||||
if (!GO_DISABLE_WIDGETS && packageName != null) {
|
||||
if (!GO_DISABLE_SHORTCUTS && packageName != null) {
|
||||
mQuery.setPackage(packageName);
|
||||
mQuery.setShortcutIds(shortcutIds);
|
||||
}
|
||||
@@ -81,7 +81,7 @@ public class ShortcutRequest {
|
||||
}
|
||||
|
||||
public ShortcutRequest withContainer(@Nullable ComponentName activity) {
|
||||
if (!GO_DISABLE_WIDGETS) {
|
||||
if (!GO_DISABLE_SHORTCUTS) {
|
||||
if (activity == null) {
|
||||
mFailed = true;
|
||||
} else {
|
||||
@@ -92,7 +92,7 @@ public class ShortcutRequest {
|
||||
}
|
||||
|
||||
public QueryResult query(int flags) {
|
||||
if (GO_DISABLE_WIDGETS || mFailed) {
|
||||
if (GO_DISABLE_SHORTCUTS || mFailed) {
|
||||
return QueryResult.DEFAULT;
|
||||
}
|
||||
mQuery.setQueryFlags(flags);
|
||||
@@ -108,7 +108,7 @@ public class ShortcutRequest {
|
||||
|
||||
public static class QueryResult extends ArrayList<ShortcutInfo> {
|
||||
|
||||
static final QueryResult DEFAULT = new QueryResult(GO_DISABLE_WIDGETS);
|
||||
static final QueryResult DEFAULT = new QueryResult(GO_DISABLE_SHORTCUTS);
|
||||
|
||||
private final boolean mWasSuccess;
|
||||
|
||||
|
||||
Reference in new issue
Block a user