Example usage for android.accessibilityservice AccessibilityService GLOBAL_ACTION_NOTIFICATIONS

List of usage examples for android.accessibilityservice AccessibilityService GLOBAL_ACTION_NOTIFICATIONS

Introduction

In this page you can find the example usage for android.accessibilityservice AccessibilityService GLOBAL_ACTION_NOTIFICATIONS.

Prototype

int GLOBAL_ACTION_NOTIFICATIONS

To view the source code for android.accessibilityservice AccessibilityService GLOBAL_ACTION_NOTIFICATIONS.

Click Source Link

Document

Action to open the notifications.

Usage

From source file:Main.java

public static void doPullDown(AccessibilityService service) {
    service.performGlobalAction(AccessibilityService.GLOBAL_ACTION_NOTIFICATIONS);
}

From source file:Main.java

@SuppressLint("NewApi")
public static void doPullDown(AccessibilityService service) {
    service.performGlobalAction(AccessibilityService.GLOBAL_ACTION_NOTIFICATIONS);
}

From source file:com.android.talkback.controller.GestureControllerApp.java

@Override
public void performAction(String action) {
    if (action.equals(mService.getString(R.string.shortcut_value_unassigned))) {
        // Do Nothing
    } else if (action.equals(mService.getString(R.string.shortcut_value_previous))) {
        boolean result = mCursorController.previous(true /* shouldWrap */, true /* shouldScroll */,
                true /*useInputFocusAsPivotIfEmpty*/, InputModeManager.INPUT_MODE_TOUCH);
        if (!result)
            mFeedbackController.playAuditory(R.raw.complete);
    } else if (action.equals(mService.getString(R.string.shortcut_value_next))) {
        boolean result = mCursorController.next(true /* shouldWrap */, true /* shouldScroll */,
                true /*useInputFocusAsPivotIfEmpty*/, InputModeManager.INPUT_MODE_TOUCH);
        if (!result)
            mFeedbackController.playAuditory(R.raw.complete);
    } else if (action.equals(mService.getString(R.string.shortcut_value_scroll_back))) {
        boolean result = mCursorController.less();
        if (!result)
            mFeedbackController.playAuditory(R.raw.complete);
    } else if (action.equals(mService.getString(R.string.shortcut_value_scroll_forward))) {
        boolean result = mCursorController.more();
        if (!result)
            mFeedbackController.playAuditory(R.raw.complete);
    } else if (action.equals(mService.getString(R.string.shortcut_value_first_in_screen))) {
        boolean result = mCursorController.jumpToTop(InputModeManager.INPUT_MODE_TOUCH);
        if (!result)
            mFeedbackController.playAuditory(R.raw.complete);
    } else if (action.equals(mService.getString(R.string.shortcut_value_last_in_screen))) {
        boolean result = mCursorController.jumpToBottom(InputModeManager.INPUT_MODE_TOUCH);
        if (!result)
            mFeedbackController.playAuditory(R.raw.complete);
    } else if (action.equals(mService.getString(R.string.shortcut_value_back))) {
        mService.performGlobalAction(AccessibilityService.GLOBAL_ACTION_BACK);
    } else if (action.equals(mService.getString(R.string.shortcut_value_home))) {
        mService.performGlobalAction(AccessibilityService.GLOBAL_ACTION_HOME);
    } else if (action.equals(mService.getString(R.string.shortcut_value_overview))) {
        mService.performGlobalAction(AccessibilityService.GLOBAL_ACTION_RECENTS);
    } else if (action.equals(mService.getString(R.string.shortcut_value_notifications))) {
        mService.performGlobalAction(AccessibilityService.GLOBAL_ACTION_NOTIFICATIONS);
    } else if (action.equals(mService.getString(R.string.shortcut_value_talkback_breakout))) {
        mMenuManager.showMenu(R.menu.global_context_menu);
    } else if (action.equals(mService.getString(R.string.shortcut_value_local_breakout))) {
        mMenuManager.showMenu(R.menu.local_context_menu);
    } else if (action.equals(mService.getString(R.string.shortcut_value_show_custom_actions))) {
        mMenuManager.showMenu(R.id.custom_action_menu);
    } else if (action.equals(mService.getString(R.string.shortcut_value_previous_granularity))) {
        boolean result = mCursorController.previousGranularity();
        if (!result)
            mFeedbackController.playAuditory(R.raw.complete);
    } else if (action.equals(mService.getString(R.string.shortcut_value_next_granularity))) {
        boolean result = mCursorController.nextGranularity();
        if (!result)
            mFeedbackController.playAuditory(R.raw.complete);
    } else if (action.equals(mService.getString(R.string.shortcut_value_read_from_top))) {
        mFullScreenReadController.startReadingFromBeginning();
    } else if (action.equals(mService.getString(R.string.shortcut_value_read_from_current))) {
        mFullScreenReadController.startReadingFromNextNode();
    } else if (action.equals(mService.getString(R.string.shortcut_value_print_node_tree))) {
        TreeDebug.logNodeTree(AccessibilityServiceCompatUtils.getRootInActiveWindow(mService));
    }//from w ww.j  a  v a 2s.  c om

    Intent intent = new Intent(GestureActionMonitor.ACTION_GESTURE_ACTION_PERFORMED);
    intent.putExtra(GestureActionMonitor.EXTRA_SHORTCUT_GESTURE_ACTION, action);
    LocalBroadcastManager.getInstance(mService).sendBroadcast(intent);
}

