Question

I have implemented some features by integrating accessibility service for my application.

I currently have a 'system overlay' ImageView that can detect TouchEvent's. however i have seen it done that immersive mode, hiding the statusbar or navbar is possible without root.

i need to beable to access the view of my touch detection window in order to process any accessibility

My Accessibility service contains:

     ...
        @Override
        public void onServiceConnected() {
            serviceInstance = this;
        }
    ...

my touch detector:

  ...
        WindowManager wm;
        private MyAccessibilityService myAccessibilityService;
        private ImageView mTouchDetector;

        @Override
        public void onCreate() {

            super.onCreate();

            myAccessibilityService = MyAccessibilityService.getSharedInstance();

    WindowManager.LayoutParams params = new WindowManager.LayoutParams(
                    100,
                    100,
                    0, 0,
                    WindowManager.LayoutParams.TYPE_PHONE,
                    WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE, debugMode());
            params.gravity = Gravity.CENTER_HORIZONTAL | Gravity.BOTTOM;
            wm = (WindowManager) getSystemService(WINDOW_SERVICE);
            wm.addView(mTouchDetector, params);
    }
...
Was it helpful?

Solution

I have partially solved this problem, however having some trouble with the back button, check here to see if it gets resolved.

create the service as normal but add these flags to the overlay:

to the window manager:

TYPE_PRIORITY_PHONE, FLAG_FULLSCREEN | FLAG_NOT_TOUCH_MODAL

to the view:

int uiOptions = View.SYSTEM_UI_FLAG_FULLSCREEN;
FloatingView.setSystemUiVisibility(uiOptions);

Android floating window with hidden statusbar Accessibility problems

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top