@org.robolectric.annotation.HiddenApi - java examples

Here are the examples of the java api @org.robolectric.annotation.HiddenApi taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

155 Examples 7

19 View Complete Implementation : ShadowLegacySystemClock.java
Copyright MIT License
Author : robolectric
@HiddenApi
@Implementation
public static long currentTimeMicro() {
    return now() * 1000;
}

19 View Complete Implementation : ShadowMotionEvent.java
Copyright MIT License
Author : robolectric
@Implementation(maxSdk = KITKAT_WATCH)
@HiddenApi
protected static float nativeGetYPrecision(int nativePtr) {
    return nativeGetYPrecision((long) nativePtr);
}

19 View Complete Implementation : ShadowTelecomManager.java
Copyright MIT License
Author : robolectric
@Implementation
@HiddenApi
public PhoneAccountHandle getUserSelectedOutgoingPhoneAccount() {
    return null;
}

19 View Complete Implementation : ShadowLegacyResourcesImpl.java
Copyright MIT License
Author : robolectric
@HiddenApi
@Implementation(maxSdk = M)
public XmlResourceParser loadXmlResourceParser(int resId, String type) throws Resources.NotFoundException {
    ShadowLegacyreplacedetManager shadowreplacedetManager = legacyShadowOf(realResourcesImpl.getreplacedets());
    return shadowreplacedetManager.loadXmlResourceParser(resId, type);
}

19 View Complete Implementation : ShadowMotionEvent.java
Copyright MIT License
Author : robolectric
@Implementation(minSdk = LOLLIPOP)
@HiddenApi
protected static void nativeSetDownTimeNanos(long nativePtr, long downTimeNanos) {
    NativeInput.MotionEvent event = getNativeMotionEvent(nativePtr);
    event.setDownTime(downTimeNanos);
}

19 View Complete Implementation : ShadowMotionEvent.java
Copyright MIT License
Author : robolectric
@Implementation(maxSdk = KITKAT_WATCH)
@HiddenApi
protected static int nativeCopy(int destNativePtr, int sourceNativePtr, boolean keepHistory) {
    return (int) nativeCopy((long) destNativePtr, (long) sourceNativePtr, keepHistory);
}

19 View Complete Implementation : ShadowMotionEvent.java
Copyright MIT License
Author : robolectric
@Implementation(minSdk = LOLLIPOP)
@HiddenApi
protected static int nativeGetHistorySize(long nativePtr) {
    NativeInput.MotionEvent event = getNativeMotionEvent(nativePtr);
    return event.getHistorySize();
}

19 View Complete Implementation : ShadowLegacyMessage.java
Copyright MIT License
Author : robolectric
/**
 * Hook to unscheduled the callback when the message is recycled.
 * Invokes {@link #unschedule()} and then calls through to the
 * package private method {@link Message#recycleUnchecked()}
 * on the real object.
 */
@HiddenApi
@Implementation(minSdk = LOLLIPOP)
public void recycleUnchecked() {
    if (getApiLevel() >= LOLLIPOP) {
        unschedule();
        directlyOn(realMessage, Message.clreplaced, "recycleUnchecked");
    } else {
        // provide forward compatibility with SDK 21.
        recycle();
    }
}

19 View Complete Implementation : ShadowMotionEvent.java
Copyright MIT License
Author : robolectric
@Implementation(minSdk = LOLLIPOP)
@HiddenApi
protected static void nativeSetEdgeFlags(long nativePtr, int edgeFlags) {
    NativeInput.MotionEvent event = getNativeMotionEvent(nativePtr);
    event.setEdgeFlags(edgeFlags);
}

19 View Complete Implementation : ShadowParcel.java
Copyright MIT License
Author : robolectric
@HiddenApi
@Implementation(maxSdk = KITKAT_WATCH)
public static String nativeReadString(int nativePtr) {
    return nativeReadString((long) nativePtr);
}

