[Service] Add error code parameter to the IScanListener
This makes internal listener same signature as the public API. Test: -m Ignore-AOSP-First: nearby_not_in_aosp_yet Bug: 263893748 Change-Id: Ie1e03fea8c79af1682ac64418498a8af5492b85d
This commit is contained in:
parent
ad5706dffc
commit
b75023e545
3 changed files with 5 additions and 4 deletions
|
|
@ -34,5 +34,5 @@ oneway interface IScanListener {
|
|||
void onLost(in NearbyDeviceParcelable nearbyDeviceParcelable);
|
||||
|
||||
/** Reports when there is an error during scanning. */
|
||||
void onError();
|
||||
void onError(in int errorCode);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -376,10 +376,10 @@ public class NearbyManager {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void onError() {
|
||||
public void onError(int errorCode) {
|
||||
mExecutor.execute(() -> {
|
||||
if (mScanCallback != null) {
|
||||
Log.e("NearbyManager", "onError: There is an error in scan.");
|
||||
mScanCallback.onError(errorCode);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ import android.nearby.IScanListener;
|
|||
import android.nearby.NearbyDeviceParcelable;
|
||||
import android.nearby.NearbyManager;
|
||||
import android.nearby.PresenceScanFilter;
|
||||
import android.nearby.ScanCallback;
|
||||
import android.nearby.ScanFilter;
|
||||
import android.nearby.ScanRequest;
|
||||
import android.os.IBinder;
|
||||
|
|
@ -82,7 +83,7 @@ public class DiscoveryProviderManager implements AbstractDiscoveryProvider.Liste
|
|||
Log.w(TAG, "[DiscoveryProviderManager] scan permission revoked "
|
||||
+ "- not forwarding results");
|
||||
try {
|
||||
record.getScanListener().onError();
|
||||
record.getScanListener().onError(ScanCallback.ERROR_PERMISSION_DENIED);
|
||||
} catch (RemoteException e) {
|
||||
Log.w(TAG, "DiscoveryProviderManager failed to report error.", e);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue