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
diff --git a/telecomm/java/android/telecom/TelecomManager.java b/telecomm/java/android/telecom/TelecomManager.java
index 9eb1665..d45b26f 100644
--- a/telecomm/java/android/telecom/TelecomManager.java
+++ b/telecomm/java/android/telecom/TelecomManager.java
@@ -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 @@
}
}
+ /**
+ * 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;