OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 package org.chromium.chrome.browser.util; | 5 package org.chromium.chrome.browser.util; |
6 | 6 |
7 import android.accessibilityservice.AccessibilityServiceInfo; | 7 import android.accessibilityservice.AccessibilityServiceInfo; |
8 import android.content.Context; | 8 import android.content.Context; |
9 import android.content.DialogInterface; | 9 import android.content.DialogInterface; |
10 import android.content.Intent; | 10 import android.content.Intent; |
11 import android.net.Uri; | 11 import android.net.Uri; |
12 import android.support.v7.app.AlertDialog; | 12 import android.support.v7.app.AlertDialog; |
13 import android.view.accessibility.AccessibilityManager; | 13 import android.view.accessibility.AccessibilityManager; |
14 | 14 |
15 import org.chromium.base.PackageUtils; | 15 import org.chromium.base.PackageUtils; |
16 import org.chromium.base.annotations.CalledByNative; | 16 import org.chromium.base.annotations.CalledByNative; |
17 import org.chromium.chrome.R; | 17 import org.chromium.chrome.R; |
18 | 18 |
19 import java.util.List; | 19 import java.util.List; |
20 | 20 |
21 /** | 21 /** |
22 * Exposes information about the current accessibility state | 22 * Exposes information about the current accessibility state |
23 */ | 23 */ |
24 public class AccessibilityUtil { | 24 public class AccessibilityUtil { |
25 // Whether we've already shown an alert that they have an old version of Tal
kBack running. | 25 // Whether we've already shown an alert that they have an old version of Tal
kBack running. |
26 private static boolean sOldTalkBackVersionAlertShown = false; | 26 private static boolean sOldTalkBackVersionAlertShown; |
27 | 27 |
28 // The link to download or update TalkBack from the Play Store. | 28 // The link to download or update TalkBack from the Play Store. |
29 private static final String TALKBACK_MARKET_LINK = | 29 private static final String TALKBACK_MARKET_LINK = |
30 "market://search?q=pname:com.google.android.marvin.talkback"; | 30 "market://search?q=pname:com.google.android.marvin.talkback"; |
31 | 31 |
32 // The package name for TalkBack, an Android accessibility service. | 32 // The package name for TalkBack, an Android accessibility service. |
33 private static final String TALKBACK_PACKAGE_NAME = | 33 private static final String TALKBACK_PACKAGE_NAME = |
34 "com.google.android.marvin.talkback"; | 34 "com.google.android.marvin.talkback"; |
35 | 35 |
36 // The minimum TalkBack version that we support. This is the version that sh
ipped with | 36 // The minimum TalkBack version that we support. This is the version that sh
ipped with |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 new DialogInterface.OnClickListener() { | 105 new DialogInterface.OnClickListener() { |
106 @Override | 106 @Override |
107 public void onClick(DialogInterface dialog, int id)
{ | 107 public void onClick(DialogInterface dialog, int id)
{ |
108 // Do nothing, this alert is only shown once eit
her way. | 108 // Do nothing, this alert is only shown once eit
her way. |
109 } | 109 } |
110 }); | 110 }); |
111 AlertDialog dialog = builder.create(); | 111 AlertDialog dialog = builder.create(); |
112 dialog.show(); | 112 dialog.show(); |
113 } | 113 } |
114 } | 114 } |
OLD | NEW |