Merge "base: remove onBind and onMessage from TraceReport API surface" am: b27a57a7b6 am: 47f0797eb0
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1991971 Change-Id: I9b8625f684a3cb120d1d8cb4f15b39332424eb14
This commit is contained in:
@@ -10179,8 +10179,6 @@ package android.service.tracing {
|
|||||||
|
|
||||||
public class TraceReportService extends android.app.Service {
|
public class TraceReportService extends android.app.Service {
|
||||||
ctor public TraceReportService();
|
ctor public TraceReportService();
|
||||||
method @Nullable public android.os.IBinder onBind(@NonNull android.content.Intent);
|
|
||||||
method public boolean onMessage(@NonNull android.os.Message);
|
|
||||||
method public void onReportTrace(@NonNull android.service.tracing.TraceReportService.TraceParams);
|
method public void onReportTrace(@NonNull android.service.tracing.TraceReportService.TraceParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -112,7 +112,6 @@ public class TraceReportService extends Service {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Methods to override.
|
|
||||||
/**
|
/**
|
||||||
* Called when a trace is reported and sent to this class.
|
* Called when a trace is reported and sent to this class.
|
||||||
*
|
*
|
||||||
@@ -123,15 +122,10 @@ public class TraceReportService extends Service {
|
|||||||
public void onReportTrace(@NonNull TraceParams args) {
|
public void onReportTrace(@NonNull TraceParams args) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Optional methods to override.
|
|
||||||
// Realistically, these methods are internal implementation details but since this class is
|
|
||||||
// a SystemApi, it's better to err on the side of flexibility just in-case we need to override
|
|
||||||
// these methods down the line.
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handles binder calls from system_server.
|
* Handles binder calls from system_server.
|
||||||
*/
|
*/
|
||||||
public boolean onMessage(@NonNull Message msg) {
|
private boolean onMessage(@NonNull Message msg) {
|
||||||
if (msg.what == MSG_REPORT_TRACE) {
|
if (msg.what == MSG_REPORT_TRACE) {
|
||||||
if (!(msg.obj instanceof TraceReportParams)) {
|
if (!(msg.obj instanceof TraceReportParams)) {
|
||||||
Log.e(TAG, "Received invalid type for report trace message.");
|
Log.e(TAG, "Received invalid type for report trace message.");
|
||||||
@@ -153,10 +147,12 @@ public class TraceReportService extends Service {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns an IBinder for handling binder calls from system_server.
|
* Returns an IBinder for handling binder calls from system_server.
|
||||||
|
*
|
||||||
|
* @hide
|
||||||
*/
|
*/
|
||||||
@Nullable
|
@Nullable
|
||||||
@Override
|
@Override
|
||||||
public IBinder onBind(@NonNull Intent intent) {
|
public final IBinder onBind(@NonNull Intent intent) {
|
||||||
if (mMessenger == null) {
|
if (mMessenger == null) {
|
||||||
mMessenger = new Messenger(new Handler(Looper.getMainLooper(), this::onMessage));
|
mMessenger = new Messenger(new Handler(Looper.getMainLooper(), this::onMessage));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user