mirror of
https://github.com/Genymobile/scrcpy.git
synced 2025-07-04 16:11:42 +00:00
Silence DiscouragedPrivateApi lint warning
This commit is contained in:
parent
cd3a5d50b6
commit
d74cfd5711
1 changed files with 2 additions and 0 deletions
|
@ -24,6 +24,7 @@ import com.genymobile.scrcpy.video.SurfaceCapture;
|
|||
import com.genymobile.scrcpy.video.SurfaceEncoder;
|
||||
import com.genymobile.scrcpy.video.VideoSource;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.os.Build;
|
||||
import android.os.Looper;
|
||||
|
||||
|
@ -199,6 +200,7 @@ public final class Server {
|
|||
Looper.prepare();
|
||||
synchronized (Looper.class) {
|
||||
try {
|
||||
@SuppressLint("DiscouragedPrivateApi")
|
||||
Field field = Looper.class.getDeclaredField("sMainLooper");
|
||||
field.setAccessible(true);
|
||||
field.set(null, Looper.myLooper());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue