accessibilityservice

How to debug accessibility service?

痞子三分冷 提交于 2019-12-04 04:24:44
I have some problem with debugging AccessibilityService and can not find a solution - with every deployment/debug from Eclipse the service is not restarted automatically and it requires the manual action of restarting the service. What I am forced to do now: I am adding some new code and deploying/debugging with Eclipse. Application is deployed correctly and started but the new version of service is not started (messages from service are not shown and breakpoints are not working). I am manually opening settings -> accessibility and see that my service runs. I am manually stopping and starting

How to interact with USSD dialog programmatically in android

£可爱£侵袭症+ 提交于 2019-12-03 09:12:58
I want to use USSD dialog which comes after dialing any USSD code say *123# which asks user to enter option number to perform specific task(s) depending upon sim card vendors. I need to interact with that dialog to provide input in the text box given into it programmatically. However, I am able to read the USSD response that comes in Alert Dialog after dialing any USSD code, using AccessibilityService and I'm showing the response in a Toast as shown in the code below. I haven't found any solution to interact with USSD dialog yet. public class UssdService extends AccessibilityService{ public

AccessibilityNodeInfo - send text

这一生的挚爱 提交于 2019-12-03 06:49:57
I am developing an Android app, where I have to send text to focused EditText field of other Applications. I have done it in API level 18 and above using AccessibilityService , when I find the EditText , I paste the data from ClipBoard. Here is the code, public class TestService extends AccessibilityService { @Override public void onAccessibilityEvent(AccessibilityEvent event) { AccessibilityNodeInfo source = event.getSource(); if (source != null && event.getEventType() == AccessibilityEvent.TYPE_VIEW_CLICKED && event.getClassName().equals("android.widget.EditText")) { ClipboardManager

Accessibility service disabled upon each debug run

天涯浪子 提交于 2019-12-02 23:16:07
Each time I start a new debug instance, my accessibility service resets to the disabled state. Is there any way to keep it enabled across successive debug runs (as it is quite long & boring to enable it each time in order to debug the service)? I have the same behavior on real device and emulators. There is no exception in the service, I tried event with no code in the event handler. There are suspicious lines in my logs: 10:47:32.801 31669-31669/? E/AffinityControl: AffinityControl: registerfunction enter 10:47:32.821 3650-3690/? I/ActivityManager: Force stopping com.test

Android: Take screenshot of Notification bar Programmatically

旧城冷巷雨未停 提交于 2019-12-02 02:39:42
问题 I used the accessibility service to expand the notifications bar on receiving notifications. I'm trying to take the screenshot of the Notification in the notification drawer. From the documentation of the Accessibility service it possible to take the screenshot of the device from Android P only. is there any other possibilities to take the screenshot of the notification drawer as my App is not in the foreground. It is running in the background 回答1: Yes, you can do this, though it's tricky.

Accessibility Service - performGlobalAction() returns false

╄→尐↘猪︶ㄣ 提交于 2019-12-01 06:11:54
I am creating an Android Accessibility Service which calls performGlobalAction() at onStartCommand() public int onStartCommand(Intent intent, int flags, int startId) { Log.d("service", "started"); Bundle extras = intent.getExtras(); Integer value = -1; if (extras != null) { value = extras.getInt("control"); } switch(value) { case BUTTON_EVENT_BACK: //press back button boolean result = performGlobalAction(GLOBAL_ACTION_BACK); Log.d("make back action result: ", Boolean.toString(result)); break; } stopSelf(); return Service.START_STICKY; } I followed the guide and add necessary permissions to the

“Cannot perform this action on a not sealed instance” java.lang.IllegalStateException exception

柔情痞子 提交于 2019-12-01 04:06:51
With android AccessibilityService able to paste in other app EditText Field, but with browser testfields (Emulator Default Browser or Samsung deault Browser) its not working, throwing error: Cannot perform this action on a not sealed instance. In android chrome browser with some singnup textfield its working but not for all textfields. @Override public void onAccessibilityEvent(AccessibilityEvent event) { AccessibilityNodeInfo source = event.getSource(); if (source != null && ( event.getEventType() == AccessibilityEvent.TYPE_VIEW_FOCUSED ) ) { // || event.getEventType() == AccessibilityEvent

“Cannot perform this action on a not sealed instance” java.lang.IllegalStateException exception

倖福魔咒の 提交于 2019-12-01 01:41:47
问题 With android AccessibilityService able to paste in other app EditText Field, but with browser testfields (Emulator Default Browser or Samsung deault Browser) its not working, throwing error: Cannot perform this action on a not sealed instance. In android chrome browser with some singnup textfield its working but not for all textfields. @Override public void onAccessibilityEvent(AccessibilityEvent event) { AccessibilityNodeInfo source = event.getSource(); if (source != null && ( event

Android : Read Google chrome URL using accessibility service

馋奶兔 提交于 2019-11-30 23:51:35
I want to read the url user has entered in his browser. Here is my accessibility service code. <accessibility-service xmlns:android="http://schemas.android.com/apk/res/android" android:accessibilityFlags="flagDefault" android:accessibilityEventTypes="typeWindowStateChanged" android:accessibilityFeedbackType="feedbackGeneric" android:notificationTimeout="0" android:canRetrieveWindowContent="true" android:packageNames="com.android.chrome" android:description="@string/accessibility_description" /> In AndroidManifest <service android:name=".MyAccessibilityService" android:label="@string

AccessibilityService stops receiving events on reboot

一曲冷凌霜 提交于 2019-11-30 16:26:08
问题 I have an app that uses the accessibility services to listen to notifications. It works correctly unti the user reboots. If you reboot, you have to disable/re-enable the service from the accessibility services menu. Why does the app not get the events after a reboot? @Override protected void onServiceConnected() { pMan = new PreferencesManager(this); bulbManager = new BulbManager(((Context) this), pMan.getBridge()); AccessibilityServiceInfo info = new AccessibilityServiceInfo(); info