Skip to content

Commit

Permalink
Internal
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 233496337
  • Loading branch information
brettchabot authored and copybara-robolectric committed Feb 11, 2019
1 parent d7d06c6 commit 02f57c9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 21 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
package org.robolectric.shadows;

import android.graphics.ColorSpace;

import static android.os.Build.VERSION_CODES.O;
import static android.os.Build.VERSION_CODES.Q;

import android.graphics.ColorSpace;
import org.robolectric.annotation.Implementation;
import org.robolectric.annotation.Implements;

Expand All @@ -17,10 +15,6 @@ public class ShadowColorSpace {
@Implements(value = ColorSpace.Rgb.class, minSdk = O)
public static class ShadowRgb {

@Implementation(minSdk = Q)
protected long getNativeInstance() {
return 1;
}
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import static android.os.Build.VERSION_CODES.M;
import static android.os.Build.VERSION_CODES.N;
import static android.os.Build.VERSION_CODES.N_MR1;
import static android.os.Build.VERSION_CODES.P;
import static org.robolectric.RuntimeEnvironment.application;
import static org.robolectric.util.ReflectionHelpers.ClassParameter.from;
import static org.robolectric.util.ReflectionHelpers.callConstructor;
Expand Down Expand Up @@ -210,13 +209,12 @@ private static Object createUsbPortStatus(
int currentPowerRole,
int currentDataRole,
int supportedRoleCombinations) {
if (RuntimeEnvironment.getApiLevel() <= P) {
return callConstructor(UsbPortStatus.class,
from(int.class, currentMode),
from(int.class, currentPowerRole),
from(int.class, currentDataRole),
from(int.class, supportedRoleCombinations));
}
return callConstructor(UsbPortStatus.class,
from(int.class, currentMode),
from(int.class, currentPowerRole),
from(int.class, currentDataRole),
from(int.class, supportedRoleCombinations));

}

/**
Expand All @@ -228,12 +226,10 @@ private static Object createUsbPort(
UsbManager usbManager,
String id,
int supportedModes) {
if (RuntimeEnvironment.getApiLevel() <= P) {
return callConstructor(UsbPort.class,
from(UsbManager.class, usbManager),
from(String.class, id),
from(int.class, supportedModes));
}
return callConstructor(UsbPort.class,
from(UsbManager.class, usbManager),
from(String.class, id),
from(int.class, supportedModes));
}

/** Accessor interface for {@link UsbManager}'s internals. */
Expand Down

0 comments on commit 02f57c9

Please sign in to comment.