Cleanup API checks for P, Q, and R.

Test: Build with gradle
Flag: NA
Change-Id: I3ef17090741d14bebd76cf09cf3dc5ac4f11e686
This commit is contained in:
Andy Wickham committed 2024-01-24 14:58:08 -08:00
1 parent a601341ff5
commit b922dccbf5
67 files changed
+117 -382

No files matched your search

@@ -20,12 +20,10 @@ import android.os.Trace;
import androidx.annotation.MainThread;
import com.android.launcher3.Utilities;
import kotlin.random.Random;
import java.util.function.Supplier;
import kotlin.random.Random;
/**
* A wrapper around {@link Trace} to allow better testing.
*
@@ -67,9 +65,6 @@ public class TraceHelper {
@SuppressWarnings("NewApi")
@SuppressLint("NewApi")
public SafeCloseable beginAsyncSection(String sectionName) {
if (!Utilities.ATLEAST_Q) {
return () -> { };
}
int cookie = Random.Default.nextInt();
Trace.beginAsyncSection(sectionName, cookie);
return () -> Trace.endAsyncSection(sectionName, cookie);
@@ -81,9 +76,6 @@ public class TraceHelper {
@SuppressWarnings("NewApi")
@SuppressLint("NewApi")
public SafeCloseable allowIpcs(String rpcName) {
if (!Utilities.ATLEAST_Q) {
return () -> { };
}
int cookie = Random.Default.nextInt();
Trace.beginAsyncSection(rpcName, cookie);
return () -> Trace.endAsyncSection(rpcName, cookie);