當前位置: 首頁>>代碼示例>>Java>>正文


Java AccessibilityServiceInfo.FEEDBACK_ALL_MASK屬性代碼示例

本文整理匯總了Java中android.accessibilityservice.AccessibilityServiceInfo.FEEDBACK_ALL_MASK屬性的典型用法代碼示例。如果您正苦於以下問題:Java AccessibilityServiceInfo.FEEDBACK_ALL_MASK屬性的具體用法?Java AccessibilityServiceInfo.FEEDBACK_ALL_MASK怎麽用?Java AccessibilityServiceInfo.FEEDBACK_ALL_MASK使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在android.accessibilityservice.AccessibilityServiceInfo的用法示例。


在下文中一共展示了AccessibilityServiceInfo.FEEDBACK_ALL_MASK屬性的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onServiceConnected

@Override
protected void onServiceConnected() {
    AccessibilityServiceInfo info = new AccessibilityServiceInfo();
    // Set the type of events that this service wants to listen to.
    info.eventTypes = AccessibilityEvent.TYPE_NOTIFICATION_STATE_CHANGED;

    // Set package names to listen for or listen for all applications
    //info.packageNames = new String[] {"com.appone.totest.accessibility", "com.apptwo.totest.accessibility"};
 
    // Set the type of feedback your service will provide.
    if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
        info.feedbackType = AccessibilityServiceInfo.FEEDBACK_ALL_MASK;
    }
    else {
        info.feedbackType = AccessibilityServiceInfo.FEEDBACK_GENERIC;
    }

    // info.flags = AccessibilityServiceInfo.DEFAULT;

    info.notificationTimeout = 100;
    this.setServiceInfo(info);
}
 
開發者ID:jareddlc,項目名稱:OpenFit,代碼行數:22,代碼來源:NotificationAccessibilityService.java

示例2: onServiceConnected

@Override
public void onServiceConnected() {
    // Set the type of events that this service wants to listen to.  
    //Others won't be passed to this service.
    Log.d("Accessibility Service", "Accessibilty Service Connected");
    info.eventTypes = AccessibilityEvent.TYPE_NOTIFICATION_STATE_CHANGED;

    // If you only want this service to work with specific applications, set their
    // package names here.  Otherwise, when the service is activated, it will listen
    // to events from all applications.
    //info.packageNames = new String[]
    //{"com.appone.totest.accessibility", "com.apptwo.totest.accessibility"};

    // Set the type of feedback your service will provide.
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
        info.feedbackType = AccessibilityServiceInfo.FEEDBACK_ALL_MASK;
    } else {
        info.feedbackType = AccessibilityServiceInfo.FEEDBACK_GENERIC;
    }

    // Default services are invoked only if no package-specific ones are present
    // for the type of AccessibilityEvent generated.  This service *is*
    // application-specific, so the flag isn't necessary.  If this was a
    // general-purpose service, it would be worth considering setting the
    // DEFAULT flag.

    // info.flags = AccessibilityServiceInfo.DEFAULT;

    info.notificationTimeout = 100;

    this.setServiceInfo(info);
}
 
開發者ID:applecool,項目名稱:Buzz-smartband,代碼行數:32,代碼來源:MyAccessibilityService.java

示例3: onServiceConnected

@Override
protected void onServiceConnected() {
    AccessibilityServiceInfo info = new AccessibilityServiceInfo();
    info.eventTypes = AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED | AccessibilityEvent.TYPE_NOTIFICATION_STATE_CHANGED;
    info.feedbackType = AccessibilityServiceInfo.FEEDBACK_ALL_MASK;
    info.notificationTimeout = 100;
    setServiceInfo(info);
    rifle = new Rifle(getApplicationContext());
}
 
開發者ID:micronic,項目名稱:pullbullet,代碼行數:9,代碼來源:AccessService.java


注:本文中的android.accessibilityservice.AccessibilityServiceInfo.FEEDBACK_ALL_MASK屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。