Merge "Add missing enterprise string" into tm-dev am: b8e9cbcc65

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/18230548

Change-Id: Ic7edfbb75e125aaa599689e90862e28e91f49dc1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Kholoud Mohamed
2022-05-10 20:23:55 +00:00
committed by Automerger Merge Worker
2 changed files with 14 additions and 2 deletions

View File

@@ -39,6 +39,7 @@ import com.android.launcher3.model.AppShareabilityManager.ShareabilityStatus;
import com.android.launcher3.model.data.ItemInfo;
import com.android.launcher3.popup.PopupDataProvider;
import com.android.launcher3.popup.SystemShortcut;
import com.android.launcher3.views.ActivityContext;
import java.io.File;
@@ -191,9 +192,14 @@ public final class AppSharing {
}
private void showCannotShareToast(Context context) {
ActivityContext activityContext = ActivityContext.lookupContext(context);
String blockedByMessage = activityContext.getStringCache() != null
? activityContext.getStringCache().disabledByAdminMessage
: context.getString(R.string.blocked_by_policy);
CharSequence text = (mSharingEnabledForUser)
? context.getText(R.string.toast_p2p_app_not_shareable)
: context.getText(R.string.blocked_by_policy);
: blockedByMessage;
int duration = Toast.LENGTH_SHORT;
Toast.makeText(context, text, duration).show();
}

View File

@@ -46,6 +46,7 @@ import com.android.launcher3.popup.SystemShortcut;
import com.android.launcher3.touch.PagedOrientationHandler;
import com.android.launcher3.util.ResourceBasedOverride;
import com.android.launcher3.util.SplitConfigurationOptions.SplitPositionOption;
import com.android.launcher3.views.ActivityContext;
import com.android.quickstep.TaskShortcutFactory.SplitSelectSystemShortcut;
import com.android.quickstep.util.RecentsOrientedState;
import com.android.quickstep.views.OverviewActionsView;
@@ -314,9 +315,14 @@ public class TaskOverlayFactory implements ResourceBasedOverride {
}
protected void showBlockedByPolicyMessage() {
ActivityContext activityContext = ActivityContext.lookupContext(
mThumbnailView.getContext());
String message = activityContext.getStringCache() != null
? activityContext.getStringCache().disabledByAdminMessage
: mThumbnailView.getContext().getString(R.string.blocked_by_policy);
Toast.makeText(
mThumbnailView.getContext(),
R.string.blocked_by_policy,
message,
Toast.LENGTH_LONG).show();
}