19 View Complete Implementation : ShadowMotionEvent.java
Copyright MIT License
Author : robolectric
@Implementation(maxSdk = KITKAT_WATCH)
@HiddenApi
protected static int nativeGetAction(int nativePtr) {
    return nativeGetAction((long) nativePtr);
}

19 View Complete Implementation : ShadowContextHubClient.java
Copyright MIT License
Author : robolectric
@Implementation(minSdk = VERSION_CODES.P)
@HiddenApi
protected int sendMessageToNanoApp(NanoAppMessage message) {
    return ContextHubTransaction.RESULT_SUCCESS;
}

19 View Complete Implementation : ShadowContextHubClient.java
Copyright MIT License
Author : robolectric
@Implementation(minSdk = VERSION_CODES.P)
@HiddenApi
protected void close() {
}

19 View Complete Implementation : ShadowMotionEvent.java
Copyright MIT License
Author : robolectric
@Implementation(minSdk = LOLLIPOP)
@HiddenApi
protected static float nativeGetXPrecision(long nativePtr) {
    NativeInput.MotionEvent event = getNativeMotionEvent(nativePtr);
    return event.getXPrecision();
}

19 View Complete Implementation : ShadowAppOpsManager.java
Copyright MIT License
Author : robolectric
/**
 * Sets audio restrictions.
 *
 * <p>This method is public for testing, as the original method is {@code @hide}.
 */
@Implementation(minSdk = LOLLIPOP)
@HiddenApi
public void setRestriction(int code, @AttributeUsage int usage, int mode, String[] exceptionPackages) {
    audioRestrictions.put(getAudioRestrictionKey(code, usage), new ModeAndException(mode, exceptionPackages));
}

19 View Complete Implementation : ShadowSubscriptionManager.java
Copyright MIT License
Author : robolectric
@Implementation(maxSdk = M)
@HiddenApi
protected static int getDefaultSmsSubId() {
    return defaultSmsSubscriptionId;
}

19 View Complete Implementation : ShadowArscAssetManager.java
Copyright MIT License
Author : robolectric
@HiddenApi
@Implementation(maxSdk = KITKAT_WATCH)
protected final int readreplacedetChar(int replacedet) {
    return readreplacedetChar((long) replacedet);
}

19 View Complete Implementation : ShadowParcel.java
Copyright MIT License
Author : robolectric
@HiddenApi
@Implementation(maxSdk = KITKAT_WATCH)
public static int nativeReadInt(int nativePtr) {
    return nativeReadInt((long) nativePtr);
}

19 View Complete Implementation : ShadowDisplayManagerGlobal.java
Copyright MIT License
Author : robolectric
@Implementation(minSdk = P)
@HiddenApi
protected Object getBrightnessConfigurationForUser(int userId) {
    BrightnessConfiguration config = brightnessConfiguration.get(userId);
    if (config != null) {
        return config;
    } else {
        return getDefaultBrightnessConfiguration();
    }
}

19 View Complete Implementation : ShadowTypeface.java
Copyright MIT License
Author : robolectric
@HiddenApi
@Implementation(minSdk = android.os.Build.VERSION_CODES.Q)
public static void initSystemDefaultTypefaces(Object systemFontMap, Object fallbacks, Object aliases) {
}

19 View Complete Implementation : ShadowParcel.java
Copyright MIT License
Author : robolectric
@HiddenApi
@Implementation(maxSdk = KITKAT_WATCH)
public static void nativeUnmarshall(int nativePtr, byte[] data, int offset, int length) {
    nativeUnmarshall((long) nativePtr, data, offset, length);
}

19 View Complete Implementation : ShadowArscAssetManager.java
Copyright MIT License
Author : robolectric
@HiddenApi
@Implementation(maxSdk = KITKAT_WATCH)
protected static int loadThemeAttributeValue(int themeHandle, int ident, TypedValue outValue, boolean resolve) {
    return loadThemeAttributeValue((long) themeHandle, ident, outValue, resolve);
}

