From 4b90dbe9678e5582c2ccf76edd35ce9185060b84 Mon Sep 17 00:00:00 2001 From: Raj Garg Date: Fri, 23 Sep 2022 17:04:29 +0000 Subject: [PATCH 01/16] Revert "Introducing new variable to enable/disable shortcuts." Revert "Introducing new variable to enable/disable shortcuts." Revert submission 19632697-cherrypick-GO-DISABLE-SHORTCUTS-tyyzrpy9oe Reason for revert: Reverting changes for the recent feature built by me. This CL was a part of the feature. Please take a call if we should revert it or not. Reverted Changes: Ib373b042f:Introducing new variable to enable/disable shortcu... I4274cb468:Introducing new variable to enable/disable shortcu... Change-Id: I81f338be71185cb008e81b020c5b3a7b01b64c58 --- go/src/com/android/launcher3/model/WidgetsModel.java | 4 +--- .../launcher3/icons/ShortcutCachingLogic.java | 4 ++-- src/com/android/launcher3/model/BgDataModel.java | 4 ++-- .../android/launcher3/shortcuts/ShortcutRequest.java | 12 ++++++------ src/com/android/launcher3/util/ShortcutUtil.java | 2 +- src/com/android/launcher3/views/AppLauncher.java | 4 ++-- .../com/android/launcher3/model/WidgetsModel.java | 2 -- 7 files changed, 14 insertions(+), 18 deletions(-) diff --git a/go/src/com/android/launcher3/model/WidgetsModel.java b/go/src/com/android/launcher3/model/WidgetsModel.java index 9a000d6b52..1aa5d03f6d 100644 --- a/go/src/com/android/launcher3/model/WidgetsModel.java +++ b/go/src/com/android/launcher3/model/WidgetsModel.java @@ -41,10 +41,8 @@ import java.util.Set; */ public class WidgetsModel { - // True if the widget support is disabled. + // True is the widget support is disabled. public static final boolean GO_DISABLE_WIDGETS = true; - // True if the shortcut support is disabled. - public static final boolean GO_DISABLE_SHORTCUTS = true; public static final boolean GO_DISABLE_NOTIFICATION_DOTS = true; private static final ArrayList EMPTY_WIDGET_LIST = new ArrayList<>(); diff --git a/src/com/android/launcher3/icons/ShortcutCachingLogic.java b/src/com/android/launcher3/icons/ShortcutCachingLogic.java index 1dc6751a34..6a8f34a93d 100644 --- a/src/com/android/launcher3/icons/ShortcutCachingLogic.java +++ b/src/com/android/launcher3/icons/ShortcutCachingLogic.java @@ -16,7 +16,7 @@ package com.android.launcher3.icons; -import static com.android.launcher3.model.WidgetsModel.GO_DISABLE_SHORTCUTS; +import static com.android.launcher3.model.WidgetsModel.GO_DISABLE_WIDGETS; import android.content.ComponentName; import android.content.Context; @@ -94,7 +94,7 @@ public class ShortcutCachingLogic implements CachingLogic { * Launcher specific checks */ public static Drawable getIcon(Context context, ShortcutInfo shortcutInfo, int density) { - if (GO_DISABLE_SHORTCUTS) { + if (GO_DISABLE_WIDGETS) { return null; } try { diff --git a/src/com/android/launcher3/model/BgDataModel.java b/src/com/android/launcher3/model/BgDataModel.java index ffb0f2f40e..de23c4b31f 100644 --- a/src/com/android/launcher3/model/BgDataModel.java +++ b/src/com/android/launcher3/model/BgDataModel.java @@ -17,7 +17,7 @@ package com.android.launcher3.model; import static android.content.pm.LauncherApps.ShortcutQuery.FLAG_GET_KEY_FIELDS_ONLY; -import static com.android.launcher3.model.WidgetsModel.GO_DISABLE_SHORTCUTS; +import static com.android.launcher3.model.WidgetsModel.GO_DISABLE_WIDGETS; import static com.android.launcher3.shortcuts.ShortcutRequest.PINNED; import static java.util.stream.Collectors.groupingBy; @@ -286,7 +286,7 @@ public class BgDataModel { * shortcuts and unpinning any extra shortcuts. */ public synchronized void updateShortcutPinnedState(Context context, UserHandle user) { - if (GO_DISABLE_SHORTCUTS) { + if (GO_DISABLE_WIDGETS) { return; } diff --git a/src/com/android/launcher3/shortcuts/ShortcutRequest.java b/src/com/android/launcher3/shortcuts/ShortcutRequest.java index 07d3292e3e..5291ce4620 100644 --- a/src/com/android/launcher3/shortcuts/ShortcutRequest.java +++ b/src/com/android/launcher3/shortcuts/ShortcutRequest.java @@ -16,7 +16,7 @@ package com.android.launcher3.shortcuts; -import static com.android.launcher3.model.WidgetsModel.GO_DISABLE_SHORTCUTS; +import static com.android.launcher3.model.WidgetsModel.GO_DISABLE_WIDGETS; 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_SHORTCUTS ? null : new ShortcutQuery(); + private final ShortcutQuery mQuery = GO_DISABLE_WIDGETS ? 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 shortcutIds) { - if (!GO_DISABLE_SHORTCUTS && packageName != null) { + if (!GO_DISABLE_WIDGETS && packageName != null) { mQuery.setPackage(packageName); mQuery.setShortcutIds(shortcutIds); } @@ -81,7 +81,7 @@ public class ShortcutRequest { } public ShortcutRequest withContainer(@Nullable ComponentName activity) { - if (!GO_DISABLE_SHORTCUTS) { + if (!GO_DISABLE_WIDGETS) { if (activity == null) { mFailed = true; } else { @@ -92,7 +92,7 @@ public class ShortcutRequest { } public QueryResult query(int flags) { - if (GO_DISABLE_SHORTCUTS || mFailed) { + if (GO_DISABLE_WIDGETS || mFailed) { return QueryResult.DEFAULT; } mQuery.setQueryFlags(flags); @@ -108,7 +108,7 @@ public class ShortcutRequest { public static class QueryResult extends ArrayList { - static final QueryResult DEFAULT = new QueryResult(GO_DISABLE_SHORTCUTS); + static final QueryResult DEFAULT = new QueryResult(GO_DISABLE_WIDGETS); private final boolean mWasSuccess; diff --git a/src/com/android/launcher3/util/ShortcutUtil.java b/src/com/android/launcher3/util/ShortcutUtil.java index 79cafa04a2..91cf835287 100644 --- a/src/com/android/launcher3/util/ShortcutUtil.java +++ b/src/com/android/launcher3/util/ShortcutUtil.java @@ -34,7 +34,7 @@ public class ShortcutUtil { * Returns true when we should show depp shortcuts in shortcut menu for the item. */ public static boolean supportsDeepShortcuts(ItemInfo info) { - return isActive(info) && isApp(info) && !WidgetsModel.GO_DISABLE_SHORTCUTS; + return isActive(info) && isApp(info) && !WidgetsModel.GO_DISABLE_WIDGETS; } /** diff --git a/src/com/android/launcher3/views/AppLauncher.java b/src/com/android/launcher3/views/AppLauncher.java index dc07e45e11..19e66abd78 100644 --- a/src/com/android/launcher3/views/AppLauncher.java +++ b/src/com/android/launcher3/views/AppLauncher.java @@ -16,7 +16,7 @@ package com.android.launcher3.views; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_APP_LAUNCH_TAP; -import static com.android.launcher3.model.WidgetsModel.GO_DISABLE_SHORTCUTS; +import static com.android.launcher3.model.WidgetsModel.GO_DISABLE_WIDGETS; import android.app.ActivityOptions; import android.content.ActivityNotFoundException; @@ -190,7 +190,7 @@ public interface AppLauncher extends ActivityContext { */ default void startShortcut(String packageName, String id, Rect sourceBounds, Bundle startActivityOptions, UserHandle user) { - if (GO_DISABLE_SHORTCUTS) { + if (GO_DISABLE_WIDGETS) { return; } try { diff --git a/src_shortcuts_overrides/com/android/launcher3/model/WidgetsModel.java b/src_shortcuts_overrides/com/android/launcher3/model/WidgetsModel.java index 13ad7a4ec5..702f3430aa 100644 --- a/src_shortcuts_overrides/com/android/launcher3/model/WidgetsModel.java +++ b/src_shortcuts_overrides/com/android/launcher3/model/WidgetsModel.java @@ -62,8 +62,6 @@ public class WidgetsModel { // True is the widget support is disabled. public static final boolean GO_DISABLE_WIDGETS = false; - // True is the shortcut support is disabled. - public static final boolean GO_DISABLE_SHORTCUTS = false; public static final boolean GO_DISABLE_NOTIFICATION_DOTS = false; private static final String TAG = "WidgetsModel"; From 786bdce21405e719e7b39328eb866d5c206c3aa4 Mon Sep 17 00:00:00 2001 From: Holly Sun Date: Wed, 26 Oct 2022 18:03:10 -0700 Subject: [PATCH 02/16] [QL-v2] Add logging for quick launch. Move logging to DeviceSearchAdapterProvider to take advantage of View so we can log more info attached to the quick launch event. Another reason is currently we can't dynamically change the enter key icon so we can't really distinguish whether it's a quick search or quick launch using the icon (we are working with gboard team to fix this issue). Bug: 256010819 Test: see wwlogging https://paste.googleplex.com/5668268562972672 Change-Id: I38aad2ae97c9b372f3d76222a82de45fc3bf3eed --- .../allapps/search/AllAppsSearchBarController.java | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/com/android/launcher3/allapps/search/AllAppsSearchBarController.java b/src/com/android/launcher3/allapps/search/AllAppsSearchBarController.java index 4c461aa5d4..4d58eb0a70 100644 --- a/src/com/android/launcher3/allapps/search/AllAppsSearchBarController.java +++ b/src/com/android/launcher3/allapps/search/AllAppsSearchBarController.java @@ -15,9 +15,6 @@ */ package com.android.launcher3.allapps.search; -import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_ALLAPPS_FOCUSED_ITEM_SELECTED_WITH_IME; -import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_ALLAPPS_QUICK_SEARCH_WITH_IME; - import android.text.Editable; import android.text.SpannableStringBuilder; import android.text.TextUtils; @@ -125,10 +122,6 @@ public class AllAppsSearchBarController public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_GO) { - mLauncher.getStatsLogManager().logger() - .log(actionId == EditorInfo.IME_ACTION_SEARCH - ? LAUNCHER_ALLAPPS_QUICK_SEARCH_WITH_IME - : LAUNCHER_ALLAPPS_FOCUSED_ITEM_SELECTED_WITH_IME); // selectFocusedView should return SearchTargetEvent that is passed onto onClick return mLauncher.getAppsView().getMainAdapterProvider().launchHighlightedItem(); } From d930011746e7b06f147512a3d7849efa7d62e9e3 Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Fri, 11 Nov 2022 23:22:49 +0000 Subject: [PATCH 03/16] Add a lint baseline for Launcher3 The lint version in tm-qpr-dev incorrectly flags BaseActivity.java. Add an entry to lint-baseline.xml file to silence the incorrect error. The newer version of lint in master doesn't have the false positive. Bug: 258754271 Bug: 256019562 Test: m RUN_ERROR_PRONE=true javac-check lint-check Change-Id: I2fd22e96c8e89b7dc25132089e36d599e012e747 Merged-In: If02f87ef74c73321afa3427d845ad80539292b30 --- lint-baseline-launcher3.xml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/lint-baseline-launcher3.xml b/lint-baseline-launcher3.xml index 107a34694b..a9dc0c604e 100644 --- a/lint-baseline-launcher3.xml +++ b/lint-baseline-launcher3.xml @@ -606,4 +606,20 @@ column="61"/> + + + + + + + + From 5eba9000df29708d72393165cddb0f3f35046893 Mon Sep 17 00:00:00 2001 From: Jon Miranda Date: Mon, 14 Nov 2022 12:28:20 -0800 Subject: [PATCH 04/16] Update transient taskbar transition duration to match spec (417ms). Bug: 246632728 Bug: 246641848 Test: manual Change-Id: If3f73774444c6074a81101d91d291ef33edcaf9c --- .../android/launcher3/QuickstepTransitionManager.java | 1 + .../launcher3/taskbar/LauncherTaskbarUIController.java | 9 ++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java b/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java index 1b47939d04..dcad873ff6 100644 --- a/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java +++ b/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java @@ -194,6 +194,7 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener public static final int SPLIT_DIVIDER_ANIM_DURATION = 100; public static final int CONTENT_ALPHA_DURATION = 217; + public static final int TRANSIENT_TASKBAR_TRANSITION_DURATION = 417; public static final int TASKBAR_TO_APP_DURATION = 600; // TODO(b/236145847): Tune TASKBAR_TO_HOME_DURATION to 383 after conflict with unlock animation // is solved. diff --git a/quickstep/src/com/android/launcher3/taskbar/LauncherTaskbarUIController.java b/quickstep/src/com/android/launcher3/taskbar/LauncherTaskbarUIController.java index beab56c6a4..0945bf2d1d 100644 --- a/quickstep/src/com/android/launcher3/taskbar/LauncherTaskbarUIController.java +++ b/quickstep/src/com/android/launcher3/taskbar/LauncherTaskbarUIController.java @@ -17,6 +17,7 @@ package com.android.launcher3.taskbar; import static android.view.InsetsState.ITYPE_EXTRA_NAVIGATION_BAR; +import static com.android.launcher3.QuickstepTransitionManager.TRANSIENT_TASKBAR_TRANSITION_DURATION; import static com.android.launcher3.taskbar.TaskbarLauncherStateController.FLAG_RESUMED; import static com.android.quickstep.TaskAnimationManager.ENABLE_SHELL_TRANSITIONS; @@ -157,9 +158,11 @@ public class LauncherTaskbarUIController extends TaskbarUIController { isResumed, fromInit, /* startAnimation= */ true, - !isResumed - ? QuickstepTransitionManager.TASKBAR_TO_APP_DURATION - : QuickstepTransitionManager.TASKBAR_TO_HOME_DURATION); + DisplayController.isTransientTaskbar(mLauncher) + ? TRANSIENT_TASKBAR_TRANSITION_DURATION + : (!isResumed + ? QuickstepTransitionManager.TASKBAR_TO_APP_DURATION + : QuickstepTransitionManager.TASKBAR_TO_HOME_DURATION)); } @Nullable From ea76d35278a12393887e406d305d4830b0b27dba Mon Sep 17 00:00:00 2001 From: Sunny Goyal Date: Fri, 4 Nov 2022 16:43:42 -0700 Subject: [PATCH 05/16] Cleaning Utilities.java > Removing some unused methods > Moving some specialized methods to corresponding classes > Removing GridProvider check as it is released Bug: 257555083 Test: Presubmit Change-Id: Ib0f8c673d018071d3f4b7d9247e0a35718ab009c --- .../launcher3/model/WellbeingModel.java | 2 - .../RecentsAnimationDeviceState.java | 25 +- .../LauncherUnfoldAnimationController.java | 3 +- .../com/android/quickstep/views/TaskView.java | 3 +- src/com/android/launcher3/BubbleTextView.java | 9 +- .../launcher3/InvariantDeviceProfile.java | 7 +- src/com/android/launcher3/Utilities.java | 254 +++--------------- .../android/launcher3/folder/FolderIcon.java | 11 +- .../android/launcher3/model/ModelUtils.java | 10 +- .../launcher3/util/BgObjectWithLooper.java | 17 ++ .../util/SimpleBroadcastReceiver.java | 11 + .../launcher3/views/OptionsPopupView.java | 27 +- 12 files changed, 110 insertions(+), 269 deletions(-) diff --git a/quickstep/src/com/android/launcher3/model/WellbeingModel.java b/quickstep/src/com/android/launcher3/model/WellbeingModel.java index 68ed682792..fb2d0dcc3c 100644 --- a/quickstep/src/com/android/launcher3/model/WellbeingModel.java +++ b/quickstep/src/com/android/launcher3/model/WellbeingModel.java @@ -18,8 +18,6 @@ package com.android.launcher3.model; import static android.content.ContentResolver.SCHEME_CONTENT; -import static com.android.launcher3.Utilities.newContentObserver; - import android.annotation.TargetApi; import android.app.RemoteAction; import android.content.ContentProviderClient; diff --git a/quickstep/src/com/android/quickstep/RecentsAnimationDeviceState.java b/quickstep/src/com/android/quickstep/RecentsAnimationDeviceState.java index e87fdad933..9e25555eec 100644 --- a/quickstep/src/com/android/quickstep/RecentsAnimationDeviceState.java +++ b/quickstep/src/com/android/quickstep/RecentsAnimationDeviceState.java @@ -46,10 +46,7 @@ import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_S import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_STATUS_BAR_KEYGUARD_SHOWING_OCCLUDED; import android.app.ActivityTaskManager; -import android.content.BroadcastReceiver; import android.content.Context; -import android.content.Intent; -import android.content.IntentFilter; import android.graphics.Region; import android.inputmethodservice.InputMethodService; import android.net.Uri; @@ -63,12 +60,12 @@ import android.view.MotionEvent; import androidx.annotation.BinderThread; import androidx.annotation.NonNull; -import com.android.launcher3.Utilities; import com.android.launcher3.util.DisplayController; import com.android.launcher3.util.DisplayController.DisplayInfoChangeListener; import com.android.launcher3.util.DisplayController.Info; import com.android.launcher3.util.NavigationMode; import com.android.launcher3.util.SettingsCache; +import com.android.launcher3.util.SimpleBroadcastReceiver; import com.android.quickstep.TopTaskTracker.CachedTaskInfo; import com.android.quickstep.util.NavBarPosition; import com.android.systemui.shared.system.ActivityManagerWrapper; @@ -114,15 +111,12 @@ public class RecentsAnimationDeviceState implements DisplayInfoChangeListener { private boolean mIsUserUnlocked; private final ArrayList mUserUnlockedActions = new ArrayList<>(); - private final BroadcastReceiver mUserUnlockedReceiver = new BroadcastReceiver() { - @Override - public void onReceive(Context context, Intent intent) { - if (ACTION_USER_UNLOCKED.equals(intent.getAction())) { - mIsUserUnlocked = true; - notifyUserUnlocked(); - } + private final SimpleBroadcastReceiver mUserUnlockedReceiver = new SimpleBroadcastReceiver(i -> { + if (ACTION_USER_UNLOCKED.equals(i.getAction())) { + mIsUserUnlocked = true; + notifyUserUnlocked(); } - }; + }); private int mGestureBlockingTaskId = -1; private @NonNull Region mExclusionRegion = new Region(); @@ -153,10 +147,9 @@ public class RecentsAnimationDeviceState implements DisplayInfoChangeListener { mIsUserUnlocked = context.getSystemService(UserManager.class) .isUserUnlocked(Process.myUserHandle()); if (!mIsUserUnlocked) { - mContext.registerReceiver(mUserUnlockedReceiver, - new IntentFilter(ACTION_USER_UNLOCKED)); + mUserUnlockedReceiver.register(mContext, ACTION_USER_UNLOCKED); } - runOnDestroy(() -> Utilities.unregisterReceiverSafely(mContext, mUserUnlockedReceiver)); + runOnDestroy(() -> mUserUnlockedReceiver.unregisterReceiverSafely(mContext)); // Register for exclusion updates mExclusionListener = new SystemGestureExclusionListenerCompat(mDisplayId) { @@ -347,7 +340,7 @@ public class RecentsAnimationDeviceState implements DisplayInfoChangeListener { action.run(); } mUserUnlockedActions.clear(); - Utilities.unregisterReceiverSafely(mContext, mUserUnlockedReceiver); + mUserUnlockedReceiver.unregisterReceiverSafely(mContext); } /** diff --git a/quickstep/src/com/android/quickstep/util/LauncherUnfoldAnimationController.java b/quickstep/src/com/android/quickstep/util/LauncherUnfoldAnimationController.java index f12074b538..170c622035 100644 --- a/quickstep/src/com/android/quickstep/util/LauncherUnfoldAnimationController.java +++ b/quickstep/src/com/android/quickstep/util/LauncherUnfoldAnimationController.java @@ -18,7 +18,6 @@ package com.android.quickstep.util; import static com.android.launcher3.LauncherAnimUtils.HOTSEAT_SCALE_PROPERTY_FACTORY; import static com.android.launcher3.LauncherAnimUtils.SCALE_INDEX_UNFOLD_ANIMATION; import static com.android.launcher3.LauncherAnimUtils.WORKSPACE_SCALE_PROPERTY_FACTORY; -import static com.android.launcher3.Utilities.comp; import android.annotation.Nullable; import android.util.FloatProperty; @@ -135,7 +134,7 @@ public class LauncherUnfoldAnimationController { @Override public void onTransitionProgress(float progress) { if (mQsbInsettable != null) { - float insetPercentage = comp(progress) * MAX_WIDTH_INSET_FRACTION; + float insetPercentage = (1 - progress) * MAX_WIDTH_INSET_FRACTION; mQsbInsettable.setHorizontalInsets(insetPercentage); } } diff --git a/quickstep/src/com/android/quickstep/views/TaskView.java b/quickstep/src/com/android/quickstep/views/TaskView.java index 583771e15e..180e13b371 100644 --- a/quickstep/src/com/android/quickstep/views/TaskView.java +++ b/quickstep/src/com/android/quickstep/views/TaskView.java @@ -20,7 +20,6 @@ import static android.view.Display.DEFAULT_DISPLAY; import static android.widget.Toast.LENGTH_SHORT; import static com.android.launcher3.LauncherState.BACKGROUND_APP; -import static com.android.launcher3.Utilities.comp; import static com.android.launcher3.Utilities.getDescendantCoordRelativeToAncestor; import static com.android.launcher3.anim.Interpolators.ACCEL_DEACCEL; import static com.android.launcher3.anim.Interpolators.FAST_OUT_SLOW_IN; @@ -501,7 +500,7 @@ public class TaskView extends FrameLayout implements Reusable { return; } mModalness = modalness; - mIconView.setAlpha(comp(modalness)); + mIconView.setAlpha(1 - modalness); mDigitalWellBeingToast.updateBannerOffset(modalness, mCurrentFullscreenParams.mCurrentDrawnInsets.top + mCurrentFullscreenParams.mCurrentDrawnInsets.bottom); diff --git a/src/com/android/launcher3/BubbleTextView.java b/src/com/android/launcher3/BubbleTextView.java index c0a00c2784..9f54f09bb6 100644 --- a/src/com/android/launcher3/BubbleTextView.java +++ b/src/com/android/launcher3/BubbleTextView.java @@ -607,15 +607,16 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver, * Get the icon bounds on the view depending on the layout type. */ public void getIconBounds(int iconSize, Rect outBounds) { - Utilities.setRectToViewCenter(this, iconSize, outBounds); + outBounds.set(0, 0, iconSize, iconSize); if (mLayoutHorizontal) { + int top = (getHeight() - iconSize) / 2; if (mIsRtl) { - outBounds.offsetTo(getWidth() - iconSize - getPaddingRight(), outBounds.top); + outBounds.offsetTo(getWidth() - iconSize - getPaddingRight(), top); } else { - outBounds.offsetTo(getPaddingLeft(), outBounds.top); + outBounds.offsetTo(getPaddingLeft(), top); } } else { - outBounds.offsetTo(outBounds.left, getPaddingTop()); + outBounds.offset((getWidth() - iconSize) / 2, getPaddingTop()); } } diff --git a/src/com/android/launcher3/InvariantDeviceProfile.java b/src/com/android/launcher3/InvariantDeviceProfile.java index ca92aa48f6..4bb9f0682d 100644 --- a/src/com/android/launcher3/InvariantDeviceProfile.java +++ b/src/com/android/launcher3/InvariantDeviceProfile.java @@ -307,8 +307,7 @@ public class InvariantDeviceProfile { } public static String getCurrentGridName(Context context) { - return Utilities.isGridOptionsEnabled(context) - ? Utilities.getPrefs(context).getString(KEY_IDP_GRID_NAME, null) : null; + return Utilities.getPrefs(context).getString(KEY_IDP_GRID_NAME, null); } private String initGrid(Context context, String gridName) { @@ -383,10 +382,6 @@ public class InvariantDeviceProfile { allAppsBorderSpaces = displayOption.allAppsBorderSpaces; allAppsIconSize = displayOption.allAppsIconSizes; allAppsIconTextSize = displayOption.allAppsIconTextSizes; - if (!Utilities.isGridOptionsEnabled(context)) { - allAppsIconSize = iconSize; - allAppsIconTextSize = iconTextSize; - } if (devicePaddingId != 0) { devicePaddings = new DevicePaddings(context, devicePaddingId); diff --git a/src/com/android/launcher3/Utilities.java b/src/com/android/launcher3/Utilities.java index e21115d7d5..359dbe8ab0 100644 --- a/src/com/android/launcher3/Utilities.java +++ b/src/com/android/launcher3/Utilities.java @@ -29,20 +29,13 @@ import android.annotation.TargetApi; import android.app.ActivityManager; import android.app.Person; import android.app.WallpaperManager; -import android.content.BroadcastReceiver; -import android.content.ComponentName; import android.content.Context; -import android.content.Intent; import android.content.SharedPreferences; import android.content.pm.LauncherActivityInfo; import android.content.pm.LauncherApps; -import android.content.pm.PackageInfo; -import android.content.pm.PackageManager; -import android.content.pm.ResolveInfo; import android.content.pm.ShortcutInfo; import android.content.res.Configuration; import android.content.res.Resources; -import android.database.ContentObserver; import android.graphics.Color; import android.graphics.ColorFilter; import android.graphics.LightingColorFilter; @@ -54,7 +47,6 @@ import android.graphics.RectF; import android.graphics.drawable.AdaptiveIconDrawable; import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.Drawable; -import android.net.Uri; import android.os.Build; import android.os.Build.VERSION_CODES; import android.os.DeadObjectException; @@ -75,15 +67,12 @@ import android.view.VelocityTracker; import android.view.View; import android.view.ViewConfiguration; import android.view.animation.Interpolator; -import android.widget.LinearLayout; import androidx.annotation.ChecksSdkIntAtLeast; import androidx.annotation.NonNull; -import androidx.annotation.Nullable; import androidx.core.graphics.ColorUtils; import com.android.launcher3.dragndrop.FolderAdaptiveIcon; -import com.android.launcher3.graphics.GridCustomizationsProvider; import com.android.launcher3.graphics.TintedDrawableSpan; import com.android.launcher3.icons.ShortcutCachingLogic; import com.android.launcher3.icons.ThemedIconDrawable; @@ -95,7 +84,6 @@ import com.android.launcher3.shortcuts.ShortcutKey; import com.android.launcher3.shortcuts.ShortcutRequest; import com.android.launcher3.testing.shared.ResourceUtils; import com.android.launcher3.util.IntArray; -import com.android.launcher3.util.PackageManagerHelper; import com.android.launcher3.util.SplitConfigurationOptions.SplitPositionOption; import com.android.launcher3.util.Themes; import com.android.launcher3.views.ActivityContext; @@ -104,10 +92,8 @@ import com.android.launcher3.widget.PendingAddShortcutInfo; import java.lang.reflect.Method; import java.util.ArrayList; -import java.util.Arrays; import java.util.List; import java.util.Locale; -import java.util.function.Consumer; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -121,8 +107,6 @@ public final class Utilities { private static final Pattern sTrimPattern = Pattern.compile("^[\\s|\\p{javaSpaceChar}]*(.*)[\\s|\\p{javaSpaceChar}]*$"); - private static final int[] sLoc0 = new int[2]; - private static final int[] sLoc1 = new int[2]; private static final Matrix sMatrix = new Matrix(); private static final Matrix sInverseMatrix = new Matrix(); @@ -171,14 +155,6 @@ public final class Utilities { Settings.Global.DEVELOPMENT_SETTINGS_ENABLED, 0) != 0; } - // An intent extra to indicate the horizontal scroll of the wallpaper. - public static final String EXTRA_WALLPAPER_OFFSET = "com.android.launcher3.WALLPAPER_OFFSET"; - public static final String EXTRA_WALLPAPER_FLAVOR = "com.android.launcher3.WALLPAPER_FLAVOR"; - - // An intent extra to indicate the launch source by launcher. - public static final String EXTRA_WALLPAPER_LAUNCH_SOURCE = - "com.android.wallpaper.LAUNCH_SOURCE"; - public static boolean IS_RUNNING_IN_TEST_HARNESS = ActivityManager.isRunningInTestHarness(); @@ -192,12 +168,6 @@ public final class Utilities { return Log.isLoggable(propertyName, Log.VERBOSE); } - public static boolean existsStyleWallpapers(Context context) { - ResolveInfo ri = context.getPackageManager().resolveActivity( - PackageManagerHelper.getStyleWallpapersIntent(context), 0); - return ri != null; - } - /** * Given a coordinate relative to the descendant, find the coordinate in a parent view's * coordinates. @@ -311,9 +281,9 @@ public final class Utilities { * Sets {@param out} to be same as {@param in} by rounding individual values */ public static void roundArray(float[] in, int[] out) { - for (int i = 0; i < in.length; i++) { - out[i] = Math.round(in[i]); - } + for (int i = 0; i < in.length; i++) { + out[i] = Math.round(in[i]); + } } public static void offsetPoints(float[] points, float offsetX, float offsetY) { @@ -334,80 +304,8 @@ public final class Utilities { localY < (v.getHeight() + slop); } - public static int[] getCenterDeltaInScreenSpace(View v0, View v1) { - v0.getLocationInWindow(sLoc0); - v1.getLocationInWindow(sLoc1); - - sLoc0[0] += (v0.getMeasuredWidth() * v0.getScaleX()) / 2; - sLoc0[1] += (v0.getMeasuredHeight() * v0.getScaleY()) / 2; - sLoc1[0] += (v1.getMeasuredWidth() * v1.getScaleX()) / 2; - sLoc1[1] += (v1.getMeasuredHeight() * v1.getScaleY()) / 2; - return new int[] {sLoc1[0] - sLoc0[0], sLoc1[1] - sLoc0[1]}; - } - - /** - * Helper method to set rectOut with rectFSrc. - */ - public static void setRect(RectF rectFSrc, Rect rectOut) { - rectOut.left = (int) rectFSrc.left; - rectOut.top = (int) rectFSrc.top; - rectOut.right = (int) rectFSrc.right; - rectOut.bottom = (int) rectFSrc.bottom; - } - public static void scaleRectFAboutCenter(RectF r, float scale) { - scaleRectFAboutPivot(r, scale, r.centerX(), r.centerY()); - } - - public static void scaleRectFAboutPivot(RectF r, float scale, float px, float py) { - if (scale != 1.0f) { - r.offset(-px, -py); - r.left = r.left * scale; - r.top = r.top * scale ; - r.right = r.right * scale; - r.bottom = r.bottom * scale; - r.offset(px, py); - } - } - - public static void scaleRectAboutCenter(Rect r, float scale) { - if (scale != 1.0f) { - int cx = r.centerX(); - int cy = r.centerY(); - r.offset(-cx, -cy); - scaleRect(r, scale); - r.offset(cx, cy); - } - } - - public static void scaleRect(Rect r, float scale) { - if (scale != 1.0f) { - r.left = (int) (r.left * scale + 0.5f); - r.top = (int) (r.top * scale + 0.5f); - r.right = (int) (r.right * scale + 0.5f); - r.bottom = (int) (r.bottom * scale + 0.5f); - } - } - - public static void insetRect(Rect r, Rect insets) { - r.left = Math.min(r.right, r.left + insets.left); - r.top = Math.min(r.bottom, r.top + insets.top); - r.right = Math.max(r.left, r.right - insets.right); - r.bottom = Math.max(r.top, r.bottom - insets.bottom); - } - - public static float shrinkRect(Rect r, float scaleX, float scaleY) { - float scale = Math.min(Math.min(scaleX, scaleY), 1.0f); - if (scale < 1.0f) { - int deltaX = (int) (r.width() * (scaleX - scale) * 0.5f); - r.left += deltaX; - r.right -= deltaX; - - int deltaY = (int) (r.height() * (scaleY - scale) * 0.5f); - r.top += deltaY; - r.bottom -= deltaY; - } - return scale; + scaleRectFAboutCenter(r, scale, scale); } /** @@ -425,6 +323,33 @@ public final class Utilities { r.offset(px, py); } + public static void scaleRectAboutCenter(Rect r, float scale) { + if (scale != 1.0f) { + int cx = r.centerX(); + int cy = r.centerY(); + r.offset(-cx, -cy); + r.left = (int) (r.left * scale + 0.5f); + r.top = (int) (r.top * scale + 0.5f); + r.right = (int) (r.right * scale + 0.5f); + r.bottom = (int) (r.bottom * scale + 0.5f); + r.offset(cx, cy); + } + } + + public static float shrinkRect(Rect r, float scaleX, float scaleY) { + float scale = Math.min(Math.min(scaleX, scaleY), 1.0f); + if (scale < 1.0f) { + int deltaX = (int) (r.width() * (scaleX - scale) * 0.5f); + r.left += deltaX; + r.right -= deltaX; + + int deltaY = (int) (r.height() * (scaleY - scale) * 0.5f); + r.top += deltaY; + r.bottom -= deltaY; + } + return scale; + } + /** * Maps t from one range to another range. * @param t The value to map. @@ -459,30 +384,6 @@ public final class Utilities { return min + (value * (max - min)); } - /** - * Bounds parameter to the range [0, 1] - */ - public static float saturate(float a) { - return boundToRange(a, 0, 1.0f); - } - - /** - * Returns the compliment (1 - a) of the parameter. - */ - public static float comp(float a) { - return 1 - a; - } - - /** - * Returns the "probabilistic or" of a and b. (a + b - ab). - * Useful beyond probability, can be used to combine two unit progresses for example. - */ - public static float or(float a, float b) { - float satA = saturate(a); - float satB = saturate(b); - return satA + satB - (satA * satB); - } - /** * Trims the string, removing all whitespace at the beginning and end of the string. * Non-breaking whitespaces are also removed. @@ -542,7 +443,6 @@ public final class Utilities { return ResourceUtils.roundPxValueFromFloat(value); } - public static String createDbSelectionQuery(String columnName, IntArray values) { return String.format(Locale.ENGLISH, "%s IN (%s)", columnName, values.toConcatString()); } @@ -565,18 +465,6 @@ public final class Utilities { return defaultValue; } - /** - * Using the view's bounds and icon size, calculate where the icon bounds will - * be if it was positioned at the center of the view. - */ - public static void setRectToViewCenter(View iconView, int iconSize, Rect outBounds) { - int top = (iconView.getHeight() - iconSize) / 2; - int left = (iconView.getWidth() - iconSize) / 2; - int right = left + iconSize; - int bottom = top + iconSize; - outBounds.set(left, top, right, bottom); - } - /** * Ensures that a value is within given bounds. Specifically: * If value is less than lowerBound, return lowerBound; else if value is greater than upperBound, @@ -652,42 +540,6 @@ public final class Utilities { || e.getCause() instanceof DeadObjectException; } - public static boolean isGridOptionsEnabled(Context context) { - return isComponentEnabled(context.getPackageManager(), - context.getPackageName(), - GridCustomizationsProvider.class.getName()); - } - - private static boolean isComponentEnabled(PackageManager pm, String pkgName, String clsName) { - ComponentName componentName = new ComponentName(pkgName, clsName); - int componentEnabledSetting = pm.getComponentEnabledSetting(componentName); - - switch (componentEnabledSetting) { - case PackageManager.COMPONENT_ENABLED_STATE_DISABLED: - return false; - case PackageManager.COMPONENT_ENABLED_STATE_ENABLED: - return true; - case PackageManager.COMPONENT_ENABLED_STATE_DEFAULT: - default: - // We need to get the application info to get the component's default state - try { - PackageInfo packageInfo = pm.getPackageInfo(pkgName, - PackageManager.GET_PROVIDERS | PackageManager.GET_DISABLED_COMPONENTS); - - if (packageInfo.providers != null) { - return Arrays.stream(packageInfo.providers).anyMatch( - pi -> pi.name.equals(clsName) && pi.isEnabled()); - } - - // the component is not declared in the AndroidManifest - return false; - } catch (PackageManager.NameNotFoundException e) { - // the package isn't installed on the device - return false; - } - } - } - /** * Utility method to post a runnable on the handler, skipping the synchronization barriers. */ @@ -697,12 +549,6 @@ public final class Utilities { handler.sendMessage(msg); } - public static void unregisterReceiverSafely(Context context, BroadcastReceiver receiver) { - try { - context.unregisterReceiver(receiver); - } catch (IllegalArgumentException e) {} - } - /** * Returns the full drawable for info without any flattening or pre-processing. * @@ -800,14 +646,6 @@ public final class Utilities { } } - /** - * @return true is the extra is either null or is of type {@param type} - */ - public static boolean isValidExtraType(Intent intent, String key, Class type) { - Object extra = intent.getParcelableExtra(key); - return extra == null || type.isInstance(extra); - } - public static float squaredHypot(float x, float y) { return x * x + y * y; } @@ -817,18 +655,6 @@ public final class Utilities { return slop * slop; } - /** - * Helper method to create a content provider - */ - public static ContentObserver newContentObserver(Handler handler, Consumer command) { - return new ContentObserver(handler) { - @Override - public void onChange(boolean selfChange, Uri uri) { - command.accept(uri); - } - }; - } - /** * Rotates `inOutBounds` by `delta` 90-degree increments. Rotation is visually CCW. Parent * sizes represent the "space" that will rotate carrying inOutBounds along with it to determine @@ -877,16 +703,6 @@ public final class Utilities { ColorUtils.blendARGB(0, color, tintAmount)); } - /** - * Sets start margin on the provided {@param view} to be {@param margin}. - * Assumes {@param view} is a child of {@link LinearLayout} - */ - public static void setStartMarginForView(View view, int margin) { - LinearLayout.LayoutParams lp = (LinearLayout.LayoutParams) view.getLayoutParams(); - lp.setMarginStart(margin); - view.setLayoutParams(lp); - } - public static Rect getViewBounds(@NonNull View v) { int[] pos = new int[2]; v.getLocationOnScreen(pos); @@ -966,12 +782,4 @@ public final class Utilities { public static float getYVelocity(VelocityTracker velocityTracker, MotionEvent event) { return getYVelocity(velocityTracker, event, -1 /* ACTIVE_POINTER_ID */); } - - public static boolean bothNull(@Nullable Object a, @Nullable Object b) { - return a == null && b == null; - } - - public static boolean bothNonNull(@Nullable Object a, @Nullable Object b) { - return a != null && b != null; - } } diff --git a/src/com/android/launcher3/folder/FolderIcon.java b/src/com/android/launcher3/folder/FolderIcon.java index e8759da0d0..dd00f07807 100644 --- a/src/com/android/launcher3/folder/FolderIcon.java +++ b/src/com/android/launcher3/folder/FolderIcon.java @@ -616,11 +616,14 @@ public class FolderIcon extends FrameLayout implements FolderListener, IconLabel public void drawDot(Canvas canvas) { if (!mForceHideDot && ((mDotInfo != null && mDotInfo.hasDot()) || mDotScale > 0)) { Rect iconBounds = mDotParams.iconBounds; + // FolderIcon draws the icon to be top-aligned (with padding) & horizontally-centered + int iconSize = mActivity.getDeviceProfile().iconSizePx; + iconBounds.left = (getWidth() - iconSize) / 2; + iconBounds.right = iconBounds.left + iconSize; + iconBounds.top = getPaddingTop(); + iconBounds.bottom = iconBounds.top + iconSize; - Utilities.setRectToViewCenter(this, mActivity.getDeviceProfile().iconSizePx, - iconBounds); - iconBounds.offsetTo(iconBounds.left, getPaddingTop()); - float iconScale = (float) mBackground.previewSize / iconBounds.width(); + float iconScale = (float) mBackground.previewSize / iconSize; Utilities.scaleRectAboutCenter(iconBounds, iconScale); // If we are animating to the accepting state, animate the dot out. diff --git a/src/com/android/launcher3/model/ModelUtils.java b/src/com/android/launcher3/model/ModelUtils.java index 1ced0b16f4..c21fc38cfb 100644 --- a/src/com/android/launcher3/model/ModelUtils.java +++ b/src/com/android/launcher3/model/ModelUtils.java @@ -15,8 +15,6 @@ */ package com.android.launcher3.model; -import static com.android.launcher3.Utilities.isValidExtraType; - import android.content.Context; import android.content.Intent; import android.graphics.Bitmap; @@ -149,4 +147,12 @@ public class ModelUtils { info.intent = launchIntent; return info; } + + /** + * @return true if the extra is either null or is of type {@param type} + */ + private static boolean isValidExtraType(Intent intent, String key, Class type) { + Object extra = intent.getParcelableExtra(key); + return extra == null || type.isInstance(extra); + } } diff --git a/src/com/android/launcher3/util/BgObjectWithLooper.java b/src/com/android/launcher3/util/BgObjectWithLooper.java index 1483c43a11..adc3c7d885 100644 --- a/src/com/android/launcher3/util/BgObjectWithLooper.java +++ b/src/com/android/launcher3/util/BgObjectWithLooper.java @@ -15,10 +15,15 @@ */ package com.android.launcher3.util; +import android.database.ContentObserver; +import android.net.Uri; +import android.os.Handler; import android.os.Looper; import androidx.annotation.WorkerThread; +import java.util.function.Consumer; + /** * Utility class to define an object which does most of it's processing on a * dedicated background thread. @@ -43,4 +48,16 @@ public abstract class BgObjectWithLooper { */ @WorkerThread protected abstract void onInitialized(Looper looper); + + /** + * Helper method to create a content provider + */ + protected static ContentObserver newContentObserver(Handler handler, Consumer command) { + return new ContentObserver(handler) { + @Override + public void onChange(boolean selfChange, Uri uri) { + command.accept(uri); + } + }; + } } diff --git a/src/com/android/launcher3/util/SimpleBroadcastReceiver.java b/src/com/android/launcher3/util/SimpleBroadcastReceiver.java index 4dfa5ccdeb..0a23506692 100644 --- a/src/com/android/launcher3/util/SimpleBroadcastReceiver.java +++ b/src/com/android/launcher3/util/SimpleBroadcastReceiver.java @@ -52,4 +52,15 @@ public class SimpleBroadcastReceiver extends BroadcastReceiver { } context.registerReceiver(this, filter, flags); } + + /** + * Unregisters the receiver ignoring any errors + */ + public void unregisterReceiverSafely(Context context) { + try { + context.unregisterReceiver(this); + } catch (IllegalArgumentException e) { + // It was probably never registered or already unregistered. Ignore. + } + } } diff --git a/src/com/android/launcher3/views/OptionsPopupView.java b/src/com/android/launcher3/views/OptionsPopupView.java index d30192542f..b3c376fb0d 100644 --- a/src/com/android/launcher3/views/OptionsPopupView.java +++ b/src/com/android/launcher3/views/OptionsPopupView.java @@ -15,9 +15,6 @@ */ package com.android.launcher3.views; -import static com.android.launcher3.Utilities.EXTRA_WALLPAPER_FLAVOR; -import static com.android.launcher3.Utilities.EXTRA_WALLPAPER_LAUNCH_SOURCE; -import static com.android.launcher3.Utilities.EXTRA_WALLPAPER_OFFSET; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.IGNORE; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_SETTINGS_BUTTON_TAP_OR_LONGPRESS; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_WIDGETSTRAY_BUTTON_TAP_OR_LONGPRESS; @@ -51,6 +48,7 @@ import com.android.launcher3.popup.ArrowPopup; import com.android.launcher3.shortcuts.DeepShortcutView; import com.android.launcher3.testing.TestLogging; import com.android.launcher3.testing.shared.TestProtocol; +import com.android.launcher3.util.PackageManagerHelper; import com.android.launcher3.widget.picker.WidgetsFullSheet; import java.util.ArrayList; @@ -62,6 +60,13 @@ import java.util.List; public class OptionsPopupView extends ArrowPopup implements OnClickListener, OnLongClickListener { + // An intent extra to indicate the horizontal scroll of the wallpaper. + private static final String EXTRA_WALLPAPER_OFFSET = "com.android.launcher3.WALLPAPER_OFFSET"; + private static final String EXTRA_WALLPAPER_FLAVOR = "com.android.launcher3.WALLPAPER_FLAVOR"; + // An intent extra to indicate the launch source by launcher. + private static final String EXTRA_WALLPAPER_LAUNCH_SOURCE = + "com.android.wallpaper.LAUNCH_SOURCE"; + private final ArrayMap mItemMap = new ArrayMap<>(); private RectF mTargetRect; private boolean mShouldAddArrow; @@ -180,10 +185,11 @@ public class OptionsPopupView extends ArrowPopup */ public static ArrayList getOptions(Launcher launcher) { ArrayList options = new ArrayList<>(); - int resString = Utilities.existsStyleWallpapers(launcher) ? - R.string.styles_wallpaper_button_text : R.string.wallpaper_button_text; - int resDrawable = Utilities.existsStyleWallpapers(launcher) ? - R.drawable.ic_palette : R.drawable.ic_wallpaper; + boolean styleWallpaperExists = styleWallpapersExists(launcher); + int resString = styleWallpaperExists + ? R.string.styles_wallpaper_button_text : R.string.wallpaper_button_text; + int resDrawable = styleWallpaperExists + ? R.drawable.ic_palette : R.drawable.ic_wallpaper; options.add(new OptionItem(launcher, resString, resDrawable, @@ -251,7 +257,7 @@ public class OptionsPopupView extends ArrowPopup .putExtra(EXTRA_WALLPAPER_OFFSET, launcher.getWorkspace().getWallpaperOffsetForCenterPage()) .putExtra(EXTRA_WALLPAPER_LAUNCH_SOURCE, "app_launched_launcher"); - if (!Utilities.existsStyleWallpapers(launcher)) { + if (!styleWallpapersExists(launcher)) { intent.putExtra(EXTRA_WALLPAPER_FLAVOR, "wallpaper_only"); } else { intent.putExtra(EXTRA_WALLPAPER_FLAVOR, "focus_wallpaper"); @@ -299,4 +305,9 @@ public class OptionsPopupView extends ArrowPopup this.clickListener = clickListener; } } + + private static boolean styleWallpapersExists(Context context) { + return context.getPackageManager().resolveActivity( + PackageManagerHelper.getStyleWallpapersIntent(context), 0) != null; + } } From 7e0f5d8a57cb7cebe9957e1c6cc2aba7c2013c0a Mon Sep 17 00:00:00 2001 From: Tracy Zhou Date: Sun, 9 Oct 2022 23:39:24 -0700 Subject: [PATCH 06/16] Implement split from workspace to workspace Fixes: 239824922 Test: https://recall.googleplex.com/projects/f46cfe9c-8076-4efe-bf8a-b1cc4f1f5e1b/sessions/b745433d-cba7-4f7a-a28d-4223d9950c0b Change-Id: I9bfd5844bb9ccb6e65e77fedb7fbccb37692f812 --- .../popup/QuickstepSystemShortcut.java | 58 ++++++++++++++-- .../uioverrides/QuickstepLauncher.java | 19 ++++-- .../com/android/quickstep/SystemUiProxy.java | 28 ++++++++ .../util/SplitSelectStateController.java | 14 ++-- .../util/SplitToWorkspaceController.java | 66 +++++++++++++++++++ .../SplitWithKeyboardShortcutController.java | 27 -------- .../android/quickstep/views/RecentsView.java | 2 +- .../launcher3/config/FeatureFlags.java | 4 ++ 8 files changed, 175 insertions(+), 43 deletions(-) create mode 100644 quickstep/src/com/android/quickstep/util/SplitToWorkspaceController.java diff --git a/quickstep/src/com/android/launcher3/popup/QuickstepSystemShortcut.java b/quickstep/src/com/android/launcher3/popup/QuickstepSystemShortcut.java index 7c3281a046..7cf8201767 100644 --- a/quickstep/src/com/android/launcher3/popup/QuickstepSystemShortcut.java +++ b/quickstep/src/com/android/launcher3/popup/QuickstepSystemShortcut.java @@ -15,20 +15,29 @@ */ package com.android.launcher3.popup; +import static com.android.launcher3.config.FeatureFlags.ENABLE_SPLIT_FROM_WORKSPACE_TO_WORKSPACE; import static com.android.launcher3.util.SplitConfigurationOptions.getLogEventForPosition; +import static com.android.quickstep.util.SplitAnimationTimings.TABLET_HOME_TO_SPLIT; import android.content.Intent; import android.graphics.Bitmap; +import android.graphics.Rect; +import android.graphics.RectF; import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.Drawable; import android.util.Log; import android.view.View; +import com.android.launcher3.AbstractFloatingView; +import com.android.launcher3.R; +import com.android.launcher3.anim.PendingAnimation; import com.android.launcher3.logging.StatsLogManager; import com.android.launcher3.model.data.ItemInfo; import com.android.launcher3.model.data.WorkspaceItemInfo; import com.android.launcher3.uioverrides.QuickstepLauncher; import com.android.launcher3.util.SplitConfigurationOptions.SplitPositionOption; +import com.android.quickstep.util.SplitSelectStateController; +import com.android.quickstep.views.FloatingTaskView; import com.android.quickstep.views.RecentsView; public interface QuickstepSystemShortcut { @@ -44,6 +53,10 @@ public interface QuickstepSystemShortcut { class SplitSelectSystemShortcut extends SystemShortcut { + private final int mSplitPlaceholderSize; + private final int mSplitPlaceholderInset; + + private final Rect mTempRect = new Rect(); private final SplitPositionOption mPosition; public SplitSelectSystemShortcut(QuickstepLauncher launcher, ItemInfo itemInfo, @@ -51,6 +64,11 @@ public interface QuickstepSystemShortcut { super(position.iconResId, position.textResId, launcher, itemInfo, originalView); mPosition = position; + + mSplitPlaceholderSize = launcher.getResources().getDimensionPixelSize( + R.dimen.split_placeholder_size); + mSplitPlaceholderInset = launcher.getResources().getDimensionPixelSize( + R.dimen.split_placeholder_inset); } @Override @@ -72,11 +90,39 @@ public interface QuickstepSystemShortcut { return; } - RecentsView recentsView = mTarget.getOverviewPanel(); StatsLogManager.EventEnum splitEvent = getLogEventForPosition(mPosition.stagePosition); - recentsView.initiateSplitSelect( - new SplitSelectSource(mOriginalView, new BitmapDrawable(bitmap), intent, - mPosition, mItemInfo, splitEvent)); + SplitSelectSource source = new SplitSelectSource(mOriginalView, + new BitmapDrawable(bitmap), intent, mPosition, mItemInfo, splitEvent); + if (ENABLE_SPLIT_FROM_WORKSPACE_TO_WORKSPACE.get()) { + startSplitToHome(source); + } else { + RecentsView recentsView = mTarget.getOverviewPanel(); + recentsView.initiateSplitSelect(source); + } + } + + private void startSplitToHome(SplitSelectSource source) { + AbstractFloatingView.closeAllOpenViews(mTarget); + + SplitSelectStateController controller = mTarget.getSplitSelectStateController(); + controller.setInitialTaskSelect(source.intent, source.position.stagePosition, + source.itemInfo, source.splitEvent); + + RecentsView recentsView = mTarget.getOverviewPanel(); + recentsView.getPagedOrientationHandler().getInitialSplitPlaceholderBounds( + mSplitPlaceholderSize, mSplitPlaceholderInset, mTarget.getDeviceProfile(), + controller.getActiveSplitStagePosition(), mTempRect); + + PendingAnimation anim = new PendingAnimation(TABLET_HOME_TO_SPLIT.getDuration()); + RectF startingTaskRect = new RectF(); + FloatingTaskView floatingTaskView = FloatingTaskView.getFloatingTaskView(mTarget, + source.view, null /* thumbnail */, + source.drawable, startingTaskRect); + floatingTaskView.setAlpha(1); + floatingTaskView.addStagingAnimation(anim, startingTaskRect, mTempRect, + false /* fadeWithThumbnail */, true /* isStagedTask */); + controller.setFirstFloatingTaskView(floatingTaskView); + anim.buildAnim().start(); } } @@ -86,7 +132,7 @@ public interface QuickstepSystemShortcut { public final Drawable drawable; public final Intent intent; public final SplitPositionOption position; - public final ItemInfo mItemInfo; + public final ItemInfo itemInfo; public final StatsLogManager.EventEnum splitEvent; public SplitSelectSource(View view, Drawable drawable, Intent intent, @@ -96,7 +142,7 @@ public interface QuickstepSystemShortcut { this.drawable = drawable; this.intent = intent; this.position = position; - this.mItemInfo = itemInfo; + this.itemInfo = itemInfo; this.splitEvent = splitEvent; } } diff --git a/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java b/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java index 9813c8a987..2d1a6cac38 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java +++ b/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java @@ -96,6 +96,7 @@ import com.android.launcher3.logging.StatsLogManager.StatsLogger; import com.android.launcher3.model.BgDataModel.FixedContainerItems; import com.android.launcher3.model.WellbeingModel; import com.android.launcher3.model.data.ItemInfo; +import com.android.launcher3.model.data.WorkspaceItemInfo; import com.android.launcher3.popup.SystemShortcut; import com.android.launcher3.proxy.ProxyActivityStarter; import com.android.launcher3.proxy.StartActivityParams; @@ -136,6 +137,7 @@ import com.android.quickstep.util.QuickstepOnboardingPrefs; import com.android.quickstep.util.RemoteAnimationProvider; import com.android.quickstep.util.RemoteFadeOutAnimationListener; import com.android.quickstep.util.SplitSelectStateController; +import com.android.quickstep.util.SplitToWorkspaceController; import com.android.quickstep.util.SplitWithKeyboardShortcutController; import com.android.quickstep.util.TISBindHelper; import com.android.quickstep.views.OverviewActionsView; @@ -182,7 +184,10 @@ public class QuickstepLauncher extends Launcher { private @Nullable RotationChangeProvider mRotationChangeProvider; private @Nullable LauncherUnfoldAnimationController mLauncherUnfoldAnimationController; + private SplitSelectStateController mSplitSelectStateController; private SplitWithKeyboardShortcutController mSplitWithKeyboardShortcutController; + private SplitToWorkspaceController mSplitToWorkspaceController; + /** * If Launcher restarted while in the middle of an Overview split select, it needs this data to * recover. In all other cases this will remain null. @@ -199,12 +204,14 @@ public class QuickstepLauncher extends Launcher { mActionsView = findViewById(R.id.overview_actions_view); RecentsView overviewPanel = getOverviewPanel(); - SplitSelectStateController controller = + mSplitSelectStateController = new SplitSelectStateController(this, mHandler, getStateManager(), getDepthController(), getStatsLogManager()); - overviewPanel.init(mActionsView, controller); + overviewPanel.init(mActionsView, mSplitSelectStateController); mSplitWithKeyboardShortcutController = new SplitWithKeyboardShortcutController(this, - controller); + mSplitSelectStateController); + mSplitToWorkspaceController = new SplitToWorkspaceController(this, + mSplitSelectStateController); mActionsView.updateDimension(getDeviceProfile(), overviewPanel.getLastComputedTaskSize()); mActionsView.updateVerticalMargin(DisplayController.getNavigationMode(this)); @@ -330,7 +337,7 @@ public class QuickstepLauncher extends Launcher { } protected void onItemClicked(View view) { - if (!mSplitWithKeyboardShortcutController.handleSecondAppSelectionForSplit(view)) { + if (!mSplitToWorkspaceController.handleSecondAppSelectionForSplit(view)) { QuickstepLauncher.super.getItemOnClickListener().onClick(view); } } @@ -724,6 +731,10 @@ public class QuickstepLauncher extends Launcher { return mTaskbarUIController; } + public SplitSelectStateController getSplitSelectStateController() { + return mSplitSelectStateController; + } + public T getActionsView() { return (T) mActionsView; } diff --git a/quickstep/src/com/android/quickstep/SystemUiProxy.java b/quickstep/src/com/android/quickstep/SystemUiProxy.java index ef7c6dca11..bb973342d5 100644 --- a/quickstep/src/com/android/quickstep/SystemUiProxy.java +++ b/quickstep/src/com/android/quickstep/SystemUiProxy.java @@ -561,6 +561,20 @@ public class SystemUiProxy implements ISystemUiProxy { } } + public void startIntents(PendingIntent pendingIntent1, Bundle options1, + PendingIntent pendingIntent2, Bundle options2, + @SplitConfigurationOptions.StagePosition int splitPosition, + float splitRatio, RemoteTransition remoteTransition, InstanceId instanceId) { + if (mSystemUiProxy != null) { + try { + mSplitScreen.startIntents(pendingIntent1, options1, pendingIntent2, options2, + splitPosition, splitRatio, remoteTransition, instanceId); + } catch (RemoteException e) { + Log.w(TAG, "Failed call startIntents"); + } + } + } + public void startShortcutAndTask(ShortcutInfo shortcutInfo, Bundle options1, int taskId, Bundle options2, @SplitConfigurationOptions.StagePosition int splitPosition, float splitRatio, RemoteTransition remoteTransition, InstanceId instanceId) { @@ -617,6 +631,20 @@ public class SystemUiProxy implements ISystemUiProxy { } } + public void startIntentsWithLegacyTransition(PendingIntent pendingIntent1, Bundle options1, + PendingIntent pendingIntent2, Bundle options2, + @SplitConfigurationOptions.StagePosition int sidePosition, float splitRatio, + RemoteAnimationAdapter adapter, InstanceId instanceId) { + if (mSystemUiProxy != null) { + try { + mSplitScreen.startIntentsWithLegacyTransition(pendingIntent1, options1, + pendingIntent2, options2, sidePosition, splitRatio, adapter, instanceId); + } catch (RemoteException e) { + Log.w(TAG, "Failed call startIntentsWithLegacyTransition"); + } + } + } + public void startShortcut(String packageName, String shortcutId, int position, Bundle options, UserHandle user, InstanceId instanceId) { if (mSplitScreen != null) { diff --git a/quickstep/src/com/android/quickstep/util/SplitSelectStateController.java b/quickstep/src/com/android/quickstep/util/SplitSelectStateController.java index 4a74ac663b..c263fe8656 100644 --- a/quickstep/src/com/android/quickstep/util/SplitSelectStateController.java +++ b/quickstep/src/com/android/quickstep/util/SplitSelectStateController.java @@ -37,6 +37,7 @@ import android.os.Handler; import android.os.IBinder; import android.os.RemoteException; import android.os.UserHandle; +import android.text.TextUtils; import android.util.Log; import android.util.Pair; import android.view.RemoteAnimationAdapter; @@ -207,8 +208,8 @@ public class SplitSelectStateController { * fill in intent with a taskId2 are set. * @param intent1 is null when split is initiated from Overview * @param stagePosition representing location of task1 - * @param shellInstanceId loggingId to be used by shell, will be non-null for actions that create - * a split instance, null for cases that bring existing instaces to the + * @param shellInstanceId loggingId to be used by shell, will be non-null for actions that + * create a split instance, null for cases that bring existing instaces to the * foreground (quickswitch, launching previous pairs from overview) */ public void launchTasks(int taskId1, @Nullable Intent intent1, int taskId2, @@ -238,7 +239,9 @@ public class SplitSelectStateController { getOppositeStagePosition(stagePosition), splitRatio, remoteTransition, shellInstanceId); } else { - // TODO: the case when both split apps are started from an intent. + mSystemUiProxy.startIntents(getPendingIntent(intent1), options1.toBundle(), + getPendingIntent(intent2), null /* options2 */, stagePosition, + splitRatio, remoteTransition, shellInstanceId); } } else { final RemoteSplitLaunchAnimationRunner animationRunner = @@ -259,7 +262,9 @@ public class SplitSelectStateController { getOppositeStagePosition(stagePosition), splitRatio, adapter, shellInstanceId); } else { - // TODO: the case when both split apps are started from an intent. + mSystemUiProxy.startIntentsWithLegacyTransition(getPendingIntent(intent1), + options1.toBundle(), getPendingIntent(intent2), null /* options2 */, + stagePosition, splitRatio, adapter, shellInstanceId); } } } @@ -305,7 +310,6 @@ public class SplitSelectStateController { : PendingIntent.getActivity(mContext, 0, intent, FLAG_MUTABLE)); } - public @StagePosition int getActiveSplitStagePosition() { return mStagePosition; } diff --git a/quickstep/src/com/android/quickstep/util/SplitToWorkspaceController.java b/quickstep/src/com/android/quickstep/util/SplitToWorkspaceController.java new file mode 100644 index 0000000000..e8a4b0a324 --- /dev/null +++ b/quickstep/src/com/android/quickstep/util/SplitToWorkspaceController.java @@ -0,0 +1,66 @@ +/* + * Copyright (C) 2022 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.quickstep.util; + +import static com.android.launcher3.config.FeatureFlags.ENABLE_SPLIT_FROM_FULLSCREEN_WITH_KEYBOARD_SHORTCUTS; +import static com.android.launcher3.config.FeatureFlags.ENABLE_SPLIT_FROM_WORKSPACE_TO_WORKSPACE; + +import android.content.Intent; +import android.view.View; + +import com.android.launcher3.Launcher; +import com.android.launcher3.model.data.WorkspaceItemInfo; + +/** Handles when the stage split lands on the home screen. */ +public class SplitToWorkspaceController { + + private final Launcher mLauncher; + private final SplitSelectStateController mController; + + public SplitToWorkspaceController(Launcher launcher, SplitSelectStateController controller) { + mLauncher = launcher; + mController = controller; + } + + /** + * Handles second app selection from stage split. If the item can't be opened in split or + * it's not in stage split state, we pass it onto Launcher's default item click handler. + */ + public boolean handleSecondAppSelectionForSplit(View view) { + if ((!ENABLE_SPLIT_FROM_FULLSCREEN_WITH_KEYBOARD_SHORTCUTS.get() + && !ENABLE_SPLIT_FROM_WORKSPACE_TO_WORKSPACE.get()) + || !mController.isSplitSelectActive()) { + return false; + } + Object tag = view.getTag(); + Intent intent; + if (tag instanceof WorkspaceItemInfo) { + final WorkspaceItemInfo workspaceItemInfo = (WorkspaceItemInfo) tag; + intent = workspaceItemInfo.intent; + } else if (tag instanceof com.android.launcher3.model.data.AppInfo) { + final com.android.launcher3.model.data.AppInfo appInfo = + (com.android.launcher3.model.data.AppInfo) tag; + intent = appInfo.intent; + } else { + return false; + } + mController.setSecondTask(intent); + mController.launchSplitTasks(aBoolean -> mLauncher.getDragLayer().removeView( + mController.getFirstFloatingTaskView())); + return true; + } +} diff --git a/quickstep/src/com/android/quickstep/util/SplitWithKeyboardShortcutController.java b/quickstep/src/com/android/quickstep/util/SplitWithKeyboardShortcutController.java index 3587bd1da5..24d832640f 100644 --- a/quickstep/src/com/android/quickstep/util/SplitWithKeyboardShortcutController.java +++ b/quickstep/src/com/android/quickstep/util/SplitWithKeyboardShortcutController.java @@ -101,33 +101,6 @@ public class SplitWithKeyboardShortcutController { }); } - /** - * Handles second app selection from stage split. If the item can't be opened in split or - * it's not in stage split state, we pass it onto Launcher's default item click handler. - */ - public boolean handleSecondAppSelectionForSplit(View view) { - if (!ENABLE_SPLIT_FROM_FULLSCREEN_WITH_KEYBOARD_SHORTCUTS.get() - || !mController.isSplitSelectActive()) { - return false; - } - Object tag = view.getTag(); - Intent intent; - if (tag instanceof WorkspaceItemInfo) { - final WorkspaceItemInfo workspaceItemInfo = (WorkspaceItemInfo) tag; - intent = workspaceItemInfo.intent; - } else if (tag instanceof com.android.launcher3.model.data.AppInfo) { - final com.android.launcher3.model.data.AppInfo appInfo = - (com.android.launcher3.model.data.AppInfo) tag; - intent = appInfo.intent; - } else { - return false; - } - mController.setSecondTask(intent); - mController.launchSplitTasks(aBoolean -> mLauncher.getDragLayer().removeView( - mController.getFirstFloatingTaskView())); - return true; - } - public void onDestroy() { mOverviewComponentObserver.onDestroy(); } diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java index ff0c984b6d..ce84869932 100644 --- a/quickstep/src/com/android/quickstep/views/RecentsView.java +++ b/quickstep/src/com/android/quickstep/views/RecentsView.java @@ -4232,7 +4232,7 @@ public abstract class RecentsView Date: Wed, 16 Nov 2022 02:38:05 -0800 Subject: [PATCH 07/16] Import translations. DO NOT MERGE ANYWHERE Auto-generated-cl: translation import Change-Id: I20c0940ae9281268a194f7b3548509e3b15084eb --- quickstep/res/values-af/strings.xml | 5 +- quickstep/res/values-am/strings.xml | 5 +- quickstep/res/values-ar/strings.xml | 5 +- quickstep/res/values-as/strings.xml | 5 +- quickstep/res/values-az/strings.xml | 5 +- quickstep/res/values-b+sr+Latn/strings.xml | 5 +- quickstep/res/values-be/strings.xml | 5 +- quickstep/res/values-bg/strings.xml | 5 +- quickstep/res/values-bn/strings.xml | 5 +- quickstep/res/values-bs/strings.xml | 5 +- quickstep/res/values-ca/strings.xml | 5 +- quickstep/res/values-cs/strings.xml | 5 +- quickstep/res/values-da/strings.xml | 5 +- quickstep/res/values-de/strings.xml | 5 +- quickstep/res/values-el/strings.xml | 5 +- quickstep/res/values-en-rAU/strings.xml | 5 +- quickstep/res/values-en-rCA/strings.xml | 55 ++++++++++++---------- quickstep/res/values-en-rGB/strings.xml | 5 +- quickstep/res/values-en-rIN/strings.xml | 5 +- quickstep/res/values-en-rXC/strings.xml | 5 +- quickstep/res/values-es-rUS/strings.xml | 5 +- quickstep/res/values-es/strings.xml | 5 +- quickstep/res/values-et/strings.xml | 5 +- quickstep/res/values-eu/strings.xml | 5 +- quickstep/res/values-fa/strings.xml | 5 +- quickstep/res/values-fi/strings.xml | 5 +- quickstep/res/values-fr-rCA/strings.xml | 5 +- quickstep/res/values-fr/strings.xml | 5 +- quickstep/res/values-gl/strings.xml | 5 +- quickstep/res/values-gu/strings.xml | 5 +- quickstep/res/values-hi/strings.xml | 5 +- quickstep/res/values-hr/strings.xml | 5 +- quickstep/res/values-hu/strings.xml | 5 +- quickstep/res/values-hy/strings.xml | 5 +- quickstep/res/values-in/strings.xml | 5 +- quickstep/res/values-is/strings.xml | 5 +- quickstep/res/values-it/strings.xml | 5 +- quickstep/res/values-iw/strings.xml | 5 +- quickstep/res/values-ja/strings.xml | 5 +- quickstep/res/values-ka/strings.xml | 5 +- quickstep/res/values-kk/strings.xml | 5 +- quickstep/res/values-km/strings.xml | 5 +- quickstep/res/values-kn/strings.xml | 5 +- quickstep/res/values-ko/strings.xml | 5 +- quickstep/res/values-ky/strings.xml | 5 +- quickstep/res/values-lo/strings.xml | 5 +- quickstep/res/values-lt/strings.xml | 5 +- quickstep/res/values-lv/strings.xml | 5 +- quickstep/res/values-mk/strings.xml | 5 +- quickstep/res/values-ml/strings.xml | 5 +- quickstep/res/values-mn/strings.xml | 5 +- quickstep/res/values-mr/strings.xml | 5 +- quickstep/res/values-ms/strings.xml | 5 +- quickstep/res/values-my/strings.xml | 5 +- quickstep/res/values-nb/strings.xml | 5 +- quickstep/res/values-ne/strings.xml | 5 +- quickstep/res/values-nl/strings.xml | 5 +- quickstep/res/values-or/strings.xml | 5 +- quickstep/res/values-pa/strings.xml | 5 +- quickstep/res/values-pl/strings.xml | 5 +- quickstep/res/values-pt-rPT/strings.xml | 5 +- quickstep/res/values-pt/strings.xml | 5 +- quickstep/res/values-ro/strings.xml | 5 +- quickstep/res/values-ru/strings.xml | 5 +- quickstep/res/values-si/strings.xml | 5 +- quickstep/res/values-sk/strings.xml | 5 +- quickstep/res/values-sl/strings.xml | 5 +- quickstep/res/values-sq/strings.xml | 5 +- quickstep/res/values-sr/strings.xml | 5 +- quickstep/res/values-sv/strings.xml | 5 +- quickstep/res/values-sw/strings.xml | 5 +- quickstep/res/values-ta/strings.xml | 5 +- quickstep/res/values-te/strings.xml | 5 +- quickstep/res/values-th/strings.xml | 5 +- quickstep/res/values-tl/strings.xml | 5 +- quickstep/res/values-tr/strings.xml | 5 +- quickstep/res/values-uk/strings.xml | 5 +- quickstep/res/values-ur/strings.xml | 5 +- quickstep/res/values-uz/strings.xml | 5 +- quickstep/res/values-vi/strings.xml | 5 +- quickstep/res/values-zh-rCN/strings.xml | 5 +- quickstep/res/values-zh-rHK/strings.xml | 5 +- quickstep/res/values-zh-rTW/strings.xml | 5 +- quickstep/res/values-zu/strings.xml | 5 +- 84 files changed, 361 insertions(+), 109 deletions(-) diff --git a/quickstep/res/values-af/strings.xml b/quickstep/res/values-af/strings.xml index 34805eae3d..8bfca3f1dc 100644 --- a/quickstep/res/values-af/strings.xml +++ b/quickstep/res/values-af/strings.xml @@ -77,6 +77,8 @@ "Tutoriaal %1$d/%2$d" "Gereed!" "Swiep op om na die tuisskerm toe te gaan" + + "Jy is gereed om jou foon te begin gebruik" "Jy is gereed om jou tablet te begin gebruik" "Stelselnavigasie-instellings" @@ -84,7 +86,8 @@ "Skermkiekie" "Verdeel" "Probeer ander program om verdeelde skerm te gebruik" - "Program steun nie verdeelde skerm nie." + + "Jou organisasie laat nie hierdie program toe nie" "Slaan navigasietutoriaal oor?" "Jy kan dit later in die %1$s-program kry" diff --git a/quickstep/res/values-am/strings.xml b/quickstep/res/values-am/strings.xml index 1789c2b8dd..bc4209ee0f 100644 --- a/quickstep/res/values-am/strings.xml +++ b/quickstep/res/values-am/strings.xml @@ -77,6 +77,8 @@ "አጋዥ ሥልጠና %1$d/%2$d" "ሁሉም ዝግጁ!" "ወደ መነሻ ለመሄድ በጣት ወደ ላይ ማንሸራተት" + + "ስልክዎን መጠቀም ለመጀመር ዝግጁ ነዎት" "ጡባዊዎን መጠቀም ለመጀመር ዝግጁ ነዎት" "የስርዓት አሰሳ ቅንብሮች" @@ -84,7 +86,8 @@ "ቅጽበታዊ ገጽ እይታ" "ክፈል" "የተከፈለ ማያን ለመጠቀም ሌላ መተግበሪያ መታ ያድርጉ" - "መተግበሪያው የተከፈለ ማያ ገጽን አይደግፍም።" + + "ይህ ድርጊት በመተግበሪያው ወይም በእርስዎ ድርጅት አይፈቀድም" "የአሰሳ አጋዥ ሥልጠናን ይዝለሉ?" "ይህን በኋላ በ%1$s መተግበሪያው ውስጥ ማግኘት ይችላሉ" diff --git a/quickstep/res/values-ar/strings.xml b/quickstep/res/values-ar/strings.xml index f9755d2d37..b461230676 100644 --- a/quickstep/res/values-ar/strings.xml +++ b/quickstep/res/values-ar/strings.xml @@ -77,6 +77,8 @@ "الدليل التوجيهي %1$d من إجمالي %2$d" "اكتملت عملية الإعداد" "مرِّر سريعًا للأعلى للانتقال إلى الشاشة الرئيسية." + + "يمكنك الآن بدء استخدام هاتفك." "يمكنك الآن بدء استخدام جهازك اللوحي." "إعدادات التنقّل داخل النظام" @@ -84,7 +86,8 @@ "لقطة شاشة" "تقسيم" "انقر على تطبيق آخر لاستخدام وضع تقسيم الشاشة." - "التطبيق لا يتيح تقسيم الشاشة." + + "لا يسمح التطبيق أو لا تسمح مؤسستك بهذا الإجراء." "هل تريد تخطي الدليل التوجيهي؟" "يمكنك العثور على هذا الدليل التوجيهي لاحقًا في التطبيق \"%1$s\"" diff --git a/quickstep/res/values-as/strings.xml b/quickstep/res/values-as/strings.xml index ec47dd4570..3bae94e157 100644 --- a/quickstep/res/values-as/strings.xml +++ b/quickstep/res/values-as/strings.xml @@ -77,6 +77,8 @@ "টিউট’ৰিয়েল %1$d/%2$d" "সকলো সাজু!" "গৃহ স্ক্ৰীনলৈ যাবলৈ ওপৰলৈ ছোৱাইপ কৰক" + + "আপুনি আপোনাৰ ফ’নটো ব্যৱহাৰ কৰিবলৈ সাজু" "আপুনি আপোনাৰ টেবলেটটো ব্যৱহাৰ কৰিবলৈ সাজু" "ছিষ্টেম নেভিগেশ্বনৰ ছেটিং" @@ -84,7 +86,8 @@ "স্ক্ৰীনশ্বট" "বিভাজন কৰক" "বিভাজিত স্ক্ৰীন ব্যৱহাৰ কৰিবলৈ অন্য এটা এপত টিপক" - "এপ্‌টোৱে বিভাজিত স্ক্ৰীন সমৰ্থন নকৰে।" + + "এপ্‌টোৱে অথবা আপোনাৰ প্ৰতিষ্ঠানে এই কাৰ্যটোৰ অনুমতি নিদিয়ে" "নেভিগেশ্বনৰ টিউট’ৰিয়েল এৰিব বিচাৰে নেকি?" "আপুনি এয়া পাছত %1$s এপ্‌টোত বিচাৰিব পাৰিব" diff --git a/quickstep/res/values-az/strings.xml b/quickstep/res/values-az/strings.xml index 7d15232fd6..ff01f86f2b 100644 --- a/quickstep/res/values-az/strings.xml +++ b/quickstep/res/values-az/strings.xml @@ -77,6 +77,8 @@ "Dərslik %1$d/%2$d" "Hər şey hazırdır!" "Əsas səhifəyə keçmək üçün yuxarı çəkin" + + "Telefondan istifadəyə başlamağa hazırsınız" "Planşetdən istifadəyə başlamağa hazırsınız" "Sistem naviqasiya ayarları" @@ -84,7 +86,8 @@ "Skrinşot" "Ayırın" "Bölmə ekranını istifadə etmək üçün başqa tətbiqə toxunun" - "Tətbiq ekran bölünməsini dəstəkləmir." + + "Bu əməliyyata tətbiq və ya təşkilatınız tərəfindən icazə verilmir" "Naviqasiya dərsliyi ötürülsün?" "Bunu sonra %1$s tətbiqində tapa bilərsiniz" diff --git a/quickstep/res/values-b+sr+Latn/strings.xml b/quickstep/res/values-b+sr+Latn/strings.xml index 638795369c..881237cf42 100644 --- a/quickstep/res/values-b+sr+Latn/strings.xml +++ b/quickstep/res/values-b+sr+Latn/strings.xml @@ -77,6 +77,8 @@ "Vodič %1$d/%2$d" "Gotovo!" "Prevucite nagore da biste otvorili početni ekran" + + "Spremni ste da počnete da koristite telefon" "Spremni ste da počnete da koristite tablet" "Podešavanja kretanja kroz sistem" @@ -84,7 +86,8 @@ "Snimak ekrana" "Podeli" "Dodirnite drugu aplikaciju za podeljeni ekran" - "Aplikacija ne podržava podeljeni ekran." + + "Aplikacija ili organizacija ne dozvoljavaju ovu radnju" "Želite da preskočite vodič za kretanje?" "Možete da pronađete ovo kasnije u aplikaciji %1$s" diff --git a/quickstep/res/values-be/strings.xml b/quickstep/res/values-be/strings.xml index 5e5f147b16..db280f2d95 100644 --- a/quickstep/res/values-be/strings.xml +++ b/quickstep/res/values-be/strings.xml @@ -77,6 +77,8 @@ "Дапаможнік %1$d/%2$d" "Гатова!" "Каб перайсці на галоўны экран, правядзіце пальцам уверх" + + "Вы можаце пачаць карыстанне тэлефонам" "Вы можаце пачаць карыстанне планшэтам" "Налады навігацыі ў сістэме" @@ -84,7 +86,8 @@ "Здымак экрана" "Падзелены экран" "Для падзеленага экрана націсніце на іншую праграму" - "Праграма не падтрымлівае рэжым падзеленага экрана." + + "Гэта дзеянне не дазволена праграмай ці вашай арганізацыяй" "Прапусціць дапаможнік па навігацыі?" "Знайсці дапаможнік можна ў праграме \"%1$s\"" diff --git a/quickstep/res/values-bg/strings.xml b/quickstep/res/values-bg/strings.xml index ca61151db2..375fa6a8b4 100644 --- a/quickstep/res/values-bg/strings.xml +++ b/quickstep/res/values-bg/strings.xml @@ -77,6 +77,8 @@ "Урок %1$d/%2$d" "Готово!" "Прекарайте пръст нагоре, за да отворите началния екран" + + "Можете да започнете да използвате телефона си" "Можете да започнете да използвате таблета си" "Настройки за навигиране в системата" @@ -84,7 +86,8 @@ "Екранна снимка" "Разделяне на екрана" "Докоснете друго прил., за да ползвате разд. екран" - "Приложението не поддържа разделен екран." + + "Това действие не е разрешено от приложението или организацията ви" "Пропускане на урока за навигиране?" "Урокът е налице в приложението %1$s" diff --git a/quickstep/res/values-bn/strings.xml b/quickstep/res/values-bn/strings.xml index 268e73667f..24d2f1a2f5 100644 --- a/quickstep/res/values-bn/strings.xml +++ b/quickstep/res/values-bn/strings.xml @@ -77,6 +77,8 @@ "টিউটোরিয়াল %1$d/%2$d" "সব রেডি!" "হোম স্ক্রিনে যেতে উপরের দিকে সোয়াইপ করুন" + + "এবারে আপনি ফোন ব্যবহার করতে পারবেন" "এবারে আপনি ট্যাবলেট ব্যবহার করতে পারবেন" "সিস্টেম নেভিগেশন সেটিংস" @@ -84,7 +86,8 @@ "স্ক্রিনশট নিন" "স্প্লিট" "স্প্লিটস্ক্রিন ব্যবহার করতে অন্য অ্যাপে ট্যাপ করুন" - "স্প্লিট-স্ক্রিনে এই অ্যাপ কাজ করে না।" + + "এই অ্যাপ বা আপনার প্রতিষ্ঠান এই অ্যাকশনটি পারফর্ম করার অনুমতি দেয়নি" "নেভিগেশন টিউটোরিয়াল এড়িয়ে যেতে চান?" "আপনি %1$s অ্যাপে পরে এটি খুঁজে পাবেন" diff --git a/quickstep/res/values-bs/strings.xml b/quickstep/res/values-bs/strings.xml index 1ff0817246..208e457ef6 100644 --- a/quickstep/res/values-bs/strings.xml +++ b/quickstep/res/values-bs/strings.xml @@ -77,6 +77,8 @@ "Vodič %1$d/%2$d" "Sve je spremno!" "Prevucite prema gore da odete na početni ekran" + + "Sve je spremno da počnete koristiti telefon" "Sve je spremno da počnete koristiti tablet" "Postavke navigiranja sistemom" @@ -84,7 +86,8 @@ "Snimak ekrana" "Podijeli" "Dodirnite drugu apl. da koristite podijeljeni ekran" - "Aplikacija ne podržava podijeljeni ekran." + + "Ovu radnju ne dozvoljava aplikacija ili vaša organizacija" "Preskočiti vodič za navigiranje?" "Možete ga pronaći kasnije u aplikaciji %1$s" diff --git a/quickstep/res/values-ca/strings.xml b/quickstep/res/values-ca/strings.xml index 4957aee817..2eb14927a3 100644 --- a/quickstep/res/values-ca/strings.xml +++ b/quickstep/res/values-ca/strings.xml @@ -77,6 +77,8 @@ "Tutorial %1$d/%2$d" "Tot a punt!" "Llisca cap amunt per anar a la pàgina d\'inici" + + "Ja pots començar a utilitzar el telèfon" "Ja pots començar a utilitzar la tauleta" "Configuració de navegació del sistema" @@ -84,7 +86,8 @@ "Captura de pantalla" "Divideix" "Toca una altra aplicació per dividir la pantalla" - "L\'aplicació no admet la pantalla dividida." + + "L\'aplicació o la teva organització no permeten aquesta acció" "Vols ometre el tutorial de navegació?" "Pots trobar-lo més tard a l\'aplicació %1$s" diff --git a/quickstep/res/values-cs/strings.xml b/quickstep/res/values-cs/strings.xml index fa707ac652..e337de0cab 100644 --- a/quickstep/res/values-cs/strings.xml +++ b/quickstep/res/values-cs/strings.xml @@ -77,6 +77,8 @@ "Výukový program %1$d/%2$d" "Hotovo!" "Přejetím nahoru se vrátíte na plochu" + + "Jste připraveni začít používat telefon" "Jste připraveni začít používat tablet" "Nastavení navigace v systému" @@ -84,7 +86,8 @@ "Snímek obrazovky" "Rozdělit" "Klepnutím na jinou aplikaci rozdělíte obrazovku" - "Aplikace nepodporuje režim rozdělené obrazovky." + + "Aplikace nebo organizace zakazuje tuto akci" "Přeskočit výukový program k navigaci?" "Program později najdete v aplikaci %1$s" diff --git a/quickstep/res/values-da/strings.xml b/quickstep/res/values-da/strings.xml index d88061d399..2c9591a21c 100644 --- a/quickstep/res/values-da/strings.xml +++ b/quickstep/res/values-da/strings.xml @@ -77,6 +77,8 @@ "Selvstudie %1$d/%2$d" "Alt er parat!" "Stryg opad for at gå til startsiden" + + "Du er klar til at bruge din telefon" "Du er klar til at bruge din tablet" "Indstillinger for systemnavigation" @@ -84,7 +86,8 @@ "Screenshot" "Opdel" "Tryk på en anden app for at bruge opdelt skærm" - "Appen understøtter ikke opdelt skærm." + + "Appen eller din organisation tillader ikke denne handling" "Vil du springe selvstudiet for navigation over?" "Du kan finde dette senere i appen %1$s" diff --git a/quickstep/res/values-de/strings.xml b/quickstep/res/values-de/strings.xml index 3728b35ee3..d0b898384f 100644 --- a/quickstep/res/values-de/strings.xml +++ b/quickstep/res/values-de/strings.xml @@ -77,6 +77,8 @@ "Anleitung %1$d/%2$d" "Fertig!" "Nach oben wischen, um den Startbildschirm aufzurufen" + + "Du kannst dein Smartphone jetzt verwenden" "Du kannst dein Tablet jetzt verwenden" "Einstellungen der Systemsteuerung" @@ -84,7 +86,8 @@ "Screenshot" "Teilen" "Für „Bildschirm teilen“ auf weitere App tippen" - "„Geteilter Bildschirm“ wird v. d. App nicht unterstützt." + + "Die App oder deine Organisation lässt diese Aktion nicht zu" "Navigationstutorial überspringen?" "Du findest es später auch in der %1$s App" diff --git a/quickstep/res/values-el/strings.xml b/quickstep/res/values-el/strings.xml index 5ff882e967..a2ab151c5b 100644 --- a/quickstep/res/values-el/strings.xml +++ b/quickstep/res/values-el/strings.xml @@ -77,6 +77,8 @@ "Οδηγός %1$d/%2$d" "Όλα έτοιμα!" "Σύρετε προς τα πάνω για μετάβαση στην αρχική οθόνη." + + "Είστε έτοιμοι να ξεκινήσετε να χρησιμοποιείτε το τηλέφωνό σας" "Είστε έτοιμοι να ξεκινήσετε να χρησιμοποιείτε το tablet." "Ρυθμίσεις πλοήγησης συστήματος" @@ -84,7 +86,8 @@ "Στιγμιότυπο οθόνης" "Διαχωρισμός" "Πατήστε άλλη εφαρμογή για χρήση διαχωρισμού οθόνης" - "Η εφαρμογή δεν υποστηρίζει διαχωρισμό οθόνης." + + "Αυτή η ενέργεια δεν επιτρέπεται από την εφαρμογή ή τον οργανισμό σας." "Παράβλεψη οδηγού πλοήγησης;" "Βρείτε τον αργότερα στην εφαρμογή %1$s" diff --git a/quickstep/res/values-en-rAU/strings.xml b/quickstep/res/values-en-rAU/strings.xml index 5b378b41ac..19b0c3c65c 100644 --- a/quickstep/res/values-en-rAU/strings.xml +++ b/quickstep/res/values-en-rAU/strings.xml @@ -77,6 +77,8 @@ "Tutorial %1$d/%2$d" "Ready!" "Swipe up to go home" + + "You’re ready to start using your phone" "You’re ready to start using your tablet" "System navigation settings" @@ -84,7 +86,8 @@ "Screenshot" "Split" "Tap another app to use split-screen" - "App does not support split-screen." + + "This action isn\'t allowed by the app or your organisation" "Skip navigation tutorial?" "You can find this later in the %1$s app" diff --git a/quickstep/res/values-en-rCA/strings.xml b/quickstep/res/values-en-rCA/strings.xml index ab0a8e9a4b..f6498c3be2 100644 --- a/quickstep/res/values-en-rCA/strings.xml +++ b/quickstep/res/values-en-rCA/strings.xml @@ -25,18 +25,18 @@ "App usage settings" "Clear all" "Recent apps" - "Task closed" + "Task Closed" "%1$s, %2$s" "< 1 minute" "%1$s left today" "App suggestions" "Your predicted apps" - "Get app suggestions on the bottom row of your home screen" - "Get app suggestions on the favourites row of your home screen" - "Easily access your most-used apps directly from the home screen. Suggestions will change based on your routines. Apps on the bottom row will move up to your home screen." - "Easily access your most-used apps directly from the home screen. Suggestions will change based on your routines. Apps in the favourites row will move to your home screen." + "Get app suggestions on the bottom row of your Home screen" + "Get app suggestions on favorites row of your Home screen" + "Easily access your most-used apps right on the Home screen. Suggestions will change based on your routines. Apps on the bottom row will move up to your Home screen." + "Easily access your most-used apps right on the Home screen. Suggestions will change based on your routines. Apps in favorites row will move to your Home screen." "Get app suggestions" - "No, thanks" + "No thanks" "Settings" "Most-used apps appear here, and change based on routines" "Drag apps off the bottom row to get app suggestions" @@ -44,47 +44,50 @@ "App suggestions enabled" "App suggestions are disabled" "Predicted app: %1$s" - "Make sure that you swipe from the far-right or far-left edge." - "Make sure that you swipe from the right or left edge to the middle of the screen and let go." - "You learned how to swipe from the right to go back. Next, learn how to switch apps." + "Make sure you swipe from the far-right or far-left edge." + "Make sure you swipe from the right or left edge to the middle of the screen and let go." + "You learned how to swipe from the right to go back. Next up, learn how to switch apps." "You completed the go back gesture." - "Make sure that you don\'t swipe too close to the bottom of the screen." - "To change sensitivity of the back gesture, go to Settings" + "Make sure you don\'t swipe too close to the bottom of the screen." + "To change the sensitivity of the back gesture, go to Settings" "Swipe to go back" "To go back to the last screen, swipe from the left or right edge to the middle of the screen." - "To go back to the last screen, swipe with two fingers from the left or right edge to the middle of the screen." - "Make sure that you swipe up from the bottom edge of the screen." - "Make sure that you don\'t pause before letting go." - "Make sure that you swipe straight up." - "You completed the go home gesture. Next, learn how to go back." - "You completed the go home gesture." + "To go back to the last screen, swipe with 2 fingers from the left or right edge to the middle of the screen." + "Make sure you swipe up from the bottom edge of the screen." + "Make sure you don\'t pause before letting go." + "Make sure you swipe straight up." + "You completed the go Home gesture. Next up, learn how to go back." + "You completed the go Home gesture." "Swipe to go home" - "Swipe up from the bottom of your screen. This gesture always takes you to the home screen." - "Swipe up with two fingers from the bottom of the screen. This gesture always takes you to the home screen." - "Make sure that you swipe up from the bottom edge of the screen." + "Swipe up from the bottom of your screen. This gesture always takes you to the Home screen." + "Swipe up with 2 fingers from the bottom of the screen. This gesture always takes you to the Home screen." + "Make sure you swipe up from the bottom edge of the screen." "Try holding the window for longer before releasing." - "Make sure that you swipe straight up, then pause." + "Make sure you swipe straight up, then pause." "You learned how to use gestures. To turn off gestures, go to Settings." "You completed the switch apps gesture." "Swipe to switch apps" "To switch between apps, swipe up from the bottom of your screen, hold, then release." - "To switch between apps, swipe up with two fingers from the bottom of your screen, hold, then release." + "To switch between apps, swipe up with 2 fingers from the bottom of your screen, hold, then release." "All set" "Done" "Settings" "Try again" "Nice!" "Tutorial %1$d/%2$d" - "Ready!" - "Swipe up to go home" + "All set!" + "Swipe up to go Home" + + "You’re ready to start using your phone" "You’re ready to start using your tablet" "System navigation settings" "Share" "Screenshot" "Split" - "Tap another app to use split-screen" - "App does not support split-screen." + "Tap another app to use splitscreen" + + "This action isn\'t allowed by the app or your organization" "Skip navigation tutorial?" "You can find this later in the %1$s app" diff --git a/quickstep/res/values-en-rGB/strings.xml b/quickstep/res/values-en-rGB/strings.xml index 5b378b41ac..19b0c3c65c 100644 --- a/quickstep/res/values-en-rGB/strings.xml +++ b/quickstep/res/values-en-rGB/strings.xml @@ -77,6 +77,8 @@ "Tutorial %1$d/%2$d" "Ready!" "Swipe up to go home" + + "You’re ready to start using your phone" "You’re ready to start using your tablet" "System navigation settings" @@ -84,7 +86,8 @@ "Screenshot" "Split" "Tap another app to use split-screen" - "App does not support split-screen." + + "This action isn\'t allowed by the app or your organisation" "Skip navigation tutorial?" "You can find this later in the %1$s app" diff --git a/quickstep/res/values-en-rIN/strings.xml b/quickstep/res/values-en-rIN/strings.xml index 5b378b41ac..19b0c3c65c 100644 --- a/quickstep/res/values-en-rIN/strings.xml +++ b/quickstep/res/values-en-rIN/strings.xml @@ -77,6 +77,8 @@ "Tutorial %1$d/%2$d" "Ready!" "Swipe up to go home" + + "You’re ready to start using your phone" "You’re ready to start using your tablet" "System navigation settings" @@ -84,7 +86,8 @@ "Screenshot" "Split" "Tap another app to use split-screen" - "App does not support split-screen." + + "This action isn\'t allowed by the app or your organisation" "Skip navigation tutorial?" "You can find this later in the %1$s app" diff --git a/quickstep/res/values-en-rXC/strings.xml b/quickstep/res/values-en-rXC/strings.xml index f0b2066d3f..55b99c862c 100644 --- a/quickstep/res/values-en-rXC/strings.xml +++ b/quickstep/res/values-en-rXC/strings.xml @@ -77,6 +77,8 @@ "‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‎‏‎‎‎‏‏‎‏‏‏‏‏‏‎‏‏‎‎‎‏‏‏‎‎‎‎‏‎‏‎‏‏‎‏‏‎‏‎‏‏‎‎‏‎‏‎‏‏‎‏‏‏‎‎‎‎‎‏‎‎‏‏‎‎‏‎‏‏‏‏‏‎‏‎‎‎‎Tutorial ‎‏‎‎‏‏‎%1$d‎‏‎‎‏‏‏‎/‎‏‎‎‏‏‎%2$d‎‏‎‎‏‏‏‎‎‏‎‎‏‎" "‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‎‏‎‎‎‏‏‎‏‏‏‏‏‏‏‏‏‎‎‎‏‎‏‏‎‏‎‏‏‏‎‏‎‏‎‎‎‎‎‎‎‎‏‏‎‏‎‎‏‏‎‎‏‎‎‎‏‏‎‏‎‏‎‎‏‎‏‏‎‎‎‏‎‏‏‎‎‏‏‎All set!‎‏‎‎‏‎" "‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‎‏‎‎‎‏‏‎‏‏‏‏‏‏‏‎‏‎‎‎‎‏‎‎‎‏‎‏‏‏‏‏‏‎‏‎‏‏‎‎‎‏‎‎‏‏‎‎‎‎‏‎‏‏‎‎‎‏‏‏‏‎‎‎‎‎‏‏‏‏‏‎‏‏‏‏‏‏‎Swipe up to go Home‎‏‎‎‏‎" + + "‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‎‏‎‎‎‏‏‎‏‏‏‏‏‏‏‏‏‎‏‏‎‎‎‎‎‏‎‎‎‎‎‏‏‎‏‏‏‏‎‏‏‎‎‏‎‎‏‎‎‎‏‏‏‎‏‎‏‎‎‎‏‎‎‏‎‏‏‎‏‏‎‏‎‎‏‎‏‎‎‎You’re ready to start using your phone‎‏‎‎‏‎" "‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‎‏‎‎‎‏‏‎‏‏‏‏‏‏‏‏‏‏‎‎‏‎‏‏‏‎‎‎‎‎‎‏‎‏‏‏‏‏‏‎‎‎‏‎‎‎‎‎‏‏‎‏‎‎‏‏‎‎‎‎‏‏‏‏‎‎‎‎‏‏‏‏‏‎‎‏‏‏‏‎You’re ready to start using your tablet‎‏‎‎‏‎" "‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‎‏‎‎‎‏‏‎‏‏‏‏‏‏‏‏‏‎‎‎‎‎‏‎‏‏‎‏‎‎‏‎‏‏‎‎‎‎‎‏‎‎‎‎‏‎‎‎‎‏‏‎‏‎‏‎‎‎‎‎‏‏‎‎‎‎‏‎‏‏‏‏‎‏‏‏‎‏‏‎‎‏‎‎‏‏‎""‎‏‎‎‏‏‏‎System navigation settings‎‏‎‎‏‏‎""‎‏‎‎‏‏‏‎‎‏‎‎‏‎" @@ -84,7 +86,8 @@ "‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‎‏‎‎‎‏‏‎‏‏‏‏‏‏‏‏‏‏‏‎‎‎‏‎‏‏‎‎‏‎‏‏‎‏‎‏‎‏‏‏‎‏‎‏‎‏‎‏‎‏‎‎‏‏‎‎‏‏‎‎‏‏‎‎‏‎‎‎‎‏‏‏‏‎‎‎‏‎‏‎Screenshot‎‏‎‎‏‎" "‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‎‏‎‎‎‏‏‎‏‏‏‏‏‏‎‏‏‏‏‎‏‎‎‎‏‏‏‎‏‏‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‏‏‏‏‎‎‏‎‎‏‎‎‎‏‎‎‏‏‏‏‎‎‏‎‏‏‎‏‎‏‎‎‎Split‎‏‎‎‏‎" "‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‎‏‎‎‎‏‏‎‏‏‏‏‏‏‏‏‏‎‎‏‎‏‏‏‎‏‏‎‎‎‎‎‎‎‎‎‏‏‎‎‎‏‎‎‏‎‏‏‎‎‏‏‎‏‎‏‎‎‎‏‎‏‎‏‏‎‏‏‎‏‎‎‎‏‏‎‎‎‎‎Tap another app to use splitscreen‎‏‎‎‏‎" - "‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‎‏‎‎‎‏‏‎‏‏‏‏‏‏‏‎‏‎‏‏‎‏‎‏‏‎‎‏‏‎‏‏‎‎‏‎‏‏‏‎‎‏‎‏‏‏‎‎‎‎‏‏‏‎‏‏‏‎‏‎‎‏‎‎‎‏‎‎‎‏‏‎‎‏‎‎‏‎‎App does not support split-screen.‎‏‎‎‏‎" + + "‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‎‏‎‎‎‏‏‎‏‏‏‏‏‏‎‏‏‏‏‎‎‏‎‏‏‏‏‏‏‎‎‎‏‏‎‎‎‎‏‎‎‏‏‎‎‏‏‏‎‏‎‏‏‏‎‎‎‎‎‎‎‎‏‏‏‏‏‏‏‎‎‏‎‏‎‏‎‎This action isn\'t allowed by the app or your organization‎‏‎‎‏‎" "‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‎‏‎‎‎‏‏‎‏‏‏‏‏‏‏‎‏‎‎‏‎‏‏‏‎‏‎‎‏‏‎‏‏‎‏‏‏‎‎‎‎‎‎‎‏‏‏‎‎‏‏‎‏‏‎‏‏‎‎‎‎‎‏‎‎‏‏‎‎‏‎‎‏‏‏‎‏‎‎Skip navigation tutorial?‎‏‎‎‏‎" "‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‎‏‎‎‎‏‏‎‏‏‏‏‏‎‏‏‏‏‏‏‎‎‎‏‏‎‎‏‏‏‎‎‏‏‎‏‎‏‏‎‏‏‎‎‏‏‎‏‏‏‏‏‏‏‏‏‎‎‎‎‎‎‏‏‏‏‏‎‏‎‎‏‏‏‎‎You can find this later in the ‎‏‎‎‏‏‎%1$s‎‏‎‎‏‏‏‎ app‎‏‎‎‏‎" diff --git a/quickstep/res/values-es-rUS/strings.xml b/quickstep/res/values-es-rUS/strings.xml index b9bb70f36f..7bb40e9ebf 100644 --- a/quickstep/res/values-es-rUS/strings.xml +++ b/quickstep/res/values-es-rUS/strings.xml @@ -77,6 +77,8 @@ "Instructivo %1$d/%2$d" "Todo listo" "Desliza el dedo hacia arriba para ir a la pantalla principal" + + "Ya puedes empezar a usar tu teléfono" "Ya puedes empezar a usar tu tablet" "Configuración de navegación del sistema" @@ -84,7 +86,8 @@ "Captura de pantalla" "Pantalla dividida" "Presiona otra app para usar la pantalla dividida" - "La app no es compatible con la función de pantalla dividida." + + "La app o tu organización no permiten realizar esta acción" "¿Omitir el instructivo de navegación?" "Puedes encontrarlo en la app de %1$s" diff --git a/quickstep/res/values-es/strings.xml b/quickstep/res/values-es/strings.xml index f3d7a31623..6610768d77 100644 --- a/quickstep/res/values-es/strings.xml +++ b/quickstep/res/values-es/strings.xml @@ -77,6 +77,8 @@ "Tutorial %1$d/%2$d" "¡Ya está!" "Desliza el dedo hacia arriba para ir a la pantalla de inicio" + + "Ya puedes empezar a usar tu teléfono" "Ya puedes empezar a usar tu tablet" "Ajustes de navegación del sistema" @@ -84,7 +86,8 @@ "Hacer captura" "Dividir" "Toca otra aplicación para usar la pantalla dividida" - "La aplicación no admite la pantalla dividida." + + "No puedes hacerlo porque la aplicación o tu organización no lo permiten" "¿Saltar tutorial de navegación?" "Puedes consultarlo en otro momento en la aplicación %1$s" diff --git a/quickstep/res/values-et/strings.xml b/quickstep/res/values-et/strings.xml index 73c1c1da38..67f4e1c04e 100644 --- a/quickstep/res/values-et/strings.xml +++ b/quickstep/res/values-et/strings.xml @@ -77,6 +77,8 @@ "Õpetus %1$d/%2$d" "Valmis!" "Avakuvale liikumiseks pühkige üles" + + "Olete valmis oma telefoni kasutama." "Olete valmis oma tahvelarvutit kasutama" "Süsteemi navigeerimisseaded" @@ -84,7 +86,8 @@ "Ekraanipilt" "Eralda" "Jagatud kuva kasutamiseks puudutage muud rakendust" - "Rakendus ei toeta jagatud ekraani." + + "Rakendus või teie organisatsioon on selle toimingu keelanud" "Kas jätta navigeerimise õpetused vahele?" "Leiate selle hiljem rakendusest %1$s" diff --git a/quickstep/res/values-eu/strings.xml b/quickstep/res/values-eu/strings.xml index 5b83633565..0185bb9202 100644 --- a/quickstep/res/values-eu/strings.xml +++ b/quickstep/res/values-eu/strings.xml @@ -77,6 +77,8 @@ "Tutoriala: %1$d/%2$d" "Dena prest!" "Pasatu hatza gora hasierako pantailara joateko" + + "Prest zaude telefonoa erabiltzen hasteko" "Prest zaude tableta erabiltzen hasteko" "Sisteman nabigatzeko ezarpenak" @@ -84,7 +86,8 @@ "Atera pantaila-argazki bat" "Zatitu" "Sakatu beste aplikazio bat pantaila zatitzeko" - "Aplikazioak ez du onartzen pantaila zatitua." + + "Aplikazioak edo erakundeak ez du eman ekintza hori gauzatzeko baimena" "Nabigazio-tutoriala saltatu nahi duzu?" "%1$s aplikazioan dago eskuragarri tutoriala" diff --git a/quickstep/res/values-fa/strings.xml b/quickstep/res/values-fa/strings.xml index a64a876980..44c9975f3f 100644 --- a/quickstep/res/values-fa/strings.xml +++ b/quickstep/res/values-fa/strings.xml @@ -77,6 +77,8 @@ "آموزش گام‌به‌گام %1$d/%2$d" "همه چیز آماده است!" "برای رفتن به «صفحه اصلی»، تند به‌بالا بکشید" + + "آماده‌اید از تلفنتان استفاده کنید" "آماده‌اید از رایانه لوحی‌تان استفاده کنید" "تنظیمات پیمایش سیستم" @@ -84,7 +86,8 @@ "نماگرفت" "دونیمه" "برای استفاده از صفحهٔ دونیمه، روی برنامه دیگری ضربه بزنید" - "برنامه از صفحهٔ دونیمه پشتیبانی نمی‌کند." + + "برنامه یا سازمان شما اجازه نمی‌دهد این کنش انجام شود." "آموزش گام‌به‌گام پیمایش رد شود؟" "می‌توانید آن را بعداً در برنامه %1$s پیدا کنید" diff --git a/quickstep/res/values-fi/strings.xml b/quickstep/res/values-fi/strings.xml index 08a9248692..adff666707 100644 --- a/quickstep/res/values-fi/strings.xml +++ b/quickstep/res/values-fi/strings.xml @@ -77,6 +77,8 @@ "Ohje %1$d/%2$d" "Valmis" "Siirry aloitusnäytölle pyyhkäisemällä ylös" + + "Olet valmis aloittamaan puhelimen käytön" "Olet valmis aloittamaan tabletin käytön" "Järjestelmän navigointiasetukset" @@ -84,7 +86,8 @@ "Kuvakaappaus" "Jaa" "Avaa jaettu näyttö napauttamalla toista sovellusta" - "Sovellus ei tue jaetun näytön tilaa." + + "Sovellus tai organisaatio ei salli tätä toimintoa" "Ohitetaanko navigointiohje?" "Löydät tämän myöhemmin sovelluksesta: %1$s" diff --git a/quickstep/res/values-fr-rCA/strings.xml b/quickstep/res/values-fr-rCA/strings.xml index 6199a1421a..63f1a1a337 100644 --- a/quickstep/res/values-fr-rCA/strings.xml +++ b/quickstep/res/values-fr-rCA/strings.xml @@ -77,6 +77,8 @@ "Étape %1$d sur %2$d du tutoriel" "Tout est prêt!" "Balayez l\'écran vers le haut pour accéder à l\'écran d\'accueil" + + "Vous êtes maintenant prêt à utiliser votre téléphone" "Vous êtes maintenant prêt à utiliser votre tablette" "Paramètres de navigation du système" @@ -84,7 +86,8 @@ "Capture d\'écran" "Séparé" "Touchez une autre appli pour partager l\'écran" - "L\'appli n\'est pas compatible avec l\'écran partagé." + + "L\'application ou votre organisation n\'autorise pas cette action" "Ignorer le tutoriel sur la navigation?" "Vous trouverez le tutoriel dans l\'application %1$s" diff --git a/quickstep/res/values-fr/strings.xml b/quickstep/res/values-fr/strings.xml index c66da27883..5eccc91df1 100644 --- a/quickstep/res/values-fr/strings.xml +++ b/quickstep/res/values-fr/strings.xml @@ -77,6 +77,8 @@ "Tutoriel %1$d sur %2$d" "Tout est prêt !" "Balayez l\'écran vers le haut pour revenir à l\'accueil" + + "Vous pouvez maintenant utiliser votre téléphone" "Vous pouvez maintenant utiliser votre tablette" "Paramètres de navigation système" @@ -84,7 +86,8 @@ "Capture d\'écran" "Partager" "Appuyez sur autre appli pour utiliser écran partagé" - "Appli incompatible avec l\'écran partagé." + + "Cette action n\'est pas autorisée par l\'application ou par votre organisation" "Ignorer le tutoriel de navigation ?" "Vous le retrouverez dans l\'appli %1$s" diff --git a/quickstep/res/values-gl/strings.xml b/quickstep/res/values-gl/strings.xml index 9946f17b4b..95c8761c98 100644 --- a/quickstep/res/values-gl/strings.xml +++ b/quickstep/res/values-gl/strings.xml @@ -77,6 +77,8 @@ "Titorial %1$d/%2$d" "Todo listo" "Pasa o dedo cara arriba para ir á pantalla de inicio" + + "Xa podes comezar a utilizar o teléfono" "Todo está listo para comezar a utilizar a tableta" "Configuración da navegación do sistema" @@ -84,7 +86,8 @@ "Facer captura" "Dividir" "Para usar a pantalla dividida, toca outra app" - "A app non admite a función de pantalla dividida." + + "A aplicación ou a túa organización non permite realizar esta acción" "Queres omitir o titorial de navegación?" "Podes atopalo máis tarde na aplicación %1$s" diff --git a/quickstep/res/values-gu/strings.xml b/quickstep/res/values-gu/strings.xml index 3439410d37..051077da0d 100644 --- a/quickstep/res/values-gu/strings.xml +++ b/quickstep/res/values-gu/strings.xml @@ -77,6 +77,8 @@ "ટ્યૂટૉરિઅલ %1$d/%2$d" "બધું સેટ થઈ ગયું!" "હોમપેજ પર જવા માટે ઉપરની તરફ સ્વાઇપ કરો" + + "તમે તમારા ફોનનો ઉપયોગ કરવા માટે તૈયાર છો" "તમે તમારા ટૅબ્લેટનો ઉપયોગ કરવા માટે તૈયાર છો" "સિસ્ટમના નૅવિગેશન સેટિંગ" @@ -84,7 +86,8 @@ "સ્ક્રીનશૉટ" "વિભાજિત કરો" "સ્પલિટસ્ક્રીનના વપરાશ માટે, કોઈ અન્ય ઍપ પર ટૅપ કરો" - "ઍપ સ્ક્રીન-વિભાજનને સપોર્ટ કરતી નથી." + + "ઍપ કે તમારી સંસ્થા દ્વારા આ ક્રિયા કરવાની મંજૂરી નથી" "નૅવિગેશન ટ્યૂટૉરિઅલ છોડી દઈએ?" "તમે આને પછીથી %1$s ઍપમાં જોઈ શકો છો" diff --git a/quickstep/res/values-hi/strings.xml b/quickstep/res/values-hi/strings.xml index be5a2776b4..434845ff8f 100644 --- a/quickstep/res/values-hi/strings.xml +++ b/quickstep/res/values-hi/strings.xml @@ -77,6 +77,8 @@ "ट्यूटोरियल %1$d/%2$d" "हो गया!" "होम स्क्रीन पर जाने के लिए, ऊपर की ओर स्वाइप करें" + + "अब आपका फ़ोन, इस्तेमाल के लिए तैयार है" "आप टैबलेट को इस्तेमाल करने के लिए तैयार हैं" "सिस्टम नेविगेशन सेटिंग" @@ -84,7 +86,8 @@ "स्क्रीनशॉट लें" "स्प्लिट स्क्रीन मोड" "स्प्लिट स्क्रीन मोड के लिए, दूसरे ऐप पर टैप करें" - "यह ऐप्लिकेशन, स्प्लिट स्क्रीन पर काम नहीं करता है." + + "ऐप्लिकेशन या आपका संगठन इस कार्रवाई की अनुमति नहीं देता" "क्या आपको नेविगेशन ट्यूटोरियल छोड़ना है?" "इसे बाद में %1$s ऐप्लिकेशन पर देखा जा सकता है" diff --git a/quickstep/res/values-hr/strings.xml b/quickstep/res/values-hr/strings.xml index 620ba51788..681105e3d3 100644 --- a/quickstep/res/values-hr/strings.xml +++ b/quickstep/res/values-hr/strings.xml @@ -77,6 +77,8 @@ "Vodič %1$d/%2$d" "Sve je spremno!" "Prijeđite prstom prema gore da biste otvorili početni zaslon" + + "Spremni ste za početak upotrebe telefona" "Spremni ste za početak upotrebe tableta" "Postavke navigacije sustavom" @@ -84,7 +86,8 @@ "Snimka zaslona" "Podijeli" "Dodirnite drugu aplikaciju za podijeljeni zaslon" - "Aplikacija ne podržava podijeljeni zaslon." + + "Aplikacija ili vaša organizacija ne dopuštaju ovu radnju" "Želite li preskočiti vodič za kretanje?" "Kasnije ga možete pronaći u aplikaciji %1$s" diff --git a/quickstep/res/values-hu/strings.xml b/quickstep/res/values-hu/strings.xml index 61f0a3b31a..46e4b2bd69 100644 --- a/quickstep/res/values-hu/strings.xml +++ b/quickstep/res/values-hu/strings.xml @@ -77,6 +77,8 @@ "Útmutató (%2$d/%1$d.)" "Kész is!" "Felfelé csúsztatva megjelenik a Kezdőképernyő" + + "Készen áll a telefon használatára" "Készen áll a táblagép használatára" "Rendszer-navigációs beállítások" @@ -84,7 +86,8 @@ "Képernyőkép" "Felosztás" "Koppintson másik appra a képernyőmegosztáshoz" - "Az alkalmazás nem támogatja az osztott képernyőt." + + "Az alkalmazás vagy az Ön szervezete nem engedélyezi ezt a műveletet" "Kihagyja a navigáció bemutatóját?" "Ezt később megtalálhatja a(z) %1$s alkalmazásban" diff --git a/quickstep/res/values-hy/strings.xml b/quickstep/res/values-hy/strings.xml index 0f9356a42d..cc49954127 100644 --- a/quickstep/res/values-hy/strings.xml +++ b/quickstep/res/values-hy/strings.xml @@ -77,6 +77,8 @@ "Ուղեցույց %1$d/%2$d" "Պատրաստ է" "Մատը սահեցրեք վերև՝ հիմնական էկրան անցնելու համար" + + "Դուք արդեն կարող եք օգտագործել ձեր հեռախոսը" "Դուք արդեն կարող եք օգտագործել ձեր պլանշետը" "Նավիգացիայի համակարգային կարգավորումներ" @@ -84,7 +86,8 @@ "Սքրինշոթ անել" "Տրոհել" "Հպեք այլ հավելվածի՝ էկրանը տրոհելու համար" - "Հավելվածը չի աջակցում էկրանի տրոհումը։" + + "Այս գործողությունն արգելված է հավելվածի կամ ձեր կազմակերպության կողմից" "Բաց թողնե՞լ նավիգացիայի ուղեցույցը" "Հետագայում սա կարող եք գտնել «%1$s» հավելվածում" diff --git a/quickstep/res/values-in/strings.xml b/quickstep/res/values-in/strings.xml index b95871f9f6..9012ba6cd9 100644 --- a/quickstep/res/values-in/strings.xml +++ b/quickstep/res/values-in/strings.xml @@ -77,6 +77,8 @@ "Tutorial %1$d/%2$d" "Semua siap." "Geser ke atas untuk beralih ke Layar utama" + + "Anda sudah siap untuk mulai menggunakan ponsel" "Anda sudah siap untuk mulai menggunakan tablet" "Setelan navigasi sistem" @@ -84,7 +86,8 @@ "Screenshot" "Pisahkan" "Ketuk aplikasi lain untuk menggunakan layar terpisah" - "Aplikasi tidak mendukung layar terpisah." + + "Tindakan ini tidak diizinkan oleh aplikasi atau organisasi Anda" "Lewati tutorial gestur?" "Anda dapat menemukan tutorial ini di lain waktu di aplikasi %1$s" diff --git a/quickstep/res/values-is/strings.xml b/quickstep/res/values-is/strings.xml index 5730900804..d7f2075cfe 100644 --- a/quickstep/res/values-is/strings.xml +++ b/quickstep/res/values-is/strings.xml @@ -77,6 +77,8 @@ "Leiðsögn %1$d/%2$d" "Allt tilbúið!" "Strjúktu upp til að fara á heimaskjáinn" + + "Þú getur byrjað að nota símann" "Þú getur byrjað að nota spjaldtölvuna" "Stillingar kerfisstjórnunar" @@ -84,7 +86,8 @@ "Skjámynd" "Skipta" "Ýttu á annað forrit til að nota skjáskiptingu" - "Forritið styður ekki að skjánum sé skipt." + + "Forritið eða fyrirtækið leyfir ekki þessa aðgerð" "Sleppa flettileiðsögn?" "Þú getur fundið þetta síðar í forritinu %1$s" diff --git a/quickstep/res/values-it/strings.xml b/quickstep/res/values-it/strings.xml index 7e04cf66ab..7df4dee155 100644 --- a/quickstep/res/values-it/strings.xml +++ b/quickstep/res/values-it/strings.xml @@ -77,6 +77,8 @@ "Tutorial %1$d/%2$d" "Finito." "Scorri verso l\'alto per andare alla schermata Home" + + "Puoi iniziare a usare il tuo telefono" "Puoi iniziare a usare il tuo tablet" "Impostazioni Navigazione del sistema" @@ -84,7 +86,8 @@ "Screenshot" "Dividi" "Tocca un\'altra app per usare lo schermo diviso" - "L\'app non supporta la modalità Schermo diviso." + + "Questa azione non è consentita dall\'app o dall\'organizzazione" "Saltare il tutorial di navigazione?" "Puoi trovarlo in un secondo momento nell\'app %1$s" diff --git a/quickstep/res/values-iw/strings.xml b/quickstep/res/values-iw/strings.xml index 56148e79ff..899011a35a 100644 --- a/quickstep/res/values-iw/strings.xml +++ b/quickstep/res/values-iw/strings.xml @@ -77,6 +77,8 @@ "מדריך %1$d/%2$d" "הכול מוכן!" "כדי לעבור לדף הבית, מחליקים כלפי מעלה" + + "הכול מוכן ואפשר להתחיל להשתמש בטלפון" "הכול מוכן ואפשר להתחיל להשתמש בטאבלט" "הגדרות הניווט של המערכת" @@ -84,7 +86,8 @@ "צילום מסך" "פיצול" "צריך להקיש על אפליקציה אחרת כדי להשתמש במסך מפוצל" - "האפליקציה אינה תומכת במסך מפוצל." + + "האפליקציה או הארגון שלך אינם מתירים את הפעולה הזאת" "לדלג על המדריך לניווט?" "ניתן למצוא את המדריך מאוחר יותר באפליקציה %1$s" diff --git a/quickstep/res/values-ja/strings.xml b/quickstep/res/values-ja/strings.xml index 013939f900..3614e2db4d 100644 --- a/quickstep/res/values-ja/strings.xml +++ b/quickstep/res/values-ja/strings.xml @@ -77,6 +77,8 @@ "チュートリアル %1$d/%2$d" "設定完了" "ホームに移動するには上にスワイプします" + + "スマートフォンを使用する準備ができました" "これでタブレットが使えるようになりました" "システム ナビゲーションの設定" @@ -84,7 +86,8 @@ "スクリーンショット" "分割" "分割画面を使用するには、他のアプリをタップします" - "アプリで分割画面がサポートされていません。" + + "この操作はアプリまたは組織で許可されていません" "操作チュートリアルをスキップしますか?" "チュートリアルは後から %1$s アプリで確認できます" diff --git a/quickstep/res/values-ka/strings.xml b/quickstep/res/values-ka/strings.xml index d54ac881c3..b862c6f5d8 100644 --- a/quickstep/res/values-ka/strings.xml +++ b/quickstep/res/values-ka/strings.xml @@ -77,6 +77,8 @@ "სახელმძღვანელო %1$d/%2$d" "მზადაა!" "მთავარ გვერდზე გადასასვლელად გადაფურცლეთ ზევით" + + "მზად ხართ ტელეფონის გამოსაყენებლად" "მზად ხართ ტაბლეტის გამოსაყენებლად" "სისტემის ნავიგაციის პარამეტრები" @@ -84,7 +86,8 @@ "ეკრანის ანაბეჭდი" "გაყოფა" "შეეხეთ სხვა აპს ეკრანის გასაყოფად" - "ეკრანის გაყოფა არ არის მხარდაჭერილი აპის მიერ." + + "ეს მოქმედება არ არის დაშვებული აპის ან თქვენი ორგანიზაციის მიერ" "გსურთ, გამოტოვოთ ნავიგაციის სახელმძღვანელო?" "ამის მოგვიანებით პოვნა %1$s აპში შეგიძლიათ" diff --git a/quickstep/res/values-kk/strings.xml b/quickstep/res/values-kk/strings.xml index bfa2a5cf37..8f42ff6c53 100644 --- a/quickstep/res/values-kk/strings.xml +++ b/quickstep/res/values-kk/strings.xml @@ -77,6 +77,8 @@ "Оқулық: %1$d/%2$d" "Бәрі дайын!" "Негізгі экранға өту үшін жоғары қарай сырғытыңыз." + + "Телефоныңыз пайдалануға дайын." "Планшетіңіз пайдалануға дайын." "Навигацияның жүйелік параметрлері" @@ -84,7 +86,8 @@ "Скриншот" "Бөлу" "Экранды бөлу режимін пайдалану үшін басқа қолданбаны түртіңіз." - "Қолданбада экранды бөлу мүмкін емес." + + "Бұл әрекетке қолданба не ұйым рұқсат етпейді." "Қимылдар оқулығын өткізіп жіберу керек пе?" "Мұны кейін %1$s қолданбасынан таба аласыз." diff --git a/quickstep/res/values-km/strings.xml b/quickstep/res/values-km/strings.xml index 4a78d9d79a..d1ed52899b 100644 --- a/quickstep/res/values-km/strings.xml +++ b/quickstep/res/values-km/strings.xml @@ -77,6 +77,8 @@ "មេរៀនទី %1$d/%2$d" "រួចហើយ!" "អូសឡើងលើ ដើម្បី​ទៅកាន់​អេក្រង់ដើម" + + "អ្នក​អាច​ចាប់ផ្ដើម​ប្រើ​ទូរសព្ទ​របស់អ្នក​បានហើយ" "អ្នកអាចចាប់ផ្ដើមប្រើថេប្លេតរបស់អ្នកបានហើយ" "ការកំណត់​ការរុករក​ប្រព័ន្ធ" @@ -84,7 +86,8 @@ "រូបថតអេក្រង់" "បំបែក" "ចុចកម្មវិធី​ផ្សេងទៀត ដើម្បីប្រើមុខងារ​បំបែកអេក្រង់" - "កម្មវិធីមិនអាចប្រើមុខងារ​បំបែកអេក្រង់បានទេ។" + + "សកម្មភាពនេះ​មិនត្រូវបានអនុញ្ញាតដោយកម្មវិធី​ ឬ​ស្ថាប័ន​របស់អ្នកទេ" "រំលង​មេរៀន​អំពី​ការរុករក​ឬ?" "អ្នកអាចស្វែងរកមេរៀននេះនៅពេលក្រោយក្នុងកម្មវិធី %1$s" diff --git a/quickstep/res/values-kn/strings.xml b/quickstep/res/values-kn/strings.xml index 91a12f86b7..99fb8ba089 100644 --- a/quickstep/res/values-kn/strings.xml +++ b/quickstep/res/values-kn/strings.xml @@ -77,6 +77,8 @@ "ಟ್ಯುಟೋರಿಯಲ್ %1$d/%2$d" "ಎಲ್ಲವೂ ಸಿದ್ಧವಾಗಿದೆ!" "ಮುಖಪುಟಕ್ಕೆ ಹೋಗಲು ಮೇಲಕ್ಕೆ ಸ್ವೈಪ್ ಮಾಡಿ" + + "ನಿಮ್ಮ ಫೋನ್ ಬಳಸುವುದನ್ನು ಪ್ರಾರಂಭಿಸಲು ನೀವು ಸಿದ್ದರಾಗಿರುವಿರಿ" "ನಿಮ್ಮ ಟ್ಯಾಬ್ಲೆಟ್‌‌ ಬಳಸುವುದನ್ನು ಪ್ರಾರಂಭಿಸಲು ನೀವು ಸಿದ್ದರಾಗಿರುವಿರಿ" "ಸಿಸ್ಟಂ ನ್ಯಾವಿಗೇಶನ್ ಸೆಟ್ಟಿಂಗ್‌ಗಳು" @@ -84,7 +86,8 @@ "ಸ್ಕ್ರೀನ್‌ಶಾಟ್" "ವಿಭಜಿಸಿ" "ಸ್ಪ್ಲಿಟ್ ಸ್ಕ್ರೀನ್ ಅನ್ನು ಬಳಸಲು ಬೇರೊಂದು ಆ್ಯಪ್ ಮೇಲೆ ಟ್ಯಾಪ್ ಮಾಡಿ" - "ಸ್ಪ್ಲಿಟ್ ಸ್ಕ್ರೀನ್ ಅನ್ನು ಆ್ಯಪ್ ಬೆಂಬಲಿಸುವುದಿಲ್ಲ." + + "ಆ್ಯಪ್ ಅಥವಾ ನಿಮ್ಮ ಸಂಸ್ಥೆಯು ಈ ಕ್ರಿಯೆಯನ್ನು ಅನುಮತಿಸುವುದಿಲ್ಲ" "ನ್ಯಾವಿಗೇಶನ್ ಟ್ಯುಟೋರಿಯಲ್ ಸ್ಕಿಪ್ ಮಾಡಬೇಕೇ?" "%1$s ಆ್ಯಪ್‌ನಲ್ಲಿ ಇದನ್ನು ನಂತರ ಕಾಣಬಹುದು" diff --git a/quickstep/res/values-ko/strings.xml b/quickstep/res/values-ko/strings.xml index bfe98f9780..8af2ef782e 100644 --- a/quickstep/res/values-ko/strings.xml +++ b/quickstep/res/values-ko/strings.xml @@ -77,6 +77,8 @@ "튜토리얼 %1$d/%2$d" "설정 완료" "위로 스와이프하여 홈으로 이동" + + "휴대전화를 사용할 준비가 되었습니다." "태블릿을 사용할 준비가 되었습니다." "시스템 탐색 설정" @@ -84,7 +86,8 @@ "스크린샷" "분할" "다른 앱을 탭하여 화면 분할 사용" - "앱이 화면 분할을 지원하지 않습니다." + + "이 작업은 앱 또는 조직에서 허용되지 않습니다." "이동 방법 튜토리얼을 건너뛰시겠습니까?" "이 튜토리얼은 %1$s 앱에서 다시 볼 수 있습니다." diff --git a/quickstep/res/values-ky/strings.xml b/quickstep/res/values-ky/strings.xml index 5472eadc8b..b7721f4d91 100644 --- a/quickstep/res/values-ky/strings.xml +++ b/quickstep/res/values-ky/strings.xml @@ -77,6 +77,8 @@ "Үйрөткүч: %1$d/%2$d" "Бүттү!" "Башкы бетке өтүү үчүн экранды өйдө сүрүңүз" + + "Телефонуңузду колдоно берсеңиз болот" "Планшетиңизди колдоно берсеңиз болот" "Өтүү аракетинин системалык параметрлери" @@ -84,7 +86,8 @@ "Скриншот" "Бөлүү" "Экранды бөлүү үчүн башка колдонмону таптап коюңуз" - "Колдонмодо экран бөлүнбөйт." + + "Бул аракетти аткарууга колдонмо же ишканаңыз тыюу салган" "Жаңсоолор үйрөткүчүн өткөрүп жибересизби?" "Аны кийин %1$s колдонмосунан табасыз" diff --git a/quickstep/res/values-lo/strings.xml b/quickstep/res/values-lo/strings.xml index 7d87ec483e..a1d8640631 100644 --- a/quickstep/res/values-lo/strings.xml +++ b/quickstep/res/values-lo/strings.xml @@ -77,6 +77,8 @@ "ການສອນການນຳໃຊ້ທີ %1$d/%2$d" "ຮຽບຮ້ອຍໝົດແລ້ວ!" "ປັດຂຶ້ນເພື່ອໄປຫາໜ້າຫຼັກ" + + "ທ່ານພ້ອມເລີ່ມຕົ້ນໃຊ້ໂທລະສັບຂອງທ່ານແລ້ວ" "ທ່ານພ້ອມເລີ່ມຕົ້ນໃຊ້ແທັບເລັດຂອງທ່ານແລ້ວ" "ການຕັ້ງຄ່າການນຳທາງລະບົບ" @@ -84,7 +86,8 @@ "ຮູບໜ້າຈໍ" "ແບ່ງ" "ແຕະແອັບອື່ນເພື່ອໃຊ້ການແຍກໜ້າຈໍ" - "ແອັບບໍ່ຮອງຮັບການແບ່ງໜ້າຈໍ." + + "ແອັບ ຫຼື ອົງການຂອງທ່ານບໍ່ອະນຸຍາດໃຫ້ໃຊ້ຄຳສັ່ງນີ້" "ຂ້າມການສອນການນຳໃຊ້ການນຳທາງບໍ?" "ທ່ານສາມາດຊອກສ່ວນນີ້ພາຍຫຼັງໄດ້ໃນແອັບ %1$s" diff --git a/quickstep/res/values-lt/strings.xml b/quickstep/res/values-lt/strings.xml index b60146f35d..0ee9f0a2a7 100644 --- a/quickstep/res/values-lt/strings.xml +++ b/quickstep/res/values-lt/strings.xml @@ -77,6 +77,8 @@ "Mokymo programa: %1$d iš %2$d" "Paruošta!" "Perbraukite aukštyn, kad grįžtumėte į pagrindinį ekraną" + + "Esate pasiruošę pradėti naudoti telefoną" "Esate pasiruošę pradėti naudoti planšetinį kompiuterį" "Sistemos naršymo nustatymai" @@ -84,7 +86,8 @@ "Ekrano kopija" "Išskaidymo režimas" "Pal. kitą progr., kad gal. naud. išsk. ekr. rež." - "Programoje nepalaikomas išskaidyto ekrano režimas." + + "Jūsų organizacijoje arba naudojant šią programą neleidžiama atlikti šio veiksmo" "Praleisti naršymo mokymo programą?" "Tai galėsite rasti vėliau programoje „%1$s“" diff --git a/quickstep/res/values-lv/strings.xml b/quickstep/res/values-lv/strings.xml index d3c3b80cad..27460f43e7 100644 --- a/quickstep/res/values-lv/strings.xml +++ b/quickstep/res/values-lv/strings.xml @@ -77,6 +77,8 @@ "%1$d. mācību darbība no %2$d" "Gatavs!" "Velciet augšup, lai pārietu uz sākuma ekrānu." + + "Varat sākt izmantot savu tālruni" "Varat sākt izmantot savu planšetdatoru" "Sistēmas navigācijas iestatījumi" @@ -84,7 +86,8 @@ "Veikt ekrānuzņēmumu" "Sadalīt" "Piesk. citai lietotnei, lai izm. ekrāna sadalīšanu" - "Lietotnē netiek atbalstīta ekrāna sadalīšana." + + "Lietotne vai jūsu organizācija neatļauj veikt šo darbību." "Vai izlaist navigācijas mācības?" "Varēsiet to vēlāk atrast lietotnē %1$s." diff --git a/quickstep/res/values-mk/strings.xml b/quickstep/res/values-mk/strings.xml index 7ac9ad0f9e..38ec94bf8d 100644 --- a/quickstep/res/values-mk/strings.xml +++ b/quickstep/res/values-mk/strings.xml @@ -77,6 +77,8 @@ "Упатство %1$d/%2$d" "Готово!" "Повлечете нагоре за да појдете на почетниот екран" + + "Спремни сте да почнете да го користите телефонот" "Спремни сте да почнете да го користите таблетот" "Поставки за системска навигација" @@ -84,7 +86,8 @@ "Слика од екранот" "Раздели" "Допрете друга апликација за да користите поделен екран" - "Апликацијата не поддржува поделен екран." + + "Апликацијата или вашата организација не го дозволува дејствово" "Да се прескокне упатството за навигација?" "Ова може да го најдете подоцна во апликацијата %1$s" diff --git a/quickstep/res/values-ml/strings.xml b/quickstep/res/values-ml/strings.xml index 90fc5138b4..bc7efb9395 100644 --- a/quickstep/res/values-ml/strings.xml +++ b/quickstep/res/values-ml/strings.xml @@ -77,6 +77,8 @@ "ട്യൂട്ടോറിയൽ %1$d/%2$d" "എല്ലാം സജ്ജീകരിച്ചു!" "ഹോമിലേക്ക് പോകാൻ മുകളിലേക്ക് സ്വൈപ്പ് ചെയ്യുക" + + "ഫോൺ ഉപയോഗിച്ച് തുടങ്ങാൻ നിങ്ങൾ തയ്യാറാണ്" "ടാബ്‌ലെറ്റ് ഉപയോഗിച്ച് തുടങ്ങാൻ നിങ്ങൾ തയ്യാറാണ്" "സിസ്‌റ്റം നാവിഗേഷൻ ക്രമീകരണം" @@ -84,7 +86,8 @@ "സ്ക്രീൻഷോട്ട്" "വിഭജിക്കുക" "സ്പ്ലിറ്റ് സ്ക്രീനിനായി മറ്റൊരു ആപ്പ് ടാപ്പുചെയ്യൂ" - "സ്പ്ലിറ്റ്-സ്ക്രീനിനെ ആപ്പ് പിന്തുണയ്ക്കുന്നില്ല." + + "ഈ നടപടി എടുക്കുന്നത് ആപ്പോ നിങ്ങളുടെ സ്ഥാപനമോ അനുവദിക്കുന്നില്ല" "നാവിഗേഷൻ ട്യൂട്ടോറിയൽ ഒഴിവാക്കണോ?" "%1$s ആപ്പിൽ നിങ്ങൾക്ക് ഇത് പിന്നീട് കാണാനാകും" diff --git a/quickstep/res/values-mn/strings.xml b/quickstep/res/values-mn/strings.xml index c435528b66..45e66e4c6e 100644 --- a/quickstep/res/values-mn/strings.xml +++ b/quickstep/res/values-mn/strings.xml @@ -77,6 +77,8 @@ "%1$d/%2$d практик хичээл" "Тохируулж дууслаа!" "Нүүр хуудас руу очихын тулд дээш шударна уу" + + "Та утсаа ашиглаж эхлэхэд бэлэн боллоо" "Та таблетаа ашиглаж эхлэхэд бэлэн боллоо" "Системийн навигацын тохиргоо" @@ -84,7 +86,8 @@ "Дэлгэцийн агшин дарах" "Хуваах" "Дэлгэц хуваахыг ашиглах бол өөр аппыг товшино уу" - "Апп дэлгэцийг хуваах горимыг дэмждэггүй." + + "Энэ үйлдлийг апп эсвэл танай байгууллага зөвшөөрдөггүй" "Навигацын практик хичээлийг алгасах уу?" "Та үүнийг дараа нь %1$s аппаас олох боломжтой" diff --git a/quickstep/res/values-mr/strings.xml b/quickstep/res/values-mr/strings.xml index fc9027133b..f6f8c142df 100644 --- a/quickstep/res/values-mr/strings.xml +++ b/quickstep/res/values-mr/strings.xml @@ -77,6 +77,8 @@ "ट्यूटोरियल %1$d/%2$d" "सर्व तयार आहे!" "होम वर जाण्यासाठी वरती स्वाइप करा" + + "तुम्ही तुमचा फोन वापरण्यास सुरुवात करू शकता" "तुम्ही तुमचा टॅबलेट वापरण्यास सुरुवात करू शकता" "सिस्टीम नेव्हिगेशन सेटिंग्ज" @@ -84,7 +86,8 @@ "स्क्रीनशॉट" "स्प्लिट" "स्प्लिटस्क्रीन वापरण्यासाठी दुसऱ्या ॲपवर टॅप करा" - "अ‍ॅप हे स्प्लिट-स्क्रीनला सपोर्ट करत नाही." + + "अ‍ॅप किंवा तुमच्या संस्थेद्वारे ही क्रिया करण्याची अनुमती नाही" "नेव्हिगेशन ट्यूटोरियल वगळायचे आहे का?" "तुम्हाला हे नंतर %1$s ॲपमध्ये मिळेल" diff --git a/quickstep/res/values-ms/strings.xml b/quickstep/res/values-ms/strings.xml index 5d3f4a8896..d173790e28 100644 --- a/quickstep/res/values-ms/strings.xml +++ b/quickstep/res/values-ms/strings.xml @@ -77,6 +77,8 @@ "Tutorial %1$d/%2$d" "Siap!" "Leret ke atas untuk kembali ke Laman Utama" + + "Anda sudah sedia untuk mula menggunakan telefon anda" "Anda bersedia untuk mula menggunakan tablet anda" "Tetapan navigasi sistem" @@ -84,7 +86,8 @@ "Tangkapan skrin" "Pisah" "Ketik apl lain untuk menggunakan skrin pisah" - "Apl tidak menyokong skrin pisah." + + "Tindakan ini tidak dibenarkan oleh apl atau organisasi anda" "Langkau tutorial navigasi?" "Anda boleh mendapatkan tutorial ini kemudian dalam apl %1$s" diff --git a/quickstep/res/values-my/strings.xml b/quickstep/res/values-my/strings.xml index 8f6af710ee..20441d1771 100644 --- a/quickstep/res/values-my/strings.xml +++ b/quickstep/res/values-my/strings.xml @@ -77,6 +77,8 @@ "ရှင်းလင်းပို့ချချက် %1$d/%2$d" "အားလုံး အဆင်သင့်ပါ။" "ပင်မစာမျက်နှာသို့သွားရန် အပေါ်သို့ ပွတ်ဆွဲပါ" + + "သင့်ဖုန်း စသုံးရန် အသင့်ဖြစ်ပါပြီ" "သင့်တက်ဘလက်ကို စသုံးရန် အသင့်ဖြစ်ပါပြီ" "စနစ် လမ်းညွှန် ဆက်တင်များ" @@ -84,7 +86,8 @@ "ဖန်သားပြင်ဓာတ်ပုံ" "ခွဲထုတ်ရန်" "မျက်နှာပြင်ခွဲ၍ပြသရန် အက်ပ်နောက်တစ်ခုကို တို့ပါ" - "အက်ပ်တွင် မျက်နှာပြင် ခွဲ၍ပြသခြင်း သုံး၍မရပါ။" + + "ဤလုပ်ဆောင်ချက်ကို အက်ပ် သို့မဟုတ် သင်၏အဖွဲ့အစည်းက ခွင့်မပြုပါ" "လမ်းညွှန်ခြင်း ရှင်းလင်းပို့ချချက်ကို ကျော်မလား။" "၎င်းကို နောက်မှ %1$s အက်ပ်တွင် ရှာနိုင်သည်" diff --git a/quickstep/res/values-nb/strings.xml b/quickstep/res/values-nb/strings.xml index eff2e3ca92..4045c7c80a 100644 --- a/quickstep/res/values-nb/strings.xml +++ b/quickstep/res/values-nb/strings.xml @@ -77,6 +77,8 @@ "Veiledning %1$d/%2$d" "Alt er klart!" "Sveip opp for å gå til startskjermen" + + "Du er klar til å begynne å bruke telefonen" "Du er klar til å begynne å bruke nettbrettet" "Innstillinger for systemnavigasjon" @@ -84,7 +86,8 @@ "Skjermdump" "Del opp" "Trykk på en annen app for å bruke delt skjerm" - "Appen støtter ikke delt skjerm." + + "Appen eller organisasjonen din tillater ikke denne handlingen" "Vil du hoppe over navigeringsveiledningen?" "Du kan finne dette i %1$s-appen senere" diff --git a/quickstep/res/values-ne/strings.xml b/quickstep/res/values-ne/strings.xml index 3a23567b74..fe081fec42 100644 --- a/quickstep/res/values-ne/strings.xml +++ b/quickstep/res/values-ne/strings.xml @@ -77,6 +77,8 @@ "ट्युटोरियल %1$d/%2$d" "सबै तयार भयो!" "होममा जान माथितिर स्वाइप गर्नुहोस्" + + "तपाईं आफ्नो फोन चलाउन थाल्न सक्नुहुन्छ" "तपाईं अब आफ्नो ट्याब्लेट चलाउन थाल्न सक्नुहुन्छ" "सिस्टम नेभिगेसनसम्बन्धी सेटिङ" @@ -84,7 +86,8 @@ "स्क्रिनसट" "स्प्लिट गर्नुहोस्" "स्प्लिटक्रिन प्रयोग गर्न अर्को एपमा ट्याप गर्नुहोस्" - "यो एपको स्क्रिन विभाजन गर्न मिल्दैन।" + + "यो एप वा तपाईंको सङ्गठनले यो कारबाही गर्ने अनुमति दिँदैन" "नेभिगेसन ट्युटोरियल स्किप गर्ने हो?" "तपाईं पछि %1$s नामक एपमा गई यो ट्युटोरियल भेट्टाउन सक्नुहुन्छ" diff --git a/quickstep/res/values-nl/strings.xml b/quickstep/res/values-nl/strings.xml index 650e3403d0..543983310e 100644 --- a/quickstep/res/values-nl/strings.xml +++ b/quickstep/res/values-nl/strings.xml @@ -77,6 +77,8 @@ "Tutorial %1$d/%2$d" "Klaar" "Swipe omhoog om naar het startscherm te gaan" + + "Je bent klaar om je telefoon te gebruiken" "Je bent klaar om je tablet te gebruiken" "Navigatie-instellingen van systeem" @@ -84,7 +86,8 @@ "Screenshot" "Splitsen" "Tik op nog een app om je scherm te splitsen" - "App ondersteunt geen gesplitst scherm." + + "Deze actie wordt niet toegestaan door de app of je organisatie" "Navigatietutorial overslaan?" "Je vindt dit later terug in de app %1$s" diff --git a/quickstep/res/values-or/strings.xml b/quickstep/res/values-or/strings.xml index 5016399d95..aa998bab5f 100644 --- a/quickstep/res/values-or/strings.xml +++ b/quickstep/res/values-or/strings.xml @@ -77,6 +77,8 @@ "ଟ୍ୟୁଟୋରିଆଲ୍ %1$d/%2$d" "ସମ୍ପୂର୍ଣ୍ଣ ଭାବେ ପ୍ରସ୍ତୁତ!" "ହୋମକୁ ଯିବା ପାଇଁ ଉପରକୁ ସ୍ୱାଇପ କରନ୍ତୁ" + + "ଆପଣ ଆପଣଙ୍କ ଫୋନ୍ ବ୍ୟବହାର କରିବା ପାଇଁ ପ୍ରସ୍ତୁତ ଅଛନ୍ତି" "ଆପଣ ଆପଣଙ୍କ ଟାବଲେଟ ବ୍ୟବହାର କରିବା ଆରମ୍ଭ କରିବାକୁ ପ୍ରସ୍ତୁତ ଅଛନ୍ତି" "ସିଷ୍ଟମ ନାଭିଗେସନ ସେଟିଂସ" @@ -84,7 +86,8 @@ "ସ୍କ୍ରିନସଟ୍" "ସ୍ପ୍ଲିଟ୍" "ସ୍ପ୍ଲିଟସ୍କ୍ରିନ ବ୍ୟବହାର କରିବାକୁ ଅନ୍ୟ ଏକ ଆପରେ ଟାପ କର" - "ସ୍ପ୍ଲିଟ-ସ୍କ୍ରିନକୁ ଆପ ସମର୍ଥନ କରେ ନାହିଁ।" + + "ଆପ୍ କିମ୍ବା ଆପଣଙ୍କ ସଂସ୍ଥା ଦ୍ୱାରା ଏହି କାର୍ଯ୍ୟକୁ ଅନୁମତି ଦିଆଯାଇ ନାହିଁ" "ନାଭିଗେସନ୍ ଟ୍ୟୁଟୋରିଆଲକୁ ବାଦ୍ ଦେବେ?" "ଆପଣ ପରେ ଏହାକୁ %1$s ଆପରେ ପାଇପାରିବେ" diff --git a/quickstep/res/values-pa/strings.xml b/quickstep/res/values-pa/strings.xml index 7d1d2b5f66..4bcf4d6ae2 100644 --- a/quickstep/res/values-pa/strings.xml +++ b/quickstep/res/values-pa/strings.xml @@ -77,6 +77,8 @@ "ਟਿਊਟੋਰੀਅਲ %1$d/%2$d" "ਪੂਰੀ ਤਰ੍ਹਾਂ ਤਿਆਰ!" "ਹੋਮ \'ਤੇ ਜਾਣ ਲਈ ਉੱਪਰ ਵੱਲ ਸਵਾਈਪ ਕਰੋ" + + "ਤੁਸੀਂ ਆਪਣਾ ਫ਼ੋਨ ਵਰਤਣ ਲਈ ਤਿਆਰ ਹੋ" "ਤੁਸੀਂ ਆਪਣਾ ਟੈਬਲੈੱਟ ਵਰਤਣ ਲਈ ਤਿਆਰ ਹੋ" "ਸਿਸਟਮ ਨੈਵੀਗੇਸ਼ਨ ਸੈਟਿੰਗਾਂ" @@ -84,7 +86,8 @@ "ਸਕ੍ਰੀਨਸ਼ਾਟ" "ਸਪਲਿਟ" "ਸਪਲਿਟ ਸਕ੍ਰੀਨ ਵਰਤਣ ਲਈ ਕਿਸੇ ਹੋਰ ਐਪ \'ਤੇ ਟੈਪ ਕਰੋ" - "ਐਪ ਸਪਲਿਟ-ਸਕ੍ਰੀਨ ਦਾ ਸਮਰਥਨ ਨਹੀਂ ਕਰਦੀ।" + + "ਐਪ ਜਾਂ ਤੁਹਾਡੀ ਸੰਸਥਾ ਵੱਲੋਂ ਇਸ ਕਾਰਵਾਈ ਦੀ ਇਜਾਜ਼ਤ ਨਹੀਂ ਹੈ" "ਕੀ ਨੈਵੀਗੇਸ਼ਨ ਟਿਊਟੋਰੀਅਲ ਨੂੰ ਛੱਡਣਾ ਹੈ?" "ਤੁਸੀਂ ਇਸਨੂੰ ਬਾਅਦ ਵਿੱਚ %1$s ਐਪ ਵਿੱਚ ਲੱਭ ਸਕਦੇ ਹੋ" diff --git a/quickstep/res/values-pl/strings.xml b/quickstep/res/values-pl/strings.xml index 3c73de487f..0394bb7f72 100644 --- a/quickstep/res/values-pl/strings.xml +++ b/quickstep/res/values-pl/strings.xml @@ -77,6 +77,8 @@ "Samouczek %1$d/%2$d" "Wszystko gotowe" "Aby przejść na ekran główny, przesuń palcem w górę" + + "Teraz możesz zacząć używać telefonu" "Teraz możesz zacząć używać tabletu" "Ustawienia nawigacji w systemie" @@ -84,7 +86,8 @@ "Zrzut ekranu" "Podziel" "Kliknij drugą aplikację, aby podzielić ekran" - "Aplikacja nie obsługuje podzielonego ekranu." + + "Nie możesz wykonać tego działania, bo nie zezwala na to aplikacja lub Twoja organizacja" "Pominąć samouczek nawigacji?" "Znajdziesz to później w aplikacji %1$s" diff --git a/quickstep/res/values-pt-rPT/strings.xml b/quickstep/res/values-pt-rPT/strings.xml index 5e01dc187f..47bc834b64 100644 --- a/quickstep/res/values-pt-rPT/strings.xml +++ b/quickstep/res/values-pt-rPT/strings.xml @@ -77,6 +77,8 @@ "Tutorial %1$d/%2$d" "Tudo pronto!" "Deslize rapidamente para cima para aceder ao ecrã principal" + + "Já pode começar a utilizar o seu telemóvel" "Já pode começar a usar o seu tablet" "Definições de navegação do sistema" @@ -84,7 +86,8 @@ "Fazer captura de ecrã" "Dividir" "Toque noutra app para utilizar o ecrã dividido" - "A app não é compatível com o ecrã dividido." + + "Esta ação não é permitida pela app ou a sua entidade." "Ignorar o tutorial de navegação?" "Pode encontrar isto mais tarde na app %1$s" diff --git a/quickstep/res/values-pt/strings.xml b/quickstep/res/values-pt/strings.xml index fad2170e85..6a366089f1 100644 --- a/quickstep/res/values-pt/strings.xml +++ b/quickstep/res/values-pt/strings.xml @@ -77,6 +77,8 @@ "Tutorial %1$d/%2$d" "Tudo pronto!" "Deslize para cima para acessar a tela inicial" + + "Você já pode começar a usar seu smartphone" "Você já pode começar a usar seu tablet" "Configurações de navegação do sistema" @@ -84,7 +86,8 @@ "Capturar tela" "Dividir" "Toque em outro app para dividir a tela" - "O app não tem suporte para a divisão de tela." + + "Essa ação não é permitida pelo app ou pela organização" "Pular o tutorial de navegação?" "Veja o tutorial mais tarde no app %1$s" diff --git a/quickstep/res/values-ro/strings.xml b/quickstep/res/values-ro/strings.xml index 8b8c187033..9856a6c1e1 100644 --- a/quickstep/res/values-ro/strings.xml +++ b/quickstep/res/values-ro/strings.xml @@ -77,6 +77,8 @@ "Tutorialul %1$d / %2$d" "Gata!" "Glisează în sus pentru a accesa ecranul de pornire" + + "Ești gata să folosești telefonul" "Ești gata să folosești tableta" "Setările de navigare ale sistemului" @@ -84,7 +86,8 @@ "Captură de ecran" "Împărțit" "Atinge altă aplicație pentru ecranul împărțit" - "Aplicația nu acceptă ecranul împărțit." + + "Această acțiune nu este permisă de aplicație sau de organizația ta" "Omiți tutorialul de navigare?" "Îl poți găsi mai târziu în aplicația %1$s" diff --git a/quickstep/res/values-ru/strings.xml b/quickstep/res/values-ru/strings.xml index e078ba0aad..de3343e10a 100644 --- a/quickstep/res/values-ru/strings.xml +++ b/quickstep/res/values-ru/strings.xml @@ -77,6 +77,8 @@ "Руководство (шаг %1$d из %2$d)" "Готово!" "Чтобы перейти на главный экран, проведите вверх." + + "Теперь вы можете использовать телефон." "Теперь вы можете использовать планшет." "Системные настройки навигации" @@ -84,7 +86,8 @@ "Скриншот" "Разделить" "Для разделения экрана нажмите на другое приложение." - "Приложение не поддерживает разделение экрана." + + "Это действие заблокировано приложением или организацией." "Пропустить руководство по жестам?" "Его можно найти в приложении \"%1$s\"." diff --git a/quickstep/res/values-si/strings.xml b/quickstep/res/values-si/strings.xml index f890548f58..509490c612 100644 --- a/quickstep/res/values-si/strings.xml +++ b/quickstep/res/values-si/strings.xml @@ -77,6 +77,8 @@ "නිබන්ධනය %1$d/%2$d" "සියල්ල සූදානම්!" "මුල් පිටුවට යාමට ඉහළට ස්වයිප් කරන්න" + + "ඔබ ඔබගේ දුරකථනය භාවිත කිරීම පටන් ගැනීමට සූදානම්" "ඔබ ඔබගේ ටැබ්ලටය භාවිත කිරීම පටන් ගැනීමට සූදානම්" "පද්ධති සංචාලන සැකසීම්" @@ -84,7 +86,8 @@ "තිර රුව" "බෙදන්න" "බෙදුම් තිරය භාවිත කිරීමට තවත් යෙදුමක් තට්ටු කරන්න" - "යෙදුම බෙදුම් තිරය සඳහා සහාය නොදක්වයි." + + "මෙම ක්‍රියාව යෙදුම හෝ ඔබේ සංවිධානය මගින් ඉඩ නොදේ" "නිබන්ධනය සංචාලනය මඟ හරින්නද?" "ඔබට මෙය පසුව %1$s යෙදුම තුළ සොයා ගත හැකිය" diff --git a/quickstep/res/values-sk/strings.xml b/quickstep/res/values-sk/strings.xml index cdf33391ee..f9372def02 100644 --- a/quickstep/res/values-sk/strings.xml +++ b/quickstep/res/values-sk/strings.xml @@ -77,6 +77,8 @@ "Návod %1$d/%2$d" "Hotovo" "Potiahnutím nahor prejdete na plochu" + + "Telefón môžete začať používať" "Tablet môžete začať používať" "Nastavenia navigácie systémom" @@ -84,7 +86,8 @@ "Snímka obrazovky" "Rozdeliť" "Rozdel. obrazovku spustíte klepnutím na inú aplik." - "Aplikácia nepodporuje rozdelenú obrazovku." + + "Aplikácia alebo vaša organizácia túto akciu nepovoľuje" "Chcete preskočiť návod na navigáciu?" "Tento návod nájdete v aplikácii %1$s" diff --git a/quickstep/res/values-sl/strings.xml b/quickstep/res/values-sl/strings.xml index 3e7c5ce681..0a5a271462 100644 --- a/quickstep/res/values-sl/strings.xml +++ b/quickstep/res/values-sl/strings.xml @@ -77,6 +77,8 @@ "Vadnica %1$d/%2$d" "Končano" "Povlecite navzgor za začetni zaslon" + + "Pripravljeni ste, da začnete uporabljati telefon" "Pripravljeni ste, da začnete uporabljati tablični računalnik." "Nastavitve krmarjenja po sistemu" @@ -84,7 +86,8 @@ "Posnetek zaslona" "Razdeli" "Za uporabo razdeljenega zaslona se dotaknite še ene aplikacije." - "Aplikacija ne podpira načina razdeljenega zaslona." + + "Aplikacija ali vaša organizacija ne dovoljuje tega dejanja" "Želite preskočiti vadnico za krmarjenje?" "To lahko pozneje najdete v aplikaciji %1$s." diff --git a/quickstep/res/values-sq/strings.xml b/quickstep/res/values-sq/strings.xml index 04b7bc152f..f326693364 100644 --- a/quickstep/res/values-sq/strings.xml +++ b/quickstep/res/values-sq/strings.xml @@ -77,6 +77,8 @@ "Udhëzuesi %1$d/%2$d" "Plotësisht gati!" "Rrëshqit shpejt lart për të shkuar tek \"Ekrani bazë\"" + + "Je gati për të filluar përdorimin e telefonit tënd" "Je gati që të fillosh të përdorësh tabletin" "Cilësimet e navigimit të sistemit" @@ -84,7 +86,8 @@ "Pamja e ekranit" "Ndaj" "Trokit aplikacion tjetër e përdor ekranin e ndarë" - "Aplikacioni nuk mbështet ekranin e ndarë." + + "Ky veprim nuk lejohet nga aplikacioni ose organizata jote" "Të kapërcehet udhëzuesi i navigimit?" "Këtë mund ta gjesh më vonë tek aplikacioni \"%1$s\"" diff --git a/quickstep/res/values-sr/strings.xml b/quickstep/res/values-sr/strings.xml index 215fde9100..518023aeac 100644 --- a/quickstep/res/values-sr/strings.xml +++ b/quickstep/res/values-sr/strings.xml @@ -77,6 +77,8 @@ "Водич %1$d/%2$d" "Готово!" "Превуците нагоре да бисте отворили почетни екран" + + "Спремни сте да почнете да користите телефон" "Спремни сте да почнете да користите таблет" "Подешавања кретања кроз систем" @@ -84,7 +86,8 @@ "Снимак екрана" "Подели" "Додирните другу апликацију за подељени екран" - "Апликација не подржава подељени екран." + + "Апликација или организација не дозвољавају ову радњу" "Желите да прескочите водич за кретање?" "Можете да пронађете ово касније у апликацији %1$s" diff --git a/quickstep/res/values-sv/strings.xml b/quickstep/res/values-sv/strings.xml index e7c0226337..2d9db938d3 100644 --- a/quickstep/res/values-sv/strings.xml +++ b/quickstep/res/values-sv/strings.xml @@ -77,6 +77,8 @@ "Självstudie %1$d/%2$d" "Klart!" "Svep uppåt för att öppna startskärmen" + + "Nu kan du börja använda telefonen" "Nu kan du börja använda surfplattan" "Systemnavigeringsinställningar" @@ -84,7 +86,8 @@ "Skärmbild" "Delat" "Tryck på en annan app för att använda delad skärm" - "Appen har inte stöd för delad skärm." + + "Appen eller organisationen tillåter inte den här åtgärden" "Vill du hoppa över självstudierna?" "Du hittar det här igen i %1$s-appen" diff --git a/quickstep/res/values-sw/strings.xml b/quickstep/res/values-sw/strings.xml index b1a178e9b3..aadf378f1f 100644 --- a/quickstep/res/values-sw/strings.xml +++ b/quickstep/res/values-sw/strings.xml @@ -77,6 +77,8 @@ "Mafunzo ya %1$d kati ya %2$d" "Tayari!" "Telezesha kidole juu ili uende kwenye skrini ya kwanza" + + "Uko tayari kuanza kutumia simu yako" "Uko tayari kuanza kutumia kompyuta kibao yako" "Mipangilio ya usogezaji kwenye mfumo" @@ -84,7 +86,8 @@ "Picha ya skrini" "Iliyogawanywa" "Gusa programu nyingine ili utumie skrini iliyogawanywa" - "Programu haiwezi kutumia skrini iliyogawanywa." + + "Kitendo hiki hakiruhusiwi na programu au shirika lako" "Ungependa kuruka mafunzo ya usogezaji?" "Utapata mafunzo haya baadaye katika programu ya %1$s" diff --git a/quickstep/res/values-ta/strings.xml b/quickstep/res/values-ta/strings.xml index 431ae3cce5..77c3c37d98 100644 --- a/quickstep/res/values-ta/strings.xml +++ b/quickstep/res/values-ta/strings.xml @@ -77,6 +77,8 @@ "பயிற்சி %1$d/%2$d" "அனைத்தையும் அமைத்துவிட்டீர்கள்!" "முகப்புத் திரைக்குச் செல்ல மேல்நோக்கி ஸ்வைப் செய்யுங்கள்" + + "மொபைலைப் பயன்படுத்தத் தயாராகிவிட்டீர்கள்" "உங்கள் டேப்லெட்டைப் பயன்படுத்தத் தயாராகிவிட்டீர்கள்" "சிஸ்டம் வழிசெலுத்தல் அமைப்புகள்" @@ -84,7 +86,8 @@ "ஸ்கிரீன்ஷாட்" "பிரி" "ஸ்பிளிட் ஸ்கிரீனுக்கு மற்றொரு ஆப்ஸைத் தட்டவும்" - "திரைப் பிரிப்பு அம்சத்தை ஆப்ஸ் ஆதரிக்கவில்லை." + + "ஆப்ஸோ உங்கள் நிறுவனமோ இந்த செயலை அனுமதிப்பதில்லை" "வழிகாட்டுதல் பயிற்சியைத் தவிர்க்கவா?" "%1$s ஆப்ஸில் பிறகு இதைக் கண்டறியலாம்" diff --git a/quickstep/res/values-te/strings.xml b/quickstep/res/values-te/strings.xml index 7b6dedf757..052ca5d477 100644 --- a/quickstep/res/values-te/strings.xml +++ b/quickstep/res/values-te/strings.xml @@ -77,6 +77,8 @@ "ట్యుటోరియల్ %1$d/%2$d" "అంతా సెట్ అయింది!" "మొదటి స్క్రీన్‌కు వెళ్లడానికి పైకి స్వైప్ చేయండి" + + "మీరు మీ ఫోన్‌ను ఉపయోగించడానికి సిద్ధంగా ఉన్నారు" "మీరు మీ టాబ్లెట్‌ను ఉపయోగించడానికి సిద్ధంగా ఉన్నారు" "సిస్టమ్ నావిగేషన్ సెట్టింగ్‌లు" @@ -84,7 +86,8 @@ "స్క్రీన్‌షాట్" "స్ప్లిట్ చేయండి" "స్క్రీన్ విభజనను ఉపయోగించడానికి మరొక యాప్ నొక్కండి" - "యాప్‌లో స్ప్లిట్-స్క్రీన్ పని చేయదు." + + "ఈ చర్యను యాప్ గానీ, మీ సంస్థ గానీ అనుమతించవు" "నావిగేషన్ ట్యుటోరియల్‌ను స్కిప్ చేయాలా?" "%1$s యాప్‌లో మీరు తర్వాత కనుగొనవచ్చు" diff --git a/quickstep/res/values-th/strings.xml b/quickstep/res/values-th/strings.xml index 4d5794b8a7..13f0e12c90 100644 --- a/quickstep/res/values-th/strings.xml +++ b/quickstep/res/values-th/strings.xml @@ -77,6 +77,8 @@ "บทแนะนำ %1$d/%2$d" "เรียบร้อยแล้ว" "ปัดขึ้นเพื่อไปที่หน้าแรก" + + "คุณเริ่มใช้โทรศัพท์ได้แล้ว" "คุณเริ่มใช้แท็บเล็ตได้แล้ว" "การตั้งค่าการนำทางของระบบ" @@ -84,7 +86,8 @@ "ภาพหน้าจอ" "แยก" "แตะที่แอปอื่นเพื่อใช้แบ่งหน้าจอ" - "แอปไม่รองรับการแบ่งหน้าจอ" + + "แอปหรือองค์กรของคุณไม่อนุญาตการดำเนินการนี้" "ข้ามบทแนะนำการนำทางไหม" "คุณดูบทแนะนำนี้ได้ภายหลังในแอป \"%1$s\"" diff --git a/quickstep/res/values-tl/strings.xml b/quickstep/res/values-tl/strings.xml index 6699ed876d..68b39025fd 100644 --- a/quickstep/res/values-tl/strings.xml +++ b/quickstep/res/values-tl/strings.xml @@ -77,6 +77,8 @@ "Tutorial %1$d/%2$d" "Handa na ang lahat!" "Mag-swipe pataas para pumunta sa Home" + + "Handa mo nang simulan ang paggamit sa iyong telepono" "Handa mo nang simulan ang paggamit sa iyong tablet" "Mga setting ng navigation ng system" @@ -84,7 +86,8 @@ "Screenshot" "Split" "Mag-tap ng ibang app para gamitin ang splitscreen" - "Hindi sinusuportahan ng app ang split-screen." + + "Hindi pinapayagan ng app o ng iyong organisasyon ang pagkilos na ito" "Laktawan ang tutorial sa pag-navigate?" "Makikita mo ito sa %1$s app sa ibang pagkakataon" diff --git a/quickstep/res/values-tr/strings.xml b/quickstep/res/values-tr/strings.xml index 24e25ff5bb..c7f7ac9b28 100644 --- a/quickstep/res/values-tr/strings.xml +++ b/quickstep/res/values-tr/strings.xml @@ -77,6 +77,8 @@ "Eğitim %1$d/%2$d" "İşlem tamam!" "Ana ekrana gitmek için yukarı kaydırın" + + "Telefonunuzu kullanmaya hazırsınız" "Tabletinizi kullanmaya hazırsınız" "Sistem gezinme ayarları" @@ -84,7 +86,8 @@ "Ekran görüntüsü" "Böl" "Bölünmüş ekran için başka bir uygulamaya dokunun" - "Uygulama bölünmüş ekranı desteklemiyor." + + "Uygulamanız veya kuruluşunuz bu işleme izin vermiyor" "Gezinme eğitimi atlansın mı?" "Bunu daha sonra %1$s uygulamasında bulabilirsiniz" diff --git a/quickstep/res/values-uk/strings.xml b/quickstep/res/values-uk/strings.xml index 8dd65e2cf0..173f637f09 100644 --- a/quickstep/res/values-uk/strings.xml +++ b/quickstep/res/values-uk/strings.xml @@ -77,6 +77,8 @@ "Навчальний посібник %1$d/%2$d" "Готово." "Щоб перейти на головний екран, проведіть пальцем угору" + + "Тепер ви можете користуватися телефоном" "Тепер ви можете користуватися планшетом" "Системні налаштування навігації" @@ -84,7 +86,8 @@ "Знімок екрана" "Розділити" "Щоб розділити екран, виберіть ще один додаток" - "Додаток не підтримує розділення екрана." + + "Ця дія заборонена додатком або адміністратором організації" "Пропустити посібник із навігації?" "Ви знайдете його пізніше в додатку %1$s" diff --git a/quickstep/res/values-ur/strings.xml b/quickstep/res/values-ur/strings.xml index 2d9a1e30f2..89e518b0ed 100644 --- a/quickstep/res/values-ur/strings.xml +++ b/quickstep/res/values-ur/strings.xml @@ -77,6 +77,8 @@ "ٹیوٹوریل %1$d/%2$d" "سب کچھ تیار ہے!" "ہوم پر جانے کے لیے اوپر سوائپ کریں" + + "آپ اپنا فون استعمال شروع کرنے کے لیے تیار ہیں" "آپ اپنے ٹیبلیٹ کا استعمال شروع کرنے کے لیے تیار ہیں" "سسٹم نیویگیشن کی ترتیبات" @@ -84,7 +86,8 @@ "اسکرین شاٹ" "اسپلٹ" "اسپلٹ اسکرین کا استعمال کرنے کیلئے دوسری ایپ پر تھپتھپائیں" - "ایپ سپلٹ اسکرین کو سپورٹ نہیں کرتی۔" + + "ایپ یا آپ کی تنظیم کی جانب سے اس کارروائی کی اجازت نہیں ہے" "نیویگیشن کا ٹیوٹوریل نظر انداز کریں؟" "آپ اسے بعد میں %1$s ایپ میں تلاش کر سکتے ہیں" diff --git a/quickstep/res/values-uz/strings.xml b/quickstep/res/values-uz/strings.xml index 9446325829..56a76d5f58 100644 --- a/quickstep/res/values-uz/strings.xml +++ b/quickstep/res/values-uz/strings.xml @@ -77,6 +77,8 @@ "Darslik: %1$d/%2$d" "Hammasi tayyor!" "Boshiga qaytish uchun tepaga suring" + + "Telefoningiz xizmatga tayyor" "Planshetingiz xizmatga tayyor" "Tizim navigatsiya sozlamalari" @@ -84,7 +86,8 @@ "Skrinshot" "Ajratish" "Ekranni ikkiga ajratish uchun boshqa ilovani bosing" - "Bu ilovada ekranni ikkiga ajratish ishlamaydi." + + "Bu amal ilova yoki tashkilotingiz tomonidan taqiqlangan" "Navigatsiya darsi yopilsinmi?" "Bu darslar %1$s ilovasida chiqadi" diff --git a/quickstep/res/values-vi/strings.xml b/quickstep/res/values-vi/strings.xml index 55027aeda3..3b17966f88 100644 --- a/quickstep/res/values-vi/strings.xml +++ b/quickstep/res/values-vi/strings.xml @@ -77,6 +77,8 @@ "Hướng dẫn %1$d/%2$d" "Đã hoàn tất!" "Vuốt lên để chuyển đến Màn hình chính" + + "Vậy là bạn đã sẵn sàng sử dụng điện thoại của mình" "Bạn đã sẵn sàng sử dụng máy tính bảng" "Chế độ cài đặt di chuyển trên hệ thống" @@ -84,7 +86,8 @@ "Chụp ảnh màn hình" "Chia đôi màn hình" "Nhấn vào một ứng dụng khác để dùng màn hình chia đôi" - "Ứng dụng không hỗ trợ chia đôi màn hình." + + "Ứng dụng hoặc tổ chức của bạn không cho phép thực hiện hành động này" "Bỏ qua phần hướng dẫn thao tác?" "Bạn có thể tìm lại phần hướng dẫn này trong ứng dụng %1$s" diff --git a/quickstep/res/values-zh-rCN/strings.xml b/quickstep/res/values-zh-rCN/strings.xml index debf23a9cc..0ff369e38d 100644 --- a/quickstep/res/values-zh-rCN/strings.xml +++ b/quickstep/res/values-zh-rCN/strings.xml @@ -77,6 +77,8 @@ "教程 %1$d/%2$d" "大功告成!" "向上滑动即可转到主屏幕" + + "您可以开始使用手机了" "您可以开始使用平板电脑了" "系统导航设置" @@ -84,7 +86,8 @@ "屏幕截图" "拆分" "点按另一个应用即可使用分屏" - "应用不支持分屏。" + + "该应用或您所在的单位不允许执行此操作" "要跳过导航教程吗?" "您之后可以在“%1$s”应用中找到此教程" diff --git a/quickstep/res/values-zh-rHK/strings.xml b/quickstep/res/values-zh-rHK/strings.xml index c7a44e7d3f..ff648dfe62 100644 --- a/quickstep/res/values-zh-rHK/strings.xml +++ b/quickstep/res/values-zh-rHK/strings.xml @@ -77,6 +77,8 @@ "教學課程 %1$d/%2$d" "設定完成!" "向上滑動即可前往主畫面" + + "您可以開始使用手機了" "您可以開始使用平板電腦了" "系統導覽設定" @@ -84,7 +86,8 @@ "螢幕截圖" "分割" "輕按其他應用程式以使用分割螢幕" - "應用程式不支援分割螢幕。" + + "應用程式或您的機構不允許此操作" "要略過手勢操作教學課程嗎?" "您之後可以在「%1$s」應用程式找到這些說明" diff --git a/quickstep/res/values-zh-rTW/strings.xml b/quickstep/res/values-zh-rTW/strings.xml index 15d5de5ecb..23bee1757a 100644 --- a/quickstep/res/values-zh-rTW/strings.xml +++ b/quickstep/res/values-zh-rTW/strings.xml @@ -77,6 +77,8 @@ "教學課程 %1$d/%2$d" "設定完成!" "向上滑動即可前往主畫面" + + "你可以開始使用手機了" "你可以開始使用平板電腦了" "系統操作機制設定" @@ -84,7 +86,8 @@ "螢幕截圖" "分割" "輕觸另一個應用程式即可使用分割畫面" - "這個應用程式不支援分割畫面。" + + "這個應用程式或貴機構不允許執行這個動作" "要略過手勢操作教學課程嗎?" "你之後可以在「%1$s」應用程式找到這些說明" diff --git a/quickstep/res/values-zu/strings.xml b/quickstep/res/values-zu/strings.xml index 3db58360db..46ba92994f 100644 --- a/quickstep/res/values-zu/strings.xml +++ b/quickstep/res/values-zu/strings.xml @@ -77,6 +77,8 @@ "Okokufundisa %1$d/%2$d" "Konke kusethiwe!" "Swayiphela phezulu ukuze uye Ekhaya" + + "Usulungele ukuqala ukusebenzisa ifoni yakho" "Usulungele ukuqala ukusebenzisa ithebulethi yakho" "Amasethingi wokuzulazula isistimu" @@ -84,7 +86,8 @@ "Isithombe-skrini" "Hlukanisa" "Thepha enye i-app ukuze usebenzise isikrini sokuhlukanisa" - "Uhlelo lokusebenza alusekeli isikrini esihlukanisiwe." + + "Lesi senzo asivunyelwanga uhlelo lokusebenza noma inhlangano yakho" "Yeqa isifundo sokuzulazula?" "Lokhu ungakuthola kamuva ku-app ye-%1$s" From cfcb55b6f7d59fd9c9f6f11c7d0e0eb9c52ccfa3 Mon Sep 17 00:00:00 2001 From: Bill Yi Date: Wed, 16 Nov 2022 02:39:00 -0800 Subject: [PATCH 08/16] Import translations. DO NOT MERGE ANYWHERE Auto-generated-cl: translation import Change-Id: I4b5010c13a5e0a79c1ca8d900f0963595ee6e50c --- go/quickstep/res/values-en-rCA/strings.xml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/go/quickstep/res/values-en-rCA/strings.xml b/go/quickstep/res/values-en-rCA/strings.xml index 676ac43284..664bd94219 100644 --- a/go/quickstep/res/values-en-rCA/strings.xml +++ b/go/quickstep/res/values-en-rCA/strings.xml @@ -1,19 +1,19 @@ - "Share app" + "Share App" "Listen" "Translate" "Lens" - "OK" + "GOT IT" "CANCEL" "SETTINGS" "Translate or listen to text on screen" - "Information such as text on your screen, web addresses and screenshots may be shared with Google.\n\nTo change what information you share, go to ""Settings > Apps > Default apps > Digital assistant app""." + "Information such as text on your screen, web addresses, and screenshots may be shared with Google.\n\nTo change what information you share, go to ""Settings > Apps > Default apps > Digital assistant app""." "Choose an assistant to use this feature" - "To listen to or translate text on your screen, choose a digital assistant app in settings" + "To listen to or translate text on your screen, choose a digital assistant app in Settings" "Change your assistant to use this feature" - "To listen to or translate text on your screen, change your digital assistant app in settings" + "To listen to or translate text on your screen, change your digital assistant app in Settings" "Tap here to listen to text on this screen" "Tap here to translate text on this screen" "This app can’t be shared" From 41a507c544cf65b2ba15e9995790ba777713f7b8 Mon Sep 17 00:00:00 2001 From: Bill Yi Date: Wed, 16 Nov 2022 02:39:56 -0800 Subject: [PATCH 09/16] Import translations. DO NOT MERGE ANYWHERE Auto-generated-cl: translation import Change-Id: I0e3b7adf8621368e01c64bb031dff207e7699873 --- res/values-en-rCA/strings.xml | 42 +++++++++++++++++------------------ 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/res/values-en-rCA/strings.xml b/res/values-en-rCA/strings.xml index 4f15eb5777..aa29d8dc2f 100644 --- a/res/values-en-rCA/strings.xml +++ b/res/values-en-rCA/strings.xml @@ -32,12 +32,12 @@ "Split left" "Split right" "App info for %1$s" - "Touch and hold to move a widget." + "Touch & hold to move a widget." "Double-tap & hold to move a widget or use custom actions." "%1$d × %2$d" "%1$d wide by %2$d high" "%1$s widget" - "Touch and hold the widget to move it around the home screen" + "Touch & hold the widget to move it around the home screen" "Add to home screen" "%1$s widget added to home screen" "{count,plural, =1{# widget}other{# widgets}}" @@ -54,18 +54,18 @@ "Useful info at your fingertips" "To get info without opening apps, you can add widgets to your home screen" "Tap to change widget settings" - "OK" + "Got it" "Change widget settings" "Search apps" "Loading apps…" - "No apps found matching \'%1$s\'" + "No apps found matching \"%1$s\"" "App" "All apps" "Notifications" "Touch & hold to move a shortcut." "Double-tap & hold to move a shortcut or use custom actions." "No room on this home screen" - "No more room in the Favourites tray" + "No more room in the Favorites tray" "Apps list" "Search results" "Personal apps list" @@ -75,13 +75,13 @@ "App info" "Install" "Don\'t suggest app" - "Pin prediction" + "Pin Prediction" "install shortcuts" "Allows an app to add shortcuts without user intervention." - "read Home settings and shortcuts" - "Allows the app to read the settings and shortcuts in Home." - "write Home settings and shortcuts" - "Allows the app to change the settings and shortcuts in Home." + "read home settings and shortcuts" + "Allows the app to read the settings and shortcuts in home." + "write home settings and shortcuts" + "Allows the app to change the settings and shortcuts in home." "%1$s is not allowed to make phone calls" "Can\'t load widget" "Widget settings" @@ -101,7 +101,7 @@ "Folder: %1$s, %2$d items" "Folder: %1$s, %2$d or more items" "Wallpapers" - "Wallpaper and style" + "Wallpaper & style" "Home settings" "Disabled by your admin" "Allow home screen rotation" @@ -113,7 +113,7 @@ "To show Notification Dots, turn on app notifications for %1$s" "Change settings" "Show notification dots" - "Developer options" + "Developer Options" "Add app icons to home screen" "For new apps" "Unknown" @@ -125,7 +125,7 @@ "%1$s downloading, %2$s complete" "%1$s waiting to install" "App update required" - "The app for this icon isn\'t updated. You can update manually to re-enable this shortcut or remove the icon." + "The app for this icon isn\'t updated. You can update manually to re-enable this shortcut, or remove the icon." "Update" "Remove" "Widgets list" @@ -138,7 +138,7 @@ "Move item" "Move to row %1$s column %2$s in %3$s" "Move to position %1$s" - "Move to favourites position %1$s" + "Move to favorites position %1$s" "Item moved" "Add to folder: %1$s" "Add to folder with %1$s" @@ -146,13 +146,13 @@ "Create folder with: %1$s" "Folder created" "Move to home screen" - "Re-size" + "Resize" "Increase width" "Increase height" "Decrease width" "Decrease height" - "Widget re-sized to width %1$s height %2$s" - "Short cuts" + "Widget resized to width %1$s height %2$s" + "Shortcuts" "Shortcuts and notifications" "Dismiss" "Close" @@ -161,12 +161,12 @@ "Work" "Work profile" "Work apps are badged and visible to your IT admin" - "OK" + "Got it" "Work apps are paused" - "Your work apps can’t send you notifications, use your battery or access your location" - "Work apps are off. Your work apps can’t send you notifications, use your battery or access your location" + "Your work apps can’t send you notifications, use your battery, or access your location" + "Work apps are off. Your work apps can’t send you notifications, use your battery, or access your location" "Work apps are badged and visible to your IT admin" - "OK" + "Got it" "Pause work apps" "Turn on work apps" "Filter" From 905e0f16378fc36aedad00b70d922455013eb5e4 Mon Sep 17 00:00:00 2001 From: Alex Chau Date: Mon, 14 Nov 2022 21:55:37 +0000 Subject: [PATCH 10/16] Update overview to fit transient taskbar Bug: 245320601 Test: manual Change-Id: Ie2085811ef25dc03a3765559c9a0ee37e38aa38e --- src/com/android/launcher3/DeviceProfile.java | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java index c91e3ebcf4..3cb3461f8f 100644 --- a/src/com/android/launcher3/DeviceProfile.java +++ b/src/com/android/launcher3/DeviceProfile.java @@ -255,6 +255,7 @@ public class DeviceProfile { public boolean isTaskbarPresentInApps; public int taskbarSize; public int stashedTaskbarSize; + public int transientTaskbarMargin; // DragController public int flingToDeleteThresholdVelocity; @@ -320,6 +321,8 @@ public class DeviceProfile { taskbarSize = res.getDimensionPixelSize(R.dimen.transient_taskbar_size); stashedTaskbarSize = res.getDimensionPixelSize(R.dimen.transient_taskbar_stashed_size); + transientTaskbarMargin = + res.getDimensionPixelSize(R.dimen.transient_taskbar_margin); } else { taskbarSize = res.getDimensionPixelSize(R.dimen.taskbar_size); stashedTaskbarSize = res.getDimensionPixelSize(R.dimen.taskbar_stashed_size); @@ -1305,15 +1308,15 @@ public class DeviceProfile { * Returns the number of pixels required below OverviewActions excluding insets. */ public int getOverviewActionsClaimedSpaceBelow() { - if (isTaskbarPresent && !isGestureMode - // If taskbar is in overview, overview action has dedicated space above nav buttons - && !FeatureFlags.ENABLE_TASKBAR_IN_OVERVIEW.get()) { - // Align vertically to where nav buttons are. - return ((taskbarSize - overviewActionsHeight) / 2) + getTaskbarOffsetY(); - } - if (isTaskbarPresent) { - return FeatureFlags.ENABLE_TASKBAR_IN_OVERVIEW.get() ? taskbarSize : stashedTaskbarSize; + if (FeatureFlags.ENABLE_TASKBAR_IN_OVERVIEW.get()) { + return taskbarSize + transientTaskbarMargin; + } + + return isGestureMode + ? stashedTaskbarSize + // Align vertically to where nav buttons are. + : ((taskbarSize - overviewActionsHeight) / 2) + getTaskbarOffsetY(); } return mInsets.bottom; } From 6abdd5c73531c0bd145613a33fbdd0d653a5bddc Mon Sep 17 00:00:00 2001 From: Sunny Goyal Date: Wed, 16 Nov 2022 13:57:28 -0800 Subject: [PATCH 11/16] Removing unnecessary event dispatching via touch-controller. Instead using a poll method similar to other touch controllers Bug: 259447608 Test: Verified on device Change-Id: I5c29c7c1b87acb668ea93e9f44fb685379de54fb --- .../NoButtonNavbarToOverviewTouchController.java | 16 ++++++---------- .../android/quickstep/BaseActivityInterface.java | 3 --- .../quickstep/FallbackActivityInterface.java | 5 ----- .../quickstep/LauncherActivityInterface.java | 9 --------- .../quickstep/OverviewComponentObserver.java | 5 ----- src/com/android/launcher3/Launcher.java | 8 -------- .../android/launcher3/dragndrop/DragLayer.java | 11 ----------- .../android/launcher3/util/TouchController.java | 5 ----- 8 files changed, 6 insertions(+), 56 deletions(-) diff --git a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NoButtonNavbarToOverviewTouchController.java b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NoButtonNavbarToOverviewTouchController.java index 918b3c1bf8..f343f525b5 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NoButtonNavbarToOverviewTouchController.java +++ b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NoButtonNavbarToOverviewTouchController.java @@ -26,6 +26,7 @@ import static com.android.launcher3.Utilities.EDGE_NAV_BAR; import static com.android.launcher3.anim.AnimatorListeners.forSuccessCallback; import static com.android.launcher3.anim.Interpolators.ACCEL_DEACCEL; import static com.android.quickstep.util.VibratorWrapper.OVERVIEW_HAPTIC; +import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_ONE_HANDED_ACTIVE; import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_OVERVIEW_DISABLED; import android.animation.ObjectAnimator; @@ -86,6 +87,11 @@ public class NoButtonNavbarToOverviewTouchController extends PortraitStatesTouch @Override protected boolean canInterceptTouch(MotionEvent ev) { mDidTouchStartInNavBar = (ev.getEdgeFlags() & EDGE_NAV_BAR) != 0; + boolean isOneHandedModeActive = (SystemUiProxy.INSTANCE.get(mLauncher) + .getLastSystemUiStateFlags() & SYSUI_STATE_ONE_HANDED_ACTIVE) != 0; + // Reset touch slop multiplier to default 1.0f if one-handed-mode is not active + mDetector.setTouchSlopMultiplier( + isOneHandedModeActive ? ONE_HANDED_ACTIVATED_SLOP_MULTIPLIER : 1f /* default */); return super.canInterceptTouch(ev) && !mLauncher.isInState(HINT_STATE); } @@ -277,14 +283,4 @@ public class NoButtonNavbarToOverviewTouchController extends PortraitStatesTouch private float dpiFromPx(float pixels) { return Utilities.dpiFromPx(pixels, mLauncher.getResources().getDisplayMetrics().densityDpi); } - - @Override - public void onOneHandedModeStateChanged(boolean activated) { - if (activated) { - mDetector.setTouchSlopMultiplier(ONE_HANDED_ACTIVATED_SLOP_MULTIPLIER); - } else { - // Reset touch slop multiplier to default 1.0f - mDetector.setTouchSlopMultiplier(1f /* default */); - } - } } diff --git a/quickstep/src/com/android/quickstep/BaseActivityInterface.java b/quickstep/src/com/android/quickstep/BaseActivityInterface.java index a62232620d..2c3ba85136 100644 --- a/quickstep/src/com/android/quickstep/BaseActivityInterface.java +++ b/quickstep/src/com/android/quickstep/BaseActivityInterface.java @@ -121,9 +121,6 @@ public abstract class BaseActivityInterface callback); diff --git a/quickstep/src/com/android/quickstep/FallbackActivityInterface.java b/quickstep/src/com/android/quickstep/FallbackActivityInterface.java index c62220f54b..ae9fb0b385 100644 --- a/quickstep/src/com/android/quickstep/FallbackActivityInterface.java +++ b/quickstep/src/com/android/quickstep/FallbackActivityInterface.java @@ -77,11 +77,6 @@ public final class FallbackActivityInterface extends // set to zero prior to this class becoming active. } - @Override - public void onOneHandedModeStateChanged(boolean activated) { - // Do nothing for FallbackActivityInterface - } - /** 6 */ @Override public AnimationFactory prepareRecentsUI(RecentsAnimationDeviceState deviceState, diff --git a/quickstep/src/com/android/quickstep/LauncherActivityInterface.java b/quickstep/src/com/android/quickstep/LauncherActivityInterface.java index ecb37474e6..9ff941671b 100644 --- a/quickstep/src/com/android/quickstep/LauncherActivityInterface.java +++ b/quickstep/src/com/android/quickstep/LauncherActivityInterface.java @@ -108,15 +108,6 @@ public final class LauncherActivityInterface extends launcher.onAssistantVisibilityChanged(visibility); } - @Override - public void onOneHandedModeStateChanged(boolean activated) { - Launcher launcher = getCreatedActivity(); - if (launcher == null) { - return; - } - launcher.onOneHandedStateChanged(activated); - } - @Override public AnimationFactory prepareRecentsUI(RecentsAnimationDeviceState deviceState, boolean activityVisible, Consumer callback) { diff --git a/quickstep/src/com/android/quickstep/OverviewComponentObserver.java b/quickstep/src/com/android/quickstep/OverviewComponentObserver.java index 9e3173c1f0..8e07376b14 100644 --- a/quickstep/src/com/android/quickstep/OverviewComponentObserver.java +++ b/quickstep/src/com/android/quickstep/OverviewComponentObserver.java @@ -115,11 +115,6 @@ public final class OverviewComponentObserver { if (mDeviceState.isHomeDisabled() != mIsHomeDisabled) { updateOverviewTargets(); } - - // Notify ALL_APPS touch controller when one handed mode state activated or deactivated - if (mDeviceState.isOneHandedModeEnabled()) { - mActivityInterface.onOneHandedModeStateChanged(mDeviceState.isOneHandedModeActive()); - } } private void updateOverviewTargets(Intent unused) { diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java index ab7f6226c9..8453f2c1dc 100644 --- a/src/com/android/launcher3/Launcher.java +++ b/src/com/android/launcher3/Launcher.java @@ -647,14 +647,6 @@ public class Launcher extends StatefulActivity mHotseat.getQsb().setAlpha(1f - visibility); } - /** - * Called when one handed mode activated and deactivated. - * @param activated true if one handed mode activated, false otherwise. - */ - public void onOneHandedStateChanged(boolean activated) { - mDragLayer.onOneHandedModeStateChanged(activated); - } - /** * Returns {@code true} if a new DeviceProfile is initialized, and {@code false} otherwise. */ diff --git a/src/com/android/launcher3/dragndrop/DragLayer.java b/src/com/android/launcher3/dragndrop/DragLayer.java index 1ee7fc1fa3..366870b4c2 100644 --- a/src/com/android/launcher3/dragndrop/DragLayer.java +++ b/src/com/android/launcher3/dragndrop/DragLayer.java @@ -56,7 +56,6 @@ import com.android.launcher3.celllayout.CellLayoutLayoutParams; import com.android.launcher3.folder.Folder; import com.android.launcher3.graphics.Scrim; import com.android.launcher3.keyboard.ViewGroupFocusHelper; -import com.android.launcher3.util.TouchController; import com.android.launcher3.views.BaseDragLayer; import com.android.systemui.plugins.shared.LauncherOverlayManager.LauncherOverlayCallbacks; @@ -474,16 +473,6 @@ public class DragLayer extends BaseDragLayer implements LauncherOverla return mWorkspaceDragScrim; } - /** - * Called when one handed mode state changed. - * @param activated true if one handed mode activated, false otherwise. - */ - public void onOneHandedModeStateChanged(boolean activated) { - for (TouchController controller : mControllers) { - controller.onOneHandedModeStateChanged(activated); - } - } - @Override public void onOverlayScrollChanged(float progress) { float alpha = 1 - Interpolators.DEACCEL_3.getInterpolation(progress); diff --git a/src/com/android/launcher3/util/TouchController.java b/src/com/android/launcher3/util/TouchController.java index 9c397c0f74..fc1d819f78 100644 --- a/src/com/android/launcher3/util/TouchController.java +++ b/src/com/android/launcher3/util/TouchController.java @@ -32,10 +32,5 @@ public interface TouchController { */ boolean onControllerInterceptTouchEvent(MotionEvent ev); - /** - * Called when one handed mode state changed - */ - default void onOneHandedModeStateChanged(boolean activated) { } - default void dump(String prefix, PrintWriter writer) { } } From aa2b872d1c295aef1e56e5a60ada1cc871a7add8 Mon Sep 17 00:00:00 2001 From: Sihua Ma Date: Tue, 25 Oct 2022 15:17:58 -0700 Subject: [PATCH 12/16] Move most of the functions in LauncherAppWidgetHost to LauncherWidgetHolder Test: N/A Bug: 235358918 Change-Id: I343419376491203a195154f2766b12e5def38879 --- .../launcher3/uioverrides/ApiWrapper.java | 4 +- .../QuickstepInteractionHandler.java | 6 +- .../launcher3/AppWidgetsRestoredReceiver.java | 15 +- .../android/launcher3/AutoInstallsLayout.java | 15 +- .../launcher3/DefaultLayoutParser.java | 11 +- src/com/android/launcher3/Launcher.java | 1 + .../android/launcher3/LauncherProvider.java | 111 ++--- .../launcher3/LauncherWidgetHolder.java | 392 ++++++++++++++++-- src/com/android/launcher3/Workspace.java | 2 +- .../launcher3/dragndrop/AddItemActivity.java | 24 +- .../graphics/LauncherPreviewRenderer.java | 4 +- .../launcher3/provider/RestoreDbTask.java | 6 +- .../widget/LauncherAppWidgetHost.java | 364 ++-------------- .../widget/LauncherAppWidgetHostView.java | 11 + .../widget/picker/WidgetsFullSheet.java | 2 +- .../launcher3/uioverrides/ApiWrapper.java | 4 +- .../android/launcher3/util/WidgetUtils.java | 22 +- 17 files changed, 534 insertions(+), 460 deletions(-) diff --git a/quickstep/src/com/android/launcher3/uioverrides/ApiWrapper.java b/quickstep/src/com/android/launcher3/uioverrides/ApiWrapper.java index 729eea9834..8002c6d525 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/ApiWrapper.java +++ b/quickstep/src/com/android/launcher3/uioverrides/ApiWrapper.java @@ -23,8 +23,8 @@ import android.content.pm.ShortcutInfo; import androidx.annotation.NonNull; import androidx.annotation.Nullable; +import com.android.launcher3.LauncherWidgetHolder; import com.android.launcher3.Utilities; -import com.android.launcher3.widget.LauncherAppWidgetHost; /** * A wrapper for the hidden API calls @@ -44,7 +44,7 @@ public class ApiWrapper { * @param handler InteractionHandler for the views in the host */ public static void setHostInteractionHandler(@NonNull AppWidgetHost host, - @Nullable LauncherAppWidgetHost.LauncherWidgetInteractionHandler handler) { + @Nullable LauncherWidgetHolder.LauncherWidgetInteractionHandler handler) { host.setInteractionHandler(handler::onInteraction); } } diff --git a/quickstep/src/com/android/launcher3/uioverrides/QuickstepInteractionHandler.java b/quickstep/src/com/android/launcher3/uioverrides/QuickstepInteractionHandler.java index 2dde6b6148..6a6c824ed8 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/QuickstepInteractionHandler.java +++ b/quickstep/src/com/android/launcher3/uioverrides/QuickstepInteractionHandler.java @@ -29,16 +29,16 @@ import android.view.View; import android.widget.RemoteViews; import android.window.SplashScreen; +import com.android.launcher3.LauncherWidgetHolder; import com.android.launcher3.Utilities; import com.android.launcher3.logging.StatsLogManager; import com.android.launcher3.model.data.ItemInfo; import com.android.launcher3.util.ActivityOptionsWrapper; -import com.android.launcher3.widget.LauncherAppWidgetHost; import com.android.launcher3.widget.LauncherAppWidgetHostView; /** Provides a Quickstep specific animation when launching an activity from an app widget. */ -class QuickstepInteractionHandler implements - LauncherAppWidgetHost.LauncherWidgetInteractionHandler { +class QuickstepInteractionHandler + implements LauncherWidgetHolder.LauncherWidgetInteractionHandler { private static final String TAG = "QuickstepInteractionHandler"; diff --git a/src/com/android/launcher3/AppWidgetsRestoredReceiver.java b/src/com/android/launcher3/AppWidgetsRestoredReceiver.java index 75e89b2944..8604f1acd4 100644 --- a/src/com/android/launcher3/AppWidgetsRestoredReceiver.java +++ b/src/com/android/launcher3/AppWidgetsRestoredReceiver.java @@ -2,7 +2,6 @@ package com.android.launcher3; import static android.os.Process.myUserHandle; -import android.appwidget.AppWidgetHost; import android.appwidget.AppWidgetManager; import android.appwidget.AppWidgetProviderInfo; import android.content.BroadcastReceiver; @@ -12,6 +11,7 @@ import android.content.Intent; import android.database.Cursor; import android.util.Log; +import androidx.annotation.NonNull; import androidx.annotation.WorkerThread; import com.android.launcher3.LauncherSettings.Favorites; @@ -21,7 +21,6 @@ import com.android.launcher3.model.data.LauncherAppWidgetInfo; import com.android.launcher3.pm.UserCache; import com.android.launcher3.provider.RestoreDbTask; import com.android.launcher3.util.ContentWriter; -import com.android.launcher3.widget.LauncherAppWidgetHost; public class AppWidgetsRestoredReceiver extends BroadcastReceiver { @@ -32,7 +31,7 @@ public class AppWidgetsRestoredReceiver extends BroadcastReceiver { if (AppWidgetManager.ACTION_APPWIDGET_HOST_RESTORED.equals(intent.getAction())) { int hostId = intent.getIntExtra(AppWidgetManager.EXTRA_HOST_ID, 0); Log.d(TAG, "Widget ID map received for host:" + hostId); - if (hostId != LauncherAppWidgetHost.APPWIDGET_HOST_ID) { + if (hostId != LauncherWidgetHolder.APPWIDGET_HOST_ID) { return; } @@ -50,11 +49,11 @@ public class AppWidgetsRestoredReceiver extends BroadcastReceiver { * Updates the app widgets whose id has changed during the restore process. */ @WorkerThread - public static void restoreAppWidgetIds(Context context, int[] oldWidgetIds, int[] newWidgetIds) { - AppWidgetHost appWidgetHost = new LauncherAppWidgetHost(context); + public static void restoreAppWidgetIds(Context context, int[] oldWidgetIds, int[] newWidgetIds, + @NonNull LauncherWidgetHolder holder) { if (WidgetsModel.GO_DISABLE_WIDGETS) { Log.e(TAG, "Skipping widget ID remap as widgets not supported"); - appWidgetHost.deleteHost(); + holder.deleteHost(); return; } if (!RestoreDbTask.isPending(context)) { @@ -63,7 +62,7 @@ public class AppWidgetsRestoredReceiver extends BroadcastReceiver { Log.e(TAG, "Skipping widget ID remap as DB already in use"); for (int widgetId : newWidgetIds) { Log.d(TAG, "Deleting widgetId: " + widgetId); - appWidgetHost.deleteAppWidgetId(widgetId); + holder.deleteAppWidgetId(widgetId); } return; } @@ -100,7 +99,7 @@ public class AppWidgetsRestoredReceiver extends BroadcastReceiver { try { if (!cursor.moveToFirst()) { // The widget no long exists. - appWidgetHost.deleteAppWidgetId(newWidgetIds[i]); + holder.deleteAppWidgetId(newWidgetIds[i]); } } finally { cursor.close(); diff --git a/src/com/android/launcher3/AutoInstallsLayout.java b/src/com/android/launcher3/AutoInstallsLayout.java index 64666b0041..0003510ab1 100644 --- a/src/com/android/launcher3/AutoInstallsLayout.java +++ b/src/com/android/launcher3/AutoInstallsLayout.java @@ -16,7 +16,6 @@ package com.android.launcher3; -import android.appwidget.AppWidgetHost; import android.content.ComponentName; import android.content.ContentValues; import android.content.Context; @@ -74,7 +73,7 @@ public class AutoInstallsLayout { private static final String FORMATTED_LAYOUT_RES = "default_layout_%dx%d"; private static final String LAYOUT_RES = "default_layout"; - static AutoInstallsLayout get(Context context, AppWidgetHost appWidgetHost, + static AutoInstallsLayout get(Context context, LauncherWidgetHolder appWidgetHolder, LayoutParserCallback callback) { Pair customizationApkInfo = PackageManagerHelper.findSystemApk( ACTION_LAUNCHER_CUSTOMIZATION, context.getPackageManager()); @@ -109,7 +108,7 @@ public class AutoInstallsLayout { Log.e(TAG, "Layout definition not found in package: " + pkg); return null; } - return new AutoInstallsLayout(context, appWidgetHost, callback, targetRes, layoutId, + return new AutoInstallsLayout(context, appWidgetHolder, callback, targetRes, layoutId, TAG_WORKSPACE); } @@ -156,7 +155,7 @@ public class AutoInstallsLayout { @Thunk final Context mContext; @Thunk - final AppWidgetHost mAppWidgetHost; + final LauncherWidgetHolder mAppWidgetHolder; protected final LayoutParserCallback mCallback; protected final PackageManager mPackageManager; @@ -174,17 +173,17 @@ public class AutoInstallsLayout { protected SQLiteDatabase mDb; - public AutoInstallsLayout(Context context, AppWidgetHost appWidgetHost, + public AutoInstallsLayout(Context context, LauncherWidgetHolder appWidgetHolder, LayoutParserCallback callback, Resources res, int layoutId, String rootTag) { - this(context, appWidgetHost, callback, res, () -> res.getXml(layoutId), rootTag); + this(context, appWidgetHolder, callback, res, () -> res.getXml(layoutId), rootTag); } - public AutoInstallsLayout(Context context, AppWidgetHost appWidgetHost, + public AutoInstallsLayout(Context context, LauncherWidgetHolder appWidgetHolder, LayoutParserCallback callback, Resources res, Supplier initialLayoutSupplier, String rootTag) { mContext = context; - mAppWidgetHost = appWidgetHost; + mAppWidgetHolder = appWidgetHolder; mCallback = callback; mPackageManager = context.getPackageManager(); diff --git a/src/com/android/launcher3/DefaultLayoutParser.java b/src/com/android/launcher3/DefaultLayoutParser.java index 4daca8b109..d8558f0ca6 100644 --- a/src/com/android/launcher3/DefaultLayoutParser.java +++ b/src/com/android/launcher3/DefaultLayoutParser.java @@ -1,6 +1,5 @@ package com.android.launcher3; -import android.appwidget.AppWidgetHost; import android.appwidget.AppWidgetManager; import android.content.ComponentName; import android.content.Context; @@ -55,9 +54,9 @@ public class DefaultLayoutParser extends AutoInstallsLayout { private static final String ACTION_APPWIDGET_DEFAULT_WORKSPACE_CONFIGURE = "com.android.launcher.action.APPWIDGET_DEFAULT_WORKSPACE_CONFIGURE"; - public DefaultLayoutParser(Context context, AppWidgetHost appWidgetHost, + public DefaultLayoutParser(Context context, LauncherWidgetHolder appWidgetHolder, LayoutParserCallback callback, Resources sourceRes, int layoutId) { - super(context, appWidgetHost, callback, sourceRes, layoutId, TAG_FAVORITES); + super(context, appWidgetHolder, callback, sourceRes, layoutId, TAG_FAVORITES); } @Override @@ -336,11 +335,11 @@ public class DefaultLayoutParser extends AutoInstallsLayout { final AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(mContext); int insertedId = -1; try { - int appWidgetId = mAppWidgetHost.allocateAppWidgetId(); + int appWidgetId = mAppWidgetHolder.allocateAppWidgetId(); if (!appWidgetManager.bindAppWidgetIdIfAllowed(appWidgetId, cn)) { Log.e(TAG, "Unable to bind app widget id " + cn); - mAppWidgetHost.deleteAppWidgetId(appWidgetId); + mAppWidgetHolder.deleteAppWidgetId(appWidgetId); return -1; } @@ -349,7 +348,7 @@ public class DefaultLayoutParser extends AutoInstallsLayout { mValues.put(Favorites._ID, mCallback.generateNewItemId()); insertedId = mCallback.insertAndCheck(mDb, mValues); if (insertedId < 0) { - mAppWidgetHost.deleteAppWidgetId(appWidgetId); + mAppWidgetHolder.deleteAppWidgetId(appWidgetId); return insertedId; } diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java index ab7f6226c9..de2ef554ad 100644 --- a/src/com/android/launcher3/Launcher.java +++ b/src/com/android/launcher3/Launcher.java @@ -1720,6 +1720,7 @@ public class Launcher extends StatefulActivity } catch (NullPointerException ex) { Log.w(TAG, "problem while stopping AppWidgetHost during Launcher destruction", ex); } + mAppWidgetHolder.destroy(); TextKeyListener.getInstance().release(); clearPendingBinds(); diff --git a/src/com/android/launcher3/LauncherProvider.java b/src/com/android/launcher3/LauncherProvider.java index 58e85fea7e..a6731a5d77 100644 --- a/src/com/android/launcher3/LauncherProvider.java +++ b/src/com/android/launcher3/LauncherProvider.java @@ -22,7 +22,6 @@ import static com.android.launcher3.provider.LauncherDbUtils.tableExists; import android.annotation.TargetApi; import android.app.backup.BackupManager; -import android.appwidget.AppWidgetHost; import android.appwidget.AppWidgetManager; import android.content.ComponentName; import android.content.ContentProvider; @@ -55,6 +54,8 @@ import android.text.TextUtils; import android.util.Log; import android.util.Xml; +import androidx.annotation.NonNull; + import com.android.launcher3.AutoInstallsLayout.LayoutParserCallback; import com.android.launcher3.LauncherSettings.Favorites; import com.android.launcher3.config.FeatureFlags; @@ -70,7 +71,6 @@ import com.android.launcher3.util.IntSet; import com.android.launcher3.util.NoLocaleSQLiteHelper; import com.android.launcher3.util.PackageManagerHelper; import com.android.launcher3.util.Thunk; -import com.android.launcher3.widget.LauncherAppWidgetHost; import org.xmlpull.v1.XmlPullParser; @@ -255,17 +255,20 @@ public class LauncherProvider extends ContentProvider { values.getAsString(Favorites.APPWIDGET_PROVIDER)); if (cn != null) { + LauncherWidgetHolder widgetHolder = mOpenHelper.newLauncherWidgetHolder(); try { - AppWidgetHost widgetHost = mOpenHelper.newLauncherWidgetHost(); - int appWidgetId = widgetHost.allocateAppWidgetId(); + int appWidgetId = widgetHolder.allocateAppWidgetId(); values.put(LauncherSettings.Favorites.APPWIDGET_ID, appWidgetId); if (!appWidgetManager.bindAppWidgetIdIfAllowed(appWidgetId,cn)) { - widgetHost.deleteAppWidgetId(appWidgetId); + widgetHolder.deleteAppWidgetId(appWidgetId); return false; } } catch (RuntimeException e) { Log.e(TAG, "Failed to initialize external widget", e); return false; + } finally { + // Necessary to destroy the holder to free up possible activity context + widgetHolder.destroy(); } } else { return false; @@ -533,10 +536,10 @@ public class LauncherProvider extends ContentProvider { if (sp.getBoolean(mOpenHelper.getKey(EMPTY_DATABASE_CREATED), false)) { Log.d(TAG, "loading default workspace"); - AppWidgetHost widgetHost = mOpenHelper.newLauncherWidgetHost(); - AutoInstallsLayout loader = createWorkspaceLoaderFromAppRestriction(widgetHost); + LauncherWidgetHolder widgetHolder = mOpenHelper.newLauncherWidgetHolder(); + AutoInstallsLayout loader = createWorkspaceLoaderFromAppRestriction(widgetHolder); if (loader == null) { - loader = AutoInstallsLayout.get(getContext(),widgetHost, mOpenHelper); + loader = AutoInstallsLayout.get(getContext(), widgetHolder, mOpenHelper); } if (loader == null) { final Partner partner = Partner.get(getContext().getPackageManager()); @@ -545,7 +548,7 @@ public class LauncherProvider extends ContentProvider { int workspaceResId = partnerRes.getIdentifier(Partner.RES_DEFAULT_LAYOUT, "xml", partner.getPackageName()); if (workspaceResId != 0) { - loader = new DefaultLayoutParser(getContext(), widgetHost, + loader = new DefaultLayoutParser(getContext(), widgetHolder, mOpenHelper, partnerRes, workspaceResId); } } @@ -553,7 +556,7 @@ public class LauncherProvider extends ContentProvider { final boolean usingExternallyProvidedLayout = loader != null; if (loader == null) { - loader = getDefaultLayoutParser(widgetHost); + loader = getDefaultLayoutParser(widgetHolder); } // There might be some partially restored DB items, due to buggy restore logic in @@ -565,9 +568,10 @@ public class LauncherProvider extends ContentProvider { // Unable to load external layout. Cleanup and load the internal layout. mOpenHelper.createEmptyDB(mOpenHelper.getWritableDatabase()); mOpenHelper.loadFavorites(mOpenHelper.getWritableDatabase(), - getDefaultLayoutParser(widgetHost)); + getDefaultLayoutParser(widgetHolder)); } clearFlagEmptyDbCreated(); + widgetHolder.destroy(); } } @@ -576,7 +580,8 @@ public class LauncherProvider extends ContentProvider { * * @return the loader if the restrictions are set and the resource exists; null otherwise. */ - private AutoInstallsLayout createWorkspaceLoaderFromAppRestriction(AppWidgetHost widgetHost) { + private AutoInstallsLayout createWorkspaceLoaderFromAppRestriction( + LauncherWidgetHolder widgetHolder) { Context ctx = getContext(); final String authority; if (!TextUtils.isEmpty(mProviderAuthority)) { @@ -602,7 +607,7 @@ public class LauncherProvider extends ContentProvider { parser.setInput(new StringReader(layout)); Log.d(TAG, "Loading layout from " + authority); - return new AutoInstallsLayout(ctx, widgetHost, mOpenHelper, + return new AutoInstallsLayout(ctx, widgetHolder, mOpenHelper, ctx.getPackageManager().getResourcesForApplication(pi.applicationInfo), () -> parser, AutoInstallsLayout.TAG_WORKSPACE); } catch (Exception e) { @@ -621,7 +626,7 @@ public class LauncherProvider extends ContentProvider { .build(); } - private DefaultLayoutParser getDefaultLayoutParser(AppWidgetHost widgetHost) { + private DefaultLayoutParser getDefaultLayoutParser(LauncherWidgetHolder widgetHolder) { InvariantDeviceProfile idp = LauncherAppState.getIDP(getContext()); int defaultLayout = mUseTestWorkspaceLayout ? TEST_WORKSPACE_LAYOUT_RES_XML : idp.defaultLayoutId; @@ -631,7 +636,7 @@ public class LauncherProvider extends ContentProvider { defaultLayout = idp.demoModeLayoutId; } - return new DefaultLayoutParser(getContext(), widgetHost, + return new DefaultLayoutParser(getContext(), widgetHolder, mOpenHelper, getContext().getResources(), defaultLayout); } @@ -932,40 +937,46 @@ public class LauncherProvider extends ContentProvider { */ public void removeGhostWidgets(SQLiteDatabase db) { // Get all existing widget ids. - final AppWidgetHost host = newLauncherWidgetHost(); - final int[] allWidgets; + final LauncherWidgetHolder holder = newLauncherWidgetHolder(); try { - // Although the method was defined in O, it has existed since the beginning of time, - // so it might work on older platforms as well. - allWidgets = host.getAppWidgetIds(); - } catch (IncompatibleClassChangeError e) { - Log.e(TAG, "getAppWidgetIds not supported", e); - return; - } - final IntSet validWidgets = IntSet.wrap(LauncherDbUtils.queryIntArray(false, db, - Favorites.TABLE_NAME, Favorites.APPWIDGET_ID, - "itemType=" + Favorites.ITEM_TYPE_APPWIDGET, null, null)); - boolean isAnyWidgetRemoved = false; - for (int widgetId : allWidgets) { - if (!validWidgets.contains(widgetId)) { - try { - FileLog.d(TAG, "Deleting invalid widget " + widgetId); - host.deleteAppWidgetId(widgetId); - isAnyWidgetRemoved = true; - } catch (RuntimeException e) { - // Ignore + final int[] allWidgets; + try { + // Although the method was defined in O, it has existed since the beginning of + // time, so it might work on older platforms as well. + allWidgets = holder.getAppWidgetIds(); + } catch (IncompatibleClassChangeError e) { + Log.e(TAG, "getAppWidgetIds not supported", e); + // Necessary to destroy the holder to free up possible activity context + holder.destroy(); + return; + } + final IntSet validWidgets = IntSet.wrap(LauncherDbUtils.queryIntArray(false, db, + Favorites.TABLE_NAME, Favorites.APPWIDGET_ID, + "itemType=" + Favorites.ITEM_TYPE_APPWIDGET, null, null)); + boolean isAnyWidgetRemoved = false; + for (int widgetId : allWidgets) { + if (!validWidgets.contains(widgetId)) { + try { + FileLog.d(TAG, "Deleting invalid widget " + widgetId); + holder.deleteAppWidgetId(widgetId); + isAnyWidgetRemoved = true; + } catch (RuntimeException e) { + // Ignore + } } } - } - if (isAnyWidgetRemoved) { - final String allWidgetsIds = Arrays.stream(allWidgets).mapToObj(String::valueOf) - .collect(Collectors.joining(",", "[", "]")); - final String validWidgetsIds = Arrays.stream( - validWidgets.getArray().toArray()).mapToObj(String::valueOf) - .collect(Collectors.joining(",", "[", "]")); - FileLog.d(TAG, "One or more widgets was removed. db_path=" + db.getPath() - + " allWidgetsIds=" + allWidgetsIds - + ", validWidgetsIds=" + validWidgetsIds); + if (isAnyWidgetRemoved) { + final String allWidgetsIds = Arrays.stream(allWidgets).mapToObj(String::valueOf) + .collect(Collectors.joining(",", "[", "]")); + final String validWidgetsIds = Arrays.stream( + validWidgets.getArray().toArray()).mapToObj(String::valueOf) + .collect(Collectors.joining(",", "[", "]")); + FileLog.d(TAG, "One or more widgets was removed. db_path=" + db.getPath() + + " allWidgetsIds=" + allWidgetsIds + + ", validWidgetsIds=" + validWidgetsIds); + } + } finally { + holder.destroy(); } } @@ -1066,8 +1077,12 @@ public class LauncherProvider extends ContentProvider { return mMaxItemId; } - public AppWidgetHost newLauncherWidgetHost() { - return new LauncherAppWidgetHost(mContext); + /** + * @return A new {@link LauncherWidgetHolder} based on the current context + */ + @NonNull + public LauncherWidgetHolder newLauncherWidgetHolder() { + return new LauncherWidgetHolder(mContext); } @Override diff --git a/src/com/android/launcher3/LauncherWidgetHolder.java b/src/com/android/launcher3/LauncherWidgetHolder.java index 5fcd46fe4d..2612b9cb63 100644 --- a/src/com/android/launcher3/LauncherWidgetHolder.java +++ b/src/com/android/launcher3/LauncherWidgetHolder.java @@ -15,17 +15,39 @@ */ package com.android.launcher3; +import static android.app.Activity.RESULT_CANCELED; + +import static com.android.launcher3.util.Executors.MAIN_EXECUTOR; + +import android.app.PendingIntent; +import android.appwidget.AppWidgetHost; import android.appwidget.AppWidgetHostView; +import android.appwidget.AppWidgetManager; import android.appwidget.AppWidgetProviderInfo; +import android.content.ActivityNotFoundException; import android.content.Context; +import android.content.Intent; +import android.os.Bundle; +import android.util.SparseArray; +import android.view.View; +import android.widget.RemoteViews; +import android.widget.Toast; import androidx.annotation.NonNull; import androidx.annotation.Nullable; +import com.android.launcher3.config.FeatureFlags; +import com.android.launcher3.model.WidgetsModel; +import com.android.launcher3.model.data.ItemInfo; +import com.android.launcher3.testing.TestLogging; +import com.android.launcher3.testing.shared.TestProtocol; import com.android.launcher3.uioverrides.ApiWrapper; +import com.android.launcher3.widget.DeferredAppWidgetHostView; import com.android.launcher3.widget.LauncherAppWidgetHost; +import com.android.launcher3.widget.LauncherAppWidgetHostView; import com.android.launcher3.widget.LauncherAppWidgetProviderInfo; import com.android.launcher3.widget.PendingAppWidgetHostView; +import com.android.launcher3.widget.custom.CustomWidgetManager; import java.util.function.IntConsumer; @@ -34,8 +56,36 @@ import java.util.function.IntConsumer; * background. */ public class LauncherWidgetHolder { + public static final int APPWIDGET_HOST_ID = 1024; + + private static final int FLAG_LISTENING = 1; + private static final int FLAG_STATE_IS_NORMAL = 1 << 1; + private static final int FLAG_ACTIVITY_STARTED = 1 << 2; + private static final int FLAG_ACTIVITY_RESUMED = 1 << 3; + private static final int FLAGS_SHOULD_LISTEN = + FLAG_STATE_IS_NORMAL | FLAG_ACTIVITY_STARTED | FLAG_ACTIVITY_RESUMED; + @NonNull - private final LauncherAppWidgetHost mWidgetHost; + private final Context mContext; + + @NonNull + private final AppWidgetHost mWidgetHost; + + @NonNull + private final SparseArray mViews = new SparseArray<>(); + @NonNull + private final SparseArray mPendingViews = new SparseArray<>(); + @NonNull + private final SparseArray mDeferredViews = new SparseArray<>(); + @NonNull + private final SparseArray mCachedRemoteViews = new SparseArray<>(); + + private int mFlags = FLAG_STATE_IS_NORMAL; + + // TODO(b/191735836): Replace with ActivityOptions.KEY_SPLASH_SCREEN_STYLE when un-hidden + private static final String KEY_SPLASH_SCREEN_STYLE = "android.activity.splashScreenStyle"; + // TODO(b/191735836): Replace with SplashScreen.SPLASH_SCREEN_STYLE_EMPTY when un-hidden + private static final int SPLASH_SCREEN_STYLE_EMPTY = 0; public LauncherWidgetHolder(@NonNull Context context) { this(context, null); @@ -43,30 +93,70 @@ public class LauncherWidgetHolder { public LauncherWidgetHolder(@NonNull Context context, @Nullable IntConsumer appWidgetRemovedCallback) { - mWidgetHost = new LauncherAppWidgetHost(context, appWidgetRemovedCallback); + mContext = context; + mWidgetHost = createHost(context, appWidgetRemovedCallback); + } + + protected AppWidgetHost createHost( + Context context, @Nullable IntConsumer appWidgetRemovedCallback) { + return new LauncherAppWidgetHost(context, appWidgetRemovedCallback, this); } /** * Starts listening to the widget updates from the server side */ public void startListening() { - mWidgetHost.startListening(); + if (WidgetsModel.GO_DISABLE_WIDGETS) { + return; + } + setListeningFlag(true); + try { + mWidgetHost.startListening(); + } catch (Exception e) { + if (!Utilities.isBinderSizeError(e)) { + throw new RuntimeException(e); + } + // We're willing to let this slide. The exception is being caused by the list of + // RemoteViews which is being passed back. The startListening relationship will + // have been established by this point, and we will end up populating the + // widgets upon bind anyway. See issue 14255011 for more context. + } + + // We go in reverse order and inflate any deferred or cached widget + for (int i = mViews.size() - 1; i >= 0; i--) { + LauncherAppWidgetHostView view = mViews.valueAt(i); + if (view instanceof DeferredAppWidgetHostView) { + view.reInflate(); + } + if (FeatureFlags.ENABLE_CACHED_WIDGET.get()) { + final int appWidgetId = mViews.keyAt(i); + if (view == mDeferredViews.get(appWidgetId)) { + // If the widget view was deferred, we'll need to call super.createView here + // to make the binder call to system process to fetch cumulative updates to this + // widget, as well as setting up this view for future updates. + mWidgetHost.createView(view.getLauncher(), appWidgetId, + view.getAppWidgetInfo()); + // At this point #onCreateView should have been called, which in turn returned + // the deferred view. There's no reason to keep the reference anymore, so we + // removed it here. + mDeferredViews.remove(appWidgetId); + } + } + } } /** - * Set the STARTED state of the widget host - * @param isStarted True if setting the host as started, false otherwise + * Registers an "activity started/stopped" event. */ public void setActivityStarted(boolean isStarted) { - mWidgetHost.setActivityStarted(isStarted); + setShouldListenFlag(FLAG_ACTIVITY_STARTED, isStarted); } /** - * Set the RESUMED state of the widget host - * @param isResumed True if setting the host as resumed, false otherwise + * Registers an "activity paused/resumed" event. */ public void setActivityResumed(boolean isResumed) { - mWidgetHost.setActivityResumed(isResumed); + setShouldListenFlag(FLAG_ACTIVITY_RESUMED, isResumed); } /** @@ -74,7 +164,7 @@ public class LauncherWidgetHolder { * @param isNormal True if setting the host to be in normal state, false otherwise */ public void setStateIsNormal(boolean isNormal) { - mWidgetHost.setStateIsNormal(isNormal); + setShouldListenFlag(FLAG_STATE_IS_NORMAL, isNormal); } /** @@ -83,6 +173,7 @@ public class LauncherWidgetHolder { */ public void deleteAppWidgetId(int appWidgetId) { mWidgetHost.deleteAppWidgetId(appWidgetId); + mViews.remove(appWidgetId); } /** @@ -91,20 +182,37 @@ public class LauncherWidgetHolder { * @param view The {@link PendingAppWidgetHostView} of the app widget */ public void addPendingView(int appWidgetId, @NonNull PendingAppWidgetHostView view) { - mWidgetHost.addPendingView(appWidgetId, view); + mPendingViews.put(appWidgetId, view); } /** - * @return True if the host is listening to the widget updates, false otherwise + * @param appWidgetId The app widget id of the specified widget + * @return The {@link PendingAppWidgetHostView} of the widget if it exists, null otherwise */ - public boolean isListening() { - return mWidgetHost.isListening(); + @Nullable + protected PendingAppWidgetHostView getPendingView(int appWidgetId) { + return mPendingViews.get(appWidgetId); + } + + protected void removePendingView(int appWidgetId) { + mPendingViews.remove(appWidgetId); + } + + /** + * Called when the launcher is destroyed + */ + public void destroy() { + // No-op } /** * @return The allocated app widget id if allocation is successful, returns -1 otherwise */ public int allocateAppWidgetId() { + if (WidgetsModel.GO_DISABLE_WIDGETS) { + return AppWidgetManager.INVALID_APPWIDGET_ID; + } + return mWidgetHost.allocateAppWidgetId(); } @@ -112,18 +220,18 @@ public class LauncherWidgetHolder { * Add a listener that is triggered when the providers of the widgets are changed * @param listener The listener that notifies when the providers changed */ - public void addProviderChangeListener( - @NonNull LauncherAppWidgetHost.ProviderChangedListener listener) { - mWidgetHost.addProviderChangeListener(listener); + public void addProviderChangeListener(@NonNull ProviderChangedListener listener) { + LauncherAppWidgetHost tempHost = (LauncherAppWidgetHost) mWidgetHost; + tempHost.addProviderChangeListener(listener); } /** * Remove the specified listener from the host * @param listener The listener that is to be removed from the host */ - public void removeProviderChangeListener( - LauncherAppWidgetHost.ProviderChangedListener listener) { - mWidgetHost.removeProviderChangeListener(listener); + public void removeProviderChangeListener(ProviderChangedListener listener) { + LauncherAppWidgetHost tempHost = (LauncherAppWidgetHost) mWidgetHost; + tempHost.removeProviderChangeListener(listener); } /** @@ -134,7 +242,40 @@ public class LauncherWidgetHolder { */ public void startConfigActivity(@NonNull BaseDraggingActivity activity, int widgetId, int requestCode) { - mWidgetHost.startConfigActivity(activity, widgetId, requestCode); + if (WidgetsModel.GO_DISABLE_WIDGETS) { + sendActionCancelled(activity, requestCode); + return; + } + + try { + TestLogging.recordEvent(TestProtocol.SEQUENCE_MAIN, "start: startConfigActivity"); + mWidgetHost.startAppWidgetConfigureActivityForResult(activity, widgetId, 0, requestCode, + getConfigurationActivityOptions(activity, widgetId)); + } catch (ActivityNotFoundException | SecurityException e) { + Toast.makeText(activity, R.string.activity_not_found, Toast.LENGTH_SHORT).show(); + sendActionCancelled(activity, requestCode); + } + } + + private void sendActionCancelled(final BaseActivity activity, final int requestCode) { + MAIN_EXECUTOR.execute( + () -> activity.onActivityResult(requestCode, RESULT_CANCELED, null)); + } + + /** + * Returns an {@link android.app.ActivityOptions} bundle from the {code activity} for launching + * the configuration of the {@code widgetId} app widget, or null of options cannot be produced. + */ + @Nullable + protected Bundle getConfigurationActivityOptions(@NonNull BaseDraggingActivity activity, + int widgetId) { + LauncherAppWidgetHostView view = mViews.get(widgetId); + if (view == null) return null; + Object tag = view.getTag(); + if (!(tag instanceof ItemInfo)) return null; + Bundle bundle = activity.getActivityLaunchOptions(view, (ItemInfo) tag).toBundle(); + bundle.putInt(KEY_SPLASH_SCREEN_STYLE, SPLASH_SCREEN_STYLE_EMPTY); + return bundle; } /** @@ -146,27 +287,38 @@ public class LauncherWidgetHolder { */ public void startBindFlow(@NonNull BaseActivity activity, int appWidgetId, @NonNull AppWidgetProviderInfo info, int requestCode) { - mWidgetHost.startBindFlow(activity, appWidgetId, info, requestCode); + if (WidgetsModel.GO_DISABLE_WIDGETS) { + sendActionCancelled(activity, requestCode); + return; + } + + Intent intent = new Intent(AppWidgetManager.ACTION_APPWIDGET_BIND) + .putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId) + .putExtra(AppWidgetManager.EXTRA_APPWIDGET_PROVIDER, info.provider) + .putExtra(AppWidgetManager.EXTRA_APPWIDGET_PROVIDER_PROFILE, info.getProfile()); + // TODO: we need to make sure that this accounts for the options bundle. + // intent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_OPTIONS, options); + activity.startActivityForResult(intent, requestCode); } /** * Stop the host from listening to the widget updates */ public void stopListening() { + if (WidgetsModel.GO_DISABLE_WIDGETS) { + return; + } + mWidgetHost.stopListening(); + setListeningFlag(false); } - /** - * Create a view for the specified app widget - * @param context The activity context for which the view is created - * @param appWidgetId The ID of the widget - * @param info The {@link LauncherAppWidgetProviderInfo} of the widget - * @return A view for the widget - */ - @NonNull - public AppWidgetHostView createView(@NonNull Context context, int appWidgetId, - @NonNull LauncherAppWidgetProviderInfo info) { - return mWidgetHost.createView(context, appWidgetId, info); + protected void setListeningFlag(final boolean isListening) { + if (isListening) { + mFlags |= FLAG_LISTENING; + return; + } + mFlags &= ~FLAG_LISTENING; } /** @@ -174,14 +326,184 @@ public class LauncherWidgetHolder { * @param handler The interaction handler */ public void setInteractionHandler( - @Nullable LauncherAppWidgetHost.LauncherWidgetInteractionHandler handler) { + @Nullable LauncherWidgetInteractionHandler handler) { ApiWrapper.setHostInteractionHandler(mWidgetHost, handler); } + /** + * Delete the host + */ + public void deleteHost() { + mWidgetHost.deleteHost(); + } + + /** + * @return The app widget ids + */ + @NonNull + public int[] getAppWidgetIds() { + return mWidgetHost.getAppWidgetIds(); + } + + /** + * Create a view for the specified app widget + * @param context The activity context for which the view is created + * @param appWidgetId The ID of the widget + * @param appWidget The {@link LauncherAppWidgetProviderInfo} of the widget + * @return A view for the widget + */ + @NonNull + public AppWidgetHostView createView(@NonNull Context context, int appWidgetId, + @NonNull LauncherAppWidgetProviderInfo appWidget) { + if (appWidget.isCustomWidget()) { + LauncherAppWidgetHostView lahv = new LauncherAppWidgetHostView(context); + lahv.setAppWidget(0, appWidget); + CustomWidgetManager.INSTANCE.get(context).onViewCreated(lahv); + return lahv; + } else if ((mFlags & FLAG_LISTENING) == 0) { + // Since the launcher hasn't started listening to widget updates, we can't simply call + // super.createView here because the later will make a binder call to retrieve + // RemoteViews from system process. + // TODO: have launcher always listens to widget updates in background so that this + // check can be removed altogether. + if (FeatureFlags.ENABLE_CACHED_WIDGET.get() + && mCachedRemoteViews.get(appWidgetId) != null) { + // We've found RemoteViews from cache for this widget, so we will instantiate a + // widget host view and populate it with the cached RemoteViews. + final LauncherAppWidgetHostView view = new LauncherAppWidgetHostView(context); + view.setAppWidget(appWidgetId, appWidget); + view.updateAppWidget(mCachedRemoteViews.get(appWidgetId)); + mDeferredViews.put(appWidgetId, view); + mViews.put(appWidgetId, view); + return view; + } else { + // When cache misses, a placeholder for the widget will be returned instead. + DeferredAppWidgetHostView view = new DeferredAppWidgetHostView(context); + view.setAppWidget(appWidgetId, appWidget); + mViews.put(appWidgetId, view); + return view; + } + } else { + try { + return mWidgetHost.createView(context, appWidgetId, appWidget); + } catch (Exception e) { + if (!Utilities.isBinderSizeError(e)) { + throw new RuntimeException(e); + } + + // If the exception was thrown while fetching the remote views, let the view stay. + // This will ensure that if the widget posts a valid update later, the view + // will update. + LauncherAppWidgetHostView view = mViews.get(appWidgetId); + if (view == null) { + view = onCreateView(mContext, appWidgetId, appWidget); + } + view.setAppWidget(appWidgetId, appWidget); + view.switchToErrorView(); + return view; + } + } + } + + /** + * Listener for getting notifications on provider changes. + */ + public interface ProviderChangedListener { + /** + * Notify the listener that the providers have changed + */ + void notifyWidgetProvidersChanged(); + } + + /** + * Called to return a proper view when creating a view + * @param context The context for which the widget view is created + * @param appWidgetId The ID of the added widget + * @param appWidget The provider info of the added widget + * @return A view for the specified app widget + */ + @NonNull + public LauncherAppWidgetHostView onCreateView(Context context, int appWidgetId, + AppWidgetProviderInfo appWidget) { + final LauncherAppWidgetHostView view; + if (getPendingView(appWidgetId) != null) { + view = getPendingView(appWidgetId); + removePendingView(appWidgetId); + } else if (mDeferredViews.get(appWidgetId) != null) { + // In case the widget view is deferred, we will simply return the deferred view as + // opposed to instantiate a new instance of LauncherAppWidgetHostView since launcher + // already added the former to the workspace. + view = mDeferredViews.get(appWidgetId); + } else { + view = new LauncherAppWidgetHostView(context); + } + mViews.put(appWidgetId, view); + return view; + } + /** * Clears all the views from the host */ public void clearViews() { - mWidgetHost.clearViews(); + LauncherAppWidgetHost tempHost = (LauncherAppWidgetHost) mWidgetHost; + tempHost.clearViews(); + if (FeatureFlags.ENABLE_CACHED_WIDGET.get()) { + // First, we clear any previously cached content from existing widgets + mCachedRemoteViews.clear(); + mDeferredViews.clear(); + // Then we proceed to cache the content from the widgets + for (int i = 0; i < mViews.size(); i++) { + final int appWidgetId = mViews.keyAt(i); + final LauncherAppWidgetHostView view = mViews.get(appWidgetId); + mCachedRemoteViews.put(appWidgetId, view.getLastRemoteViews()); + } + } + mViews.clear(); + } + + /** + * @return True if the host is listening to the updates, false otherwise + */ + public boolean isListening() { + return (mFlags & FLAG_LISTENING) != 0; + } + + /** + * Sets or unsets a flag the can change whether the widget host should be in the listening + * state. + */ + private void setShouldListenFlag(int flag, boolean on) { + if (on) { + mFlags |= flag; + } else { + mFlags &= ~flag; + } + + final boolean listening = isListening(); + if (!listening && (mFlags & FLAGS_SHOULD_LISTEN) == FLAGS_SHOULD_LISTEN) { + // Postpone starting listening until all flags are on. + startListening(); + } else if (listening && (mFlags & FLAG_ACTIVITY_STARTED) == 0) { + // Postpone stopping listening until the activity is stopped. + stopListening(); + } + } + + /** + * Set as a substitution for the hidden interaction handler in RemoteViews + */ + public interface LauncherWidgetInteractionHandler { + /** + * Invoked when the user performs an interaction on the View. + * + * @param view the View with which the user interacted + * @param pendingIntent the base PendingIntent associated with the view + * @param response the response to the interaction, which knows how to fill in the + * attached PendingIntent + */ + boolean onInteraction( + View view, + PendingIntent pendingIntent, + RemoteViews.RemoteResponse response); } } diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java index 27e1ba143b..39679a994a 100644 --- a/src/com/android/launcher3/Workspace.java +++ b/src/com/android/launcher3/Workspace.java @@ -63,6 +63,7 @@ import android.widget.Toast; import androidx.annotation.Nullable; +import com.android.launcher3.LauncherWidgetHolder.ProviderChangedListener; import com.android.launcher3.accessibility.AccessibleDragListenerAdapter; import com.android.launcher3.accessibility.WorkspaceAccessibilityHelper; import com.android.launcher3.anim.Interpolators; @@ -107,7 +108,6 @@ import com.android.launcher3.util.PackageUserKey; import com.android.launcher3.util.RunnableList; import com.android.launcher3.util.Thunk; import com.android.launcher3.util.WallpaperOffsetInterpolator; -import com.android.launcher3.widget.LauncherAppWidgetHost.ProviderChangedListener; import com.android.launcher3.widget.LauncherAppWidgetHostView; import com.android.launcher3.widget.NavigableAppWidgetHostView; import com.android.launcher3.widget.PendingAddShortcutInfo; diff --git a/src/com/android/launcher3/dragndrop/AddItemActivity.java b/src/com/android/launcher3/dragndrop/AddItemActivity.java index 05b1984887..4fb5ff6638 100644 --- a/src/com/android/launcher3/dragndrop/AddItemActivity.java +++ b/src/com/android/launcher3/dragndrop/AddItemActivity.java @@ -53,10 +53,13 @@ import android.view.accessibility.AccessibilityEvent; import android.view.accessibility.AccessibilityManager; import android.widget.TextView; +import androidx.annotation.Nullable; + import com.android.launcher3.BaseActivity; import com.android.launcher3.InvariantDeviceProfile; import com.android.launcher3.Launcher; import com.android.launcher3.LauncherAppState; +import com.android.launcher3.LauncherWidgetHolder; import com.android.launcher3.R; import com.android.launcher3.logging.StatsLogManager; import com.android.launcher3.model.ItemInstallQueue; @@ -69,7 +72,6 @@ import com.android.launcher3.util.SystemUiController; import com.android.launcher3.views.AbstractSlideInView; import com.android.launcher3.views.BaseDragLayer; import com.android.launcher3.widget.AddItemWidgetsBottomSheet; -import com.android.launcher3.widget.LauncherAppWidgetHost; import com.android.launcher3.widget.LauncherAppWidgetProviderInfo; import com.android.launcher3.widget.NavigableAppWidgetHostView; import com.android.launcher3.widget.PendingAddShortcutInfo; @@ -105,7 +107,8 @@ public class AddItemActivity extends BaseActivity private WidgetCell mWidgetCell; // Widget request specific options. - private LauncherAppWidgetHost mAppWidgetHost; + @Nullable + private LauncherWidgetHolder mAppWidgetHolder = null; private WidgetManagerHelper mAppWidgetManager; private int mPendingBindWidgetId; private Bundle mWidgetOptions; @@ -284,7 +287,7 @@ public class AddItemActivity extends BaseActivity mWidgetCell.setRemoteViewsPreview(PinItemDragListener.getPreview(mRequest)); mAppWidgetManager = new WidgetManagerHelper(this); - mAppWidgetHost = new LauncherAppWidgetHost(this); + mAppWidgetHolder = new LauncherWidgetHolder(this); PendingAddWidgetInfo pendingInfo = new PendingAddWidgetInfo(widgetInfo, CONTAINER_PIN_WIDGETS); @@ -338,7 +341,7 @@ public class AddItemActivity extends BaseActivity return; } - mPendingBindWidgetId = mAppWidgetHost.allocateAppWidgetId(); + mPendingBindWidgetId = mAppWidgetHolder.allocateAppWidgetId(); AppWidgetProviderInfo widgetProviderInfo = mRequest.getAppWidgetProviderInfo(this); boolean success = mAppWidgetManager.bindAppWidgetIdIfAllowed( mPendingBindWidgetId, widgetProviderInfo, mWidgetOptions); @@ -349,7 +352,7 @@ public class AddItemActivity extends BaseActivity } // request bind widget - mAppWidgetHost.startBindFlow(this, mPendingBindWidgetId, + mAppWidgetHolder.startBindFlow(this, mPendingBindWidgetId, mRequest.getAppWidgetProviderInfo(this), REQUEST_BIND_APPWIDGET); } @@ -362,6 +365,15 @@ public class AddItemActivity extends BaseActivity mSlideInView.close(/* animate= */ true); } + @Override + public void onDestroy() { + super.onDestroy(); + if (mAppWidgetHolder != null) { + // Necessary to destroy the holder to free up possible activity context + mAppWidgetHolder.destroy(); + } + } + @Override public void onBackPressed() { logCommand(LAUNCHER_ADD_EXTERNAL_ITEM_BACK); @@ -378,7 +390,7 @@ public class AddItemActivity extends BaseActivity acceptWidget(widgetId); } else { // Simply wait it out. - mAppWidgetHost.deleteAppWidgetId(widgetId); + mAppWidgetHolder.deleteAppWidgetId(widgetId); mPendingBindWidgetId = -1; } return; diff --git a/src/com/android/launcher3/graphics/LauncherPreviewRenderer.java b/src/com/android/launcher3/graphics/LauncherPreviewRenderer.java index 482e923403..0646e7f802 100644 --- a/src/com/android/launcher3/graphics/LauncherPreviewRenderer.java +++ b/src/com/android/launcher3/graphics/LauncherPreviewRenderer.java @@ -68,6 +68,7 @@ import com.android.launcher3.InsettableFrameLayout; import com.android.launcher3.InvariantDeviceProfile; import com.android.launcher3.LauncherAppState; import com.android.launcher3.LauncherSettings.Favorites; +import com.android.launcher3.LauncherWidgetHolder; import com.android.launcher3.R; import com.android.launcher3.Utilities; import com.android.launcher3.Workspace; @@ -99,7 +100,6 @@ import com.android.launcher3.util.window.WindowManagerProxy; import com.android.launcher3.views.ActivityContext; import com.android.launcher3.views.BaseDragLayer; import com.android.launcher3.widget.BaseLauncherAppWidgetHostView; -import com.android.launcher3.widget.LauncherAppWidgetHost; import com.android.launcher3.widget.LauncherAppWidgetProviderInfo; import com.android.launcher3.widget.LocalColorExtractor; import com.android.launcher3.widget.NavigableAppWidgetHostView; @@ -554,7 +554,7 @@ public class LauncherPreviewRenderer extends ContextWrapper private class LauncherPreviewAppWidgetHost extends AppWidgetHost { private LauncherPreviewAppWidgetHost(Context context) { - super(context, LauncherAppWidgetHost.APPWIDGET_HOST_ID); + super(context, LauncherWidgetHolder.APPWIDGET_HOST_ID); } @Override diff --git a/src/com/android/launcher3/provider/RestoreDbTask.java b/src/com/android/launcher3/provider/RestoreDbTask.java index 48b3acfbf1..70dd98eef6 100644 --- a/src/com/android/launcher3/provider/RestoreDbTask.java +++ b/src/com/android/launcher3/provider/RestoreDbTask.java @@ -38,6 +38,7 @@ import com.android.launcher3.InvariantDeviceProfile; import com.android.launcher3.LauncherAppState; import com.android.launcher3.LauncherProvider.DatabaseHelper; import com.android.launcher3.LauncherSettings.Favorites; +import com.android.launcher3.LauncherWidgetHolder; import com.android.launcher3.Utilities; import com.android.launcher3.logging.FileLog; import com.android.launcher3.model.DeviceGridState; @@ -353,9 +354,12 @@ public class RestoreDbTask { private void restoreAppWidgetIdsIfExists(Context context) { SharedPreferences prefs = Utilities.getPrefs(context); if (prefs.contains(APPWIDGET_OLD_IDS) && prefs.contains(APPWIDGET_IDS)) { + LauncherWidgetHolder holder = new LauncherWidgetHolder(context); AppWidgetsRestoredReceiver.restoreAppWidgetIds(context, IntArray.fromConcatString(prefs.getString(APPWIDGET_OLD_IDS, "")).toArray(), - IntArray.fromConcatString(prefs.getString(APPWIDGET_IDS, "")).toArray()); + IntArray.fromConcatString(prefs.getString(APPWIDGET_IDS, "")).toArray(), + holder); + holder.destroy(); } else { FileLog.d(TAG, "No app widget ids to restore."); } diff --git a/src/com/android/launcher3/widget/LauncherAppWidgetHost.java b/src/com/android/launcher3/widget/LauncherAppWidgetHost.java index fff8fbb12a..c57139d72c 100644 --- a/src/com/android/launcher3/widget/LauncherAppWidgetHost.java +++ b/src/com/android/launcher3/widget/LauncherAppWidgetHost.java @@ -16,301 +16,88 @@ package com.android.launcher3.widget; -import static android.app.Activity.RESULT_CANCELED; +import static com.android.launcher3.LauncherWidgetHolder.APPWIDGET_HOST_ID; -import android.app.PendingIntent; import android.appwidget.AppWidgetHost; -import android.appwidget.AppWidgetHostView; -import android.appwidget.AppWidgetManager; import android.appwidget.AppWidgetProviderInfo; -import android.content.ActivityNotFoundException; import android.content.Context; -import android.content.Intent; -import android.os.Bundle; -import android.os.Handler; -import android.util.SparseArray; -import android.view.View; -import android.widget.RemoteViews; -import android.widget.Toast; +import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import com.android.launcher3.BaseActivity; -import com.android.launcher3.BaseDraggingActivity; import com.android.launcher3.LauncherAppState; -import com.android.launcher3.R; -import com.android.launcher3.Utilities; -import com.android.launcher3.config.FeatureFlags; -import com.android.launcher3.model.WidgetsModel; -import com.android.launcher3.model.data.ItemInfo; -import com.android.launcher3.testing.TestLogging; -import com.android.launcher3.testing.shared.TestProtocol; -import com.android.launcher3.widget.custom.CustomWidgetManager; +import com.android.launcher3.LauncherWidgetHolder; import java.util.ArrayList; import java.util.function.IntConsumer; - /** * Specific {@link AppWidgetHost} that creates our {@link LauncherAppWidgetHostView} * which correctly captures all long-press events. This ensures that users can * always pick up and move widgets. */ public class LauncherAppWidgetHost extends AppWidgetHost { + @NonNull + private final ArrayList + mProviderChangeListeners = new ArrayList<>(); - private static final int FLAG_LISTENING = 1; - private static final int FLAG_STATE_IS_NORMAL = 1 << 1; - private static final int FLAG_ACTIVITY_STARTED = 1 << 2; - private static final int FLAG_ACTIVITY_RESUMED = 1 << 3; - private static final int FLAGS_SHOULD_LISTEN = - FLAG_STATE_IS_NORMAL | FLAG_ACTIVITY_STARTED | FLAG_ACTIVITY_RESUMED; - // TODO(b/191735836): Replace with ActivityOptions.KEY_SPLASH_SCREEN_STYLE when un-hidden - private static final String KEY_SPLASH_SCREEN_STYLE = "android.activity.splashScreenStyle"; - // TODO(b/191735836): Replace with SplashScreen.SPLASH_SCREEN_STYLE_EMPTY when un-hidden - private static final int SPLASH_SCREEN_STYLE_EMPTY = 0; - - public static final int APPWIDGET_HOST_ID = 1024; - - private final ArrayList mProviderChangeListeners = new ArrayList<>(); - private final SparseArray mViews = new SparseArray<>(); - private final SparseArray mPendingViews = new SparseArray<>(); - private final SparseArray mDeferredViews = new SparseArray<>(); - private final SparseArray mCachedRemoteViews = new SparseArray<>(); - + @NonNull private final Context mContext; - private int mFlags = FLAG_STATE_IS_NORMAL; - private IntConsumer mAppWidgetRemovedCallback = null; + @Nullable + private final IntConsumer mAppWidgetRemovedCallback; - /** - * This serves for the purpose of getting rid of the hidden API calling of InteractionHandler - */ - public interface LauncherWidgetInteractionHandler { - /** - * Invoked when the user performs an interaction on the View. - * - * @param view the View with which the user interacted - * @param pendingIntent the base PendingIntent associated with the view - * @param response the response to the interaction, which knows how to fill in the - * attached PendingIntent - */ - boolean onInteraction( - View view, - PendingIntent pendingIntent, - RemoteViews.RemoteResponse response); - } + @NonNull + private final LauncherWidgetHolder mHolder; - public LauncherAppWidgetHost(Context context) { - this(context, null); - } - - public LauncherAppWidgetHost(Context context, - IntConsumer appWidgetRemovedCallback) { + public LauncherAppWidgetHost(@NonNull Context context, + @Nullable IntConsumer appWidgetRemovedCallback, @NonNull LauncherWidgetHolder holder) { super(context, APPWIDGET_HOST_ID); mContext = context; mAppWidgetRemovedCallback = appWidgetRemovedCallback; - } - - @Override - protected LauncherAppWidgetHostView onCreateView(Context context, int appWidgetId, - AppWidgetProviderInfo appWidget) { - final LauncherAppWidgetHostView view; - if (mPendingViews.get(appWidgetId) != null) { - view = mPendingViews.get(appWidgetId); - mPendingViews.remove(appWidgetId); - } else if (mDeferredViews.get(appWidgetId) != null) { - // In case the widget view is deferred, we will simply return the deferred view as - // opposed to instantiate a new instance of LauncherAppWidgetHostView since launcher - // already added the former to the workspace. - view = mDeferredViews.get(appWidgetId); - } else { - view = new LauncherAppWidgetHostView(context); - } - mViews.put(appWidgetId, view); - return view; - } - - @Override - public void startListening() { - if (WidgetsModel.GO_DISABLE_WIDGETS) { - return; - } - mFlags |= FLAG_LISTENING; - try { - super.startListening(); - } catch (Exception e) { - if (!Utilities.isBinderSizeError(e)) { - throw new RuntimeException(e); - } - // We're willing to let this slide. The exception is being caused by the list of - // RemoteViews which is being passed back. The startListening relationship will - // have been established by this point, and we will end up populating the - // widgets upon bind anyway. See issue 14255011 for more context. - } - - // We go in reverse order and inflate any deferred or cached widget - for (int i = mViews.size() - 1; i >= 0; i--) { - LauncherAppWidgetHostView view = mViews.valueAt(i); - if (view instanceof DeferredAppWidgetHostView) { - view.reInflate(); - } - if (FeatureFlags.ENABLE_CACHED_WIDGET.get()) { - final int appWidgetId = mViews.keyAt(i); - if (view == mDeferredViews.get(appWidgetId)) { - // If the widget view was deferred, we'll need to call super.createView here - // to make the binder call to system process to fetch cumulative updates to this - // widget, as well as setting up this view for future updates. - super.createView(view.mLauncher, appWidgetId, view.getAppWidgetInfo()); - // At this point #onCreateView should have been called, which in turn returned - // the deferred view. There's no reason to keep the reference anymore, so we - // removed it here. - mDeferredViews.remove(appWidgetId); - } - } - } - } - - @Override - public void stopListening() { - if (WidgetsModel.GO_DISABLE_WIDGETS) { - return; - } - mFlags &= ~FLAG_LISTENING; - super.stopListening(); - } - - public boolean isListening() { - return (mFlags & FLAG_LISTENING) != 0; + mHolder = holder; } /** - * Sets or unsets a flag the can change whether the widget host should be in the listening - * state. + * Add a listener that is triggered when the providers of the widgets are changed + * @param listener The listener that notifies when the providers changed */ - private void setShouldListenFlag(int flag, boolean on) { - if (on) { - mFlags |= flag; - } else { - mFlags &= ~flag; - } - - final boolean listening = isListening(); - if (!listening && (mFlags & FLAGS_SHOULD_LISTEN) == FLAGS_SHOULD_LISTEN) { - // Postpone starting listening until all flags are on. - startListening(); - } else if (listening && (mFlags & FLAG_ACTIVITY_STARTED) == 0) { - // Postpone stopping listening until the activity is stopped. - stopListening(); - } + public void addProviderChangeListener( + @NonNull LauncherWidgetHolder.ProviderChangedListener listener) { + mProviderChangeListeners.add(listener); } /** - * Registers an "entering/leaving Normal state" event. + * Remove the specified listener from the host + * @param listener The listener that is to be removed from the host */ - public void setStateIsNormal(boolean isNormal) { - setShouldListenFlag(FLAG_STATE_IS_NORMAL, isNormal); - } - - /** - * Registers an "activity started/stopped" event. - */ - public void setActivityStarted(boolean isStarted) { - setShouldListenFlag(FLAG_ACTIVITY_STARTED, isStarted); - } - - /** - * Registers an "activity paused/resumed" event. - */ - public void setActivityResumed(boolean isResumed) { - setShouldListenFlag(FLAG_ACTIVITY_RESUMED, isResumed); + public void removeProviderChangeListener( + LauncherWidgetHolder.ProviderChangedListener listener) { + mProviderChangeListeners.remove(listener); } @Override - public int allocateAppWidgetId() { - if (WidgetsModel.GO_DISABLE_WIDGETS) { - return AppWidgetManager.INVALID_APPWIDGET_ID; - } - - return super.allocateAppWidgetId(); - } - - public void addProviderChangeListener(ProviderChangedListener callback) { - mProviderChangeListeners.add(callback); - } - - public void removeProviderChangeListener(ProviderChangedListener callback) { - mProviderChangeListeners.remove(callback); - } - protected void onProvidersChanged() { if (!mProviderChangeListeners.isEmpty()) { - for (ProviderChangedListener callback : new ArrayList<>(mProviderChangeListeners)) { + for (LauncherWidgetHolder.ProviderChangedListener callback : + new ArrayList<>(mProviderChangeListeners)) { callback.notifyWidgetProvidersChanged(); } } } - public void addPendingView(int appWidgetId, PendingAppWidgetHostView view) { - mPendingViews.put(appWidgetId, view); - } - - public AppWidgetHostView createView(Context context, int appWidgetId, - LauncherAppWidgetProviderInfo appWidget) { - if (appWidget.isCustomWidget()) { - LauncherAppWidgetHostView lahv = new LauncherAppWidgetHostView(context); - lahv.setAppWidget(0, appWidget); - CustomWidgetManager.INSTANCE.get(context).onViewCreated(lahv); - return lahv; - } else if ((mFlags & FLAG_LISTENING) == 0) { - // Since the launcher hasn't started listening to widget updates, we can't simply call - // super.createView here because the later will make a binder call to retrieve - // RemoteViews from system process. - // TODO: have launcher always listens to widget updates in background so that this - // check can be removed altogether. - if (FeatureFlags.ENABLE_CACHED_WIDGET.get() - && mCachedRemoteViews.get(appWidgetId) != null) { - // We've found RemoteViews from cache for this widget, so we will instantiate a - // widget host view and populate it with the cached RemoteViews. - final LauncherAppWidgetHostView view = new LauncherAppWidgetHostView(context); - view.setAppWidget(appWidgetId, appWidget); - view.updateAppWidget(mCachedRemoteViews.get(appWidgetId)); - mDeferredViews.put(appWidgetId, view); - mViews.put(appWidgetId, view); - return view; - } else { - // When cache misses, a placeholder for the widget will be returned instead. - DeferredAppWidgetHostView view = new DeferredAppWidgetHostView(context); - view.setAppWidget(appWidgetId, appWidget); - mViews.put(appWidgetId, view); - return view; - } - } else { - try { - return super.createView(context, appWidgetId, appWidget); - } catch (Exception e) { - if (!Utilities.isBinderSizeError(e)) { - throw new RuntimeException(e); - } - - // If the exception was thrown while fetching the remote views, let the view stay. - // This will ensure that if the widget posts a valid update later, the view - // will update. - LauncherAppWidgetHostView view = mViews.get(appWidgetId); - if (view == null) { - view = onCreateView(mContext, appWidgetId, appWidget); - } - view.setAppWidget(appWidgetId, appWidget); - view.switchToErrorView(); - return view; - } - } + @Override + @NonNull + public LauncherAppWidgetHostView onCreateView(Context context, int appWidgetId, + AppWidgetProviderInfo appWidget) { + return mHolder.onCreateView(context, appWidgetId, appWidget); } /** * Called when the AppWidget provider for a AppWidget has been upgraded to a new apk. */ @Override - protected void onProviderChanged(int appWidgetId, AppWidgetProviderInfo appWidget) { + protected void onProviderChanged(int appWidgetId, @NonNull AppWidgetProviderInfo appWidget) { LauncherAppWidgetProviderInfo info = LauncherAppWidgetProviderInfo.fromProviderInfo( mContext, appWidget); super.onProviderChanged(appWidgetId, info); @@ -324,6 +111,7 @@ public class LauncherAppWidgetHost extends AppWidgetHost { * * @param appWidgetId TODO: make this override when SDK is updated */ + @Override public void onAppWidgetRemoved(int appWidgetId) { if (mAppWidgetRemovedCallback == null) { return; @@ -331,92 +119,12 @@ public class LauncherAppWidgetHost extends AppWidgetHost { mAppWidgetRemovedCallback.accept(appWidgetId); } - @Override - public void deleteAppWidgetId(int appWidgetId) { - super.deleteAppWidgetId(appWidgetId); - mViews.remove(appWidgetId); - } - + /** + * The same as super.clearViews(), except with the scope exposed + */ @Override public void clearViews() { super.clearViews(); - if (FeatureFlags.ENABLE_CACHED_WIDGET.get()) { - // First, we clear any previously cached content from existing widgets - mCachedRemoteViews.clear(); - mDeferredViews.clear(); - // Then we proceed to cache the content from the widgets - for (int i = 0; i < mViews.size(); i++) { - final int appWidgetId = mViews.keyAt(i); - final LauncherAppWidgetHostView view = mViews.get(appWidgetId); - mCachedRemoteViews.put(appWidgetId, view.mLastRemoteViews); - } - } - mViews.clear(); } - public void startBindFlow(BaseActivity activity, - int appWidgetId, AppWidgetProviderInfo info, int requestCode) { - - if (WidgetsModel.GO_DISABLE_WIDGETS) { - sendActionCancelled(activity, requestCode); - return; - } - - Intent intent = new Intent(AppWidgetManager.ACTION_APPWIDGET_BIND) - .putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId) - .putExtra(AppWidgetManager.EXTRA_APPWIDGET_PROVIDER, info.provider) - .putExtra(AppWidgetManager.EXTRA_APPWIDGET_PROVIDER_PROFILE, info.getProfile()); - // TODO: we need to make sure that this accounts for the options bundle. - // intent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_OPTIONS, options); - activity.startActivityForResult(intent, requestCode); - } - - /** - * Launches an app widget's configuration activity. - * @param activity The activity from which to launch the configuration activity - * @param widgetId The id of the bound app widget to be configured - * @param requestCode An optional request code to be returned with the result - */ - public void startConfigActivity(BaseDraggingActivity activity, int widgetId, int requestCode) { - if (WidgetsModel.GO_DISABLE_WIDGETS) { - sendActionCancelled(activity, requestCode); - return; - } - - try { - TestLogging.recordEvent(TestProtocol.SEQUENCE_MAIN, "start: startConfigActivity"); - startAppWidgetConfigureActivityForResult(activity, widgetId, 0, requestCode, - getConfigurationActivityOptions(activity, widgetId)); - } catch (ActivityNotFoundException | SecurityException e) { - Toast.makeText(activity, R.string.activity_not_found, Toast.LENGTH_SHORT).show(); - sendActionCancelled(activity, requestCode); - } - } - - /** - * Returns an {@link android.app.ActivityOptions} bundle from the {code activity} for launching - * the configuration of the {@code widgetId} app widget, or null of options cannot be produced. - */ - @Nullable - private Bundle getConfigurationActivityOptions(BaseDraggingActivity activity, int widgetId) { - LauncherAppWidgetHostView view = mViews.get(widgetId); - if (view == null) return null; - Object tag = view.getTag(); - if (!(tag instanceof ItemInfo)) return null; - Bundle bundle = activity.getActivityLaunchOptions(view, (ItemInfo) tag).toBundle(); - bundle.putInt(KEY_SPLASH_SCREEN_STYLE, SPLASH_SCREEN_STYLE_EMPTY); - return bundle; - } - - private void sendActionCancelled(final BaseActivity activity, final int requestCode) { - new Handler().post(() -> activity.onActivityResult(requestCode, RESULT_CANCELED, null)); - } - - /** - * Listener for getting notifications on provider changes. - */ - public interface ProviderChangedListener { - - void notifyWidgetProvidersChanged(); - } } diff --git a/src/com/android/launcher3/widget/LauncherAppWidgetHostView.java b/src/com/android/launcher3/widget/LauncherAppWidgetHostView.java index bc3889fd26..990282bdab 100644 --- a/src/com/android/launcher3/widget/LauncherAppWidgetHostView.java +++ b/src/com/android/launcher3/widget/LauncherAppWidgetHostView.java @@ -37,6 +37,7 @@ import android.widget.AdapterView; import android.widget.Advanceable; import android.widget.RemoteViews; +import androidx.annotation.NonNull; import androidx.annotation.Nullable; import com.android.launcher3.CheckLongPressHelper; @@ -172,6 +173,16 @@ public class LauncherAppWidgetHostView extends BaseLauncherAppWidgetHostView mReinflateOnConfigChange = !isSameOrientation(); } + @NonNull + public Launcher getLauncher() { + return mLauncher; + } + + @Nullable + public RemoteViews getLastRemoteViews() { + return mLastRemoteViews; + } + private boolean isSameOrientation() { return mLauncher.getResources().getConfiguration().orientation == mLauncher.getOrientation(); diff --git a/src/com/android/launcher3/widget/picker/WidgetsFullSheet.java b/src/com/android/launcher3/widget/picker/WidgetsFullSheet.java index 21b2647d0c..ee8d8e85b3 100644 --- a/src/com/android/launcher3/widget/picker/WidgetsFullSheet.java +++ b/src/com/android/launcher3/widget/picker/WidgetsFullSheet.java @@ -52,6 +52,7 @@ import androidx.recyclerview.widget.RecyclerView; import com.android.launcher3.Launcher; import com.android.launcher3.LauncherAppState; +import com.android.launcher3.LauncherWidgetHolder.ProviderChangedListener; import com.android.launcher3.R; import com.android.launcher3.Utilities; import com.android.launcher3.anim.PendingAnimation; @@ -65,7 +66,6 @@ import com.android.launcher3.views.SpringRelativeLayout; import com.android.launcher3.views.StickyHeaderLayout; import com.android.launcher3.views.WidgetsEduView; import com.android.launcher3.widget.BaseWidgetSheet; -import com.android.launcher3.widget.LauncherAppWidgetHost.ProviderChangedListener; import com.android.launcher3.widget.model.WidgetsListBaseEntry; import com.android.launcher3.widget.picker.search.SearchModeListener; import com.android.launcher3.widget.picker.search.WidgetsSearchBar; diff --git a/src_ui_overrides/com/android/launcher3/uioverrides/ApiWrapper.java b/src_ui_overrides/com/android/launcher3/uioverrides/ApiWrapper.java index ea0f5a3c5d..51bcca9f52 100644 --- a/src_ui_overrides/com/android/launcher3/uioverrides/ApiWrapper.java +++ b/src_ui_overrides/com/android/launcher3/uioverrides/ApiWrapper.java @@ -23,8 +23,8 @@ import android.content.pm.ShortcutInfo; import androidx.annotation.NonNull; import androidx.annotation.Nullable; +import com.android.launcher3.LauncherWidgetHolder; import com.android.launcher3.Utilities; -import com.android.launcher3.widget.LauncherAppWidgetHost; /** * A wrapper for the hidden API calls @@ -43,7 +43,7 @@ public class ApiWrapper { * @param handler InteractionHandler for the views in the host */ public static void setHostInteractionHandler(@NonNull AppWidgetHost host, - @Nullable LauncherAppWidgetHost.LauncherWidgetInteractionHandler handler) { + @Nullable LauncherWidgetHolder.LauncherWidgetInteractionHandler handler) { // No-op } } diff --git a/tests/src/com/android/launcher3/util/WidgetUtils.java b/tests/src/com/android/launcher3/util/WidgetUtils.java index 6fc84914f8..c8cec56c34 100644 --- a/tests/src/com/android/launcher3/util/WidgetUtils.java +++ b/tests/src/com/android/launcher3/util/WidgetUtils.java @@ -20,7 +20,6 @@ import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentat import static com.android.launcher3.WorkspaceLayoutManager.FIRST_SCREEN_ID; -import android.appwidget.AppWidgetHost; import android.appwidget.AppWidgetManager; import android.appwidget.AppWidgetProviderInfo; import android.content.ComponentName; @@ -30,9 +29,9 @@ import android.os.Bundle; import android.os.Process; import com.android.launcher3.LauncherSettings; +import com.android.launcher3.LauncherWidgetHolder; import com.android.launcher3.model.data.ItemInfo; import com.android.launcher3.model.data.LauncherAppWidgetInfo; -import com.android.launcher3.widget.LauncherAppWidgetHost; import com.android.launcher3.widget.LauncherAppWidgetProviderInfo; import com.android.launcher3.widget.PendingAddWidgetInfo; import com.android.launcher3.widget.WidgetManagerHelper; @@ -71,14 +70,19 @@ public class WidgetUtils { pendingInfo.minSpanY = item.minSpanY; Bundle options = pendingInfo.getDefaultSizeOptions(targetContext); - AppWidgetHost host = new LauncherAppWidgetHost(targetContext); - int widgetId = host.allocateAppWidgetId(); - if (!new WidgetManagerHelper(targetContext) - .bindAppWidgetIdIfAllowed(widgetId, info, options)) { - host.deleteAppWidgetId(widgetId); - throw new IllegalArgumentException("Unable to bind widget id"); + LauncherWidgetHolder holder = new LauncherWidgetHolder(targetContext); + try { + int widgetId = holder.allocateAppWidgetId(); + if (!new WidgetManagerHelper(targetContext) + .bindAppWidgetIdIfAllowed(widgetId, info, options)) { + holder.deleteAppWidgetId(widgetId); + throw new IllegalArgumentException("Unable to bind widget id"); + } + item.appWidgetId = widgetId; + } finally { + // Necessary to destroy the holder to free up possible activity context + holder.destroy(); } - item.appWidgetId = widgetId; } return item; } From 8bbfcb65815cb3d2d6f269d8d11e6d4a04980937 Mon Sep 17 00:00:00 2001 From: Sihua Ma Date: Tue, 8 Nov 2022 16:46:07 -0800 Subject: [PATCH 13/16] Move LauncherWidgetHolder to widget package Making LauncherAppWidgetHost package-private as well Bug: 235358918 Test: N/A Change-Id: If022ec8d429579a972991872b2dc11db76719341 --- .../android/launcher3/uioverrides/ApiWrapper.java | 2 +- .../uioverrides/QuickstepInteractionHandler.java | 2 +- .../launcher3/uioverrides/QuickstepLauncher.java | 2 +- .../launcher3/AppWidgetsRestoredReceiver.java | 1 + src/com/android/launcher3/AutoInstallsLayout.java | 1 + .../android/launcher3/DefaultLayoutParser.java | 1 + src/com/android/launcher3/Launcher.java | 1 + src/com/android/launcher3/LauncherProvider.java | 1 + src/com/android/launcher3/Workspace.java | 3 ++- .../launcher3/dragndrop/AddItemActivity.java | 2 +- .../graphics/LauncherPreviewRenderer.java | 2 +- src/com/android/launcher3/model/ModelWriter.java | 2 +- .../android/launcher3/provider/RestoreDbTask.java | 2 +- .../launcher3/widget/LauncherAppWidgetHost.java | 5 ++--- .../widget/LauncherAppWidgetHostView.java | 11 ----------- .../{ => widget}/LauncherWidgetHolder.java | 15 +++++++-------- .../launcher3/widget/picker/WidgetsFullSheet.java | 2 +- .../android/launcher3/uioverrides/ApiWrapper.java | 2 +- .../com/android/launcher3/util/WidgetUtils.java | 2 +- 19 files changed, 26 insertions(+), 33 deletions(-) rename src/com/android/launcher3/{ => widget}/LauncherWidgetHolder.java (97%) diff --git a/quickstep/src/com/android/launcher3/uioverrides/ApiWrapper.java b/quickstep/src/com/android/launcher3/uioverrides/ApiWrapper.java index 8002c6d525..379a6cd2f4 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/ApiWrapper.java +++ b/quickstep/src/com/android/launcher3/uioverrides/ApiWrapper.java @@ -23,8 +23,8 @@ import android.content.pm.ShortcutInfo; import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import com.android.launcher3.LauncherWidgetHolder; import com.android.launcher3.Utilities; +import com.android.launcher3.widget.LauncherWidgetHolder; /** * A wrapper for the hidden API calls diff --git a/quickstep/src/com/android/launcher3/uioverrides/QuickstepInteractionHandler.java b/quickstep/src/com/android/launcher3/uioverrides/QuickstepInteractionHandler.java index 6a6c824ed8..353d817242 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/QuickstepInteractionHandler.java +++ b/quickstep/src/com/android/launcher3/uioverrides/QuickstepInteractionHandler.java @@ -29,12 +29,12 @@ import android.view.View; import android.widget.RemoteViews; import android.window.SplashScreen; -import com.android.launcher3.LauncherWidgetHolder; import com.android.launcher3.Utilities; import com.android.launcher3.logging.StatsLogManager; import com.android.launcher3.model.data.ItemInfo; import com.android.launcher3.util.ActivityOptionsWrapper; import com.android.launcher3.widget.LauncherAppWidgetHostView; +import com.android.launcher3.widget.LauncherWidgetHolder; /** Provides a Quickstep specific animation when launching an activity from an app widget. */ class QuickstepInteractionHandler diff --git a/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java b/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java index 9813c8a987..f90feb8ed7 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java +++ b/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java @@ -78,7 +78,6 @@ import com.android.launcher3.DeviceProfile; import com.android.launcher3.Launcher; import com.android.launcher3.LauncherSettings.Favorites; import com.android.launcher3.LauncherState; -import com.android.launcher3.LauncherWidgetHolder; import com.android.launcher3.QuickstepAccessibilityDelegate; import com.android.launcher3.QuickstepTransitionManager; import com.android.launcher3.R; @@ -125,6 +124,7 @@ import com.android.launcher3.util.PendingSplitSelectInfo; import com.android.launcher3.util.RunnableList; import com.android.launcher3.util.SplitConfigurationOptions.SplitPositionOption; import com.android.launcher3.util.TouchController; +import com.android.launcher3.widget.LauncherWidgetHolder; import com.android.quickstep.OverviewCommandHelper; import com.android.quickstep.RecentsModel; import com.android.quickstep.SystemUiProxy; diff --git a/src/com/android/launcher3/AppWidgetsRestoredReceiver.java b/src/com/android/launcher3/AppWidgetsRestoredReceiver.java index 8604f1acd4..eb6d096602 100644 --- a/src/com/android/launcher3/AppWidgetsRestoredReceiver.java +++ b/src/com/android/launcher3/AppWidgetsRestoredReceiver.java @@ -21,6 +21,7 @@ import com.android.launcher3.model.data.LauncherAppWidgetInfo; import com.android.launcher3.pm.UserCache; import com.android.launcher3.provider.RestoreDbTask; import com.android.launcher3.util.ContentWriter; +import com.android.launcher3.widget.LauncherWidgetHolder; public class AppWidgetsRestoredReceiver extends BroadcastReceiver { diff --git a/src/com/android/launcher3/AutoInstallsLayout.java b/src/com/android/launcher3/AutoInstallsLayout.java index 0003510ab1..efdd5e15e7 100644 --- a/src/com/android/launcher3/AutoInstallsLayout.java +++ b/src/com/android/launcher3/AutoInstallsLayout.java @@ -47,6 +47,7 @@ import com.android.launcher3.qsb.QsbContainerView; import com.android.launcher3.util.IntArray; import com.android.launcher3.util.PackageManagerHelper; import com.android.launcher3.util.Thunk; +import com.android.launcher3.widget.LauncherWidgetHolder; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; diff --git a/src/com/android/launcher3/DefaultLayoutParser.java b/src/com/android/launcher3/DefaultLayoutParser.java index d8558f0ca6..af13beac1d 100644 --- a/src/com/android/launcher3/DefaultLayoutParser.java +++ b/src/com/android/launcher3/DefaultLayoutParser.java @@ -20,6 +20,7 @@ import com.android.launcher3.LauncherSettings.Favorites; import com.android.launcher3.model.data.WorkspaceItemInfo; import com.android.launcher3.shortcuts.ShortcutKey; import com.android.launcher3.util.Thunk; +import com.android.launcher3.widget.LauncherWidgetHolder; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java index de2ef554ad..81f2c18503 100644 --- a/src/com/android/launcher3/Launcher.java +++ b/src/com/android/launcher3/Launcher.java @@ -210,6 +210,7 @@ import com.android.launcher3.views.OptionsPopupView; import com.android.launcher3.views.ScrimView; import com.android.launcher3.widget.LauncherAppWidgetHostView; import com.android.launcher3.widget.LauncherAppWidgetProviderInfo; +import com.android.launcher3.widget.LauncherWidgetHolder; import com.android.launcher3.widget.PendingAddShortcutInfo; import com.android.launcher3.widget.PendingAddWidgetInfo; import com.android.launcher3.widget.PendingAppWidgetHostView; diff --git a/src/com/android/launcher3/LauncherProvider.java b/src/com/android/launcher3/LauncherProvider.java index a6731a5d77..457e12673b 100644 --- a/src/com/android/launcher3/LauncherProvider.java +++ b/src/com/android/launcher3/LauncherProvider.java @@ -71,6 +71,7 @@ import com.android.launcher3.util.IntSet; import com.android.launcher3.util.NoLocaleSQLiteHelper; import com.android.launcher3.util.PackageManagerHelper; import com.android.launcher3.util.Thunk; +import com.android.launcher3.widget.LauncherWidgetHolder; import org.xmlpull.v1.XmlPullParser; diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java index 39679a994a..99045dc68a 100644 --- a/src/com/android/launcher3/Workspace.java +++ b/src/com/android/launcher3/Workspace.java @@ -63,7 +63,6 @@ import android.widget.Toast; import androidx.annotation.Nullable; -import com.android.launcher3.LauncherWidgetHolder.ProviderChangedListener; import com.android.launcher3.accessibility.AccessibleDragListenerAdapter; import com.android.launcher3.accessibility.WorkspaceAccessibilityHelper; import com.android.launcher3.anim.Interpolators; @@ -109,6 +108,8 @@ import com.android.launcher3.util.RunnableList; import com.android.launcher3.util.Thunk; import com.android.launcher3.util.WallpaperOffsetInterpolator; import com.android.launcher3.widget.LauncherAppWidgetHostView; +import com.android.launcher3.widget.LauncherWidgetHolder; +import com.android.launcher3.widget.LauncherWidgetHolder.ProviderChangedListener; import com.android.launcher3.widget.NavigableAppWidgetHostView; import com.android.launcher3.widget.PendingAddShortcutInfo; import com.android.launcher3.widget.PendingAddWidgetInfo; diff --git a/src/com/android/launcher3/dragndrop/AddItemActivity.java b/src/com/android/launcher3/dragndrop/AddItemActivity.java index 4fb5ff6638..5a49f4ad41 100644 --- a/src/com/android/launcher3/dragndrop/AddItemActivity.java +++ b/src/com/android/launcher3/dragndrop/AddItemActivity.java @@ -59,7 +59,6 @@ import com.android.launcher3.BaseActivity; import com.android.launcher3.InvariantDeviceProfile; import com.android.launcher3.Launcher; import com.android.launcher3.LauncherAppState; -import com.android.launcher3.LauncherWidgetHolder; import com.android.launcher3.R; import com.android.launcher3.logging.StatsLogManager; import com.android.launcher3.model.ItemInstallQueue; @@ -73,6 +72,7 @@ import com.android.launcher3.views.AbstractSlideInView; import com.android.launcher3.views.BaseDragLayer; import com.android.launcher3.widget.AddItemWidgetsBottomSheet; import com.android.launcher3.widget.LauncherAppWidgetProviderInfo; +import com.android.launcher3.widget.LauncherWidgetHolder; import com.android.launcher3.widget.NavigableAppWidgetHostView; import com.android.launcher3.widget.PendingAddShortcutInfo; import com.android.launcher3.widget.PendingAddWidgetInfo; diff --git a/src/com/android/launcher3/graphics/LauncherPreviewRenderer.java b/src/com/android/launcher3/graphics/LauncherPreviewRenderer.java index 0646e7f802..2361907ed4 100644 --- a/src/com/android/launcher3/graphics/LauncherPreviewRenderer.java +++ b/src/com/android/launcher3/graphics/LauncherPreviewRenderer.java @@ -68,7 +68,6 @@ import com.android.launcher3.InsettableFrameLayout; import com.android.launcher3.InvariantDeviceProfile; import com.android.launcher3.LauncherAppState; import com.android.launcher3.LauncherSettings.Favorites; -import com.android.launcher3.LauncherWidgetHolder; import com.android.launcher3.R; import com.android.launcher3.Utilities; import com.android.launcher3.Workspace; @@ -101,6 +100,7 @@ import com.android.launcher3.views.ActivityContext; import com.android.launcher3.views.BaseDragLayer; import com.android.launcher3.widget.BaseLauncherAppWidgetHostView; import com.android.launcher3.widget.LauncherAppWidgetProviderInfo; +import com.android.launcher3.widget.LauncherWidgetHolder; import com.android.launcher3.widget.LocalColorExtractor; import com.android.launcher3.widget.NavigableAppWidgetHostView; import com.android.launcher3.widget.custom.CustomWidgetManager; diff --git a/src/com/android/launcher3/model/ModelWriter.java b/src/com/android/launcher3/model/ModelWriter.java index 514e7b22d8..f444bd5718 100644 --- a/src/com/android/launcher3/model/ModelWriter.java +++ b/src/com/android/launcher3/model/ModelWriter.java @@ -36,7 +36,6 @@ import com.android.launcher3.LauncherProvider; import com.android.launcher3.LauncherSettings; import com.android.launcher3.LauncherSettings.Favorites; import com.android.launcher3.LauncherSettings.Settings; -import com.android.launcher3.LauncherWidgetHolder; import com.android.launcher3.Utilities; import com.android.launcher3.config.FeatureFlags; import com.android.launcher3.logging.FileLog; @@ -49,6 +48,7 @@ import com.android.launcher3.util.ContentWriter; import com.android.launcher3.util.Executors; import com.android.launcher3.util.ItemInfoMatcher; import com.android.launcher3.util.LooperExecutor; +import com.android.launcher3.widget.LauncherWidgetHolder; import java.util.ArrayList; import java.util.Arrays; diff --git a/src/com/android/launcher3/provider/RestoreDbTask.java b/src/com/android/launcher3/provider/RestoreDbTask.java index 70dd98eef6..95ac7b0ca9 100644 --- a/src/com/android/launcher3/provider/RestoreDbTask.java +++ b/src/com/android/launcher3/provider/RestoreDbTask.java @@ -38,7 +38,6 @@ import com.android.launcher3.InvariantDeviceProfile; import com.android.launcher3.LauncherAppState; import com.android.launcher3.LauncherProvider.DatabaseHelper; import com.android.launcher3.LauncherSettings.Favorites; -import com.android.launcher3.LauncherWidgetHolder; import com.android.launcher3.Utilities; import com.android.launcher3.logging.FileLog; import com.android.launcher3.model.DeviceGridState; @@ -48,6 +47,7 @@ import com.android.launcher3.model.data.WorkspaceItemInfo; import com.android.launcher3.provider.LauncherDbUtils.SQLiteTransaction; import com.android.launcher3.util.IntArray; import com.android.launcher3.util.LogConfig; +import com.android.launcher3.widget.LauncherWidgetHolder; import java.io.InvalidObjectException; import java.util.Arrays; diff --git a/src/com/android/launcher3/widget/LauncherAppWidgetHost.java b/src/com/android/launcher3/widget/LauncherAppWidgetHost.java index c57139d72c..9c21ea2bb7 100644 --- a/src/com/android/launcher3/widget/LauncherAppWidgetHost.java +++ b/src/com/android/launcher3/widget/LauncherAppWidgetHost.java @@ -16,7 +16,7 @@ package com.android.launcher3.widget; -import static com.android.launcher3.LauncherWidgetHolder.APPWIDGET_HOST_ID; +import static com.android.launcher3.widget.LauncherWidgetHolder.APPWIDGET_HOST_ID; import android.appwidget.AppWidgetHost; import android.appwidget.AppWidgetProviderInfo; @@ -26,7 +26,6 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; import com.android.launcher3.LauncherAppState; -import com.android.launcher3.LauncherWidgetHolder; import java.util.ArrayList; import java.util.function.IntConsumer; @@ -36,7 +35,7 @@ import java.util.function.IntConsumer; * which correctly captures all long-press events. This ensures that users can * always pick up and move widgets. */ -public class LauncherAppWidgetHost extends AppWidgetHost { +class LauncherAppWidgetHost extends AppWidgetHost { @NonNull private final ArrayList mProviderChangeListeners = new ArrayList<>(); diff --git a/src/com/android/launcher3/widget/LauncherAppWidgetHostView.java b/src/com/android/launcher3/widget/LauncherAppWidgetHostView.java index 990282bdab..bc3889fd26 100644 --- a/src/com/android/launcher3/widget/LauncherAppWidgetHostView.java +++ b/src/com/android/launcher3/widget/LauncherAppWidgetHostView.java @@ -37,7 +37,6 @@ import android.widget.AdapterView; import android.widget.Advanceable; import android.widget.RemoteViews; -import androidx.annotation.NonNull; import androidx.annotation.Nullable; import com.android.launcher3.CheckLongPressHelper; @@ -173,16 +172,6 @@ public class LauncherAppWidgetHostView extends BaseLauncherAppWidgetHostView mReinflateOnConfigChange = !isSameOrientation(); } - @NonNull - public Launcher getLauncher() { - return mLauncher; - } - - @Nullable - public RemoteViews getLastRemoteViews() { - return mLastRemoteViews; - } - private boolean isSameOrientation() { return mLauncher.getResources().getConfiguration().orientation == mLauncher.getOrientation(); diff --git a/src/com/android/launcher3/LauncherWidgetHolder.java b/src/com/android/launcher3/widget/LauncherWidgetHolder.java similarity index 97% rename from src/com/android/launcher3/LauncherWidgetHolder.java rename to src/com/android/launcher3/widget/LauncherWidgetHolder.java index 2612b9cb63..54977297b8 100644 --- a/src/com/android/launcher3/LauncherWidgetHolder.java +++ b/src/com/android/launcher3/widget/LauncherWidgetHolder.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.android.launcher3; +package com.android.launcher3.widget; import static android.app.Activity.RESULT_CANCELED; @@ -36,17 +36,16 @@ import android.widget.Toast; import androidx.annotation.NonNull; import androidx.annotation.Nullable; +import com.android.launcher3.BaseActivity; +import com.android.launcher3.BaseDraggingActivity; +import com.android.launcher3.R; +import com.android.launcher3.Utilities; import com.android.launcher3.config.FeatureFlags; import com.android.launcher3.model.WidgetsModel; import com.android.launcher3.model.data.ItemInfo; import com.android.launcher3.testing.TestLogging; import com.android.launcher3.testing.shared.TestProtocol; import com.android.launcher3.uioverrides.ApiWrapper; -import com.android.launcher3.widget.DeferredAppWidgetHostView; -import com.android.launcher3.widget.LauncherAppWidgetHost; -import com.android.launcher3.widget.LauncherAppWidgetHostView; -import com.android.launcher3.widget.LauncherAppWidgetProviderInfo; -import com.android.launcher3.widget.PendingAppWidgetHostView; import com.android.launcher3.widget.custom.CustomWidgetManager; import java.util.function.IntConsumer; @@ -134,7 +133,7 @@ public class LauncherWidgetHolder { // If the widget view was deferred, we'll need to call super.createView here // to make the binder call to system process to fetch cumulative updates to this // widget, as well as setting up this view for future updates. - mWidgetHost.createView(view.getLauncher(), appWidgetId, + mWidgetHost.createView(view.mLauncher, appWidgetId, view.getAppWidgetInfo()); // At this point #onCreateView should have been called, which in turn returned // the deferred view. There's no reason to keep the reference anymore, so we @@ -455,7 +454,7 @@ public class LauncherWidgetHolder { for (int i = 0; i < mViews.size(); i++) { final int appWidgetId = mViews.keyAt(i); final LauncherAppWidgetHostView view = mViews.get(appWidgetId); - mCachedRemoteViews.put(appWidgetId, view.getLastRemoteViews()); + mCachedRemoteViews.put(appWidgetId, view.mLastRemoteViews); } } mViews.clear(); diff --git a/src/com/android/launcher3/widget/picker/WidgetsFullSheet.java b/src/com/android/launcher3/widget/picker/WidgetsFullSheet.java index ee8d8e85b3..72ec62979e 100644 --- a/src/com/android/launcher3/widget/picker/WidgetsFullSheet.java +++ b/src/com/android/launcher3/widget/picker/WidgetsFullSheet.java @@ -52,7 +52,6 @@ import androidx.recyclerview.widget.RecyclerView; import com.android.launcher3.Launcher; import com.android.launcher3.LauncherAppState; -import com.android.launcher3.LauncherWidgetHolder.ProviderChangedListener; import com.android.launcher3.R; import com.android.launcher3.Utilities; import com.android.launcher3.anim.PendingAnimation; @@ -66,6 +65,7 @@ import com.android.launcher3.views.SpringRelativeLayout; import com.android.launcher3.views.StickyHeaderLayout; import com.android.launcher3.views.WidgetsEduView; import com.android.launcher3.widget.BaseWidgetSheet; +import com.android.launcher3.widget.LauncherWidgetHolder.ProviderChangedListener; import com.android.launcher3.widget.model.WidgetsListBaseEntry; import com.android.launcher3.widget.picker.search.SearchModeListener; import com.android.launcher3.widget.picker.search.WidgetsSearchBar; diff --git a/src_ui_overrides/com/android/launcher3/uioverrides/ApiWrapper.java b/src_ui_overrides/com/android/launcher3/uioverrides/ApiWrapper.java index 51bcca9f52..02f4ecee3c 100644 --- a/src_ui_overrides/com/android/launcher3/uioverrides/ApiWrapper.java +++ b/src_ui_overrides/com/android/launcher3/uioverrides/ApiWrapper.java @@ -23,8 +23,8 @@ import android.content.pm.ShortcutInfo; import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import com.android.launcher3.LauncherWidgetHolder; import com.android.launcher3.Utilities; +import com.android.launcher3.widget.LauncherWidgetHolder; /** * A wrapper for the hidden API calls diff --git a/tests/src/com/android/launcher3/util/WidgetUtils.java b/tests/src/com/android/launcher3/util/WidgetUtils.java index c8cec56c34..e514142f7d 100644 --- a/tests/src/com/android/launcher3/util/WidgetUtils.java +++ b/tests/src/com/android/launcher3/util/WidgetUtils.java @@ -29,10 +29,10 @@ import android.os.Bundle; import android.os.Process; import com.android.launcher3.LauncherSettings; -import com.android.launcher3.LauncherWidgetHolder; import com.android.launcher3.model.data.ItemInfo; import com.android.launcher3.model.data.LauncherAppWidgetInfo; import com.android.launcher3.widget.LauncherAppWidgetProviderInfo; +import com.android.launcher3.widget.LauncherWidgetHolder; import com.android.launcher3.widget.PendingAddWidgetInfo; import com.android.launcher3.widget.WidgetManagerHelper; From 6692f78229b42462ba90e2666e7dd42d0f6e8c1f Mon Sep 17 00:00:00 2001 From: Jeremy Sim Date: Wed, 9 Nov 2022 18:26:06 -0800 Subject: [PATCH 14/16] Allow user to tap on stashed app to launch task in fullscreen This patch implements a new feature that allows the user to tap on the staged app rectangle in split staging mode. When the user does so, split selection will be canceled, and the staged app will animate out to fill the screen and launch in fullscreen. Done by creating a new onClick listener on mFirstFloatingTaskView that sets up the screen-filling animation, and then calls a new RecentsView function, launchStagedTask(), that launches mSplitHiddenTaskView and cleans up RecentsView afterwards (similar to what happens when a split pair is selected, but only one app is launched). Open issues: - After the staged task animates out to fill the screen, the task itself loads instantly without animating in. Ideally, it should fade in, similar to what happens when two split tasks are loaded in. Bug: 257513449 Test: Manual on tablet Change-Id: I2ae8e13e1c9848aae1978a536766c370949fd08b --- .../quickstep/util/SplitAnimationTimings.java | 2 +- .../android/quickstep/views/RecentsView.java | 50 +++++++++++++++++-- .../launcher3/config/FeatureFlags.java | 5 ++ 3 files changed, 51 insertions(+), 6 deletions(-) diff --git a/quickstep/src/com/android/quickstep/util/SplitAnimationTimings.java b/quickstep/src/com/android/quickstep/util/SplitAnimationTimings.java index 2966fbb5db..7dc1b32858 100644 --- a/quickstep/src/com/android/quickstep/util/SplitAnimationTimings.java +++ b/quickstep/src/com/android/quickstep/util/SplitAnimationTimings.java @@ -25,7 +25,7 @@ import android.view.animation.Interpolator; */ public interface SplitAnimationTimings { int TABLET_ENTER_DURATION = 866; - int TABLET_CONFIRM_DURATION = 383; + int TABLET_CONFIRM_DURATION = 500; int PHONE_ENTER_DURATION = 517; int PHONE_CONFIRM_DURATION = 333; diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java index ff0c984b6d..2474b690a8 100644 --- a/quickstep/src/com/android/quickstep/views/RecentsView.java +++ b/quickstep/src/com/android/quickstep/views/RecentsView.java @@ -41,6 +41,7 @@ import static com.android.launcher3.anim.Interpolators.FINAL_FRAME; import static com.android.launcher3.anim.Interpolators.LINEAR; import static com.android.launcher3.anim.Interpolators.OVERSHOOT_0_75; import static com.android.launcher3.anim.Interpolators.clampToProgress; +import static com.android.launcher3.config.FeatureFlags.ENABLE_LAUNCH_FROM_STAGED_APP; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_OVERVIEW_ACTIONS_SPLIT; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASK_CLEAR_ALL; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASK_DISMISS_SWIPE_UP; @@ -125,7 +126,6 @@ import androidx.annotation.Nullable; import androidx.annotation.UiThread; import androidx.core.graphics.ColorUtils; -import com.android.launcher3.AbstractFloatingView; import com.android.launcher3.BaseActivity; import com.android.launcher3.BaseActivity.MultiWindowModeChangedListener; import com.android.launcher3.DeviceProfile; @@ -2903,6 +2903,11 @@ public abstract class RecentsView launchStagedTask()); + + pendingAnimation.buildAnim().start(); + } + /** * Creates a {@link PendingAnimation} for dismissing the specified {@link TaskView}. * @param dismissedTaskView the {@link TaskView} to be dismissed @@ -4294,11 +4327,8 @@ public abstract class RecentsView resetFromSplitSelectionState()); + } else { + // Split staging was started from a new intent (from app menu in Home/AllApps) + mActivity.startActivity(mSplitSelectSource.intent); + } + } + protected void onTaskLaunchAnimationEnd(boolean success) { if (success) { resetTaskVisuals(); diff --git a/src/com/android/launcher3/config/FeatureFlags.java b/src/com/android/launcher3/config/FeatureFlags.java index 33f3bfdbfe..e20489c3aa 100644 --- a/src/com/android/launcher3/config/FeatureFlags.java +++ b/src/com/android/launcher3/config/FeatureFlags.java @@ -342,6 +342,11 @@ public final class FeatureFlags { public static final BooleanFlag ENABLE_DEVICE_PROFILE_LOGGING = new DeviceFlag( "ENABLE_DEVICE_PROFILE_LOGGING", false, "Allows DeviceProfile logging"); + public static final BooleanFlag ENABLE_LAUNCH_FROM_STAGED_APP = getDebugFlag( + "ENABLE_LAUNCH_FROM_STAGED_APP", false, + "Enable the ability to tap a staged app during split select to launch it in full screen" + ); + public static void initialize(Context context) { synchronized (sDebugFlags) { for (DebugFlag flag : sDebugFlags) { From 30cc32411771d1dcc1a98d370c94c60200b71207 Mon Sep 17 00:00:00 2001 From: Jon Miranda Date: Wed, 16 Nov 2022 15:51:10 -0800 Subject: [PATCH 15/16] Check NPE and log error condition for enableBlockingTimeout in test harness. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Similar to enableTransientTaskbar changes in ag/Ifa929dca18437ae101cf3290feda4209790604d2 This method differs from enableManualTaskbarStashing in that we call it during setup/teardown and so in these cases TaskbarActivityContext being null may be valid. For instance, as part of the teardown, taskbar may have already been destroyed so enabling blocking timeout may be a moot point — adding logs can help verify that assumption. Bug: 259337908 Bug: 257549303 Test: TaplTestsTaskbar Change-Id: I2eeb02573670a503687ca7aa364d14f3124cd0ef --- .../quickstep/QuickstepTestInformationHandler.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/quickstep/src/com/android/quickstep/QuickstepTestInformationHandler.java b/quickstep/src/com/android/quickstep/QuickstepTestInformationHandler.java index 65614ba966..713b01654c 100644 --- a/quickstep/src/com/android/quickstep/QuickstepTestInformationHandler.java +++ b/quickstep/src/com/android/quickstep/QuickstepTestInformationHandler.java @@ -179,9 +179,15 @@ public class QuickstepTestInformationHandler extends TestInformationHandler { private void enableBlockingTimeout( TouchInteractionService.TISBinder tisBinder, boolean enable) { - // Allow null-pointer to catch illegal states. - tisBinder.getTaskbarManager().getCurrentActivityContext().enableBlockingTimeoutDuringTests( - enable); + TaskbarActivityContext context = tisBinder.getTaskbarManager().getCurrentActivityContext(); + if (context == null) { + if (TestProtocol.sDebugTracing) { + Log.d(NPE_TRANSIENT_TASKBAR, "enableBlockingTimeout: enable=" + enable, + new Exception()); + } + } else { + context.enableBlockingTimeoutDuringTests(enable); + } } private void enableTransientTaskbar( From 47d4d81b4f4dcc604716306745756df4bee35a7b Mon Sep 17 00:00:00 2001 From: Sunny Goyal Date: Fri, 4 Nov 2022 16:43:42 -0700 Subject: [PATCH 16/16] Cleaning Utilities.java > Removing some unused methods > Moving some specialized methods to corresponding classes > Removing GridProvider check as it is released Bug: 257555083 Test: Presubmit Change-Id: Ib0f8c673d018071d3f4b7d9247e0a35718ab009c Merged-In: Ib0f8c673d018071d3f4b7d9247e0a35718ab009c --- .../launcher3/model/WellbeingModel.java | 2 - .../RecentsAnimationDeviceState.java | 25 +- .../LauncherUnfoldAnimationController.java | 3 +- .../com/android/quickstep/views/TaskView.java | 3 +- src/com/android/launcher3/BubbleTextView.java | 9 +- .../launcher3/InvariantDeviceProfile.java | 7 +- src/com/android/launcher3/Utilities.java | 254 +++--------------- .../android/launcher3/folder/FolderIcon.java | 11 +- .../android/launcher3/model/ModelUtils.java | 10 +- .../launcher3/util/BgObjectWithLooper.java | 17 ++ .../util/SimpleBroadcastReceiver.java | 11 + .../launcher3/views/OptionsPopupView.java | 27 +- 12 files changed, 110 insertions(+), 269 deletions(-) diff --git a/quickstep/src/com/android/launcher3/model/WellbeingModel.java b/quickstep/src/com/android/launcher3/model/WellbeingModel.java index 68ed682792..fb2d0dcc3c 100644 --- a/quickstep/src/com/android/launcher3/model/WellbeingModel.java +++ b/quickstep/src/com/android/launcher3/model/WellbeingModel.java @@ -18,8 +18,6 @@ package com.android.launcher3.model; import static android.content.ContentResolver.SCHEME_CONTENT; -import static com.android.launcher3.Utilities.newContentObserver; - import android.annotation.TargetApi; import android.app.RemoteAction; import android.content.ContentProviderClient; diff --git a/quickstep/src/com/android/quickstep/RecentsAnimationDeviceState.java b/quickstep/src/com/android/quickstep/RecentsAnimationDeviceState.java index e87fdad933..9e25555eec 100644 --- a/quickstep/src/com/android/quickstep/RecentsAnimationDeviceState.java +++ b/quickstep/src/com/android/quickstep/RecentsAnimationDeviceState.java @@ -46,10 +46,7 @@ import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_S import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_STATUS_BAR_KEYGUARD_SHOWING_OCCLUDED; import android.app.ActivityTaskManager; -import android.content.BroadcastReceiver; import android.content.Context; -import android.content.Intent; -import android.content.IntentFilter; import android.graphics.Region; import android.inputmethodservice.InputMethodService; import android.net.Uri; @@ -63,12 +60,12 @@ import android.view.MotionEvent; import androidx.annotation.BinderThread; import androidx.annotation.NonNull; -import com.android.launcher3.Utilities; import com.android.launcher3.util.DisplayController; import com.android.launcher3.util.DisplayController.DisplayInfoChangeListener; import com.android.launcher3.util.DisplayController.Info; import com.android.launcher3.util.NavigationMode; import com.android.launcher3.util.SettingsCache; +import com.android.launcher3.util.SimpleBroadcastReceiver; import com.android.quickstep.TopTaskTracker.CachedTaskInfo; import com.android.quickstep.util.NavBarPosition; import com.android.systemui.shared.system.ActivityManagerWrapper; @@ -114,15 +111,12 @@ public class RecentsAnimationDeviceState implements DisplayInfoChangeListener { private boolean mIsUserUnlocked; private final ArrayList mUserUnlockedActions = new ArrayList<>(); - private final BroadcastReceiver mUserUnlockedReceiver = new BroadcastReceiver() { - @Override - public void onReceive(Context context, Intent intent) { - if (ACTION_USER_UNLOCKED.equals(intent.getAction())) { - mIsUserUnlocked = true; - notifyUserUnlocked(); - } + private final SimpleBroadcastReceiver mUserUnlockedReceiver = new SimpleBroadcastReceiver(i -> { + if (ACTION_USER_UNLOCKED.equals(i.getAction())) { + mIsUserUnlocked = true; + notifyUserUnlocked(); } - }; + }); private int mGestureBlockingTaskId = -1; private @NonNull Region mExclusionRegion = new Region(); @@ -153,10 +147,9 @@ public class RecentsAnimationDeviceState implements DisplayInfoChangeListener { mIsUserUnlocked = context.getSystemService(UserManager.class) .isUserUnlocked(Process.myUserHandle()); if (!mIsUserUnlocked) { - mContext.registerReceiver(mUserUnlockedReceiver, - new IntentFilter(ACTION_USER_UNLOCKED)); + mUserUnlockedReceiver.register(mContext, ACTION_USER_UNLOCKED); } - runOnDestroy(() -> Utilities.unregisterReceiverSafely(mContext, mUserUnlockedReceiver)); + runOnDestroy(() -> mUserUnlockedReceiver.unregisterReceiverSafely(mContext)); // Register for exclusion updates mExclusionListener = new SystemGestureExclusionListenerCompat(mDisplayId) { @@ -347,7 +340,7 @@ public class RecentsAnimationDeviceState implements DisplayInfoChangeListener { action.run(); } mUserUnlockedActions.clear(); - Utilities.unregisterReceiverSafely(mContext, mUserUnlockedReceiver); + mUserUnlockedReceiver.unregisterReceiverSafely(mContext); } /** diff --git a/quickstep/src/com/android/quickstep/util/LauncherUnfoldAnimationController.java b/quickstep/src/com/android/quickstep/util/LauncherUnfoldAnimationController.java index f12074b538..170c622035 100644 --- a/quickstep/src/com/android/quickstep/util/LauncherUnfoldAnimationController.java +++ b/quickstep/src/com/android/quickstep/util/LauncherUnfoldAnimationController.java @@ -18,7 +18,6 @@ package com.android.quickstep.util; import static com.android.launcher3.LauncherAnimUtils.HOTSEAT_SCALE_PROPERTY_FACTORY; import static com.android.launcher3.LauncherAnimUtils.SCALE_INDEX_UNFOLD_ANIMATION; import static com.android.launcher3.LauncherAnimUtils.WORKSPACE_SCALE_PROPERTY_FACTORY; -import static com.android.launcher3.Utilities.comp; import android.annotation.Nullable; import android.util.FloatProperty; @@ -135,7 +134,7 @@ public class LauncherUnfoldAnimationController { @Override public void onTransitionProgress(float progress) { if (mQsbInsettable != null) { - float insetPercentage = comp(progress) * MAX_WIDTH_INSET_FRACTION; + float insetPercentage = (1 - progress) * MAX_WIDTH_INSET_FRACTION; mQsbInsettable.setHorizontalInsets(insetPercentage); } } diff --git a/quickstep/src/com/android/quickstep/views/TaskView.java b/quickstep/src/com/android/quickstep/views/TaskView.java index 583771e15e..180e13b371 100644 --- a/quickstep/src/com/android/quickstep/views/TaskView.java +++ b/quickstep/src/com/android/quickstep/views/TaskView.java @@ -20,7 +20,6 @@ import static android.view.Display.DEFAULT_DISPLAY; import static android.widget.Toast.LENGTH_SHORT; import static com.android.launcher3.LauncherState.BACKGROUND_APP; -import static com.android.launcher3.Utilities.comp; import static com.android.launcher3.Utilities.getDescendantCoordRelativeToAncestor; import static com.android.launcher3.anim.Interpolators.ACCEL_DEACCEL; import static com.android.launcher3.anim.Interpolators.FAST_OUT_SLOW_IN; @@ -501,7 +500,7 @@ public class TaskView extends FrameLayout implements Reusable { return; } mModalness = modalness; - mIconView.setAlpha(comp(modalness)); + mIconView.setAlpha(1 - modalness); mDigitalWellBeingToast.updateBannerOffset(modalness, mCurrentFullscreenParams.mCurrentDrawnInsets.top + mCurrentFullscreenParams.mCurrentDrawnInsets.bottom); diff --git a/src/com/android/launcher3/BubbleTextView.java b/src/com/android/launcher3/BubbleTextView.java index c0a00c2784..9f54f09bb6 100644 --- a/src/com/android/launcher3/BubbleTextView.java +++ b/src/com/android/launcher3/BubbleTextView.java @@ -607,15 +607,16 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver, * Get the icon bounds on the view depending on the layout type. */ public void getIconBounds(int iconSize, Rect outBounds) { - Utilities.setRectToViewCenter(this, iconSize, outBounds); + outBounds.set(0, 0, iconSize, iconSize); if (mLayoutHorizontal) { + int top = (getHeight() - iconSize) / 2; if (mIsRtl) { - outBounds.offsetTo(getWidth() - iconSize - getPaddingRight(), outBounds.top); + outBounds.offsetTo(getWidth() - iconSize - getPaddingRight(), top); } else { - outBounds.offsetTo(getPaddingLeft(), outBounds.top); + outBounds.offsetTo(getPaddingLeft(), top); } } else { - outBounds.offsetTo(outBounds.left, getPaddingTop()); + outBounds.offset((getWidth() - iconSize) / 2, getPaddingTop()); } } diff --git a/src/com/android/launcher3/InvariantDeviceProfile.java b/src/com/android/launcher3/InvariantDeviceProfile.java index ca92aa48f6..4bb9f0682d 100644 --- a/src/com/android/launcher3/InvariantDeviceProfile.java +++ b/src/com/android/launcher3/InvariantDeviceProfile.java @@ -307,8 +307,7 @@ public class InvariantDeviceProfile { } public static String getCurrentGridName(Context context) { - return Utilities.isGridOptionsEnabled(context) - ? Utilities.getPrefs(context).getString(KEY_IDP_GRID_NAME, null) : null; + return Utilities.getPrefs(context).getString(KEY_IDP_GRID_NAME, null); } private String initGrid(Context context, String gridName) { @@ -383,10 +382,6 @@ public class InvariantDeviceProfile { allAppsBorderSpaces = displayOption.allAppsBorderSpaces; allAppsIconSize = displayOption.allAppsIconSizes; allAppsIconTextSize = displayOption.allAppsIconTextSizes; - if (!Utilities.isGridOptionsEnabled(context)) { - allAppsIconSize = iconSize; - allAppsIconTextSize = iconTextSize; - } if (devicePaddingId != 0) { devicePaddings = new DevicePaddings(context, devicePaddingId); diff --git a/src/com/android/launcher3/Utilities.java b/src/com/android/launcher3/Utilities.java index a5075327d0..743e3aed52 100644 --- a/src/com/android/launcher3/Utilities.java +++ b/src/com/android/launcher3/Utilities.java @@ -26,20 +26,13 @@ import android.annotation.TargetApi; import android.app.ActivityManager; import android.app.Person; import android.app.WallpaperManager; -import android.content.BroadcastReceiver; -import android.content.ComponentName; import android.content.Context; -import android.content.Intent; import android.content.SharedPreferences; import android.content.pm.LauncherActivityInfo; import android.content.pm.LauncherApps; -import android.content.pm.PackageInfo; -import android.content.pm.PackageManager; -import android.content.pm.ResolveInfo; import android.content.pm.ShortcutInfo; import android.content.res.Configuration; import android.content.res.Resources; -import android.database.ContentObserver; import android.graphics.Color; import android.graphics.ColorFilter; import android.graphics.LightingColorFilter; @@ -51,7 +44,6 @@ import android.graphics.RectF; import android.graphics.drawable.AdaptiveIconDrawable; import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.Drawable; -import android.net.Uri; import android.os.Build; import android.os.Build.VERSION_CODES; import android.os.DeadObjectException; @@ -71,15 +63,12 @@ import android.view.MotionEvent; import android.view.View; import android.view.ViewConfiguration; import android.view.animation.Interpolator; -import android.widget.LinearLayout; import androidx.annotation.ChecksSdkIntAtLeast; import androidx.annotation.NonNull; -import androidx.annotation.Nullable; import androidx.core.graphics.ColorUtils; import com.android.launcher3.dragndrop.FolderAdaptiveIcon; -import com.android.launcher3.graphics.GridCustomizationsProvider; import com.android.launcher3.graphics.TintedDrawableSpan; import com.android.launcher3.icons.ShortcutCachingLogic; import com.android.launcher3.icons.ThemedIconDrawable; @@ -91,7 +80,6 @@ import com.android.launcher3.shortcuts.ShortcutKey; import com.android.launcher3.shortcuts.ShortcutRequest; import com.android.launcher3.testing.shared.ResourceUtils; import com.android.launcher3.util.IntArray; -import com.android.launcher3.util.PackageManagerHelper; import com.android.launcher3.util.SplitConfigurationOptions.SplitPositionOption; import com.android.launcher3.util.Themes; import com.android.launcher3.views.ActivityContext; @@ -100,10 +88,8 @@ import com.android.launcher3.widget.PendingAddShortcutInfo; import java.lang.reflect.Method; import java.util.ArrayList; -import java.util.Arrays; import java.util.List; import java.util.Locale; -import java.util.function.Consumer; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -117,8 +103,6 @@ public final class Utilities { private static final Pattern sTrimPattern = Pattern.compile("^[\\s|\\p{javaSpaceChar}]*(.*)[\\s|\\p{javaSpaceChar}]*$"); - private static final int[] sLoc0 = new int[2]; - private static final int[] sLoc1 = new int[2]; private static final Matrix sMatrix = new Matrix(); private static final Matrix sInverseMatrix = new Matrix(); @@ -167,14 +151,6 @@ public final class Utilities { Settings.Global.DEVELOPMENT_SETTINGS_ENABLED, 0) != 0; } - // An intent extra to indicate the horizontal scroll of the wallpaper. - public static final String EXTRA_WALLPAPER_OFFSET = "com.android.launcher3.WALLPAPER_OFFSET"; - public static final String EXTRA_WALLPAPER_FLAVOR = "com.android.launcher3.WALLPAPER_FLAVOR"; - - // An intent extra to indicate the launch source by launcher. - public static final String EXTRA_WALLPAPER_LAUNCH_SOURCE = - "com.android.wallpaper.LAUNCH_SOURCE"; - public static boolean IS_RUNNING_IN_TEST_HARNESS = ActivityManager.isRunningInTestHarness(); @@ -186,12 +162,6 @@ public final class Utilities { return Log.isLoggable(propertyName, Log.VERBOSE); } - public static boolean existsStyleWallpapers(Context context) { - ResolveInfo ri = context.getPackageManager().resolveActivity( - PackageManagerHelper.getStyleWallpapersIntent(context), 0); - return ri != null; - } - /** * Given a coordinate relative to the descendant, find the coordinate in a parent view's * coordinates. @@ -305,9 +275,9 @@ public final class Utilities { * Sets {@param out} to be same as {@param in} by rounding individual values */ public static void roundArray(float[] in, int[] out) { - for (int i = 0; i < in.length; i++) { - out[i] = Math.round(in[i]); - } + for (int i = 0; i < in.length; i++) { + out[i] = Math.round(in[i]); + } } public static void offsetPoints(float[] points, float offsetX, float offsetY) { @@ -328,80 +298,8 @@ public final class Utilities { localY < (v.getHeight() + slop); } - public static int[] getCenterDeltaInScreenSpace(View v0, View v1) { - v0.getLocationInWindow(sLoc0); - v1.getLocationInWindow(sLoc1); - - sLoc0[0] += (v0.getMeasuredWidth() * v0.getScaleX()) / 2; - sLoc0[1] += (v0.getMeasuredHeight() * v0.getScaleY()) / 2; - sLoc1[0] += (v1.getMeasuredWidth() * v1.getScaleX()) / 2; - sLoc1[1] += (v1.getMeasuredHeight() * v1.getScaleY()) / 2; - return new int[] {sLoc1[0] - sLoc0[0], sLoc1[1] - sLoc0[1]}; - } - - /** - * Helper method to set rectOut with rectFSrc. - */ - public static void setRect(RectF rectFSrc, Rect rectOut) { - rectOut.left = (int) rectFSrc.left; - rectOut.top = (int) rectFSrc.top; - rectOut.right = (int) rectFSrc.right; - rectOut.bottom = (int) rectFSrc.bottom; - } - public static void scaleRectFAboutCenter(RectF r, float scale) { - scaleRectFAboutPivot(r, scale, r.centerX(), r.centerY()); - } - - public static void scaleRectFAboutPivot(RectF r, float scale, float px, float py) { - if (scale != 1.0f) { - r.offset(-px, -py); - r.left = r.left * scale; - r.top = r.top * scale ; - r.right = r.right * scale; - r.bottom = r.bottom * scale; - r.offset(px, py); - } - } - - public static void scaleRectAboutCenter(Rect r, float scale) { - if (scale != 1.0f) { - int cx = r.centerX(); - int cy = r.centerY(); - r.offset(-cx, -cy); - scaleRect(r, scale); - r.offset(cx, cy); - } - } - - public static void scaleRect(Rect r, float scale) { - if (scale != 1.0f) { - r.left = (int) (r.left * scale + 0.5f); - r.top = (int) (r.top * scale + 0.5f); - r.right = (int) (r.right * scale + 0.5f); - r.bottom = (int) (r.bottom * scale + 0.5f); - } - } - - public static void insetRect(Rect r, Rect insets) { - r.left = Math.min(r.right, r.left + insets.left); - r.top = Math.min(r.bottom, r.top + insets.top); - r.right = Math.max(r.left, r.right - insets.right); - r.bottom = Math.max(r.top, r.bottom - insets.bottom); - } - - public static float shrinkRect(Rect r, float scaleX, float scaleY) { - float scale = Math.min(Math.min(scaleX, scaleY), 1.0f); - if (scale < 1.0f) { - int deltaX = (int) (r.width() * (scaleX - scale) * 0.5f); - r.left += deltaX; - r.right -= deltaX; - - int deltaY = (int) (r.height() * (scaleY - scale) * 0.5f); - r.top += deltaY; - r.bottom -= deltaY; - } - return scale; + scaleRectFAboutCenter(r, scale, scale); } /** @@ -419,6 +317,33 @@ public final class Utilities { r.offset(px, py); } + public static void scaleRectAboutCenter(Rect r, float scale) { + if (scale != 1.0f) { + int cx = r.centerX(); + int cy = r.centerY(); + r.offset(-cx, -cy); + r.left = (int) (r.left * scale + 0.5f); + r.top = (int) (r.top * scale + 0.5f); + r.right = (int) (r.right * scale + 0.5f); + r.bottom = (int) (r.bottom * scale + 0.5f); + r.offset(cx, cy); + } + } + + public static float shrinkRect(Rect r, float scaleX, float scaleY) { + float scale = Math.min(Math.min(scaleX, scaleY), 1.0f); + if (scale < 1.0f) { + int deltaX = (int) (r.width() * (scaleX - scale) * 0.5f); + r.left += deltaX; + r.right -= deltaX; + + int deltaY = (int) (r.height() * (scaleY - scale) * 0.5f); + r.top += deltaY; + r.bottom -= deltaY; + } + return scale; + } + /** * Maps t from one range to another range. * @param t The value to map. @@ -453,30 +378,6 @@ public final class Utilities { return min + (value * (max - min)); } - /** - * Bounds parameter to the range [0, 1] - */ - public static float saturate(float a) { - return boundToRange(a, 0, 1.0f); - } - - /** - * Returns the compliment (1 - a) of the parameter. - */ - public static float comp(float a) { - return 1 - a; - } - - /** - * Returns the "probabilistic or" of a and b. (a + b - ab). - * Useful beyond probability, can be used to combine two unit progresses for example. - */ - public static float or(float a, float b) { - float satA = saturate(a); - float satB = saturate(b); - return satA + satB - (satA * satB); - } - /** * Trims the string, removing all whitespace at the beginning and end of the string. * Non-breaking whitespaces are also removed. @@ -536,7 +437,6 @@ public final class Utilities { return ResourceUtils.roundPxValueFromFloat(value); } - public static String createDbSelectionQuery(String columnName, IntArray values) { return String.format(Locale.ENGLISH, "%s IN (%s)", columnName, values.toConcatString()); } @@ -559,18 +459,6 @@ public final class Utilities { return defaultValue; } - /** - * Using the view's bounds and icon size, calculate where the icon bounds will - * be if it was positioned at the center of the view. - */ - public static void setRectToViewCenter(View iconView, int iconSize, Rect outBounds) { - int top = (iconView.getHeight() - iconSize) / 2; - int left = (iconView.getWidth() - iconSize) / 2; - int right = left + iconSize; - int bottom = top + iconSize; - outBounds.set(left, top, right, bottom); - } - /** * Ensures that a value is within given bounds. Specifically: * If value is less than lowerBound, return lowerBound; else if value is greater than upperBound, @@ -646,42 +534,6 @@ public final class Utilities { || e.getCause() instanceof DeadObjectException; } - public static boolean isGridOptionsEnabled(Context context) { - return isComponentEnabled(context.getPackageManager(), - context.getPackageName(), - GridCustomizationsProvider.class.getName()); - } - - private static boolean isComponentEnabled(PackageManager pm, String pkgName, String clsName) { - ComponentName componentName = new ComponentName(pkgName, clsName); - int componentEnabledSetting = pm.getComponentEnabledSetting(componentName); - - switch (componentEnabledSetting) { - case PackageManager.COMPONENT_ENABLED_STATE_DISABLED: - return false; - case PackageManager.COMPONENT_ENABLED_STATE_ENABLED: - return true; - case PackageManager.COMPONENT_ENABLED_STATE_DEFAULT: - default: - // We need to get the application info to get the component's default state - try { - PackageInfo packageInfo = pm.getPackageInfo(pkgName, - PackageManager.GET_PROVIDERS | PackageManager.GET_DISABLED_COMPONENTS); - - if (packageInfo.providers != null) { - return Arrays.stream(packageInfo.providers).anyMatch( - pi -> pi.name.equals(clsName) && pi.isEnabled()); - } - - // the component is not declared in the AndroidManifest - return false; - } catch (PackageManager.NameNotFoundException e) { - // the package isn't installed on the device - return false; - } - } - } - /** * Utility method to post a runnable on the handler, skipping the synchronization barriers. */ @@ -691,12 +543,6 @@ public final class Utilities { handler.sendMessage(msg); } - public static void unregisterReceiverSafely(Context context, BroadcastReceiver receiver) { - try { - context.unregisterReceiver(receiver); - } catch (IllegalArgumentException e) {} - } - /** * Returns the full drawable for info without any flattening or pre-processing. * @@ -794,14 +640,6 @@ public final class Utilities { } } - /** - * @return true is the extra is either null or is of type {@param type} - */ - public static boolean isValidExtraType(Intent intent, String key, Class type) { - Object extra = intent.getParcelableExtra(key); - return extra == null || type.isInstance(extra); - } - public static float squaredHypot(float x, float y) { return x * x + y * y; } @@ -811,18 +649,6 @@ public final class Utilities { return slop * slop; } - /** - * Helper method to create a content provider - */ - public static ContentObserver newContentObserver(Handler handler, Consumer command) { - return new ContentObserver(handler) { - @Override - public void onChange(boolean selfChange, Uri uri) { - command.accept(uri); - } - }; - } - /** * Rotates `inOutBounds` by `delta` 90-degree increments. Rotation is visually CCW. Parent * sizes represent the "space" that will rotate carrying inOutBounds along with it to determine @@ -871,16 +697,6 @@ public final class Utilities { ColorUtils.blendARGB(0, color, tintAmount)); } - /** - * Sets start margin on the provided {@param view} to be {@param margin}. - * Assumes {@param view} is a child of {@link LinearLayout} - */ - public static void setStartMarginForView(View view, int margin) { - LinearLayout.LayoutParams lp = (LinearLayout.LayoutParams) view.getLayoutParams(); - lp.setMarginStart(margin); - view.setLayoutParams(lp); - } - public static Rect getViewBounds(@NonNull View v) { int[] pos = new int[2]; v.getLocationOnScreen(pos); @@ -921,12 +737,4 @@ public final class Utilities { } return options; } - - public static boolean bothNull(@Nullable Object a, @Nullable Object b) { - return a == null && b == null; - } - - public static boolean bothNonNull(@Nullable Object a, @Nullable Object b) { - return a != null && b != null; - } } diff --git a/src/com/android/launcher3/folder/FolderIcon.java b/src/com/android/launcher3/folder/FolderIcon.java index e8759da0d0..dd00f07807 100644 --- a/src/com/android/launcher3/folder/FolderIcon.java +++ b/src/com/android/launcher3/folder/FolderIcon.java @@ -616,11 +616,14 @@ public class FolderIcon extends FrameLayout implements FolderListener, IconLabel public void drawDot(Canvas canvas) { if (!mForceHideDot && ((mDotInfo != null && mDotInfo.hasDot()) || mDotScale > 0)) { Rect iconBounds = mDotParams.iconBounds; + // FolderIcon draws the icon to be top-aligned (with padding) & horizontally-centered + int iconSize = mActivity.getDeviceProfile().iconSizePx; + iconBounds.left = (getWidth() - iconSize) / 2; + iconBounds.right = iconBounds.left + iconSize; + iconBounds.top = getPaddingTop(); + iconBounds.bottom = iconBounds.top + iconSize; - Utilities.setRectToViewCenter(this, mActivity.getDeviceProfile().iconSizePx, - iconBounds); - iconBounds.offsetTo(iconBounds.left, getPaddingTop()); - float iconScale = (float) mBackground.previewSize / iconBounds.width(); + float iconScale = (float) mBackground.previewSize / iconSize; Utilities.scaleRectAboutCenter(iconBounds, iconScale); // If we are animating to the accepting state, animate the dot out. diff --git a/src/com/android/launcher3/model/ModelUtils.java b/src/com/android/launcher3/model/ModelUtils.java index 1ced0b16f4..c21fc38cfb 100644 --- a/src/com/android/launcher3/model/ModelUtils.java +++ b/src/com/android/launcher3/model/ModelUtils.java @@ -15,8 +15,6 @@ */ package com.android.launcher3.model; -import static com.android.launcher3.Utilities.isValidExtraType; - import android.content.Context; import android.content.Intent; import android.graphics.Bitmap; @@ -149,4 +147,12 @@ public class ModelUtils { info.intent = launchIntent; return info; } + + /** + * @return true if the extra is either null or is of type {@param type} + */ + private static boolean isValidExtraType(Intent intent, String key, Class type) { + Object extra = intent.getParcelableExtra(key); + return extra == null || type.isInstance(extra); + } } diff --git a/src/com/android/launcher3/util/BgObjectWithLooper.java b/src/com/android/launcher3/util/BgObjectWithLooper.java index 1483c43a11..adc3c7d885 100644 --- a/src/com/android/launcher3/util/BgObjectWithLooper.java +++ b/src/com/android/launcher3/util/BgObjectWithLooper.java @@ -15,10 +15,15 @@ */ package com.android.launcher3.util; +import android.database.ContentObserver; +import android.net.Uri; +import android.os.Handler; import android.os.Looper; import androidx.annotation.WorkerThread; +import java.util.function.Consumer; + /** * Utility class to define an object which does most of it's processing on a * dedicated background thread. @@ -43,4 +48,16 @@ public abstract class BgObjectWithLooper { */ @WorkerThread protected abstract void onInitialized(Looper looper); + + /** + * Helper method to create a content provider + */ + protected static ContentObserver newContentObserver(Handler handler, Consumer command) { + return new ContentObserver(handler) { + @Override + public void onChange(boolean selfChange, Uri uri) { + command.accept(uri); + } + }; + } } diff --git a/src/com/android/launcher3/util/SimpleBroadcastReceiver.java b/src/com/android/launcher3/util/SimpleBroadcastReceiver.java index 4dfa5ccdeb..0a23506692 100644 --- a/src/com/android/launcher3/util/SimpleBroadcastReceiver.java +++ b/src/com/android/launcher3/util/SimpleBroadcastReceiver.java @@ -52,4 +52,15 @@ public class SimpleBroadcastReceiver extends BroadcastReceiver { } context.registerReceiver(this, filter, flags); } + + /** + * Unregisters the receiver ignoring any errors + */ + public void unregisterReceiverSafely(Context context) { + try { + context.unregisterReceiver(this); + } catch (IllegalArgumentException e) { + // It was probably never registered or already unregistered. Ignore. + } + } } diff --git a/src/com/android/launcher3/views/OptionsPopupView.java b/src/com/android/launcher3/views/OptionsPopupView.java index d30192542f..b3c376fb0d 100644 --- a/src/com/android/launcher3/views/OptionsPopupView.java +++ b/src/com/android/launcher3/views/OptionsPopupView.java @@ -15,9 +15,6 @@ */ package com.android.launcher3.views; -import static com.android.launcher3.Utilities.EXTRA_WALLPAPER_FLAVOR; -import static com.android.launcher3.Utilities.EXTRA_WALLPAPER_LAUNCH_SOURCE; -import static com.android.launcher3.Utilities.EXTRA_WALLPAPER_OFFSET; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.IGNORE; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_SETTINGS_BUTTON_TAP_OR_LONGPRESS; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_WIDGETSTRAY_BUTTON_TAP_OR_LONGPRESS; @@ -51,6 +48,7 @@ import com.android.launcher3.popup.ArrowPopup; import com.android.launcher3.shortcuts.DeepShortcutView; import com.android.launcher3.testing.TestLogging; import com.android.launcher3.testing.shared.TestProtocol; +import com.android.launcher3.util.PackageManagerHelper; import com.android.launcher3.widget.picker.WidgetsFullSheet; import java.util.ArrayList; @@ -62,6 +60,13 @@ import java.util.List; public class OptionsPopupView extends ArrowPopup implements OnClickListener, OnLongClickListener { + // An intent extra to indicate the horizontal scroll of the wallpaper. + private static final String EXTRA_WALLPAPER_OFFSET = "com.android.launcher3.WALLPAPER_OFFSET"; + private static final String EXTRA_WALLPAPER_FLAVOR = "com.android.launcher3.WALLPAPER_FLAVOR"; + // An intent extra to indicate the launch source by launcher. + private static final String EXTRA_WALLPAPER_LAUNCH_SOURCE = + "com.android.wallpaper.LAUNCH_SOURCE"; + private final ArrayMap mItemMap = new ArrayMap<>(); private RectF mTargetRect; private boolean mShouldAddArrow; @@ -180,10 +185,11 @@ public class OptionsPopupView extends ArrowPopup */ public static ArrayList getOptions(Launcher launcher) { ArrayList options = new ArrayList<>(); - int resString = Utilities.existsStyleWallpapers(launcher) ? - R.string.styles_wallpaper_button_text : R.string.wallpaper_button_text; - int resDrawable = Utilities.existsStyleWallpapers(launcher) ? - R.drawable.ic_palette : R.drawable.ic_wallpaper; + boolean styleWallpaperExists = styleWallpapersExists(launcher); + int resString = styleWallpaperExists + ? R.string.styles_wallpaper_button_text : R.string.wallpaper_button_text; + int resDrawable = styleWallpaperExists + ? R.drawable.ic_palette : R.drawable.ic_wallpaper; options.add(new OptionItem(launcher, resString, resDrawable, @@ -251,7 +257,7 @@ public class OptionsPopupView extends ArrowPopup .putExtra(EXTRA_WALLPAPER_OFFSET, launcher.getWorkspace().getWallpaperOffsetForCenterPage()) .putExtra(EXTRA_WALLPAPER_LAUNCH_SOURCE, "app_launched_launcher"); - if (!Utilities.existsStyleWallpapers(launcher)) { + if (!styleWallpapersExists(launcher)) { intent.putExtra(EXTRA_WALLPAPER_FLAVOR, "wallpaper_only"); } else { intent.putExtra(EXTRA_WALLPAPER_FLAVOR, "focus_wallpaper"); @@ -299,4 +305,9 @@ public class OptionsPopupView extends ArrowPopup this.clickListener = clickListener; } } + + private static boolean styleWallpapersExists(Context context) { + return context.getPackageManager().resolveActivity( + PackageManagerHelper.getStyleWallpapersIntent(context), 0) != null; + } }