mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2025-07-20 19:42:45 +00:00
Never return an NvApp object that has no app ID assigned
This commit is contained in:
parent
9772049295
commit
7ae74a6a18
@ -4,6 +4,7 @@ public class NvApp {
|
|||||||
private String appName = "";
|
private String appName = "";
|
||||||
private int appId;
|
private int appId;
|
||||||
private boolean isRunning;
|
private boolean isRunning;
|
||||||
|
private boolean initialized;
|
||||||
|
|
||||||
public void setAppName(String appName) {
|
public void setAppName(String appName) {
|
||||||
this.appName = appName;
|
this.appName = appName;
|
||||||
@ -11,6 +12,7 @@ public class NvApp {
|
|||||||
|
|
||||||
public void setAppId(String appId) {
|
public void setAppId(String appId) {
|
||||||
this.appId = Integer.parseInt(appId);
|
this.appId = Integer.parseInt(appId);
|
||||||
|
this.initialized = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setIsRunning(String isRunning) {
|
public void setIsRunning(String isRunning) {
|
||||||
@ -32,4 +34,8 @@ public class NvApp {
|
|||||||
public boolean getIsRunning() {
|
public boolean getIsRunning() {
|
||||||
return this.isRunning;
|
return this.isRunning;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isInitialized() {
|
||||||
|
return this.initialized;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -15,6 +15,7 @@ import java.security.PrivateKey;
|
|||||||
import java.security.SecureRandom;
|
import java.security.SecureRandom;
|
||||||
import java.security.cert.X509Certificate;
|
import java.security.cert.X509Certificate;
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
|
import java.util.ListIterator;
|
||||||
import java.util.Scanner;
|
import java.util.Scanner;
|
||||||
import java.util.Stack;
|
import java.util.Stack;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
@ -32,6 +33,7 @@ import org.xmlpull.v1.XmlPullParser;
|
|||||||
import org.xmlpull.v1.XmlPullParserException;
|
import org.xmlpull.v1.XmlPullParserException;
|
||||||
import org.xmlpull.v1.XmlPullParserFactory;
|
import org.xmlpull.v1.XmlPullParserFactory;
|
||||||
|
|
||||||
|
import com.limelight.LimeLog;
|
||||||
import com.limelight.nvstream.ConnectionContext;
|
import com.limelight.nvstream.ConnectionContext;
|
||||||
import com.limelight.nvstream.http.PairingManager.PairState;
|
import com.limelight.nvstream.http.PairingManager.PairState;
|
||||||
import com.squareup.okhttp.OkHttpClient;
|
import com.squareup.okhttp.OkHttpClient;
|
||||||
@ -341,7 +343,19 @@ public class NvHTTP {
|
|||||||
}
|
}
|
||||||
eventType = xpp.next();
|
eventType = xpp.next();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Ensure that all apps in the list are initialized
|
||||||
|
ListIterator<NvApp> i = appList.listIterator();
|
||||||
|
while (i.hasNext()) {
|
||||||
|
NvApp app = i.next();
|
||||||
|
|
||||||
|
// Remove uninitialized apps
|
||||||
|
if (!app.isInitialized()) {
|
||||||
|
LimeLog.warning("GFE returned incomplete app: "+app.getAppId()+" "+app.getAppName()+" "+app.getIsRunning());
|
||||||
|
i.remove();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return appList;
|
return appList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user