19 View Complete Implementation : ShadowMotionEvent.java
Copyright MIT License
Author : robolectric
@Implementation(minSdk = LOLLIPOP)
@HiddenApi
protected static float nativeGetRawAxisValue(long nativePtr, int axis, int pointerIndex, int historyPos) {
    NativeInput.MotionEvent event = getNativeMotionEvent(nativePtr);
    int pointerCount = event.getPointerCount();
    validatePointerIndex(pointerIndex, pointerCount);
    if (historyPos == HISTORY_CURRENT) {
        return event.getRawAxisValue(axis, pointerIndex);
    } else {
        int historySize = event.getHistorySize();
        validateHistoryPos(historyPos, historySize);
        return event.getHistoricalRawAxisValue(axis, pointerIndex, historyPos);
    }
}

19 View Complete Implementation : ShadowParcel.java
Copyright MIT License
Author : robolectric
@HiddenApi
@Implementation(maxSdk = KITKAT_WATCH)
public static void nativeDestroy(int nativePtr) {
    nativeDestroy((long) nativePtr);
}

19 View Complete Implementation : ShadowContentProviderOperation.java
Copyright MIT License
Author : robolectric
@HiddenApi
@Implementation
public int getType() {
    return getFieldReflectively("mType", Integer.clreplaced);
}

19 View Complete Implementation : ShadowPausedSystemClock.java
Copyright MIT License
Author : robolectric
@Implementation(minSdk = P)
@HiddenApi
protected static long currentNetworkTimeMillis() {
    if (networkTimeAvailable) {
        return currentTimeMillis;
    } else {
        throw new DateTimeException("Network time not available");
    }
}

19 View Complete Implementation : ShadowActivityManager.java
Copyright MIT License
Author : robolectric
@Implementation(minSdk = JELLY_BEAN_MR1)
@HiddenApi
@RequiresPermission(anyOf = { "android.permission.INTERACT_ACROSS_USERS", "android.permission.INTERACT_ACROSS_USERS_FULL" })
protected static int getCurrentUser() {
    return UserHandle.myUserId();
}

19 View Complete Implementation : ShadowParcel.java
Copyright MIT License
Author : robolectric
@HiddenApi
@Implementation(maxSdk = KITKAT_WATCH)
public static void nativeSetDataPosition(int nativePtr, int pos) {
    nativeSetDataPosition((long) nativePtr, pos);
}

19 View Complete Implementation : ShadowDisplayManager.java
Copyright MIT License
Author : robolectric
@Implementation(minSdk = P)
@HiddenApi
protected void setBrightnessConfigurationForUser(Object config, int userId, String packageName) {
    getShadowDisplayManagerGlobal().setBrightnessConfigurationForUser(config, userId, packageName);
}

19 View Complete Implementation : ShadowTelecomManager.java
Copyright MIT License
Author : robolectric
@Implementation
@HiddenApi
public boolean isRinging() {
    for (IncomingCallRecord callRecord : incomingCalls) {
        if (callRecord.isRinging) {
            return true;
        }
    }
    for (UnknownCallRecord callRecord : unknownCalls) {
        if (callRecord.isRinging) {
            return true;
        }
    }
    return false;
}

19 View Complete Implementation : ShadowMotionEvent.java
Copyright MIT License
Author : robolectric
@Implementation(maxSdk = KITKAT_WATCH)
@HiddenApi
protected static float nativeGetYOffset(int nativePtr) {
    return nativeGetYOffset((long) nativePtr);
}

19 View Complete Implementation : ShadowDisplayManager.java
Copyright MIT License
Author : robolectric
@Implementation(minSdk = P)
@HiddenApi
protected void setBrightnessConfiguration(Object config) {
    setBrightnessConfigurationForUser(config, 0, context.getPackageName());
}

