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