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


Java AccessibilityServiceInfo.FEEDBACK_GENERIC屬性代碼示例

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


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

示例1: onServiceConnected

@Override
protected void onServiceConnected() {
    super.onServiceConnected();

    Log.i(TAG, "SublimeNavBarService connected");

    AccessibilityServiceInfo info = new AccessibilityServiceInfo();

    // Set the type of events that this service wants to listen to.  Others
    // won't be passed to this service. `TYPE_WINDOW_STATE_CHANGED`
    // has been used only for demo purposes.
    info.eventTypes = AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED;

    // Set the type of feedback your service will provide.
    info.feedbackType = AccessibilityServiceInfo.FEEDBACK_GENERIC;

    // no delay before we are notified about an accessibility event
    info.notificationTimeout = 0;

    setServiceInfo(info);

    mWindowManager = (WindowManager) getSystemService(WINDOW_SERVICE);
    addNavView();
}
 
開發者ID:vikramkakkar,項目名稱:SublimeNavBar,代碼行數:24,代碼來源:SublimeNavBarService.java

示例2: onServiceConnected

@Override
protected void onServiceConnected() {
    super.onServiceConnected();

    packageManager = getPackageManager();
    notificationManager = NotificationManagerCompat.from(this);

    volumeReceiver = new VolumeReceiver(this);
    registerReceiver(volumeReceiver, new IntentFilter("android.media.VOLUME_CHANGED_ACTION"));

    notifications = new ArrayList<>();
    AccessibilityServiceInfo config = new AccessibilityServiceInfo();
    config.eventTypes = AccessibilityEvent.TYPE_NOTIFICATION_STATE_CHANGED | AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED;
    config.feedbackType = AccessibilityServiceInfo.FEEDBACK_GENERIC;

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN)
        config.flags = AccessibilityServiceInfo.FLAG_INCLUDE_NOT_IMPORTANT_VIEWS;

    setServiceInfo(config);
}
 
開發者ID:TheAndroidMaster,項目名稱:Status,代碼行數:20,代碼來源:AccessibilityService.java

示例3: onServiceConnected

@Override
protected void onServiceConnected() {
    super.onServiceConnected();

    packageManager = getPackageManager();
    butterboard = (Butterboard) getApplicationContext();

    AccessibilityServiceInfo config = new AccessibilityServiceInfo();
    config.eventTypes = AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED;
    config.feedbackType = AccessibilityServiceInfo.FEEDBACK_GENERIC;

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN)
        config.flags = AccessibilityServiceInfo.FLAG_INCLUDE_NOT_IMPORTANT_VIEWS;

    setServiceInfo(config);
}
 
開發者ID:DoubleDotLabs,項目名稱:Butterboard,代碼行數:16,代碼來源:AccessibilityService.java

示例4: 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

示例5: onServiceConnected

@RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN)
@Override
protected void onServiceConnected() {
    super.onServiceConnected();
    AccessibilityServiceInfo info = this.getServiceInfo();
    info.eventTypes = AccessibilityEvent.TYPE_VIEW_CLICKED | AccessibilityEvent.TYPE_VIEW_TEXT_CHANGED | AccessibilityEvent.TYPE_VIEW_LONG_CLICKED;
    info.feedbackType = AccessibilityServiceInfo.FEEDBACK_GENERIC;
    this.setServiceInfo(info);

    clipboardManager.addPrimaryClipChangedListener(this);
}
 
開發者ID:baijifeilong,項目名稱:antea,代碼行數:11,代碼來源:AnteaService.java

示例6: feedbackTypeToString

/**
 * Returns the string representation of a feedback type. For example,
 * {@link AccessibilityServiceInfo#FEEDBACK_SPOKEN} is represented by the
 * string FEEDBACK_SPOKEN.
 *
 * @param feedbackType The feedback type.
 * @return The string representation.
 */