From source file:com.android.screenspeak.controller.GestureControllerApp.java

@Override
public void performAction(String action) {
    if (action.equals(mService.getString(R.string.shortcut_value_unassigned))) {
        // Do Nothing
    } else if (action.equals(mService.getString(R.string.shortcut_value_previous))) {
        boolean result = mCursorController.previous(true /* shouldWrap */, true /* shouldScroll */,
                true /*useInputFocusAsPivotIfEmpty*/);
        if (!result)
            mFeedbackController.playAuditory(R.raw.complete);
    } else if (action.equals(mService.getString(R.string.shortcut_value_next))) {
        boolean result = mCursorController.next(true /* shouldWrap */, true /* shouldScroll */,
                true /*useInputFocusAsPivotIfEmpty*/);
        if (!result)
            mFeedbackController.playAuditory(R.raw.complete);
    } else if (action.equals(mService.getString(R.string.shortcut_value_scroll_back))) {
        boolean result = mCursorController.less();
        if (!result)
            mFeedbackController.playAuditory(R.raw.complete);
    } else if (action.equals(mService.getString(R.string.shortcut_value_scroll_forward))) {
        boolean result = mCursorController.more();
        if (!result)
            mFeedbackController.playAuditory(R.raw.complete);
    } else if (action.equals(mService.getString(R.string.shortcut_value_first_in_screen))) {
        boolean result = mCursorController.jumpToTop();
        if (!result)
            mFeedbackController.playAuditory(R.raw.complete);
    } else if (action.equals(mService.getString(R.string.shortcut_value_last_in_screen))) {
        boolean result = mCursorController.jumpToBottom();
        if (!result)
            mFeedbackController.playAuditory(R.raw.complete);
    } else if (action.equals(mService.getString(R.string.shortcut_value_back))) {
        mService.performGlobalAction(AccessibilityService.GLOBAL_ACTION_BACK);
    } else if (action.equals(mService.getString(R.string.shortcut_value_home))) {
        mService.performGlobalAction(AccessibilityService.GLOBAL_ACTION_HOME);
    } else if (action.equals(mService.getString(R.string.shortcut_value_overview))) {
        mService.performGlobalAction(AccessibilityService.GLOBAL_ACTION_RECENTS);
    } else if (action.equals(mService.getString(R.string.shortcut_value_notifications))) {
        mService.performGlobalAction(AccessibilityService.GLOBAL_ACTION_NOTIFICATIONS);
    } else if (action.equals(mService.getString(R.string.shortcut_value_screenspeak_breakout))) {
        mMenuManager.showMenu(R.menu.global_context_menu);
    } else if (action.equals(mService.getString(R.string.shortcut_value_local_breakout))) {
        mMenuManager.showMenu(R.menu.local_context_menu);
    } else if (action.equals(mService.getString(R.string.shortcut_value_previous_granularity))) {
        boolean result = mCursorController.previousGranularity();
        if (!result)
            mFeedbackController.playAuditory(R.raw.complete);
    } else if (action.equals(mService.getString(R.string.shortcut_value_next_granularity))) {
        boolean result = mCursorController.nextGranularity();
        if (!result)
            mFeedbackController.playAuditory(R.raw.complete);
    } else if (action.equals(mService.getString(R.string.shortcut_value_read_from_top))) {
        mFullScreenReadController.startReadingFromBeginning();
    } else if (action.equals(mService.getString(R.string.shortcut_value_read_from_current))) {
        mFullScreenReadController.startReadingFromNextNode();
    } else if (action.equals(mService.getString(R.string.shortcut_value_print_node_tree))) {
        TreeDebug.logNodeTree(AccessibilityServiceCompatUtils.getRootInActiveWindow(mService));
    }// w ww  .  ja  va 2 s  .  co m

    Intent intent = new Intent(GestureActionMonitor.ACTION_GESTURE_ACTION_PERFORMED);
    intent.putExtra(GestureActionMonitor.EXTRA_SHORTCUT_GESTURE_ACTION, action);
    LocalBroadcastManager.getInstance(mService).sendBroadcast(intent);
}