Change to use ComponentName instead of String in log.
* align framework log to use the same format in ag/11250012 Bug: 151285965 Test: manual test Change-Id: Ia76e3d88c116ffa37fb022aed2866acc0f315bd9
This commit is contained in:
@@ -29,16 +29,15 @@ public final class AccessibilityStatsLogUtils {
|
||||
* Logs accessibility service name and its enabled status. Calls this when the user trigger
|
||||
* the accessibility service to be enabled/disabled.
|
||||
*
|
||||
* @param packageName the package name of the service. Need to be the flattened {@link
|
||||
* ComponentName}
|
||||
* @param enabled {@code true} if the service is enabled
|
||||
* @param componentName component name of the service
|
||||
* @param enabled {@code true} if the service is enabled
|
||||
*/
|
||||
static void logServiceStatus(String packageName, boolean enabled) {
|
||||
SettingsStatsLog.write(SettingsStatsLog.ACCESSIBILITY_SERVICE_REPORTED, packageName,
|
||||
convertToLoggingServiceStatus(enabled));
|
||||
static void logAccessibilityServiceEnabled(ComponentName componentName, boolean enabled) {
|
||||
SettingsStatsLog.write(SettingsStatsLog.ACCESSIBILITY_SERVICE_REPORTED,
|
||||
componentName.flattenToString(), convertToLoggingServiceEnabled(enabled));
|
||||
}
|
||||
|
||||
private static int convertToLoggingServiceStatus(boolean enabled) {
|
||||
private static int convertToLoggingServiceEnabled(boolean enabled) {
|
||||
return enabled ? SettingsStatsLog.ACCESSIBILITY_SERVICE_REPORTED__SERVICE_STATUS__ENABLED
|
||||
: SettingsStatsLog.ACCESSIBILITY_SERVICE_REPORTED__SERVICE_STATUS__DISABLED;
|
||||
}
|
||||
|
Reference in New Issue
Block a user