Home | History | Annotate | Download | only in accessibility

Lines Matching refs:service

92  * This class is instantiated by the system as a system level service and can be
93 * accessed only by the system. The task of this service is to be a centralized
126 final List<Service> mServices = new ArrayList<Service>();
131 final Map<ComponentName, Service> mComponentNameToServiceMap = new HashMap<ComponentName, Service>();
166 private Service mUiAutomationService;
168 private Service mQueryBridge;
203 // We will update when the automation service dies.
264 // We will update when the automation service dies.
305 // We will update when the automation service dies.
323 // We will update when the automation service dies.
341 // We will update when the automation service dies.
358 // We will update when the automation service dies.
437 List<Service> services = mServices;
444 Service service = services.get(i);
445 if ((service.mFeedbackType & feedbackTypeBit) != 0) {
446 result.add(service.mAccessibilityServiceInfo);
457 Service service = mServices.get(i);
459 service.mServiceInterface.onInterrupt();
462 + service.mService, re);
510 // the automation service goes away the state is restored from the settings.
515 Service runningService = mServices.get(i);
524 // Hook the automation service up.
525 mUiAutomationService = new Service(componentName, accessibilityServiceInfo, true);
531 // Automation service is not bound, so pretend it died to perform clean up.
560 Service service = getQueryBridge();
561 final int connectionId = service.mId;
563 client.addConnection(connectionId, service);
599 private Service getQueryBridge() {
602 mQueryBridge = new Service(null, info, true);
617 // service that can handle them which is the last one
620 // the user should make the call which service handles
621 // gestures. However, only one service should handle
626 Service service = mServices.get(i);
627 if (service.mReqeustTouchExplorationMode && service.mIsDefault == isDefault) {
628 service.notifyGesture(gestureId);
666 Slog.w(LOG_TAG, "Skipping accessibilty service " + new ComponentName(
698 * and denotes the period after the last event before notifying the service.
707 Service service = mServices.get(i);
709 if (service.mIsDefault == isDefault) {
710 if (canDispathEventLocked(service, event, mHandledFeedbackTypes)) {
711 mHandledFeedbackTypes |= service.mFeedbackType;
712 service.notifyAccessibilityEvent(event);
725 * Adds a service.
727 * @param service The service to add.
729 private void tryAddServiceLocked(Service service) {
731 if (mServices.contains(service) || !service.isConfigured()) {
734 service.linkToOwnDeath();
735 mServices.add(service);
736 mComponentNameToServiceMap.put(service.mComponentName, service);
738 tryEnableTouchExplorationLocked(service);
745 * Removes a service.
747 * @param service The service.
748 * @return True if the service was removed, false otherwise.
750 private boolean tryRemoveServiceLocked(Service service) {
751 final boolean removed = mServices.remove(service);
755 mComponentNameToServiceMap.remove(service.mComponentName);
756 service.unlinkToOwnDeath();
757 service.dispose();
759 tryDisableTouchExplorationLocked(service);
764 * Determines if given event can be dispatched to a service based on the package of the
766 * service is notified if it is interested in events from the package and no other service
771 * @param service The potential receiver.
776 private boolean canDispathEventLocked(Service service, AccessibilityEvent event,
779 if (!service.isConfigured()) {
784 && !service.mIncludeNotImportantViews) {
789 if ((service
793 Set<String> packageNames = service.mPackageNames;
797 int feedbackType = service.mFeedbackType;
825 List<Service> services = mServices;
828 Service service = services.get(i);
829 if (service.unbind()) {
885 * Updates the state of each service by starting (or keeping running) enabled ones and
895 Map<ComponentName, Service> componentNameToServiceMap = mComponentNameToServiceMap;
903 Service service = componentNameToServiceMap.get(componentName);
907 if (service == null) {
908 service = new Service(componentName, installedService, false);
910 service.bind();
913 if (service != null) {
914 service.unbind();
918 if (service != null) {
919 service.unbind();
1003 private void tryEnableTouchExplorationLocked(final Service service) {
1004 if (!mIsTouchExplorationEnabled && service.mRequestTouchExplorationMode) {
1006 service.mComponentName);
1007 if (!service.mIsAutomation && !canToggleTouchExploration) {
1009 service).sendToTarget();
1016 private void tryDisableTouchExplorationLocked(Service service) {
1021 Service other = mServices.get(i);
1022 if (other != service && other.mRequestTouchExplorationMode) {
1069 final Service service = (Service) msg.obj;
1070 String label = service.mResolveInfo.loadLabel(
1085 // The user allowed the service to toggle touch exploration.
1086 mTouchExplorationGrantedServices.add(service.mComponentName);
1124 * This class represents an accessibility service. It stores all per service
1125 * data required for the service management, provides API for starting/stopping the
1126 * service and is responsible for adding/removing the service in the data structures
1127 * for service management. The class also exposes configuration interface that is
1128 * passed to the service it represents as soon it is bound. It also serves as the
1129 * connection for the service.
1131 class Service extends IAccessibilityServiceConnection.Stub
1174 // the events pending events to be dispatched to this service
1198 public Service(ComponentName componentName,
1240 // If this service is up and running we may have to enable touch
1241 // exploration, otherwise this will happen when the service connects.
1254 * Binds to the accessibility service.
1266 * Unbinds form the accessibility service and removes it from the data
1267 * structures for service management.
1285 * Returns if the service is configured i.e. at least event types of interest
1288 * @return True if the service is configured, false otherwise.
1304 // If the XML manifest had data to configure the service its info
1318 public void onServiceConnected(ComponentName componentName, IBinder service) {
1319 mService = service;
1320 mServiceInterface = IAccessibilityServiceClient.Stub.asInterface(service);
1327 Slog.w(LOG_TAG, "Error while setting Controller for service: " + service, re);
1629 // We no longer have an automation service, so restore
1658 // be modified to remove its source if the receiving service does
1676 * Notifies an accessibility service client for a scheduled event given the event type.
1687 // If the service died/was disabled while the message for dispatching
1698 // from the queue by the handler on the service thread and the latter is
1701 // so the service thread waits for the lock; 4) The binder thread replaces
1705 // the service thread handles the last message posted by the last binder call
1708 // event type of each service to catch such a scenario since only one message
1779 android.app.Service.STATUS_BAR_SERVICE);
1898 public boolean canGetAccessibilityNodeInfoLocked(Service service, int windowId) {
1899 return canRetrieveWindowContent(service) && isRetrievalAllowingWindow(windowId);
1902 public boolean canPerformActionLocked(Service service, int windowId, int action,
1904 return canRetrieveWindowContent(service)
1909 public boolean canRetrieveWindowContent(Service service) {
1910 return service.mCanRetrieveScreenContent;
1913 public void enforceCanRetrieveWindowContent(Service service) throws RemoteException {
1915 if (!canRetrieveWindowContent(service)) {
1916 Slog.e(LOG_TAG, "Accessibility serivce " + service.mComponentName + " does not " +