Merge "Allow Wear to install apps from unknown sources"
diff --git a/packages/PackageInstaller/res/values/strings.xml b/packages/PackageInstaller/res/values/strings.xml
index 688d116..6a3b239 100644
--- a/packages/PackageInstaller/res/values/strings.xml
+++ b/packages/PackageInstaller/res/values/strings.xml
@@ -189,6 +189,9 @@
<!-- Text to show in warning dialog on the tv when the app source is not trusted [CHAR LIMIT=NONE] -->
<string name="untrusted_external_source_warning" product="tv">For your security, your TV currently isn’t allowed to install unknown apps from this source. You can change this in Settings.</string>
+ <!-- Text to show in warning dialog on the wear when the app source is not trusted [CHAR LIMIT=NONE] -->
+ <string name="untrusted_external_source_warning" product="watch">For your security, your watch currently isn’t allowed to install unknown apps from this source. You can change this in Settings.</string>
+
<!-- Text to show in warning dialog on the phone when the app source is not trusted [CHAR LIMIT=NONE] -->
<string name="untrusted_external_source_warning" product="default">For your security, your phone currently isn’t allowed to install unknown apps from this source. You can change this in Settings.</string>
diff --git a/packages/PackageInstaller/src/com/android/packageinstaller/PackageInstallerActivity.java b/packages/PackageInstaller/src/com/android/packageinstaller/PackageInstallerActivity.java
index de76632..fa93670 100644
--- a/packages/PackageInstaller/src/com/android/packageinstaller/PackageInstallerActivity.java
+++ b/packages/PackageInstaller/src/com/android/packageinstaller/PackageInstallerActivity.java
@@ -124,9 +124,8 @@
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 @@
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 @@
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) {
@@ -779,21 +772,6 @@
}
/**
- * 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
*/
public static class OutOfSpaceDialog extends AppErrorDialog {