accessibilityservice

AccessibilityService stops receiving events on reboot

╄→尐↘猪︶ㄣ 提交于 2019-11-30 16:08:50
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.eventTypes = AccessibilityEvent.TYPE_NOTIFICATION_STATE_CHANGED; info.notificationTimeout = 100; info

Get notification icon using an accessibility service

不想你离开。 提交于 2019-11-30 10:25:26
Is there any way to get icons of system notifications? I can get a notification parcel with Accessibility service. I can even get the id of the icon from it, but I am stuck there. I have no idea how to use the id to get the actual bitmap so I can display it, because it is not from my apk. Here is my code so far: @Override public void onAccessibilityEvent(AccessibilityEvent event) { Log.d("onAccessibilityEvent"); if (event.getEventType() == AccessibilityEvent.TYPE_NOTIFICATION_STATE_CHANGED) { if (event.getParcelableData() instanceof Notification) { Notification notification = (Notification)

How to use Accessibility Services for “Taking Action for Users”?

廉价感情. 提交于 2019-11-30 07:06:39
Background Back a few years ago , I asked how TeamViewer allows the user to control the device without normal interaction with the device. I was told it's a special "backdoor" that manufacturers allow specifically for this app, and only possible using root priviledge for other apps. Seeing that an app like "Airplane Mode Shortcut" allows to toggle airplane mode, by automatic navigation to its screen and toggling the switch, it made me realize this situation has changed. The problem It is said in the docs : Starting with Android 4.0 (API Level 14), accessibility services can act on behalf of

How can I reliably simulate touch events on Android without root (like Automate and Tasker)?

点点圈 提交于 2019-11-29 07:46:25
How can I reliably simulate touch events on Android (without rooting) from Java outside my app which runs as a background service? While this question has been asked before, most answers utilise ADB . (such as How to simulate touch events on Android device? ) https://github.com/chetbox/android-mouse-cursor offers a good solution using Accessibility, but is not very reliable as not all views respond to it, and games do not respond at all most of the time. private void click() { AccessibilityNodeInfo nodeInfo = getRootInActiveWindow(); if (nodeInfo == null) return; AccessibilityNodeInfo

Android unable read window content on few devices using accessibility service

喜夏-厌秋 提交于 2019-11-29 07:38:35
My requirement: Reading the text from pop up, dialog etc for particular app. I have implemented an accessibility service and I am receiving proper events and data as per my requirement. However while testing I realized that on some devices instead of using a AlertDialog or Dialog they have used an activity(themed as a dialog). Hence in my accessibility event I receive only the activity title, is there a way I could find the text displayed by this particular pop up activity? I have searched pretty hard but could not get much help on the topic nor did the documentation be of any good in this

How to use Accessibility Services for “Taking Action for Users”?

元气小坏坏 提交于 2019-11-29 07:22:33
问题 Background Back a few years ago, I asked how TeamViewer allows the user to control the device without normal interaction with the device. I was told it's a special "backdoor" that manufacturers allow specifically for this app, and only possible using root priviledge for other apps. Seeing that an app like "Airplane Mode Shortcut" allows to toggle airplane mode, by automatic navigation to its screen and toggling the switch, it made me realize this situation has changed. The problem It is said

Reading notifications using AccessibilityService

*爱你&永不变心* 提交于 2019-11-29 04:14:38
I've recently tried to read incoming notifications using AccessibilityService . I know reading notifications using NotificationListenerService , but that's not what I need (for compatibility with lower android versions). My problem is, OnServiceConnected() never get called, even though in my settings, I've gave my app the neccessary premisions. Here is my code: public class NotificationAccessibilityService extends AccessibilityService{ protected void onServiceConnected() { Log.d("Tortuga", "AccessibilityService Connected"); AccessibilityServiceInfo info = new AccessibilityServiceInfo(); info

Read Notification Bar title, message using Accessibility Service Programmatically

泄露秘密 提交于 2019-11-29 02:36:20
Using Accessibility Service I am being able to read notification bar title & message, the issue I am facing is when first notification appear I am reading all these perfectly but after first notification & onward I am only getting title & text "you have 2 messages" and so on, not the entire message. Waiting for your expert advice. Code : @Override protected void onServiceConnected() { Log.d("AccessibilityServiceNotification", "ServiceConnected"); try { AccessibilityServiceInfo info = new AccessibilityServiceInfo(); info.eventTypes = AccessibilityEvent.TYPE_NOTIFICATION_STATE_CHANGED; info

How to get notified when a notification is notified [duplicate]

丶灬走出姿态 提交于 2019-11-28 19:50:32
This question already has an answer here: Detect a new Android notification 2 answers I want to read/access/log the notifications fired on notification bar by other applications. I searched Intents and PendingIntents a lot, but couldn't get a solution. Does my application need to be notified when any notification is fired? Or Does android system provide something to read notifications by the user-level applications? Starting with api 18 (android 4.3) it's possible: http://developer.android.com/reference/android/service/notification/NotificationListenerService.html Very easy to use, but the

Detect if my accessibility service is enabled

三世轮回 提交于 2019-11-28 05:54:07
I was wondering how could I detect if my own service is enabled. So I could check if my service is not enabled, then tell the user to enable it. Pankaj Kumar Below is the method to check if your accessibility service is enabled or not. Note: Change value of YOURAccessibilityService with your Service. // To check if service is enabled private boolean isAccessibilitySettingsOn(Context mContext) { int accessibilityEnabled = 0; final String service = getPackageName() + "/" + YOURAccessibilityService.class.getCanonicalName(); try { accessibilityEnabled = Settings.Secure.getInt( mContext