am d7db6baa
: Merge "Don\'t direct to market if no markets installed"
* commit 'd7db6baac7e7d6742916cf1f80e9cbf832b1c64d': 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();
|
||||
loadInstalledServices();
|
||||
updateAllPreferences();
|
||||
if (mServicesCategory.getPreference(0) == mNoServicesMessagePreference) {
|
||||
offerInstallAccessibilitySerivceOnce();
|
||||
}
|
||||
|
||||
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
|
||||
|
Reference in New Issue
Block a user