Loading src/com/android/server/telecom/LogUtils.java +21 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import android.telecom.Logging.EventManager.TimedEventPair; public class LogUtils { private static final String TAG = "Telecom"; private static final String LOGUTILS_TAG = "LogUtils"; public static final boolean SYSTRACE_DEBUG = false; /* STOP SHIP if true */ Loading Loading @@ -156,6 +157,23 @@ public class LogUtils { } } private static void eventRecordAdded(EventManager.EventRecord eventRecord) { // Only Calls will be added as event records in this case EventManager.Loggable recordEntry = eventRecord.getRecordEntry(); if (recordEntry instanceof Call) { Call callRecordEntry = (Call) recordEntry; android.telecom.Log.i(LOGUTILS_TAG, "EventRecord added as Call: " + callRecordEntry); Analytics.CallInfo callInfo = callRecordEntry.getAnalytics(); if(callInfo != null) { callInfo.setCallEvents(eventRecord); } else { android.telecom.Log.w(LOGUTILS_TAG, "Could not get Analytics CallInfo."); } } else { android.telecom.Log.w(LOGUTILS_TAG, "Non-Call EventRecord Added."); } } public static void initLogging(Context context) { android.telecom.Log.setTag(TAG); android.telecom.Log.setSessionContext(context); Loading @@ -163,5 +181,8 @@ public class LogUtils { for (EventManager.TimedEventPair p : Events.Timings.sTimedEvents) { android.telecom.Log.addRequestResponsePair(p); } android.telecom.Log.registerEventListener(LogUtils::eventRecordAdded); // Store analytics about recently completed Sessions. android.telecom.Log.registerSessionListener(Analytics::addSessionTiming); } } tests/src/com/android/server/telecom/tests/TelecomSystemTest.java +10 −4 Original line number Diff line number Diff line Loading @@ -611,6 +611,11 @@ public class TelecomSystemTest extends TelecomTestCase { // called correctly in order to continue. verify(localAppContext).sendBroadcastAsUser(actionCallIntent, UserHandle.SYSTEM); mTelecomSystem.getCallIntentProcessor().processIntent(actionCallIntent); // Wait for handler to start CallerInfo lookup. waitForHandlerAction(new Handler(Looper.getMainLooper()), TEST_TIMEOUT); // Send the CallerInfo lookup reply. mCallerInfoAsyncQueryFactoryFixture.mRequests.forEach( CallerInfoAsyncQueryFactoryFixture.Request::reply); if (!hasInCallAdapter) { verify(mInCallServiceFixtureX.getTestDouble()) Loading Loading @@ -742,10 +747,11 @@ public class TelecomSystemTest extends TelecomTestCase { .createConnection(any(PhoneAccountHandle.class), anyString(), any(ConnectionRequest.class), eq(true), eq(false), any()); for (CallerInfoAsyncQueryFactoryFixture.Request request : mCallerInfoAsyncQueryFactoryFixture.mRequests) { request.reply(); } // Wait for the handler to start the CallerInfo lookup waitForHandlerAction(new Handler(Looper.getMainLooper()), TEST_TIMEOUT); // Process the CallerInfo lookup reply mCallerInfoAsyncQueryFactoryFixture.mRequests.forEach( CallerInfoAsyncQueryFactoryFixture.Request::reply); IContentProvider blockedNumberProvider = mSpyContext.getContentResolver().acquireProvider(BlockedNumberContract.AUTHORITY); Loading Loading
src/com/android/server/telecom/LogUtils.java +21 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import android.telecom.Logging.EventManager.TimedEventPair; public class LogUtils { private static final String TAG = "Telecom"; private static final String LOGUTILS_TAG = "LogUtils"; public static final boolean SYSTRACE_DEBUG = false; /* STOP SHIP if true */ Loading Loading @@ -156,6 +157,23 @@ public class LogUtils { } } private static void eventRecordAdded(EventManager.EventRecord eventRecord) { // Only Calls will be added as event records in this case EventManager.Loggable recordEntry = eventRecord.getRecordEntry(); if (recordEntry instanceof Call) { Call callRecordEntry = (Call) recordEntry; android.telecom.Log.i(LOGUTILS_TAG, "EventRecord added as Call: " + callRecordEntry); Analytics.CallInfo callInfo = callRecordEntry.getAnalytics(); if(callInfo != null) { callInfo.setCallEvents(eventRecord); } else { android.telecom.Log.w(LOGUTILS_TAG, "Could not get Analytics CallInfo."); } } else { android.telecom.Log.w(LOGUTILS_TAG, "Non-Call EventRecord Added."); } } public static void initLogging(Context context) { android.telecom.Log.setTag(TAG); android.telecom.Log.setSessionContext(context); Loading @@ -163,5 +181,8 @@ public class LogUtils { for (EventManager.TimedEventPair p : Events.Timings.sTimedEvents) { android.telecom.Log.addRequestResponsePair(p); } android.telecom.Log.registerEventListener(LogUtils::eventRecordAdded); // Store analytics about recently completed Sessions. android.telecom.Log.registerSessionListener(Analytics::addSessionTiming); } }
tests/src/com/android/server/telecom/tests/TelecomSystemTest.java +10 −4 Original line number Diff line number Diff line Loading @@ -611,6 +611,11 @@ public class TelecomSystemTest extends TelecomTestCase { // called correctly in order to continue. verify(localAppContext).sendBroadcastAsUser(actionCallIntent, UserHandle.SYSTEM); mTelecomSystem.getCallIntentProcessor().processIntent(actionCallIntent); // Wait for handler to start CallerInfo lookup. waitForHandlerAction(new Handler(Looper.getMainLooper()), TEST_TIMEOUT); // Send the CallerInfo lookup reply. mCallerInfoAsyncQueryFactoryFixture.mRequests.forEach( CallerInfoAsyncQueryFactoryFixture.Request::reply); if (!hasInCallAdapter) { verify(mInCallServiceFixtureX.getTestDouble()) Loading Loading @@ -742,10 +747,11 @@ public class TelecomSystemTest extends TelecomTestCase { .createConnection(any(PhoneAccountHandle.class), anyString(), any(ConnectionRequest.class), eq(true), eq(false), any()); for (CallerInfoAsyncQueryFactoryFixture.Request request : mCallerInfoAsyncQueryFactoryFixture.mRequests) { request.reply(); } // Wait for the handler to start the CallerInfo lookup waitForHandlerAction(new Handler(Looper.getMainLooper()), TEST_TIMEOUT); // Process the CallerInfo lookup reply mCallerInfoAsyncQueryFactoryFixture.mRequests.forEach( CallerInfoAsyncQueryFactoryFixture.Request::reply); IContentProvider blockedNumberProvider = mSpyContext.getContentResolver().acquireProvider(BlockedNumberContract.AUTHORITY); Loading