Skip to content

Commit

Permalink
Update naming for ShadowPausedMessageQueue.nativePollOnce
Browse files Browse the repository at this point in the history
Use the name 'nativePollOnce' for the current (M+) method, and use a
custom name for the method on older SDKs. This will enable the faster
path for modern and more widely used SDK levels.
  • Loading branch information
hoisie committed Aug 20, 2024
1 parent e24baa2 commit 3911f5f
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,13 @@ protected static void nativeDestroy(long ptr) {
ShadowPausedSystemClock.removeListener(q.clockListener);
}

@Implementation(maxSdk = LOLLIPOP_MR1)
protected static void nativePollOnce(long ptr, int timeoutMillis) {
nativeQueueRegistry.getNativeObject(ptr).nativePollOnceFromM(ptr, timeoutMillis);
@Implementation(maxSdk = LOLLIPOP_MR1, methodName = "nativePollOnce")
protected static void nativePollOncePreM(long ptr, int timeoutMillis) {
nativeQueueRegistry.getNativeObject(ptr).nativePollOnce(ptr, timeoutMillis);
}

@Implementation(minSdk = M, methodName = "nativePollOnce")
protected void nativePollOnceFromM(long ptr, int timeoutMillis) {
@Implementation(minSdk = M)
protected void nativePollOnce(long ptr, int timeoutMillis) {
if (timeoutMillis == 0) {
return;
}
Expand Down

0 comments on commit 3911f5f

Please sign in to comment.