title: How to check if Talkback is active in JellyBean
body: <p><a href="https://stackoverflow.com/questions/5116867/how-to-know-if-android-talkback-is-active">This question</a> asked how to know if Android Talkback is active; that worked until Jelly Bean. Starting from Android 4.1, that steps no longer work, because the mentioned cursor is empty.</p>
  
  <p>Having this said, I want to ask is if there is a way to do the same checking in Jelly Bean.</p>
  
  <p><strong>EDIT</strong>
  I tried to search for TalkBack code and I found it <a href="http://eyes-free.googlecode.com/svn-history/r729/trunk/TalkBack/src/com/google/android/marvin/talkback/" rel="nofollow noreferrer">here</a>. 
  For checking if TalkBack is active, I am using the following code:</p>
  
  <pre><code>Intent screenReaderIntent = new Intent("android.accessibilityservice.AccessibilityService");
  screenReaderIntent.addCategory("android.accessibilityservice.category.FEEDBACK_SPOKEN");
  List&lt;ResolveInfo&gt; screenReaders = getPackageManager().queryIntentServices(screenReaderIntent, 0);
  Cursor cursor = null;
  ContentResolver cr = getContentResolver();
  for (ResolveInfo screenReader : screenReaders) {
      cursor = cr.query(Uri.parse("content://" + screenReader.serviceInfo.packageName
              + ".providers.StatusProvider"), null, null, null, null);
      //here, cursor is not null, but calling cursor.moveToFirst() returns false, which means the cursor is empty
  }
  </code></pre>
  
  <p>Having this said, if the cursor is empty, how do we know if TalkBack is running?</p>
  
  <p><strong>EDIT 2</strong>
  Following @JoxTraex suggestions, I am now sending a broadcast to query whether or not TalkBack is enabled:</p>
  
  <pre><code>Intent i = new Intent();
  i.setAction("com.google.android.marvin.talkback.ACTION_QUERY_TALKBACK_ENABLED_COMMAND");
  sendBroadcast(i);
  </code></pre>
  
  <p>Now how should I receive the response?</p>
  
  <p>I tried adding the following to manifest, but my receiver does not receive any response:</p>
  
  <pre><code>&lt;receiver android:name="my.package.MyBroadcastReceiver"
  android:permission="com.google.android.marvin.talkback.PERMISSION_SEND_INTENT_BROADCAST_COMMANDS_TO_TALKBACK"&gt;
  &lt;intent-filter&gt;
      &lt;action android:name="com.google.android.marvin.talkback.ACTION_QUERY_TALKBACK_ENABLED_COMMAND" /&gt;
  &lt;/intent-filter&gt;
  </code></pre>
  
  <p></p>