4

I have a problem with accessibility service in android. I want to retrive result of USSD command. What I try to do:

  1. I made an AccessibilityService from gist.github.com/qihnus/1909616
  2. Deal USSD: Intent i = new Intent(Intent.ACTION_CALL); i.setData(Uri.parse("tel:*110*10" + Uri.encode("#"))); i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); i.addFlags(Intent.FLAG_FROM_BACKGROUND); startActivity(i);
  3. Popup window with USSD result opens
  4. In AccessibilityService onAccessibilityEvent fired, and I get USSD result text. And it works perfectly only when screen is on. If screen is off, onAccessibilityEvent fired only after I unlock the phone.

Is it possible onAccessibilityEvent to be called when screen is off?


Please excuse my bad English, my native language is Ukrainian.

Hagakurje
  • 1,002
  • 2
  • 11
  • 17
  • I'm not sure I understand your question. Which UI accessibility event would you expect to show up in the log when the screen is off? One can't click on a View when the screen is off. And one can't use the keyboard when the screen is off. – Stephan Branczyk May 09 '14 at 07:12
  • Ok, try to explain: 1. I made an AccessibilityService from https://gist.github.com/qihnus/1909616 2. Deal USSD: Intent i = new Intent(Intent.ACTION_CALL); i.setData(Uri.parse("tel:*110*10" + Uri.encode("#"))); i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); i.addFlags(Intent.FLAG_FROM_BACKGROUND); startActivity(i); 3. Popup window with USSD result opens 4. In AccessibilityService onAccessibilityEvent fired, and I get USSD result text And it works perfectly only when screen is on. If screen is off, onAccessibilityEvent fired after I unlock the phone. – Hagakurje May 09 '14 at 07:21
  • The Android OS is not the same as a PC OS. On a PC, when the screen is turned off, you can still type on the keyboard. On an Android phone, when the screen is turned off, it probably means your phone is in your pocket, and you do not want your phone to call people, email people, or spend money, when you're making out in a night club while your phone is in your pocket. – Stephan Branczyk May 09 '14 at 07:21
  • For me too, when screen is off i do not hear the talkback for my views which i have set when screen goes off – user755499 Dec 16 '14 at 14:49
  • 1) Which kind of accessibility service do you need? 2) The USSD command should start in background with or without the user intervention? 3) What are the input or output that are you looking for? – paolo2988 Aug 06 '15 at 15:27

0 Answers0