diff options
| -rw-r--r-- | telephony/java/android/telephony/TelephonyManager.java | 91 | ||||
| -rw-r--r-- | telephony/java/com/android/internal/telephony/ITelephony.aidl | 15 |
2 files changed, 106 insertions, 0 deletions
diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index 66711df4db04..eb6a2fe208f6 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -17915,6 +17915,97 @@ public class TelephonyManager { } /** + * 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. * * The modem is required to ignore this in case of an emergency call. diff --git a/telephony/java/com/android/internal/telephony/ITelephony.aidl b/telephony/java/com/android/internal/telephony/ITelephony.aidl index ef9dc3e3621d..72b0e2bca6fc 100644 --- a/telephony/java/com/android/internal/telephony/ITelephony.aidl +++ b/telephony/java/com/android/internal/telephony/ITelephony.aidl @@ -2661,6 +2661,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 * and all new subscriptions after this. |