19 View Complete Implementation : ShadowParcel.java
Copyright MIT License
Author : robolectric
@HiddenApi
@Implementation(maxSdk = KITKAT_WATCH)
public static void nativeWriteFloat(int nativePtr, float val) {
    nativeWriteFloat((long) nativePtr, val);
}

19 View Complete Implementation : ShadowActivity.java
Copyright MIT License
Author : robolectric
/**
 * Allow setting of Parent fragmentActivity (for unit testing purposes only)
 *
 * @param parent Parent fragmentActivity to set on this fragmentActivity
 */
@HiddenApi
@Implementation
public void setParent(Activity parent) {
    this.parent = parent;
}

19 View Complete Implementation : ShadowMotionEvent.java
Copyright MIT License
Author : robolectric
@Implementation(minSdk = LOLLIPOP)
@HiddenApi
protected static int nativeGetMetaState(long nativePtr) {
    NativeInput.MotionEvent event = getNativeMotionEvent(nativePtr);
    return event.getMetaState();
}

19 View Complete Implementation : ShadowMotionEvent.java
Copyright MIT License
Author : robolectric
@Implementation(maxSdk = KITKAT_WATCH)
@HiddenApi
protected static float nativeGetAxisValue(int nativePtr, int axis, int pointerIndex, int historyPos) {
    return nativeGetAxisValue((long) nativePtr, axis, pointerIndex, historyPos);
}

19 View Complete Implementation : ShadowMotionEvent.java
Copyright MIT License
Author : robolectric
@Implementation(maxSdk = KITKAT_WATCH)
@HiddenApi
protected static int nativeGetEdgeFlags(int nativePtr) {
    return nativeGetEdgeFlags((long) nativePtr);
}

19 View Complete Implementation : ShadowContextHubManager.java
Copyright MIT License
Author : robolectric
/**
 * Provides a list with fake {@link ContextHubInfo}s.
 *
 * <p>{@link ContextHubInfo} describes an optional physical chip on the device. This does not
 * exist in test; this implementation allows to avoid possible NPEs.
 */
@Implementation(minSdk = VERSION_CODES.P)
@HiddenApi
protected List<ContextHubInfo> getContextHubs() {
    return contextHubInfoList;
}

19 View Complete Implementation : ShadowMotionEvent.java
Copyright MIT License
Author : robolectric
@Implementation(minSdk = LOLLIPOP)
@HiddenApi
@SuppressWarnings("robolectric.ShadowReturnTypeMismatch")
protected static void nativeSetSource(long nativePtr, int source) {
    NativeInput.MotionEvent event = getNativeMotionEvent(nativePtr);
    event.setSource(source);
}

19 View Complete Implementation : ShadowParcel.java
Copyright MIT License
Author : robolectric
@HiddenApi
@Implementation(maxSdk = KITKAT_WATCH)
public static float nativeReadFloat(int nativePtr) {
    return nativeReadFloat((long) nativePtr);
}

19 View Complete Implementation : ShadowMotionEvent.java
Copyright MIT License
Author : robolectric
@Implementation(maxSdk = KITKAT_WATCH)
@HiddenApi
protected static long nativeGetDownTimeNanos(int nativePtr) {
    return nativeGetDownTimeNanos((long) nativePtr);
}

19 View Complete Implementation : ShadowMotionEvent.java
Copyright MIT License
Author : robolectric
@Implementation(minSdk = LOLLIPOP)
@HiddenApi
protected static float nativeGetAxisValue(long nativePtr, int axis, int pointerIndex, int historyPos) {
    NativeInput.MotionEvent event = getNativeMotionEvent(nativePtr);
    int pointerCount = event.getPointerCount();
    validatePointerIndex(pointerIndex, pointerCount);
    if (historyPos == HISTORY_CURRENT) {
        return event.getAxisValue(axis, pointerIndex);
    } else {
        int historySize = event.getHistorySize();
        validateHistoryPos(historyPos, historySize);
        return event.getHistoricalAxisValue(axis, pointerIndex, historyPos);
    }
}

