当前位置: 首页>>代码示例>>Java>>正文


Java AccessibilityManager.getEnabledAccessibilityServiceList方法代码示例

本文整理汇总了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;
}
 
开发者ID:GuepardoApps,项目名称:LucaHome-AndroidApplication,代码行数:20,代码来源:AndroidSystemController.java

示例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;
}
 
开发者ID:Shingyx,项目名称:Bixlight,代码行数:16,代码来源:MainActivity.java

示例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;
    }
 
开发者ID:kaixuanluo,项目名称:pc-android-controller-android,代码行数:13,代码来源:AccessUtil.java

示例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;
}
 
开发者ID:KrongKrongPadakPadak,项目名称:mvo,代码行数:11,代码来源:Utils.java

示例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;
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:34,代码来源:AccessibilityUtil.java

示例6: getEnabledAccessibilityServiceList

import android.view.accessibility.AccessibilityManager; //导入方法依赖的package包/类
public static List<AccessibilityServiceInfo> getEnabledAccessibilityServiceList(AccessibilityManager manager, int feedbackTypeFlags) {
    return manager.getEnabledAccessibilityServiceList(feedbackTypeFlags);
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:4,代码来源:AccessibilityManagerCompatIcs.java


注:本文中的android.view.accessibility.AccessibilityManager.getEnabledAccessibilityServiceList方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。