* commit '677e2ff670eb48adf252e1bb9d1e2e5b3af558ee': Don't direct to market if no markets installed
This commit is contained in:
@@ -179,9 +179,9 @@ public class AccessibilitySettings extends SettingsPreferenceFragment implements
|
|||||||
super.onResume();
|
super.onResume();
|
||||||
loadInstalledServices();
|
loadInstalledServices();
|
||||||
updateAllPreferences();
|
updateAllPreferences();
|
||||||
if (mServicesCategory.getPreference(0) == mNoServicesMessagePreference) {
|
|
||||||
offerInstallAccessibilitySerivceOnce();
|
offerInstallAccessibilitySerivceOnce();
|
||||||
}
|
|
||||||
mSettingsPackageMonitor.register(getActivity(), getActivity().getMainLooper(), false);
|
mSettingsPackageMonitor.register(getActivity(), getActivity().getMainLooper(), false);
|
||||||
RotationPolicy.registerRotationPolicyListener(getActivity(),
|
RotationPolicy.registerRotationPolicyListener(getActivity(),
|
||||||
mRotationPolicyListener);
|
mRotationPolicyListener);
|
||||||
@@ -465,6 +465,17 @@ public class AccessibilitySettings extends SettingsPreferenceFragment implements
|
|||||||
final boolean offerInstallService = !preferences.getBoolean(
|
final boolean offerInstallService = !preferences.getBoolean(
|
||||||
KEY_INSTALL_ACCESSIBILITY_SERVICE_OFFERED_ONCE, false);
|
KEY_INSTALL_ACCESSIBILITY_SERVICE_OFFERED_ONCE, false);
|
||||||
if (offerInstallService) {
|
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,
|
preferences.edit().putBoolean(KEY_INSTALL_ACCESSIBILITY_SERVICE_OFFERED_ONCE,
|
||||||
true).commit();
|
true).commit();
|
||||||
// Notify user that they do not have any accessibility
|
// Notify user that they do not have any accessibility
|
||||||
|
Reference in New Issue
Block a user