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

Commit d7db6baa authored by Jeff Sharkey's avatar Jeff Sharkey Committed by android code review
Browse files

Merge "Don't direct to market if no markets installed"

parents eefa61ed fc2e1ac0
Loading
Loading
Loading
Loading
+14 −3
Original line number Diff line number Diff line
@@ -179,9 +179,9 @@ public class AccessibilitySettings extends SettingsPreferenceFragment implements
        super.onResume();
        loadInstalledServices();
        updateAllPreferences();
        if (mServicesCategory.getPreference(0) == mNoServicesMessagePreference) {

        offerInstallAccessibilitySerivceOnce();
        }

        mSettingsPackageMonitor.register(getActivity(), getActivity().getMainLooper(), false);
        RotationPolicy.registerRotationPolicyListener(getActivity(),
                mRotationPolicyListener);
@@ -465,6 +465,17 @@ public class AccessibilitySettings extends SettingsPreferenceFragment implements
        final boolean offerInstallService = !preferences.getBoolean(
                KEY_INSTALL_ACCESSIBILITY_SERVICE_OFFERED_ONCE, false);
        if (offerInstallService) {
            String screenreaderMarketLink = SystemProperties.get(
                    SYSTEM_PROPERTY_MARKET_URL,
                    DEFAULT_SCREENREADER_MARKET_LINK);
            Uri marketUri = Uri.parse(screenreaderMarketLink);
            Intent marketIntent = new Intent(Intent.ACTION_VIEW, marketUri);

            if (getPackageManager().resolveActivity(marketIntent, 0) == null) {
                // Don't show the dialog if no market app is found/installed.
                return;
            }

            preferences.edit().putBoolean(KEY_INSTALL_ACCESSIBILITY_SERVICE_OFFERED_ONCE,
                    true).commit();
            // Notify user that they do not have any accessibility