Merge "Add wrappers for IConnectivityMetricsLogger functions" into nyc-dev am: 6e08a62
am: d42b900
* commit 'd42b900e303836f5db7c772d70bbe8241ee01ce3':
Add wrappers for IConnectivityMetricsLogger functions
Change-Id: I73c9a0fd6e3c048c0909fe35a189581bf50795d7
This commit is contained in:
@@ -25338,7 +25338,10 @@ package android.net {
|
|||||||
|
|
||||||
public class ConnectivityMetricsLogger {
|
public class ConnectivityMetricsLogger {
|
||||||
ctor public ConnectivityMetricsLogger();
|
ctor public ConnectivityMetricsLogger();
|
||||||
|
method public android.net.ConnectivityMetricsEvent[] getEvents(android.net.ConnectivityMetricsEvent.Reference);
|
||||||
method public void logEvent(long, int, int, android.os.Parcelable);
|
method public void logEvent(long, int, int, android.os.Parcelable);
|
||||||
|
method public boolean register(android.app.PendingIntent);
|
||||||
|
method public boolean unregister(android.app.PendingIntent);
|
||||||
field public static final int COMPONENT_TAG_BLUETOOTH = 1; // 0x1
|
field public static final int COMPONENT_TAG_BLUETOOTH = 1; // 0x1
|
||||||
field public static final int COMPONENT_TAG_CONNECTIVITY = 0; // 0x0
|
field public static final int COMPONENT_TAG_CONNECTIVITY = 0; // 0x0
|
||||||
field public static final int COMPONENT_TAG_TELECOM = 3; // 0x3
|
field public static final int COMPONENT_TAG_TELECOM = 3; // 0x3
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
package android.net;
|
package android.net;
|
||||||
|
|
||||||
import android.annotation.SystemApi;
|
import android.annotation.SystemApi;
|
||||||
|
import android.app.PendingIntent;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Parcelable;
|
import android.os.Parcelable;
|
||||||
import android.os.RemoteException;
|
import android.os.RemoteException;
|
||||||
@@ -106,4 +107,46 @@ public class ConnectivityMetricsLogger {
|
|||||||
Log.e(TAG, "Error logging event " + e.getMessage());
|
Log.e(TAG, "Error logging event " + e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieve events
|
||||||
|
*
|
||||||
|
* @param reference of the last event previously returned. The function will return
|
||||||
|
* events following it.
|
||||||
|
* If 0 then all events will be returned.
|
||||||
|
* After the function call it will contain reference of the
|
||||||
|
* last returned event.
|
||||||
|
* @return events
|
||||||
|
*/
|
||||||
|
public ConnectivityMetricsEvent[] getEvents(ConnectivityMetricsEvent.Reference reference) {
|
||||||
|
try {
|
||||||
|
return mService.getEvents(reference);
|
||||||
|
} catch (RemoteException ex) {
|
||||||
|
Log.e(TAG, "IConnectivityMetricsLogger.getEvents: " + ex);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Register PendingIntent which will be sent when new events are ready to be retrieved.
|
||||||
|
*/
|
||||||
|
public boolean register(PendingIntent newEventsIntent) {
|
||||||
|
try {
|
||||||
|
return mService.register(newEventsIntent);
|
||||||
|
} catch (RemoteException ex) {
|
||||||
|
Log.e(TAG, "IConnectivityMetricsLogger.register: " + ex);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean unregister(PendingIntent newEventsIntent) {
|
||||||
|
try {
|
||||||
|
mService.unregister(newEventsIntent);
|
||||||
|
} catch (RemoteException ex) {
|
||||||
|
Log.e(TAG, "IConnectivityMetricsLogger.unregister: " + ex);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user