package com.octtoplus.proj.recorda;

import android.accessibilityservice.AccessibilityService;
import android.accessibilityservice.AccessibilityServiceInfo;
import android.util.Log;
import android.view.accessibility.AccessibilityEvent;

/**
 * Created by muangsiriworamet on 9/21/16.
 */

public class RecordAccessibilityService extends AccessibilityService {

    private final AccessibilityServiceInfo info = new AccessibilityServiceInfo();
    private static final String TAG = "RecService";

    @Override
    public void onAccessibilityEvent(AccessibilityEvent accessibilityEvent) {
        final int eventType = accessibilityEvent.getEventType();
        String eventText = null;
        
        switch(eventType) {
            case AccessibilityEvent.TYPE_VIEW_CLICKED:
                eventText = "Clicked: ";
                break;
            case AccessibilityEvent.TYPE_VIEW_ACCESSIBILITY_FOCUSED:
                eventText = "Focused: ";
                break;
        }
        
        eventText = eventText + accessibilityEvent.getContentDescription();
        Log.i(TAG, "Event: " + eventText);
        
    }

    @Override
    protected void onServiceConnected() {
        Log.i(TAG, "onServiceConnected: asdfadfasdfasdfasdfasdfdsafdsafs");
        info.eventTypes = AccessibilityEvent.TYPE_VIEW_CLICKED | AccessibilityEvent.TYPE_VIEW_FOCUSED;
        info.feedbackType = AccessibilityServiceInfo.FEEDBACK_HAPTIC;
        info.packageNames = new String[]{"com.octtoplus.proj.recorda"};
        info.notificationTimeout = 100;

        this.setServiceInfo(info);
    }

    @Override
    public void onInterrupt() {

    }
}

@@ -679,16 +679,17 @@
 = null;%0A
+%0A
         
@@ -1107,16 +1107,73 @@
 tText);%0A
+        Log.i(TAG, %22a: %22+accessibilityEvent.toString());%0A
         
@@ -1380,43 +1380,231 @@
 ED %7C
- AccessibilityEvent.TYPE_VIEW_FOCUS
+%0A                AccessibilityEvent.TYPE_VIEW_SCROLLED %7C%0A                AccessibilityEvent.TYPE_VIEW_LONG_CLICKED %7C%0A                AccessibilityEvent.TYPE_VIEW_FOCUSED %7C%0A                AccessibilityEvent.TYPE_VIEW_SELECT
 ED;%0A
@@ -1607,24 +1607,26 @@
 ED;%0A        
+//
 info.feedbac

Add more eventTypes(longclicked, selected, scrolled)