1 /** 2 * Copyright (C) 2021 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 package com.android.server.accessibility; 17 18 /** 19 * Interface to log accessibility trace. 20 */ 21 public interface AccessibilityTrace { 22 /** 23 * Whether the trace is enabled. 24 */ isA11yTracingEnabled()25 boolean isA11yTracingEnabled(); 26 27 /** 28 * Start tracing. 29 */ startTrace()30 void startTrace(); 31 32 /** 33 * Stop tracing. 34 */ stopTrace()35 void stopTrace(); 36 37 /** 38 * Log one trace entry. 39 * @param where A string to identify this log entry, which can be used to filter/search 40 * through the tracing file. 41 */ logTrace(String where)42 void logTrace(String where); 43 44 /** 45 * Log one trace entry. 46 * @param where A string to identify this log entry, which can be used to filter/search 47 * through the tracing file. 48 * @param callingParams The parameters for the method to be logged. 49 */ logTrace(String where, String callingParams)50 void logTrace(String where, String callingParams); 51 52 /** 53 * Log one trace entry. Accessibility services using AccessibilityInteractionClient to 54 * make screen content related requests use this API to log entry when receive callback. 55 * @param timestamp The timestamp when a callback is received. 56 * @param where A string to identify this log entry, which can be used to filter/search 57 * through the tracing file. 58 * @param callingParams The parameters for the callback. 59 * @param processId The process id of the calling component. 60 * @param threadId The threadId of the calling component. 61 * @param callingUid The calling uid of the callback. 62 * @param callStack The call stack of the callback. 63 */ logTrace(long timestamp, String where, String callingParams, int processId, long threadId, int callingUid, StackTraceElement[] callStack)64 void logTrace(long timestamp, String where, String callingParams, int processId, 65 long threadId, int callingUid, StackTraceElement[] callStack); 66 } 67