mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-04 01:46:49 +00:00
Cleanup API checks for P, Q, and R.
Test: Build with gradle Flag: NA Change-Id: I3ef17090741d14bebd76cf09cf3dc5ac4f11e686
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user