public static String feedbackTypeToString(int feedbackType) {
    StringBuilder builder = new StringBuilder();
    builder.append("[");
    while (feedbackType > 0) {
        final int feedbackTypeFlag = 1 << Integer.numberOfTrailingZeros(feedbackType);
        feedbackType &= ~feedbackTypeFlag;
        if (builder.length() > 1) {
            builder.append(", ");
        }
        switch (feedbackTypeFlag) {
            case AccessibilityServiceInfo.FEEDBACK_AUDIBLE:
                builder.append("FEEDBACK_AUDIBLE");
                break;
            case AccessibilityServiceInfo.FEEDBACK_HAPTIC:
                builder.append("FEEDBACK_HAPTIC");
                break;
            case AccessibilityServiceInfo.FEEDBACK_GENERIC:
                builder.append("FEEDBACK_GENERIC");
                break;
            case AccessibilityServiceInfo.FEEDBACK_SPOKEN:
                builder.append("FEEDBACK_SPOKEN");
                break;
            case AccessibilityServiceInfo.FEEDBACK_VISUAL:
                builder.append("FEEDBACK_VISUAL");
                break;
        }
    }
    builder.append("]");
    return builder.toString();
}
 
開發者ID:GigigoGreenLabs,項目名稱:permissionsModule,代碼行數:38,代碼來源:AccessibilityServiceInfoCompat.java

示例7: 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

示例8: onServiceConnected

@Override
protected void onServiceConnected() {
    super.onServiceConnected();

    windowManager = (WindowManager) getSystemService(Context.WINDOW_SERVICE);
    snowflakeView = new SnowflakeView(this);

    WindowManager.LayoutParams params = new WindowManager.LayoutParams(WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.TYPE_SYSTEM_OVERLAY, WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE, PixelFormat.TRANSPARENT);
    params.gravity = Gravity.TOP;

    try {
        windowManager.addView(snowflakeView, params);
    } catch (WindowManager.BadTokenException | SecurityException e) {
        e.printStackTrace();
        snowflakeView = null;
        stopSelf();
        return;
    }

    AccessibilityServiceInfo config = new AccessibilityServiceInfo();
    config.eventTypes = AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED;
    config.feedbackType = AccessibilityServiceInfo.FEEDBACK_GENERIC;

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN)
        config.flags = AccessibilityServiceInfo.FLAG_INCLUDE_NOT_IMPORTANT_VIEWS;

    setServiceInfo(config);
}
 
開發者ID:TheAndroidMaster,項目名稱:Snowflakes,代碼行數:28,代碼來源:SnowflakeService.java

示例9: onServiceConnected

@Override
public void onServiceConnected() {

    DebugLogger.log("Service connected");

    try {
        LogWriter.getLogWriter();
    } catch (IllegalStateException e) {
        LogWriter.initLogWriter(this);
    }
    Sender.startSender(PORT);

    Point size = new Point();
    WindowManager windowManager = (WindowManager) getSystemService(Context.WINDOW_SERVICE);
    windowManager.getDefaultDisplay().getSize(size);
    screenWidth = size.x;
    screenHeight = size.y;

    AccessibilityServiceInfo serviceInfo = this.getServiceInfo();
    serviceInfo.feedbackType = AccessibilityServiceInfo.FEEDBACK_GENERIC; // actually NONE
    serviceInfo.flags = AccessibilityServiceInfo.FLAG_REPORT_VIEW_IDS |
            AccessibilityServiceInfo.FLAG_RETRIEVE_INTERACTIVE_WINDOWS;
    serviceInfo.notificationTimeout = 100; // TODO: should figure out if this is right

    this.setServiceInfo(serviceInfo);

    deviceId = LogWriter.getLogWriter().getDeviceId();
    userId = LogWriter.getLogWriter().getUserId();

    DebugLogger.log("Service initialized");
}
 
開發者ID:google,項目名稱:ferret,代碼行數:31,代碼來源:ALoggerService.java

示例10: onServiceConnected

@Override
protected void onServiceConnected() {
    AccessibilityServiceInfo info = new AccessibilityServiceInfo();
    info.eventTypes = AccessibilityEvent.TYPE_NOTIFICATION_STATE_CHANGED;
    info.feedbackType = AccessibilityServiceInfo.FEEDBACK_GENERIC;
    setServiceInfo(info);
}
 
開發者ID:androidertc,項目名稱:iLocker,代碼行數:7,代碼來源:NotifyAccessibilityService.java


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