Add method to dump Telecom analytics

Add dumpAnalytics in TelecomManager to allow the connectivity stats
service to access Telecom analytics for uploading.

Change-Id: I197d6af340fac7f38b28bb44a476b5e694db4dba
This commit is contained in:
Hall Liu
2016-01-12 15:32:58 -08:00
parent b05fd8860f
commit 0464b9ba16
5 changed files with 264 additions and 0 deletions

View File

@@ -14,6 +14,7 @@
package android.telecom;
import android.Manifest;
import android.annotation.RequiresPermission;
import android.annotation.SystemApi;
import android.content.ComponentName;
@@ -1377,6 +1378,27 @@ public class TelecomManager {
}
}
/**
* Dumps telecom analytics for uploading.
*
* @return
* @hide
*/
@SystemApi
@RequiresPermission(Manifest.permission.DUMP)
public List<ParcelableCallAnalytics> dumpAnalytics() {
ITelecomService service = getTelecomService();
List<ParcelableCallAnalytics> result = null;
if (service != null) {
try {
result = service.dumpCallAnalytics();
} catch (RemoteException e) {
Log.e(TAG, "Error dumping call analytics", e);
}
}
return result;
}
private ITelecomService getTelecomService() {
if (mTelecomServiceOverride != null) {
return mTelecomServiceOverride;