summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Jason Hsu <jasonwshsu@google.com> 2021-12-04 13:26:09 +0000
committer Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> 2021-12-04 13:26:09 +0000
commitc70b0dcb7f63d3ba799c68e7555fe4eab7898d17 (patch)
treed18c452c3cba8815ab14ac6378f7ffcd6f02bcb0
parent2f7bdbc1042b06ce11971dbe2eb2798e3cfe9fce (diff)
parentf1ecb2678c236c61361206f0b82a7b8f96932422 (diff)
Merge "Fix the incorrect result of AccessibilityShortcutStats" into sc-v2-dev am: f1ecb2678c
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16388281 Change-Id: I784b61a1109fc8dfc4c1951c4b1b03c4eaa27ba5
-rw-r--r--services/core/java/com/android/server/stats/pull/StatsPullAtomService.java22
1 files changed, 20 insertions, 2 deletions
diff --git a/services/core/java/com/android/server/stats/pull/StatsPullAtomService.java b/services/core/java/com/android/server/stats/pull/StatsPullAtomService.java
index 4d95d1b36194..c35b66e646a9 100644
--- a/services/core/java/com/android/server/stats/pull/StatsPullAtomService.java
+++ b/services/core/java/com/android/server/stats/pull/StatsPullAtomService.java
@@ -50,6 +50,10 @@ import static android.telephony.TelephonyManager.UNKNOWN_CARRIER_ID;
import static android.util.MathUtils.constrain;
import static com.android.internal.util.ConcurrentUtils.DIRECT_EXECUTOR;
+import static com.android.internal.util.FrameworkStatsLog.ACCESSIBILITY_SHORTCUT_REPORTED__SHORTCUT_TYPE__A11Y_BUTTON;
+import static com.android.internal.util.FrameworkStatsLog.ACCESSIBILITY_SHORTCUT_REPORTED__SHORTCUT_TYPE__A11Y_FLOATING_MENU;
+import static com.android.internal.util.FrameworkStatsLog.ACCESSIBILITY_SHORTCUT_REPORTED__SHORTCUT_TYPE__A11Y_GESTURE;
+import static com.android.internal.util.FrameworkStatsLog.ACCESSIBILITY_SHORTCUT_REPORTED__SHORTCUT_TYPE__UNKNOWN_TYPE;
import static com.android.internal.util.FrameworkStatsLog.DATA_USAGE_BYTES_TRANSFER__OPPORTUNISTIC_DATA_SUB__NOT_OPPORTUNISTIC;
import static com.android.internal.util.FrameworkStatsLog.DATA_USAGE_BYTES_TRANSFER__OPPORTUNISTIC_DATA_SUB__OPPORTUNISTIC;
import static com.android.internal.util.FrameworkStatsLog.TIME_ZONE_DETECTOR_STATE__DETECTION_MODE__GEO;
@@ -4388,8 +4392,9 @@ public class StatsPullAtomService extends SystemService {
final int userId = userInfo.getUserHandle().getIdentifier();
if (isAccessibilityShortcutUser(mContext, userId)) {
- final int software_shortcut_type = Settings.Secure.getIntForUser(resolver,
- Settings.Secure.ACCESSIBILITY_BUTTON_MODE, 0, userId);
+ final int software_shortcut_type = convertToAccessibilityShortcutType(
+ Settings.Secure.getIntForUser(resolver,
+ Settings.Secure.ACCESSIBILITY_BUTTON_MODE, 0, userId));
final String software_shortcut_list = Settings.Secure.getStringForUser(resolver,
Settings.Secure.ACCESSIBILITY_BUTTON_TARGETS, userId);
final int software_shortcut_service_num = countAccessibilityServices(
@@ -4510,6 +4515,19 @@ public class StatsPullAtomService extends SystemService {
&& !TextUtils.isEmpty(software_string);
}
+ private int convertToAccessibilityShortcutType(int shortcutType) {
+ switch (shortcutType) {
+ case Settings.Secure.ACCESSIBILITY_BUTTON_MODE_NAVIGATION_BAR:
+ return ACCESSIBILITY_SHORTCUT_REPORTED__SHORTCUT_TYPE__A11Y_BUTTON;
+ case Settings.Secure.ACCESSIBILITY_BUTTON_MODE_FLOATING_MENU:
+ return ACCESSIBILITY_SHORTCUT_REPORTED__SHORTCUT_TYPE__A11Y_FLOATING_MENU;
+ case Settings.Secure.ACCESSIBILITY_BUTTON_MODE_GESTURE:
+ return ACCESSIBILITY_SHORTCUT_REPORTED__SHORTCUT_TYPE__A11Y_GESTURE;
+ default:
+ return ACCESSIBILITY_SHORTCUT_REPORTED__SHORTCUT_TYPE__UNKNOWN_TYPE;
+ }
+ }
+
// Thermal event received from vendor thermal management subsystem
private static final class ThermalEventListener extends IThermalEventListener.Stub {
@Override