Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3234b334 authored by Pranav Madapurmath's avatar Pranav Madapurmath
Browse files

Formalize TelephonyManager EmergencyCallDiagnostic

Formalize the TelephonyManager#EmergencyCallDiagnosticParams API as part
of the Telecom modularization. Extends the existing class to leverage
the Builder pattern.

Bug: 308472794
Bug: 311773409
Test: atest TelephonyManagerTest
Test: atest TelecomUnitTests
Change-Id: I2d05d132e88d01cd335c2c3719c415f19037d385
parent 3e344313
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -156,25 +156,26 @@ public class EmergencyCallDiagnosticLogger extends CallsManagerListenerBase
        List<Integer> dataCollectionTypes = getDataCollectionTypes(reason);
        boolean invokeTelephonyPersistApi = false;
        CallEventTimestamps ts = mEmergencyCallsMap.get(call);
        EmergencyCallDiagnosticParams dp =
                new EmergencyCallDiagnosticParams();
        EmergencyCallDiagnosticParams.Builder callDiagnosticBuilder =
                new EmergencyCallDiagnosticParams.Builder();
        for (Integer dataCollectionType : dataCollectionTypes) {
            switch (dataCollectionType) {
                case COLLECTION_TYPE_TELECOM_STATE:
                    if (isTelecomDumpCollectionEnabled()) {
                        dp.setTelecomDumpSysCollection(true);
                        callDiagnosticBuilder.setTelecomDumpSysCollectionEnabled(true);
                        invokeTelephonyPersistApi = true;
                    }
                    break;
                case COLLECTION_TYPE_TELEPHONY_STATE:
                    if (isTelephonyDumpCollectionEnabled()) {
                        dp.setTelephonyDumpSysCollection(true);
                        callDiagnosticBuilder.setTelephonyDumpSysCollectionEnabled(true);
                        invokeTelephonyPersistApi = true;
                    }
                    break;
                case COLLECTION_TYPE_LOGCAT_BUFFERS:
                    if (isLogcatCollectionEnabled()) {
                        dp.setLogcatCollection(true, ts.getCallCreatedTime());
                        callDiagnosticBuilder.setLogcatCollectionStartTimeMillis(
                                ts.getCallCreatedTime());
                        invokeTelephonyPersistApi = true;
                    }
                    break;
@@ -191,6 +192,7 @@ public class EmergencyCallDiagnosticLogger extends CallsManagerListenerBase
                default:
            }
        }
        EmergencyCallDiagnosticParams dp = callDiagnosticBuilder.build();
        if (invokeTelephonyPersistApi) {
            mAsyncTaskExecutor.execute(new Runnable() {
                @Override