Loading core/java/com/android/internal/accessibility/common/ShortcutConstants.java +0 −41 Original line number Diff line number Diff line Loading @@ -78,21 +78,6 @@ public final class ShortcutConstants { int LAUNCH_ACTIVITY = 3; } /** * Annotation for different shortcut target. */ @Retention(RetentionPolicy.SOURCE) @IntDef({ TargetType.ACCESSIBILITY_SERVICE, TargetType.ACCESSIBILITY_ACTIVITY, TargetType.WHITE_LISTING, }) public @interface TargetType { int ACCESSIBILITY_SERVICE = 0; int ACCESSIBILITY_ACTIVITY = 1; int WHITE_LISTING = 2; } /** * Annotation for different shortcut menu mode. * Loading @@ -108,30 +93,4 @@ public final class ShortcutConstants { int LAUNCH = 0; int EDIT = 1; } /** * Annotation for align the element index of white listing feature * {@code WHITE_LISTING_FEATURES}. * * {@code COMPONENT_ID} is to get the service component name. * {@code LABEL_ID} is to get the service label text. * {@code ICON_ID} is to get the service icon. * {@code FRAGMENT_TYPE} is to get the service fragment type. * {@code SETTINGS_KEY} is to get the service settings key. */ @Retention(RetentionPolicy.SOURCE) @IntDef({ WhiteListingFeatureElementIndex.COMPONENT_ID, WhiteListingFeatureElementIndex.LABEL_ID, WhiteListingFeatureElementIndex.ICON_ID, WhiteListingFeatureElementIndex.FRAGMENT_TYPE, WhiteListingFeatureElementIndex.SETTINGS_KEY, }) public @interface WhiteListingFeatureElementIndex { int COMPONENT_ID = 0; int LABEL_ID = 1; int ICON_ID = 2; int FRAGMENT_TYPE = 3; int SETTINGS_KEY = 4; } } core/java/com/android/internal/accessibility/dialog/AccessibilityActivityTarget.java 0 → 100644 +47 −0 Original line number Diff line number Diff line /* * Copyright (C) 2020 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.internal.accessibility.dialog; import static com.android.internal.accessibility.util.ShortcutUtils.convertToKey; import static com.android.internal.accessibility.util.ShortcutUtils.convertToUserType; import static com.android.internal.accessibility.util.ShortcutUtils.isShortcutContained; import android.accessibilityservice.AccessibilityShortcutInfo; import android.annotation.NonNull; import android.content.Context; import android.view.accessibility.AccessibilityManager.ShortcutType; import com.android.internal.accessibility.common.ShortcutConstants.AccessibilityFragmentType; /** * Base class for creating accessibility activity target. */ class AccessibilityActivityTarget extends AccessibilityTarget { AccessibilityActivityTarget(Context context, @ShortcutType int shortcutType, @NonNull AccessibilityShortcutInfo shortcutInfo) { super(context, shortcutType, AccessibilityFragmentType.LAUNCH_ACTIVITY, isShortcutContained(context, shortcutType, shortcutInfo.getComponentName().flattenToString()), shortcutInfo.getComponentName().flattenToString(), shortcutInfo.getActivityInfo().loadLabel(context.getPackageManager()), shortcutInfo.getActivityInfo().loadIcon(context.getPackageManager()), convertToKey(convertToUserType(shortcutType))); } } core/java/com/android/internal/accessibility/dialog/AccessibilityServiceTarget.java 0 → 100644 +49 −0 Original line number Diff line number Diff line /* * Copyright (C) 2020 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.internal.accessibility.dialog; import static com.android.internal.accessibility.util.ShortcutUtils.convertToKey; import static com.android.internal.accessibility.util.ShortcutUtils.convertToUserType; import static com.android.internal.accessibility.util.ShortcutUtils.isShortcutContained; import android.accessibilityservice.AccessibilityServiceInfo; import android.annotation.NonNull; import android.content.Context; import android.view.accessibility.AccessibilityManager.ShortcutType; import com.android.internal.accessibility.common.ShortcutConstants.AccessibilityFragmentType; /** * Base class for creating accessibility service target with various fragment types related to * legacy type, invisible type and intuitive type. */ class AccessibilityServiceTarget extends AccessibilityTarget { AccessibilityServiceTarget(Context context, @ShortcutType int shortcutType, @AccessibilityFragmentType int fragmentType, @NonNull AccessibilityServiceInfo serviceInfo) { super(context, shortcutType, fragmentType, isShortcutContained(context, shortcutType, serviceInfo.getComponentName().flattenToString()), serviceInfo.getComponentName().flattenToString(), serviceInfo.getResolveInfo().loadLabel(context.getPackageManager()), serviceInfo.getResolveInfo().loadIcon(context.getPackageManager()), convertToKey(convertToUserType(shortcutType))); } } Loading
core/java/com/android/internal/accessibility/common/ShortcutConstants.java +0 −41 Original line number Diff line number Diff line Loading @@ -78,21 +78,6 @@ public final class ShortcutConstants { int LAUNCH_ACTIVITY = 3; } /** * Annotation for different shortcut target. */ @Retention(RetentionPolicy.SOURCE) @IntDef({ TargetType.ACCESSIBILITY_SERVICE, TargetType.ACCESSIBILITY_ACTIVITY, TargetType.WHITE_LISTING, }) public @interface TargetType { int ACCESSIBILITY_SERVICE = 0; int ACCESSIBILITY_ACTIVITY = 1; int WHITE_LISTING = 2; } /** * Annotation for different shortcut menu mode. * Loading @@ -108,30 +93,4 @@ public final class ShortcutConstants { int LAUNCH = 0; int EDIT = 1; } /** * Annotation for align the element index of white listing feature * {@code WHITE_LISTING_FEATURES}. * * {@code COMPONENT_ID} is to get the service component name. * {@code LABEL_ID} is to get the service label text. * {@code ICON_ID} is to get the service icon. * {@code FRAGMENT_TYPE} is to get the service fragment type. * {@code SETTINGS_KEY} is to get the service settings key. */ @Retention(RetentionPolicy.SOURCE) @IntDef({ WhiteListingFeatureElementIndex.COMPONENT_ID, WhiteListingFeatureElementIndex.LABEL_ID, WhiteListingFeatureElementIndex.ICON_ID, WhiteListingFeatureElementIndex.FRAGMENT_TYPE, WhiteListingFeatureElementIndex.SETTINGS_KEY, }) public @interface WhiteListingFeatureElementIndex { int COMPONENT_ID = 0; int LABEL_ID = 1; int ICON_ID = 2; int FRAGMENT_TYPE = 3; int SETTINGS_KEY = 4; } }
core/java/com/android/internal/accessibility/dialog/AccessibilityActivityTarget.java 0 → 100644 +47 −0 Original line number Diff line number Diff line /* * Copyright (C) 2020 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.internal.accessibility.dialog; import static com.android.internal.accessibility.util.ShortcutUtils.convertToKey; import static com.android.internal.accessibility.util.ShortcutUtils.convertToUserType; import static com.android.internal.accessibility.util.ShortcutUtils.isShortcutContained; import android.accessibilityservice.AccessibilityShortcutInfo; import android.annotation.NonNull; import android.content.Context; import android.view.accessibility.AccessibilityManager.ShortcutType; import com.android.internal.accessibility.common.ShortcutConstants.AccessibilityFragmentType; /** * Base class for creating accessibility activity target. */ class AccessibilityActivityTarget extends AccessibilityTarget { AccessibilityActivityTarget(Context context, @ShortcutType int shortcutType, @NonNull AccessibilityShortcutInfo shortcutInfo) { super(context, shortcutType, AccessibilityFragmentType.LAUNCH_ACTIVITY, isShortcutContained(context, shortcutType, shortcutInfo.getComponentName().flattenToString()), shortcutInfo.getComponentName().flattenToString(), shortcutInfo.getActivityInfo().loadLabel(context.getPackageManager()), shortcutInfo.getActivityInfo().loadIcon(context.getPackageManager()), convertToKey(convertToUserType(shortcutType))); } }
core/java/com/android/internal/accessibility/dialog/AccessibilityServiceTarget.java 0 → 100644 +49 −0 Original line number Diff line number Diff line /* * Copyright (C) 2020 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.internal.accessibility.dialog; import static com.android.internal.accessibility.util.ShortcutUtils.convertToKey; import static com.android.internal.accessibility.util.ShortcutUtils.convertToUserType; import static com.android.internal.accessibility.util.ShortcutUtils.isShortcutContained; import android.accessibilityservice.AccessibilityServiceInfo; import android.annotation.NonNull; import android.content.Context; import android.view.accessibility.AccessibilityManager.ShortcutType; import com.android.internal.accessibility.common.ShortcutConstants.AccessibilityFragmentType; /** * Base class for creating accessibility service target with various fragment types related to * legacy type, invisible type and intuitive type. */ class AccessibilityServiceTarget extends AccessibilityTarget { AccessibilityServiceTarget(Context context, @ShortcutType int shortcutType, @AccessibilityFragmentType int fragmentType, @NonNull AccessibilityServiceInfo serviceInfo) { super(context, shortcutType, fragmentType, isShortcutContained(context, shortcutType, serviceInfo.getComponentName().flattenToString()), serviceInfo.getComponentName().flattenToString(), serviceInfo.getResolveInfo().loadLabel(context.getPackageManager()), serviceInfo.getResolveInfo().loadIcon(context.getPackageManager()), convertToKey(convertToUserType(shortcutType))); } }