Reputation: 6290
I have implemented an accessibility service for Android 7.0. The code is shown below. I would like to catch all possible events and just print them to console. The problem now is that when I start the service I'm receiving the events but the phone does not react to touch input anymore, i.e. the phone is basically blocked.
What is my mistake? Is capturing all events a problem in terms of performance or CPU load? Most of the time skype will be used (chatting) and sometimes Chrome browser.
Manifest
<service android:name=".smartphone.MyAccessibilityService"
android:permission="android.permission.BIND_ACCESSIBILITY_SERVICE">
<intent-filter>
<action android:name="android.accessibilityservice.AccessibilityService" />
</intent-filter>
<meta-data
android:name="android.accessibilityservice"
android:resource="@xml/accessibility_config" />
</service>
accessibility_config.xml
<accessibility-service xmlns:android="http://schemas.android.com/apk/res/android"
android:accessibilityEventTypes="typeAllMask"
android:accessibilityFeedbackType="feedbackAllMask"
android:canRequestTouchExplorationMode="true"
android:canRequestEnhancedWebAccessibility="true"
android:canRequestFilterKeyEvents="true"
android:canRetrieveWindowContent="true"
android:accessibilityFlags="flagDefault|flagIncludeNotImportantViews|flagReportViewIds|flagRequestEnhancedWebAccessibility|flagRequestFilterKeyEvents|flagRequestTouchExplorationMode|flagRetrieveInteractiveWindows" />
MyAccessibilityService.java
public class MyAccessibilityService extends AccessibilityService {
@Override
public void onAccessibilityEvent(AccessibilityEvent event) {
Log.i("ACCESSIBILITY SERVICE", "ACCESSIBILITY SERVICE : " + event.toString());
}
Upvotes: 0
Views: 2551
Reputation: 758
flagRequestTouchExplorationMode has turned on touch exploration mode, which is what's affecting how your device reacts to touches.
Upvotes: 2