mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2025-07-19 19:13:03 +00:00
Improve reliability of missing root detection
This commit is contained in:
parent
aae591daec
commit
e9141d65fe
@ -54,12 +54,7 @@ public class EvdevCaptureProvider extends InputCaptureProvider {
|
||||
try {
|
||||
su = builder.start();
|
||||
} catch (IOException e) {
|
||||
activity.runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Toast.makeText(activity, "This device is not rooted - Mouse capture is unavailable", Toast.LENGTH_LONG).show();
|
||||
}
|
||||
});
|
||||
reportDeviceNotRooted();
|
||||
e.printStackTrace();
|
||||
return;
|
||||
}
|
||||
@ -69,6 +64,7 @@ public class EvdevCaptureProvider extends InputCaptureProvider {
|
||||
try {
|
||||
suOut.writeChars(libraryPath+File.separatorChar+"libevdev_reader.so "+servSock.getLocalPort()+"\n");
|
||||
} catch (IOException e) {
|
||||
reportDeviceNotRooted();
|
||||
e.printStackTrace();
|
||||
return;
|
||||
}
|
||||
@ -176,6 +172,15 @@ public class EvdevCaptureProvider extends InputCaptureProvider {
|
||||
return LimelightBuildProps.ROOT_BUILD;
|
||||
}
|
||||
|
||||
private void reportDeviceNotRooted() {
|
||||
activity.runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Toast.makeText(activity, "This device is not rooted - Mouse capture is unavailable", Toast.LENGTH_LONG).show();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void enableCapture() {
|
||||
if (!started) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user