本文整理汇总了Java中android.view.accessibility.AccessibilityManager.getEnabledAccessibilityServiceList方法的典型用法代码示例。如果您正苦于以下问题:Java AccessibilityManager.getEnabledAccessibilityServiceList方法的具体用法?Java AccessibilityManager.getEnabledAccessibilityServiceList怎么用?Java AccessibilityManager.getEnabledAccessibilityServiceList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.view.accessibility.AccessibilityManager
的用法示例。
在下文中一共展示了AccessibilityManager.getEnabledAccessibilityServiceList方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: IsAccessibilityServiceEnabled
import android.view.accessibility.AccessibilityManager; //导入方法依赖的package包/类
public boolean IsAccessibilityServiceEnabled(@NonNull String serviceId) {
Logger.getInstance().Debug(TAG, String.format(Locale.getDefault(), "IsAccessibilityServiceEnabled for serviceId %s", serviceId));
AccessibilityManager accessibilityManager = (AccessibilityManager) _context.getSystemService(Context.ACCESSIBILITY_SERVICE);
if (accessibilityManager == null) {
Logger.getInstance().Error(TAG, "accessibilityManager is null!");
return false;
}
List<AccessibilityServiceInfo> runningServices = accessibilityManager.getEnabledAccessibilityServiceList(AccessibilityEvent.TYPES_ALL_MASK);
for (AccessibilityServiceInfo service : runningServices) {
Logger.getInstance().Debug(TAG, String.format(Locale.getDefault(), "Found active service %s", service.getId()));
if (serviceId.equals(service.getId())) {
return true;
}
}
return false;
}
示例2: isBixlightEnabled
import android.view.accessibility.AccessibilityManager; //导入方法依赖的package包/类
private boolean isBixlightEnabled() {
boolean ret = false;
AccessibilityManager accessibilityManager = (AccessibilityManager) getSystemService(Context.ACCESSIBILITY_SERVICE);
if (accessibilityManager != null) {
List<AccessibilityServiceInfo> runningServices = accessibilityManager.getEnabledAccessibilityServiceList(AccessibilityServiceInfo.FEEDBACK_GENERIC);
for (AccessibilityServiceInfo service : runningServices) {
if (service.getId().equals(bixlightServiceId)) {
ret = true;
break;
}
}
}
Log.v(TAG, "isBixlightEnabled = " + ret);
return ret;
}
示例3: isGroupReplyServiceEnabled
import android.view.accessibility.AccessibilityManager; //导入方法依赖的package包/类
public boolean isGroupReplyServiceEnabled(Context context) {
AccessibilityManager accessibilityManager = (AccessibilityManager) context.getSystemService(Context.ACCESSIBILITY_SERVICE);
List<AccessibilityServiceInfo> accessibilityServices =
accessibilityManager.getEnabledAccessibilityServiceList(AccessibilityServiceInfo.FEEDBACK_GENERIC);
for (AccessibilityServiceInfo info : accessibilityServices) {
// if (info.getId().equals(getPackageName() + "/.WeChatGroupSendService")) {
if (info.getId().equals(context.getPackageName() + "/.access.WeChatAccessService")) {
return true;
}
}
return false;
}
示例4: checkAccessibilityPermission
import android.view.accessibility.AccessibilityManager; //导入方法依赖的package包/类
public static boolean checkAccessibilityPermission(Context context) {
AccessibilityManager accessibilityManager = (AccessibilityManager)context.getSystemService(Context.ACCESSIBILITY_SERVICE);
List<AccessibilityServiceInfo> list = accessibilityManager.getEnabledAccessibilityServiceList(AccessibilityServiceInfo.FEEDBACK_GENERIC);
for (AccessibilityServiceInfo info : list) {
if (info.getResolveInfo().serviceInfo.packageName.equals(context.getPackageName())) {
return true;
}
}
return false;
}
示例5: showWarningIfOldTalkbackRunning
import android.view.accessibility.AccessibilityManager; //导入方法依赖的package包/类
/**
* Checks to see if an old version of TalkBack is running that Chrome doesn't support,
* and if so, shows an alert dialog prompting the user to update the app.
* @param context A {@link Context} instance.
* @return True if the dialog was shown.
*/
public static boolean showWarningIfOldTalkbackRunning(Context context) {
AccessibilityManager manager = (AccessibilityManager)
context.getSystemService(Context.ACCESSIBILITY_SERVICE);
if (manager == null) return false;
boolean isTalkbackRunning = false;
try {
List<AccessibilityServiceInfo> services =
manager.getEnabledAccessibilityServiceList(
AccessibilityServiceInfo.FEEDBACK_SPOKEN);
for (AccessibilityServiceInfo service : services) {
if (service.getId().contains(TALKBACK_PACKAGE_NAME)) isTalkbackRunning = true;
}
} catch (NullPointerException e) {
// getEnabledAccessibilityServiceList() can throw an NPE due to a bad
// AccessibilityService.
}
if (!isTalkbackRunning) return false;
if (PackageUtils.getPackageVersion(context, TALKBACK_PACKAGE_NAME) < MIN_TALKBACK_VERSION
&& !sOldTalkBackVersionAlertShown) {
showOldTalkbackVersionAlertOnce(context);
return true;
}
return false;
}
示例6: getEnabledAccessibilityServiceList
import android.view.accessibility.AccessibilityManager; //导入方法依赖的package包/类
public static List<AccessibilityServiceInfo> getEnabledAccessibilityServiceList(AccessibilityManager manager, int feedbackTypeFlags) {
return manager.getEnabledAccessibilityServiceList(feedbackTypeFlags);
}