Telephony method for ecall diagnostic data

Initial skeleton. Full impl in separate CL.

Bug: 271900116
Test: m Telephony
Change-Id: Ib969857f3016d19599418c152f44707eb5ff9437
This commit is contained in:
Chinmay Dhodapkar
2023-03-03 18:57:43 -08:00
parent a27edf5a52
commit 9a99cf4f60
2 changed files with 106 additions and 0 deletions

View File

@@ -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.
*

View File

@@ -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