Compare commits

..
7 Commits
7 changed files with 48 additions and 26 deletions

No files matched your search

+2 -2
View File
@@ -8,8 +8,8 @@ android {
minSdkVersion 16 minSdkVersion 16
targetSdkVersion 28 targetSdkVersion 28
versionName "5.10" versionName "5.10.2"
versionCode = 175 versionCode = 177
} }
flavorDimensions "root" flavorDimensions "root"
+7 -5
View File
@@ -81,11 +81,8 @@ public class AppView extends Activity implements AdapterFragmentCallbacks {
// Wait for the binder to be ready // Wait for the binder to be ready
localBinder.waitForReady(); localBinder.waitForReady();
// Now make the binder visible
managerBinder = localBinder;
// Get the computer object // Get the computer object
computer = managerBinder.getComputer(UUID.fromString(uuidString)); computer = localBinder.getComputer(UUID.fromString(uuidString));
if (computer == null) { if (computer == null) {
finish(); finish();
return; return;
@@ -95,13 +92,18 @@ public class AppView extends Activity implements AdapterFragmentCallbacks {
appGridAdapter = new AppGridAdapter(AppView.this, appGridAdapter = new AppGridAdapter(AppView.this,
PreferenceConfiguration.readPreferences(AppView.this).listMode, PreferenceConfiguration.readPreferences(AppView.this).listMode,
PreferenceConfiguration.readPreferences(AppView.this).smallIconMode, PreferenceConfiguration.readPreferences(AppView.this).smallIconMode,
computer, managerBinder.getUniqueId()); computer, localBinder.getUniqueId());
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
finish(); finish();
return; return;
} }
// Now make the binder visible. We must do this after appGridAdapter
// is set to prevent us from reaching updateUiWithServerinfo() and
// touching the appGridAdapter prior to initialization.
managerBinder = localBinder;
// Load the app grid with cached data (if possible). // Load the app grid with cached data (if possible).
// This must be done _before_ startComputerUpdates() // This must be done _before_ startComputerUpdates()
// so the initial serverinfo response can update the running // so the initial serverinfo response can update the running
+4 -2
View File
@@ -346,7 +346,8 @@ public class PcView extends Activity implements AdapterFragmentCallbacks {
} }
private void doPair(final ComputerDetails computer) { private void doPair(final ComputerDetails computer) {
if (computer.state == ComputerDetails.State.OFFLINE) { if (computer.state == ComputerDetails.State.OFFLINE ||
ServerHelper.getCurrentAddressFromComputer(computer) == null) {
Toast.makeText(PcView.this, getResources().getString(R.string.pair_pc_offline), Toast.LENGTH_SHORT).show(); Toast.makeText(PcView.this, getResources().getString(R.string.pair_pc_offline), Toast.LENGTH_SHORT).show();
return; return;
} }
@@ -478,7 +479,8 @@ public class PcView extends Activity implements AdapterFragmentCallbacks {
} }
private void doUnpair(final ComputerDetails computer) { private void doUnpair(final ComputerDetails computer) {
if (computer.state == ComputerDetails.State.OFFLINE) { if (computer.state == ComputerDetails.State.OFFLINE ||
ServerHelper.getCurrentAddressFromComputer(computer) == null) {
Toast.makeText(PcView.this, getResources().getString(R.string.error_pc_offline), Toast.LENGTH_SHORT).show(); Toast.makeText(PcView.this, getResources().getString(R.string.error_pc_offline), Toast.LENGTH_SHORT).show();
return; return;
} }
@@ -105,17 +105,27 @@ public class ComputerManagerService extends Service {
// If it's online, update our persistent state // If it's online, update our persistent state
if (details.state == ComputerDetails.State.ONLINE) { if (details.state == ComputerDetails.State.ONLINE) {
if (!newPc) { ComputerDetails existingComputer = dbManager.getComputerByUUID(details.uuid);
// Check if it's in the database because it could have been
// removed after this was issued // Check if it's in the database because it could have been
if (dbManager.getComputerByUUID(details.uuid) == null) { // removed after this was issued
// It's gone if (!newPc && existingComputer == null) {
releaseLocalDatabaseReference(); // It's gone
return false; releaseLocalDatabaseReference();
} return false;
} }
dbManager.updateComputer(details); // If we already have an entry for this computer in the DB, we must
// combine the existing data with this new data (which may be partially available
// due to detecting the PC via mDNS) without the saved external address. If we
// write to the DB without doing this first, we can overwrite our existing data.
if (existingComputer != null) {
existingComputer.update(details);
dbManager.updateComputer(existingComputer);
}
else {
dbManager.updateComputer(details);
}
} }
// Don't call the listener if this is a failed lookup of a new PC // Don't call the listener if this is a failed lookup of a new PC
@@ -304,7 +314,7 @@ public class ComputerManagerService extends Service {
}; };
} }
private void addTuple(ComputerDetails details, boolean manuallyAdded) { private void addTuple(ComputerDetails details) {
synchronized (pollingTuples) { synchronized (pollingTuples) {
for (PollingTuple tuple : pollingTuples) { for (PollingTuple tuple : pollingTuples) {
// Check if this is the same computer // Check if this is the same computer
@@ -365,7 +375,7 @@ public class ComputerManagerService extends Service {
LimeLog.info("New PC ("+fakeDetails.name+") is UUID "+fakeDetails.uuid); LimeLog.info("New PC ("+fakeDetails.name+") is UUID "+fakeDetails.uuid);
// Start a polling thread for this machine // Start a polling thread for this machine
addTuple(fakeDetails, manuallyAdded); addTuple(fakeDetails);
return true; return true;
} }
else { else {
@@ -537,7 +547,7 @@ public class ComputerManagerService extends Service {
// b) if it's null, it will be unexpectedly nulling the activeAddress of a possibly online PC // b) if it's null, it will be unexpectedly nulling the activeAddress of a possibly online PC
LimeLog.info("Starting fast poll for "+details.name+" ("+details.localAddress +", "+details.remoteAddress +", "+details.manualAddress +")"); LimeLog.info("Starting fast poll for "+details.name+" ("+details.localAddress +", "+details.remoteAddress +", "+details.manualAddress +")");
String candidateAddress = fastPollPc(details.localAddress, details.remoteAddress, details.manualAddress); String candidateAddress = fastPollPc(details.localAddress, details.remoteAddress, details.manualAddress);
LimeLog.info("Fast poll for "+details.name+" returned active address: "+details.activeAddress); LimeLog.info("Fast poll for "+details.name+" returned candidate address: "+candidateAddress);
// If no connection could be established to either IP address, there's nothing we can do // If no connection could be established to either IP address, there's nothing we can do
if (candidateAddress == null) { if (candidateAddress == null) {
@@ -593,7 +603,7 @@ public class ComputerManagerService extends Service {
for (ComputerDetails computer : dbManager.getAllComputers()) { for (ComputerDetails computer : dbManager.getAllComputers()) {
// Add tuples for each computer // Add tuples for each computer
addTuple(computer, true); addTuple(computer);
} }
releaseLocalDatabaseReference(); releaseLocalDatabaseReference();
@@ -213,9 +213,12 @@ public class StreamSettings extends Activity {
// We must now ensure our display is compatible with HDR10 // We must now ensure our display is compatible with HDR10
boolean foundHdr10 = false; boolean foundHdr10 = false;
for (int hdrType : hdrCaps.getSupportedHdrTypes()) { if (hdrCaps != null) {
if (hdrType == Display.HdrCapabilities.HDR_TYPE_HDR10) { // getHdrCapabilities() returns null on Lenovo Lenovo Mirage Solo (vega), Android 8.0
foundHdr10 = true; for (int hdrType : hdrCaps.getSupportedHdrTypes()) {
if (hdrType == Display.HdrCapabilities.HDR_TYPE_HDR10) {
foundHdr10 = true;
}
} }
} }
@@ -37,6 +37,11 @@ public class ServerHelper {
public static void doStart(Activity parent, NvApp app, ComputerDetails computer, public static void doStart(Activity parent, NvApp app, ComputerDetails computer,
ComputerManagerService.ComputerManagerBinder managerBinder) { ComputerManagerService.ComputerManagerBinder managerBinder) {
if (computer.state == ComputerDetails.State.OFFLINE ||
ServerHelper.getCurrentAddressFromComputer(computer) == null) {
Toast.makeText(parent, parent.getResources().getString(R.string.pair_pc_offline), Toast.LENGTH_SHORT).show();
return;
}
parent.startActivity(createStartIntent(parent, app, computer, managerBinder)); parent.startActivity(createStartIntent(parent, app, computer, managerBinder));
} }