Reverse boolean logic for readability

Refs #2260 <https://github.com/Genymobile/scrcpy/pull/2260#issuecomment-823508759>
This commit is contained in:
Romain Vimont 2021-04-20 20:59:58 +02:00
parent aaf7875d92
commit bb4614d558

View file

@ -14,7 +14,7 @@ public class ActivityManager {
private final IInterface manager; private final IInterface manager;
private Method getContentProviderExternalMethod; private Method getContentProviderExternalMethod;
private boolean getContentProviderExternalMethodLegacy; private boolean getContentProviderExternalMethodNewVersion = true;
private Method removeContentProviderExternalMethod; private Method removeContentProviderExternalMethod;
public ActivityManager(IInterface manager) { public ActivityManager(IInterface manager) {
@ -29,7 +29,7 @@ public class ActivityManager {
} catch (NoSuchMethodException e) { } catch (NoSuchMethodException e) {
// old version // old version
getContentProviderExternalMethod = manager.getClass().getMethod("getContentProviderExternal", String.class, int.class, IBinder.class); getContentProviderExternalMethod = manager.getClass().getMethod("getContentProviderExternal", String.class, int.class, IBinder.class);
getContentProviderExternalMethodLegacy = true; getContentProviderExternalMethodNewVersion = false;
} }
} }
return getContentProviderExternalMethod; return getContentProviderExternalMethod;
@ -46,7 +46,7 @@ public class ActivityManager {
try { try {
Method method = getGetContentProviderExternalMethod(); Method method = getGetContentProviderExternalMethod();
Object[] args; Object[] args;
if (!getContentProviderExternalMethodLegacy) { if (getContentProviderExternalMethodNewVersion) {
// new version // new version
args = new Object[]{name, ServiceManager.USER_ID, token, null}; args = new Object[]{name, ServiceManager.USER_ID, token, null};
} else { } else {