Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace systemUptime calls with CACurrentMediaTime() to comply with Apple privacy requirements #5819

Merged
merged 2 commits into from
Mar 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Example/ios/MBFingerTipWindow.m
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ - (void)removeInactiveFingerTips
{
self.fingerTipRemovalScheduled = NO;

NSTimeInterval now = [[NSProcessInfo processInfo] systemUptime];
NSTimeInterval now = CACurrentMediaTime() * 1000;
const CGFloat REMOVAL_DELAY = 0.2;

for (MBFingerTipView *touchView in [self.overlayWindow subviews])
Expand Down
10 changes: 5 additions & 5 deletions apple/sensor/ReanimatedSensor.m
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ - (bool)initializeGyroscope
[_motionManager
startGyroUpdatesToQueue:[NSOperationQueue mainQueue]
withHandler:^(CMGyroData *sensorData, NSError *error) {
double currentTime = [[NSProcessInfo processInfo] systemUptime];
double currentTime = CACurrentMediaTime() * 1000;
if (currentTime - self->_lastTimestamp < self->_interval) {
return;
}
Expand All @@ -69,7 +69,7 @@ - (bool)initializeAccelerometer
[_motionManager startAccelerometerUpdates];
[_motionManager startAccelerometerUpdatesToQueue:[NSOperationQueue mainQueue]
withHandler:^(CMAccelerometerData *sensorData, NSError *error) {
double currentTime = [[NSProcessInfo processInfo] systemUptime];
double currentTime = CACurrentMediaTime() * 1000;
if (currentTime - self->_lastTimestamp < self->_interval) {
return;
}
Expand All @@ -96,7 +96,7 @@ - (bool)initializeGravity
[_motionManager
startDeviceMotionUpdatesToQueue:[NSOperationQueue mainQueue]
withHandler:^(CMDeviceMotion *sensorData, NSError *error) {
double currentTime = [[NSProcessInfo processInfo] systemUptime];
double currentTime = CACurrentMediaTime() * 1000;
if (currentTime - self->_lastTimestamp < self->_interval) {
return;
}
Expand All @@ -121,7 +121,7 @@ - (bool)initializeMagnetometer
[_motionManager
startMagnetometerUpdatesToQueue:[NSOperationQueue mainQueue]
withHandler:^(CMMagnetometerData *sensorData, NSError *error) {
double currentTime = [[NSProcessInfo processInfo] systemUptime];
double currentTime = CACurrentMediaTime() * 1000;
if (currentTime - self->_lastTimestamp < self->_interval) {
return;
}
Expand Down Expand Up @@ -157,7 +157,7 @@ - (bool)initializeOrientation
[_motionManager startDeviceMotionUpdatesUsingReferenceFrame:(1 << _referenceFrame)
toQueue:[NSOperationQueue mainQueue]
withHandler:^(CMDeviceMotion *sensorData, NSError *error) {
double currentTime = [[NSProcessInfo processInfo] systemUptime];
double currentTime = CACurrentMediaTime() * 1000;
if (currentTime - self->_lastTimestamp < self->_interval) {
return;
}
Expand Down
Loading