mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2025-07-20 03:23:07 +00:00
Protect from accessing the ComputerManagerService before initialization has completed
This commit is contained in:
parent
09cf5d23ea
commit
8bc8f14c64
@ -148,9 +148,16 @@ public class PcView extends Activity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void stopComputerUpdates() {
|
private void stopComputerUpdates() {
|
||||||
freezeUpdates = true;
|
if (managerBinder != null) {
|
||||||
managerBinder.stopPolling();
|
if (!runningPolling) {
|
||||||
runningPolling = false;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
freezeUpdates = true;
|
||||||
|
|
||||||
|
managerBinder.stopPolling();
|
||||||
|
runningPolling = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -229,6 +236,11 @@ public class PcView extends Activity {
|
|||||||
"You must close the game before pairing.", Toast.LENGTH_LONG).show();
|
"You must close the game before pairing.", Toast.LENGTH_LONG).show();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (managerBinder == null) {
|
||||||
|
Toast.makeText(PcView.this, "The ComputerManager service is not running. " +
|
||||||
|
"Please wait a few seconds or restart the app.", Toast.LENGTH_LONG).show();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Toast.makeText(PcView.this, "Pairing...", Toast.LENGTH_SHORT).show();
|
Toast.makeText(PcView.this, "Pairing...", Toast.LENGTH_SHORT).show();
|
||||||
new Thread(new Runnable() {
|
new Thread(new Runnable() {
|
||||||
@ -330,6 +342,11 @@ public class PcView extends Activity {
|
|||||||
Toast.makeText(PcView.this, "Computer is offline", Toast.LENGTH_SHORT).show();
|
Toast.makeText(PcView.this, "Computer is offline", Toast.LENGTH_SHORT).show();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (managerBinder == null) {
|
||||||
|
Toast.makeText(PcView.this, "The ComputerManager service is not running. " +
|
||||||
|
"Please wait a few seconds or restart the app.", Toast.LENGTH_LONG).show();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Toast.makeText(PcView.this, "Unpairing...", Toast.LENGTH_SHORT).show();
|
Toast.makeText(PcView.this, "Unpairing...", Toast.LENGTH_SHORT).show();
|
||||||
new Thread(new Runnable() {
|
new Thread(new Runnable() {
|
||||||
@ -387,6 +404,11 @@ public class PcView extends Activity {
|
|||||||
Toast.makeText(PcView.this, "Computer is offline", Toast.LENGTH_SHORT).show();
|
Toast.makeText(PcView.this, "Computer is offline", Toast.LENGTH_SHORT).show();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (managerBinder == null) {
|
||||||
|
Toast.makeText(PcView.this, "The ComputerManager service is not running. " +
|
||||||
|
"Please wait a few seconds or restart the app.", Toast.LENGTH_LONG).show();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Intent i = new Intent(this, AppView.class);
|
Intent i = new Intent(this, AppView.class);
|
||||||
i.putExtra(AppView.NAME_EXTRA, computer.name);
|
i.putExtra(AppView.NAME_EXTRA, computer.name);
|
||||||
@ -422,9 +444,12 @@ public class PcView extends Activity {
|
|||||||
return true;
|
return true;
|
||||||
|
|
||||||
case DELETE_ID:
|
case DELETE_ID:
|
||||||
if (managerBinder != null) {
|
if (managerBinder == null) {
|
||||||
managerBinder.removeComputer(computer.details.name);
|
Toast.makeText(PcView.this, "The ComputerManager service is not running. " +
|
||||||
}
|
"Please wait a few seconds or restart the app.", Toast.LENGTH_LONG).show();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
managerBinder.removeComputer(computer.details.name);
|
||||||
removeListView(computer.details);
|
removeListView(computer.details);
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user