From 0eaebf0c8498943e889f8722d84d7924d5ff9b55 Mon Sep 17 00:00:00 2001 From: ryanlwlin Date: Thu, 21 Jan 2021 20:19:52 +0800 Subject: [PATCH] Add new application category for accessibility This category is used to cluster the apps built for accessibility. Developers could set it in the manifest. Bug: 180871558 Test: full build Change-Id: I94b294b46852ca1efc31b2d79275f98ba6db85d9 --- core/api/current.txt | 1 + core/java/android/content/pm/ApplicationInfo.java | 12 +++++++++++- core/res/res/values/attrs_manifest.xml | 2 ++ core/res/res/values/strings.xml | 2 ++ core/res/res/values/symbols.xml | 1 + 5 files changed, 17 insertions(+), 1 deletion(-) diff --git a/core/api/current.txt b/core/api/current.txt index e72f943da5207..89b2d07fb8c3a 100644 --- a/core/api/current.txt +++ b/core/api/current.txt @@ -11728,6 +11728,7 @@ package android.content.pm { method public boolean isResourceOverlay(); method public boolean isVirtualPreload(); method public CharSequence loadDescription(android.content.pm.PackageManager); + field public static final int CATEGORY_ACCESSIBILITY = 8; // 0x8 field public static final int CATEGORY_AUDIO = 1; // 0x1 field public static final int CATEGORY_GAME = 0; // 0x0 field public static final int CATEGORY_IMAGE = 3; // 0x3 diff --git a/core/java/android/content/pm/ApplicationInfo.java b/core/java/android/content/pm/ApplicationInfo.java index 01ff4326a8001..b80690fbad29d 100644 --- a/core/java/android/content/pm/ApplicationInfo.java +++ b/core/java/android/content/pm/ApplicationInfo.java @@ -1197,7 +1197,8 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { CATEGORY_SOCIAL, CATEGORY_NEWS, CATEGORY_MAPS, - CATEGORY_PRODUCTIVITY + CATEGORY_PRODUCTIVITY, + CATEGORY_ACCESSIBILITY }) @Retention(RetentionPolicy.SOURCE) public @interface Category { @@ -1272,6 +1273,13 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { */ public static final int CATEGORY_PRODUCTIVITY = 7; + /** + * Category for apps which are primarily accessibility apps, such as screen-readers. + * + * @see #category + */ + public static final int CATEGORY_ACCESSIBILITY = 8; + /** * Return a concise, localized title for the given * {@link ApplicationInfo#category} value, or {@code null} for unknown @@ -1297,6 +1305,8 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { return context.getText(com.android.internal.R.string.app_category_maps); case ApplicationInfo.CATEGORY_PRODUCTIVITY: return context.getText(com.android.internal.R.string.app_category_productivity); + case ApplicationInfo.CATEGORY_ACCESSIBILITY: + return context.getText(com.android.internal.R.string.app_category_accessibility); default: return null; } diff --git a/core/res/res/values/attrs_manifest.xml b/core/res/res/values/attrs_manifest.xml index 0ae6a76e2a606..41c2ef96a7678 100644 --- a/core/res/res/values/attrs_manifest.xml +++ b/core/res/res/values/attrs_manifest.xml @@ -1773,6 +1773,8 @@ + + diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml index 9ebe23af2c592..57d1e0482fa7c 100644 --- a/core/res/res/values/strings.xml +++ b/core/res/res/values/strings.xml @@ -5187,6 +5187,8 @@ Maps & Navigation Productivity + + Accessibility Device storage diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml index f66d33b02b698..fc76f7891a6ba 100644 --- a/core/res/res/values/symbols.xml +++ b/core/res/res/values/symbols.xml @@ -3290,6 +3290,7 @@ +