binder: Make transport notification methods package-private

These are overrides of BinderTransport itself, so not used elsewhere.
They are essentially private. It was scary seeing `@GuardedBy` for a
public method. I copied the annotation to the base class to make sure
ErrorProne could verify the calls.
This commit is contained in:
Eric Anderson 2024-06-05 09:55:08 -07:00
parent 791f894e25
commit 0a4df9f93c
1 changed files with 6 additions and 4 deletions

View File

@ -260,8 +260,10 @@ public abstract class BinderTransport
return !flowController.isTransmitWindowFull();
}
@GuardedBy("this")
abstract void notifyShutdown(Status shutdownStatus);
@GuardedBy("this")
abstract void notifyTerminated();
void releaseExecutors() {
@ -720,13 +722,13 @@ public abstract class BinderTransport
@Override
@GuardedBy("this")
public void notifyShutdown(Status status) {
void notifyShutdown(Status status) {
clientTransportListener.transportShutdown(status);
}
@Override
@GuardedBy("this")
public void notifyTerminated() {
void notifyTerminated() {
if (numInUseStreams.getAndSet(0) > 0) {
clientTransportListener.transportInUse(false);
}
@ -897,13 +899,13 @@ public abstract class BinderTransport
@Override
@GuardedBy("this")
public void notifyShutdown(Status status) {
void notifyShutdown(Status status) {
// Nothing to do.
}
@Override
@GuardedBy("this")
public void notifyTerminated() {
void notifyTerminated() {
if (serverTransportListener != null) {
serverTransportListener.transportTerminated();
}