Java Code Examples for android.view.accessibility.AccessibilityManager#getEnabledAccessibilityServiceList()
The following examples show how to use
android.view.accessibility.AccessibilityManager#getEnabledAccessibilityServiceList() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PPPExtenderBroadcastReceiver.java From PhoneProfilesPlus with Apache License 2.0 | 6 votes |
static boolean isAccessibilityServiceEnabled(Context context) { AccessibilityManager manager = (AccessibilityManager) context.getSystemService(Context.ACCESSIBILITY_SERVICE); if (manager != null) { List<AccessibilityServiceInfo> runningServices = manager.getEnabledAccessibilityServiceList(AccessibilityEvent.TYPES_ALL_MASK); for (AccessibilityServiceInfo service : runningServices) { if (service != null) { //PPApplication.logE("PPPExtenderBroadcastReceiver.isAccessibilityServiceEnabled", "serviceId=" + service.getId()); if (PPApplication.EXTENDER_ACCESSIBILITY_SERVICE_ID.equals(service.getId())) { //PPApplication.logE("PPPExtenderBroadcastReceiver.isAccessibilityServiceEnabled", "true"); return true; } } } //PPApplication.logE("PPPExtenderBroadcastReceiver.isAccessibilityServiceEnabled", "false"); return false; } //PPApplication.logE("PPPExtenderBroadcastReceiver.isAccessibilityServiceEnabled", "false"); return false; }
Example 2
Source File: AccessibilityUtils.java From litho with Apache License 2.0 | 6 votes |
public static boolean enabledServiceCanFocusAndRetrieveWindowContent( AccessibilityManager manager) { List<AccessibilityServiceInfo> enabledServices = manager.getEnabledAccessibilityServiceList(AccessibilityServiceInfo.FEEDBACK_ALL_MASK); if (enabledServices == null) { return false; } for (AccessibilityServiceInfo serviceInfo : enabledServices) { int eventTypes = serviceInfo.eventTypes; if ((eventTypes & AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED) != AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED) { continue; } int capabilities = AccessibilityServiceInfoCompat.getCapabilities(serviceInfo); if ((capabilities & AccessibilityServiceInfo.CAPABILITY_CAN_RETRIEVE_WINDOW_CONTENT) == AccessibilityServiceInfo.CAPABILITY_CAN_RETRIEVE_WINDOW_CONTENT) { return true; } } return false; }
Example 3
Source File: AlipayFragment.java From WeChatHongBao with Apache License 2.0 | 6 votes |
private void updateServiceStatus() { boolean serviceEnabled = false; AccessibilityManager accessibilityManager = (AccessibilityManager) baseContext.getSystemService(Context.ACCESSIBILITY_SERVICE); List<AccessibilityServiceInfo> accessibilityServices = accessibilityManager.getEnabledAccessibilityServiceList(AccessibilityServiceInfo.FEEDBACK_GENERIC); for (AccessibilityServiceInfo info : accessibilityServices) { if (info.getId().equals(baseContext.getPackageName() + "/.services.AlipayService")) { serviceEnabled = true; break; } } if (!serviceEnabled) { btn.setText(R.string.service_open); } else { btn.setText(R.string.service_off); } }
Example 4
Source File: WeChatFragment.java From WeChatHongBao with Apache License 2.0 | 6 votes |
private void updateServiceStatus() { boolean serviceEnabled = false; AccessibilityManager accessibilityManager = (AccessibilityManager) baseContext.getSystemService(Context.ACCESSIBILITY_SERVICE); List<AccessibilityServiceInfo> accessibilityServices = accessibilityManager.getEnabledAccessibilityServiceList(AccessibilityServiceInfo.FEEDBACK_GENERIC); for (AccessibilityServiceInfo info : accessibilityServices) { if (info.getId().equals(baseContext.getPackageName() + "/.services.HongbaoService")) { serviceEnabled = true; break; } } if (!serviceEnabled) { btn.setText(R.string.service_open); } else { btn.setText(R.string.service_off); } }
Example 5
Source File: QQFragment.java From WeChatHongBao with Apache License 2.0 | 6 votes |
private void updateServiceStatus() { boolean serviceEnabled = false; AccessibilityManager accessibilityManager = (AccessibilityManager) baseContext.getSystemService(Context.ACCESSIBILITY_SERVICE); List<AccessibilityServiceInfo> accessibilityServices = accessibilityManager.getEnabledAccessibilityServiceList(AccessibilityServiceInfo.FEEDBACK_GENERIC); for (AccessibilityServiceInfo info : accessibilityServices) { if (info.getId().equals(baseContext.getPackageName() + "/.services.QQService")) { serviceEnabled = true; break; } } if (!serviceEnabled) { btn.setText(R.string.service_open); } else { btn.setText(R.string.service_off); } }
Example 6
Source File: AccessibilityHelper.java From WechatHook-Dusan with Apache License 2.0 | 5 votes |
/** * 判断辅助服务是否正在运行 * */ @TargetApi(Build.VERSION_CODES.JELLY_BEAN) public static boolean isServiceRunning(WechatService service) { if(service == null) { return false; } AccessibilityManager accessibilityManager = (AccessibilityManager) service.getSystemService(Context.ACCESSIBILITY_SERVICE); AccessibilityServiceInfo info = service.getServiceInfo(); if(info == null) { return false; } List<AccessibilityServiceInfo> list = accessibilityManager.getEnabledAccessibilityServiceList(AccessibilityServiceInfo.FEEDBACK_GENERIC); Iterator<AccessibilityServiceInfo> iterator = list.iterator(); boolean isConnect = false; while (iterator.hasNext()) { AccessibilityServiceInfo i = iterator.next(); if(i.getId().equals(info.getId())) { isConnect = true; break; } } if(!isConnect) { return false; } return true; }
Example 7
Source File: AccessibilityUtil.java From 365browser with Apache License 2.0 | 5 votes |
/** * 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; }
Example 8
Source File: MainActivity.java From luckymoney with Apache License 2.0 | 5 votes |
private boolean isAccessibleEnabled() { AccessibilityManager manager = (AccessibilityManager) getSystemService(Context.ACCESSIBILITY_SERVICE); List<AccessibilityServiceInfo> runningServices = manager.getEnabledAccessibilityServiceList(AccessibilityEvent.TYPES_ALL_MASK); for (AccessibilityServiceInfo info : runningServices) { if (info.getId().equals(getPackageName() + "/.MonitorService")) { return true; } } return false; }
Example 9
Source File: Per_App.java From isu with GNU General Public License v3.0 | 5 votes |
public static boolean isAccessibilityEnabled(Context context, String id) { if (id == null) return false; AccessibilityManager am = (AccessibilityManager) context .getSystemService(Context.ACCESSIBILITY_SERVICE); List < AccessibilityServiceInfo > runningServices = am .getEnabledAccessibilityServiceList(AccessibilityEvent.TYPES_ALL_MASK); for (AccessibilityServiceInfo service: runningServices) { if (id.equals(service.getId())) return true; } return false; }
Example 10
Source File: Per_App.java From kernel_adiutor with Apache License 2.0 | 5 votes |
public static boolean isAccessibilityEnabled(Context context, String id) { AccessibilityManager am = (AccessibilityManager) context .getSystemService(Context.ACCESSIBILITY_SERVICE); List<AccessibilityServiceInfo> runningServices = am .getEnabledAccessibilityServiceList(AccessibilityEvent.TYPES_ALL_MASK); for (AccessibilityServiceInfo service : runningServices) { if (id != null && id.equals(service.getId())) { return true; } } return false; }
Example 11
Source File: Per_App.java From KA27 with Apache License 2.0 | 5 votes |
public static boolean isAccessibilityEnabled(Context context, String id) { AccessibilityManager am = (AccessibilityManager) context .getSystemService(Context.ACCESSIBILITY_SERVICE); List < AccessibilityServiceInfo > runningServices = am .getEnabledAccessibilityServiceList(AccessibilityEvent.TYPES_ALL_MASK); for (AccessibilityServiceInfo service: runningServices) { if (id != null && id.equals(service.getId())) { return true; } } return false; }
Example 12
Source File: AccessibilityUtil.java From AndroidChromium with Apache License 2.0 | 5 votes |
/** * 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; }
Example 13
Source File: ClickService.java From AndroidAutoClick with MIT License | 5 votes |
/** * 判断当前服务是否正在运行 * */ @TargetApi(Build.VERSION_CODES.JELLY_BEAN) public static boolean isRunning() { if(service == null) { return false; } AccessibilityManager accessibilityManager = (AccessibilityManager) service.getSystemService(Context.ACCESSIBILITY_SERVICE); AccessibilityServiceInfo info = service.getServiceInfo(); if(info == null) { return false; } List<AccessibilityServiceInfo> list = accessibilityManager.getEnabledAccessibilityServiceList(AccessibilityServiceInfo.FEEDBACK_GENERIC); Iterator<AccessibilityServiceInfo> iterator = list.iterator(); boolean isConnect = false; while (iterator.hasNext()) { AccessibilityServiceInfo i = iterator.next(); if(i.getId().equals(info.getId())) { isConnect = true; break; } } if(!isConnect) { return false; } return true; }
Example 14
Source File: MyUtil.java From Clip-Stack with MIT License | 5 votes |
public static boolean isAccessibilityEnabled(Context context, String id) { AccessibilityManager am = (AccessibilityManager) context .getSystemService(Context.ACCESSIBILITY_SERVICE); List<AccessibilityServiceInfo> runningServices = am .getEnabledAccessibilityServiceList(AccessibilityEvent.TYPES_ALL_MASK); for (AccessibilityServiceInfo service : runningServices) { if (service.getId().contains(id)) { return true; } } return false; }
Example 15
Source File: AccessUtil.java From pc-android-controller-android with Apache License 2.0 | 5 votes |
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; }
Example 16
Source File: AccessibilityUtils.java From SmsCode with GNU General Public License v3.0 | 5 votes |
/** * 检查当前辅助服务是否已启用 * * @param context context * @param serviceId serviceId * @return 是否已启用 */ public static boolean checkAccessibilityEnabled(Context context, String serviceId) { AccessibilityManager accessibilityManager = getAccessibilityManager(context); List<AccessibilityServiceInfo> accessibilityServiceInfoList = accessibilityManager.getEnabledAccessibilityServiceList(AccessibilityServiceInfo.FEEDBACK_ALL_MASK); for (AccessibilityServiceInfo info : accessibilityServiceInfoList) { if (info.getId().equals(serviceId)) { return true; } } return false; }
Example 17
Source File: AccessibilityManagerCompatIcs.java From guideshow with MIT License | 4 votes |
public static List<AccessibilityServiceInfo> getEnabledAccessibilityServiceList( AccessibilityManager manager,int feedbackTypeFlags) { return manager.getEnabledAccessibilityServiceList(feedbackTypeFlags); }
Example 18
Source File: AccessibilityManagerCompatIcs.java From adt-leanback-support with Apache License 2.0 | 4 votes |
public static List<AccessibilityServiceInfo> getEnabledAccessibilityServiceList( AccessibilityManager manager,int feedbackTypeFlags) { return manager.getEnabledAccessibilityServiceList(feedbackTypeFlags); }
Example 19
Source File: AccessibilityManagerCompatIcs.java From V.FlyoutTest with MIT License | 4 votes |
public static List<AccessibilityServiceInfo> getEnabledAccessibilityServiceList( AccessibilityManager manager,int feedbackTypeFlags) { return manager.getEnabledAccessibilityServiceList(feedbackTypeFlags); }
Example 20
Source File: AccessibilityManagerCompatIcs.java From CodenameOne with GNU General Public License v2.0 | 4 votes |
public static List<AccessibilityServiceInfo> getEnabledAccessibilityServiceList( AccessibilityManager manager,int feedbackTypeFlags) { return manager.getEnabledAccessibilityServiceList(feedbackTypeFlags); }