0

Preface:
Device: Nexus 5, Android Lollipop

Put simply, My App does capture the Accessibility events but capture rate is only around 93%.

This might look good but it is unacceptable for the kind of functionality my App is designed for.

My code:

    @Override
    public void onServiceConnected() {

    AccessibilityServiceInfo info = new AccessibilityServiceInfo();
    info.notificationTimeout = 0;
    info.eventTypes = AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED;
    info.feedbackType = AccessibilityServiceInfo.FEEDBACK_GENERIC;
    info.packageNames = new String[] { "com.android.phone" };

    setServiceInfo(info);
    }

    public void onAccessibilityEvent(AccessibilityEvent x) {
        Log.e("Event", "Occurred");
    }

Question:

  1. If you have worked with Accessibility Services before have you observed something similar?
  2. If missing events is a norm, is my capture rate poor ?
  3. If you overcame this issue, Please Please answer this, I'll buy you a pizza anywhere you are on earth......Seriously !
Dilnoor Singh
  • 518
  • 5
  • 16
  • Could you define what you mean by "missing"? What type of events are missing? Did you set `notificationTimeout` to 0 in your service meta-data? – alanv Mar 20 '15 at 22:52
  • alanv, I did set notificationTimeout to 0. What you can call a miss is, simply the absence of a Log Tag in LogCat which I output when the event is fired. – Dilnoor Singh Mar 20 '15 at 22:55
  • Besides, if I use Monkey by Android Debug Bridge, the capture rate gets worse. – Dilnoor Singh Mar 20 '15 at 22:56
  • What type of events are missing? – alanv Mar 20 '15 at 23:43
  • TYPE_WINDOW_STATE_CHANGED – Dilnoor Singh Mar 20 '15 at 23:44
  • Could you add the code that you're using to detect that the event has been fired and to detect that is has been received? It's possible that there's a bug in the framework, but it could be a bug in your code. Hard to tell without more context. – alanv Mar 20 '15 at 23:52
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/73454/discussion-between-time-traveller-and-alanv). – Dilnoor Singh Mar 20 '15 at 23:59

0 Answers0