Skip to content

Commit

Permalink
Void* callback for RestorableDeviceRegisterForNotifications
Browse files Browse the repository at this point in the history
Summary: The API takes any `void *`, instead of having an implicit conversion of a `void *`

Reviewed By: c-ryan747

Differential Revision: D21974704

fbshipit-source-id: 294fba1d2ce5cb0f206e394f4354b05d13ba8547
  • Loading branch information
lawrencelomax authored and facebook-github-bot committed Jun 11, 2020
1 parent ac90a5d commit 848993f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion FBDeviceControl/Management/FBAMDefines.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ typedef void (*AMDeviceNotificationCallback)(AMDeviceNotification *notification,
/**
Defines the "Notification Callback" for AMRestorableDeviceRef instances.
*/
typedef void (*AMRestorableDeviceNotificationCallback)(AMRestorableDeviceRef eventData, AMRestorableDeviceNotificationType status, id arg2);
typedef void (*AMRestorableDeviceNotificationCallback)(AMRestorableDeviceRef eventData, AMRestorableDeviceNotificationType status, void *context);

/**
A Structure that references to the AMDevice APIs we use.
Expand Down
3 changes: 2 additions & 1 deletion FBDeviceControl/Management/FBAMRestorableDeviceManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@
}
}

static void FB_AMRestorableDeviceListenerCallback(AMRestorableDeviceRef device, AMRestorableDeviceNotificationType status, FBAMRestorableDeviceManager *manager)
static void FB_AMRestorableDeviceListenerCallback(AMRestorableDeviceRef device, AMRestorableDeviceNotificationType status, void *context)
{
FBAMRestorableDeviceManager *manager = (__bridge FBAMRestorableDeviceManager *)context;
id<FBControlCoreLogger> logger = manager.logger;
AMRestorableDeviceState deviceState = manager.calls.RestorableDeviceGetState(device);
FBiOSTargetState targetState = [FBAMRestorableDevice targetStateForDeviceState:deviceState];
Expand Down

0 comments on commit 848993f

Please sign in to comment.