Lines Matching refs:callback

56   /* maps callback, to callback wrapper and sync handle */
86 * @param callback Callback used to deliver all operations status.
88 * skip} is invalid or {@code timeout} is invalid or {@code callback} is null.
91 PeriodicAdvertisingCallback callback) {
92 registerSync(scanResult, skip, timeout, callback, null);
109 * @param callback Callback used to deliver all operations status.
112 * skip} is invalid or {@code timeout} is invalid or {@code callback} is null.
115 PeriodicAdvertisingCallback callback, Handler handler) {
116 if (callback == null) {
117 throw new IllegalArgumentException("callback can't be null");
143 callback.onSyncEstablished(0, scanResult.getDevice(), scanResult.getAdvertisingSid(),
152 IPeriodicAdvertisingCallback wrapped = wrap(callback, handler);
153 callbackWrappers.put(callback, wrapped);
166 * @param callback Callback used to deliver all operations status.
167 * @throws IllegalArgumentException if {@code callback} is null, or not a properly
168 * registered callback.
170 public void unregisterSync(PeriodicAdvertisingCallback callback) {
171 if (callback == null) {
172 throw new IllegalArgumentException("callback can't be null");
183 IPeriodicAdvertisingCallback wrapper = callbackWrappers.remove(callback);
185 throw new IllegalArgumentException("callback was not properly registered");
196 private IPeriodicAdvertisingCallback wrap(PeriodicAdvertisingCallback callback, Handler handler) {
204 callback.onSyncEstablished(syncHandle, device, advertisingSid, skip, timeout,
208 // App can still unregister the sync until notified it failed. Remove callback
210 callbackWrappers.remove(callback);
220 callback.onPeriodicAdvertisingReport(report);
229 callback.onSyncLost(syncHandle);
230 // App can still unregister the sync until notified it's lost. Remove callback after
232 callbackWrappers.remove(callback);