19 View Complete Implementation : ShadowMotionEvent.java
Copyright MIT License
Author : robolectric
@Implementation(maxSdk = KITKAT_WATCH)
@HiddenApi
protected static void nativeOffsetLocation(int nativePtr, float deltaX, float deltaY) {
    nativeOffsetLocation((long) nativePtr, deltaX, deltaY);
}

19 View Complete Implementation : ShadowLegacyResourcesImpl.java
Copyright MIT License
Author : robolectric
@HiddenApi
@Implementation
public XmlResourceParser loadXmlResourceParser(String file, int id, int replacedetCookie, String type) throws Resources.NotFoundException {
    return loadXmlResourceParser(id, type);
}

19 View Complete Implementation : ShadowMotionEvent.java
Copyright MIT License
Author : robolectric
@Implementation(maxSdk = KITKAT_WATCH)
@HiddenApi
protected static int nativeGetToolType(int nativePtr, int pointerIndex) {
    return nativeGetToolType((long) nativePtr, pointerIndex);
}

19 View Complete Implementation : ShadowArscAssetManager.java
Copyright MIT License
Author : robolectric
// /*package*/ static final int STYLE_NUM_ENTRIES = 6;
// /*package*/ static final int STYLE_TYPE = 0;
// /*package*/ static final int STYLE_DATA = 1;
// /*package*/ static final int STYLE_replacedET_COOKIE = 2;
// /*package*/ static final int STYLE_RESOURCE_ID = 3;
// 
// /* Offset within typed data array for native changingConfigurations. */
// static final int STYLE_CHANGING_CONFIGURATIONS = 4;
// /*package*/ static final int STYLE_DENSITY = 5;
/* lowercase hexadecimal notation.  */
// # define PRIx8		"x"
// # define PRIx16		"x"
// # define PRIx32		"x"
@HiddenApi
@Implementation(maxSdk = KITKAT_WATCH)
protected static void applyStyle(int themeToken, int defStyleAttr, int defStyleRes, int xmlParserToken, int[] attrs, int[] outValues, int[] outIndices) {
    applyStyle((long) themeToken, defStyleAttr, defStyleRes, (long) xmlParserToken, attrs, outValues, outIndices);
}

19 View Complete Implementation : ShadowSubscriptionManager.java
Copyright MIT License
Author : robolectric
/**
 * Returns subscription Ids that were set via {@link #setActiveSubscriptionInfoList}.
 */
@Implementation(minSdk = LOLLIPOP_MR1)
@HiddenApi
protected int[] getActiveSubscriptionIdList() {
    final List<SubscriptionInfo> infos = getActiveSubscriptionInfoList();
    if (infos == null) {
        return new int[0];
    }
    int[] ids = new int[infos.size()];
    for (int i = 0; i < infos.size(); i++) {
        ids[i] = infos.get(i).getSubscriptionId();
    }
    return ids;
}

19 View Complete Implementation : ShadowMotionEvent.java
Copyright MIT License
Author : robolectric
@Implementation(minSdk = LOLLIPOP)
@HiddenApi
protected static long nativeGetEventTimeNanos(long nativePtr, int historyPos) {
    NativeInput.MotionEvent event = getNativeMotionEvent(nativePtr);
    if (historyPos == HISTORY_CURRENT) {
        return event.getEventTime();
    } else {
        int historySize = event.getHistorySize();
        validateHistoryPos(historyPos, historySize);
        return event.getHistoricalEventTime(historyPos);
    }
}

19 View Complete Implementation : ShadowTelecomManager.java
Copyright MIT License
Author : robolectric
@Implementation
@HiddenApi
public int getCallState() {
    return 0;
}

19 View Complete Implementation : ShadowSubscriptionManager.java
Copyright MIT License
Author : robolectric
@Implementation(maxSdk = M)
@HiddenApi
protected static int getDefaultDataSubId() {
    return defaultDataSubscriptionId;
}