Allow Wear to install apps from unknown sources

Bug: 229133213
Test: CTS CtsPackageInstallTestCases

Change-Id: I6fc90c035401965834471db6535e5e2f353a127c
This commit is contained in:
Justin Chung
2022-07-13 06:59:52 +00:00
parent bb210c0fdd
commit a8156ac4d4
2 changed files with 6 additions and 25 deletions

View File

@@ -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>

View File

@@ -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
*/