From a8156ac4d4e34db57aba63987b7a4063e1958169 Mon Sep 17 00:00:00 2001 From: Justin Chung Date: Wed, 13 Jul 2022 06:59:52 +0000 Subject: [PATCH] Allow Wear to install apps from unknown sources Bug: 229133213 Test: CTS CtsPackageInstallTestCases Change-Id: I6fc90c035401965834471db6535e5e2f353a127c --- .../PackageInstaller/res/values/strings.xml | 3 ++ .../PackageInstallerActivity.java | 28 ++----------------- 2 files changed, 6 insertions(+), 25 deletions(-) diff --git a/packages/PackageInstaller/res/values/strings.xml b/packages/PackageInstaller/res/values/strings.xml index 688d116914774..6a3b23900fa4d 100644 --- a/packages/PackageInstaller/res/values/strings.xml +++ b/packages/PackageInstaller/res/values/strings.xml @@ -189,6 +189,9 @@ For your security, your TV currently isn’t allowed to install unknown apps from this source. You can change this in Settings. + + For your security, your watch currently isn’t allowed to install unknown apps from this source. You can change this in Settings. + For your security, your phone currently isn’t allowed to install unknown apps from this source. You can change this in Settings. diff --git a/packages/PackageInstaller/src/com/android/packageinstaller/PackageInstallerActivity.java b/packages/PackageInstaller/src/com/android/packageinstaller/PackageInstallerActivity.java index de76632589a39..fa936706cf220 100644 --- a/packages/PackageInstaller/src/com/android/packageinstaller/PackageInstallerActivity.java +++ b/packages/PackageInstaller/src/com/android/packageinstaller/PackageInstallerActivity.java @@ -124,9 +124,8 @@ public class PackageInstallerActivity extends AlertActivity { private static final int DLG_INSTALL_ERROR = DLG_BASE + 4; private static final int DLG_UNKNOWN_SOURCES_RESTRICTED_FOR_USER = DLG_BASE + 5; private static final int DLG_ANONYMOUS_SOURCE = DLG_BASE + 6; - private static final int DLG_NOT_SUPPORTED_ON_WEAR = DLG_BASE + 7; - private static final int DLG_EXTERNAL_SOURCE_BLOCKED = DLG_BASE + 8; - private static final int DLG_INSTALL_APPS_RESTRICTED_FOR_USER = DLG_BASE + 9; + private static final int DLG_EXTERNAL_SOURCE_BLOCKED = DLG_BASE + 7; + private static final int DLG_INSTALL_APPS_RESTRICTED_FOR_USER = DLG_BASE + 8; // If unknown sources are temporary allowed private boolean mAllowUnknownSources; @@ -189,8 +188,6 @@ public class PackageInstallerActivity extends AlertActivity { case DLG_INSTALL_ERROR: return InstallErrorDialog.newInstance( mPm.getApplicationLabel(mPkgInfo.applicationInfo)); - case DLG_NOT_SUPPORTED_ON_WEAR: - return NotSupportedOnWearDialog.newInstance(); case DLG_INSTALL_APPS_RESTRICTED_FOR_USER: return SimpleErrorDialog.newInstance( R.string.install_apps_user_restriction_dlg_text); @@ -379,12 +376,8 @@ public class PackageInstallerActivity extends AlertActivity { return; } - if (DeviceUtils.isWear(this)) { - showDialogInner(DLG_NOT_SUPPORTED_ON_WEAR); - return; - } - final boolean wasSetUp = processAppSnippet(packageSource); + if (mLocalLOGV) Log.i(TAG, "wasSetUp: " + wasSetUp); if (!wasSetUp) { @@ -778,21 +771,6 @@ public class PackageInstallerActivity extends AlertActivity { } } - /** - * An error dialog shown when the app is not supported on wear - */ - public static class NotSupportedOnWearDialog extends SimpleErrorDialog { - static SimpleErrorDialog newInstance() { - return SimpleErrorDialog.newInstance(R.string.wear_not_allowed_dlg_text); - } - - @Override - public void onCancel(DialogInterface dialog) { - getActivity().setResult(RESULT_OK); - getActivity().finish(); - } - } - /** * An error dialog shown when the device is out of space */