title: AccessibilityService Keep disabling
body: <p>hey i am working with USSD response reader the code is working fine but. only issue is every time i need to enable AccessibilityService  for my app. please guide me if i done any thing worng here is my code
  USSDService.java</p>
  <pre><code>public class USSDService extends AccessibilityService {
      private static final String TAG = &quot;USSDService&quot;;
  
  
      public void setUssdrespose(String ussdrespose) {
          this.ussdrespose = ussdrespose;
      }
  
      public  String ussdrespose;
  
      public static String  text;
      @Override
      public void onAccessibilityEvent(AccessibilityEvent event) {
          Log.d(TAG, &quot;onAccessibilityEvent&quot;);
          text  = event.getText().toString();
          setUssdrespose(text);
          Log.d(TAG, text);
  MainActivity.setTextViewToModify(text);
      }
  
  
      @Override
      public void onInterrupt() {
  
      }
  
  
      @Override
      protected void onServiceConnected() {
          super.onServiceConnected();
          Log.d(TAG, &quot;onServiceConnected&quot;);
          AccessibilityServiceInfo info = new AccessibilityServiceInfo();
          info.flags = AccessibilityServiceInfo.DEFAULT;
          info.packageNames = new String[]{&quot;com.android.phone&quot;};
          info.eventTypes = AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED;
          info.feedbackType = AccessibilityServiceInfo.FEEDBACK_GENERIC;
          setServiceInfo(info);
      }
  }
  </code></pre>
  <p>manifest.xml</p>
  <pre><code>&lt;service android:name=&quot;.USSDService&quot;
              android:permission=&quot;android.permission.BIND_ACCESSIBILITY_SERVICE&quot;
              android:enabled=&quot;true&quot;
              android:exported=&quot;true&quot;&gt;
              &lt;intent-filter&gt;
                  &lt;action android:name=&quot;android.accessibilityservice.AccessibilityService&quot; /&gt;
              &lt;/intent-filter&gt;
              &lt;meta-data android:name=&quot;android.accessibilityservice&quot;
                  android:resource=&quot;@xml/config_service&quot; /&gt;
          &lt;/service&gt;
  </code></pre>