Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0fc931f2 authored by Justin Chung's avatar Justin Chung Committed by Android (Google) Code Review
Browse files

Merge "Allow Wear to install apps from unknown sources"

parents 02ab4975 a8156ac4
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -189,6 +189,9 @@
    <!-- Text to show in warning dialog on the tv when the app source is not trusted [CHAR LIMIT=NONE] -->
    <!-- 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>
    <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] -->
    <!-- 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>
    <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>


+3 −25
Original line number Original line Diff line number Diff line
@@ -124,9 +124,8 @@ public class PackageInstallerActivity extends AlertActivity {
    private static final int DLG_INSTALL_ERROR = DLG_BASE + 4;
    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_UNKNOWN_SOURCES_RESTRICTED_FOR_USER = DLG_BASE + 5;
    private static final int DLG_ANONYMOUS_SOURCE = DLG_BASE + 6;
    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 + 7;
    private static final int DLG_EXTERNAL_SOURCE_BLOCKED = DLG_BASE + 8;
    private static final int DLG_INSTALL_APPS_RESTRICTED_FOR_USER = DLG_BASE + 8;
    private static final int DLG_INSTALL_APPS_RESTRICTED_FOR_USER = DLG_BASE + 9;


    // If unknown sources are temporary allowed
    // If unknown sources are temporary allowed
    private boolean mAllowUnknownSources;
    private boolean mAllowUnknownSources;
@@ -189,8 +188,6 @@ public class PackageInstallerActivity extends AlertActivity {
            case DLG_INSTALL_ERROR:
            case DLG_INSTALL_ERROR:
                return InstallErrorDialog.newInstance(
                return InstallErrorDialog.newInstance(
                        mPm.getApplicationLabel(mPkgInfo.applicationInfo));
                        mPm.getApplicationLabel(mPkgInfo.applicationInfo));
            case DLG_NOT_SUPPORTED_ON_WEAR:
                return NotSupportedOnWearDialog.newInstance();
            case DLG_INSTALL_APPS_RESTRICTED_FOR_USER:
            case DLG_INSTALL_APPS_RESTRICTED_FOR_USER:
                return SimpleErrorDialog.newInstance(
                return SimpleErrorDialog.newInstance(
                        R.string.install_apps_user_restriction_dlg_text);
                        R.string.install_apps_user_restriction_dlg_text);
@@ -379,12 +376,8 @@ public class PackageInstallerActivity extends AlertActivity {
            return;
            return;
        }
        }


        if (DeviceUtils.isWear(this)) {
            showDialogInner(DLG_NOT_SUPPORTED_ON_WEAR);
            return;
        }

        final boolean wasSetUp = processAppSnippet(packageSource);
        final boolean wasSetUp = processAppSnippet(packageSource);

        if (mLocalLOGV) Log.i(TAG, "wasSetUp: " + wasSetUp);
        if (mLocalLOGV) Log.i(TAG, "wasSetUp: " + wasSetUp);


        if (!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
     * An error dialog shown when the device is out of space
     */
     */