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

Commit 9a99cf4f authored by Chinmay Dhodapkar's avatar Chinmay Dhodapkar
Browse files

Telephony method for ecall diagnostic data

Initial skeleton. Full impl in separate CL.

Bug: 271900116
Test: m Telephony
Change-Id: Ib969857f3016d19599418c152f44707eb5ff9437
parent a27edf5a
Loading
Loading
Loading
Loading
+91 −0
Original line number Diff line number Diff line
@@ -17914,6 +17914,97 @@ public class TelephonyManager {
        return TelephonyManager.SIM_STATE_UNKNOWN;
    }
    /**
     * Captures parameters for collection of emergency
     * call diagnostic data
     * @hide
     */
    public static class EmergencyCallDiagnosticParams {
       private boolean mCollectTelecomDumpSys;
       private boolean mCollectTelephonyDumpsys;
       private boolean mCollectLogcat;
        //logcat lines with this time or greater are collected
        //how much is collected is dependent on internal implementation.
        //Time represented as milliseconds since January 1, 1970 UTC
        private long mLogcatStartTimeMillis;
        public boolean isTelecomDumpSysCollectionEnabled() {
            return mCollectTelecomDumpSys;
        }
        public void setTelecomDumpSysCollection(boolean collectTelecomDumpSys) {
            mCollectTelecomDumpSys = collectTelecomDumpSys;
        }
        public boolean isTelephonyDumpSysCollectionEnabled() {
            return mCollectTelephonyDumpsys;
        }
        public void setTelephonyDumpSysCollection(boolean collectTelephonyDumpsys) {
            mCollectTelephonyDumpsys = collectTelephonyDumpsys;
        }
        public boolean isLogcatCollectionEnabled() {
            return mCollectLogcat;
        }
        public long getLogcatStartTime()
        {
            return mLogcatStartTimeMillis;
        }
        public void setLogcatCollection(boolean collectLogcat, long startTimeMillis) {
            mCollectLogcat = collectLogcat;
            if(mCollectLogcat)
            {
                mLogcatStartTimeMillis = startTimeMillis;
            }
        }
        @Override
        public String toString() {
            return "EmergencyCallDiagnosticParams{" +
                    "mCollectTelecomDumpSys=" + mCollectTelecomDumpSys +
                    ", mCollectTelephonyDumpsys=" + mCollectTelephonyDumpsys +
                    ", mCollectLogcat=" + mCollectLogcat +
                    ", mLogcatStartTimeMillis=" + mLogcatStartTimeMillis +
                    '}';
        }
    }
    /**
     * Request telephony to persist state for debugging emergency call failures.
     *
     * @param dropboxTag Tag to use when persisting data to dropbox service.
     *
     * @see params Parameters controlling what is collected
     *
     * @hide
     */
    @RequiresPermission(android.Manifest.permission.DUMP)
    public void persistEmergencyCallDiagnosticData(@NonNull String dropboxTag,
            @NonNull EmergencyCallDiagnosticParams params) {
        try {
            ITelephony telephony = ITelephony.Stub.asInterface(
                    TelephonyFrameworkInitializer
                            .getTelephonyServiceManager()
                            .getTelephonyServiceRegisterer()
                            .get());
            if (telephony != null) {
                telephony.persistEmergencyCallDiagnosticData(dropboxTag,
                        params.isLogcatCollectionEnabled(),
                        params.getLogcatStartTime(),
                        params.isTelecomDumpSysCollectionEnabled(),
                        params.isTelephonyDumpSysCollectionEnabled());
            }
        } catch (RemoteException e) {
            Log.e(TAG, "Error while persistEmergencyCallDiagnosticData: " + e);
        }
    }
    /**
     * Set the UE's ability to accept/reject null ciphered and null integrity-protected connections.
     *
+15 −0
Original line number Diff line number Diff line
@@ -2660,6 +2660,21 @@ interface ITelephony {
     */
    int getSimStateForSlotIndex(int slotIndex);

    /**
     * Request telephony to persist state for debugging emergency call failures.
     *
     * @param dropBoxTag Tag to use when persisting data to dropbox service.
     * @param enableLogcat whether to collect logcat output
     * @param logcatStartTimestampMillis timestamp from when logcat buffers would be persisted
     * @param enableTelecomDump whether to collect telecom dumpsys
     * @param enableTelephonyDump whether to collect telephony dumpsys
     *
     * @hide
     */
    @JavaPassthrough(annotation="@android.annotation.RequiresPermission("
            + "android.Manifest.permission.DUMP)")
    void persistEmergencyCallDiagnosticData(String dropboxTag, boolean enableLogcat,
        long logcatStartTimestampMillis, boolean enableTelecomDump, boolean enableTelephonyDump);
    /**
     * Set whether the radio is able to connect with null ciphering or integrity
     * algorithms. This is a global setting and will apply to all active subscriptions