use of android.view.accessibility.AccessibilityManager in project android_packages_apps_Settings by DirtyUnicorns.
the class ShortcutServicePickerFragment method getCandidates.
@Override
protected List<? extends DefaultAppInfo> getCandidates() {
final AccessibilityManager accessibilityManager = getContext().getSystemService(AccessibilityManager.class);
final List<AccessibilityServiceInfo> installedServices = accessibilityManager.getInstalledAccessibilityServiceList();
final int numInstalledServices = installedServices.size();
List<DefaultAppInfo> candidates = new ArrayList<>(numInstalledServices);
for (int i = 0; i < numInstalledServices; i++) {
AccessibilityServiceInfo installedServiceInfo = installedServices.get(i);
candidates.add(new DefaultAppInfo(mPm, UserHandle.myUserId(), installedServiceInfo.getComponentName(), (String) installedServiceInfo.loadSummary(mPm.getPackageManager()), true));
}
return candidates;
}
use of android.view.accessibility.AccessibilityManager in project android_packages_apps_Dialer by MoKee.
the class GlowPadView method getScaledGlowRadiusSquared.
private float getScaledGlowRadiusSquared() {
final float scaledTapRadius;
final AccessibilityManager accessibilityManager = (AccessibilityManager) getContext().getSystemService(Context.ACCESSIBILITY_SERVICE);
if (accessibilityManager.isEnabled()) {
scaledTapRadius = TAP_RADIUS_SCALE_ACCESSIBILITY_ENABLED * mGlowRadius;
} else {
scaledTapRadius = mGlowRadius;
}
return square(scaledTapRadius);
}
use of android.view.accessibility.AccessibilityManager in project MaxLock by Maxr1998.
the class MLImplementation method isAccessibilityEnabled.
private static boolean isAccessibilityEnabled(Context c) {
AccessibilityManager manager = (AccessibilityManager) c.getSystemService(Context.ACCESSIBILITY_SERVICE);
List<AccessibilityServiceInfo> infos = manager.getEnabledAccessibilityServiceList(FEEDBACK_GENERIC | FEEDBACK_VISUAL);
for (int i = 0; i < infos.size(); i++) {
// Ugh. Isn't there sth better? Definitely a // TODO
String packageName = infos.get(i).getResolveInfo().serviceInfo.packageName;
if (packageName.equals(BuildConfig.APPLICATION_ID)) {
return true;
}
}
return false;
}
use of android.view.accessibility.AccessibilityManager in project Saiy-PS by brandall76.
the class SelfAwareHelper method saiyAccessibilityRunning.
/**
* Check the running condition of {@link SaiyAccessibilityService}
*
* @param ctx the application context
*/
public static boolean saiyAccessibilityRunning(@NonNull final Context ctx) {
if (DEBUG) {
MyLog.i(CLS_NAME, "saiyAccessibilityRunning");
}
final AccessibilityManager aManager = (AccessibilityManager) ctx.getSystemService(Context.ACCESSIBILITY_SERVICE);
String className;
for (final AccessibilityServiceInfo service : aManager.getEnabledAccessibilityServiceList(AccessibilityServiceInfo.FEEDBACK_ALL_MASK)) {
try {
className = service.getId();
if (className != null) {
if (className.trim().endsWith(SaiyAccessibilityService.class.getSimpleName())) {
if (DEBUG) {
MyLog.i(CLS_NAME, "SaiyAccessibilityService running");
}
return true;
}
}
} catch (final NullPointerException e) {
if (DEBUG) {
MyLog.w(CLS_NAME, "NullPointerException");
}
} catch (final Exception e) {
if (DEBUG) {
MyLog.w(CLS_NAME, "Exception");
}
}
}
if (DEBUG) {
MyLog.i(CLS_NAME, "SaiyAccessibilityService not running");
}
return false;
}
use of android.view.accessibility.AccessibilityManager in project PhoneProfilesPlus by henrichg.
the class AccessibilityServiceBroadcastReceiver method isAccessibilityServiceEnabled.
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("AccessibilityServiceBroadcastReceiver.isAccessibilityServiceEnabled", "serviceId=" + service.getId());
if (PPApplication.EXTENDER_ACCESSIBILITY_SERVICE_ID.equals(service.getId())) {
PPApplication.logE("AccessibilityServiceBroadcastReceiver.isAccessibilityServiceEnabled", "true");
return true;
}
}
}
PPApplication.logE("AccessibilityServiceBroadcastReceiver.isAccessibilityServiceEnabled", "false");
return false;
}
PPApplication.logE("AccessibilityServiceBroadcastReceiver.isAccessibilityServiceEnabled", "false");
return false;
}
Aggregations