Merge "Telephony method for ecall diagnostic data" into udc-dev

This commit is contained in:
Chinmay Dhodapkar
2023-03-28 00:09:00 +00:00
committed by Android (Google) Code Review
2 changed files with 106 additions and 0 deletions

View File

@@ -17913,6 +17913,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

@@ -2676,6 +2676,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