code
stringlengths
11
173k
docstring
stringlengths
2
593k
func_name
stringlengths
2
189
language
stringclasses
1 value
repo
stringclasses
844 values
path
stringlengths
11
294
url
stringlengths
60
339
license
stringclasses
4 values
public static String toString(Set<PosixFilePermission> perms) { StringBuilder sb = new StringBuilder(9); writeBits(sb, perms.contains(OWNER_READ), perms.contains(OWNER_WRITE), perms.contains(OWNER_EXECUTE)); writeBits(sb, perms.contains(GROUP_READ), perms.contains(GROUP_WRITE), perms.contains(GROUP_EXECUTE)); writeBits(sb, perms.contains(OTHERS_READ), perms.contains(OTHERS_WRITE), perms.contains(OTHERS_EXECUTE)); return sb.toString(); }
Returns the {@code String} representation of a set of permissions. It is guaranteed that the returned {@code String} can be parsed by the {@link #fromString} method. <p> If the set contains {@code null} or elements that are not of type {@code PosixFilePermission} then these elements are ignored. @param perms the set of permissions @return the string representation of the permission set
PosixFilePermissions::toString
java
Reginer/aosp-android-jar
android-34/src/java/nio/file/attribute/PosixFilePermissions.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/java/nio/file/attribute/PosixFilePermissions.java
MIT
public static Set<PosixFilePermission> fromString(String perms) { if (perms.length() != 9) throw new IllegalArgumentException("Invalid mode"); Set<PosixFilePermission> result = EnumSet.noneOf(PosixFilePermission.class); if (isR(perms.charAt(0))) result.add(OWNER_READ); if (isW(perms.charAt(1))) result.add(OWNER_WRITE); if (isX(perms.charAt(2))) result.add(OWNER_EXECUTE); if (isR(perms.charAt(3))) result.add(GROUP_READ); if (isW(perms.charAt(4))) result.add(GROUP_WRITE); if (isX(perms.charAt(5))) result.add(GROUP_EXECUTE); if (isR(perms.charAt(6))) result.add(OTHERS_READ); if (isW(perms.charAt(7))) result.add(OTHERS_WRITE); if (isX(perms.charAt(8))) result.add(OTHERS_EXECUTE); return result; }
Returns the set of permissions corresponding to a given {@code String} representation. <p> The {@code perms} parameter is a {@code String} representing the permissions. It has 9 characters that are interpreted as three sets of three. The first set refers to the owner's permissions; the next to the group permissions and the last to others. Within each set, the first character is {@code 'r'} to indicate permission to read, the second character is {@code 'w'} to indicate permission to write, and the third character is {@code 'x'} for execute permission. Where a permission is not set then the corresponding character is set to {@code '-'}. <p> <b>Usage Example:</b> Suppose we require the set of permissions that indicate the owner has read, write, and execute permissions, the group has read and execute permissions and others have none. <pre> Set&lt;PosixFilePermission&gt; perms = PosixFilePermissions.fromString("rwxr-x---"); </pre> @param perms string representing a set of permissions @return the resulting set of permissions @throws IllegalArgumentException if the string cannot be converted to a set of permissions @see #toString(Set)
PosixFilePermissions::fromString
java
Reginer/aosp-android-jar
android-34/src/java/nio/file/attribute/PosixFilePermissions.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/java/nio/file/attribute/PosixFilePermissions.java
MIT
public Animation() { ensureInterpolator(); }
Creates a new animation with a duration of 0ms, the default interpolator, with fillBefore set to true and fillAfter set to false
NoImagePreloadHolder::Animation
java
Reginer/aosp-android-jar
android-33/src/android/view/animation/Animation.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/animation/Animation.java
MIT
public Animation(Context context, AttributeSet attrs) { TypedArray a = context.obtainStyledAttributes(attrs, com.android.internal.R.styleable.Animation); setDuration((long) a.getInt(com.android.internal.R.styleable.Animation_duration, 0)); setStartOffset((long) a.getInt(com.android.internal.R.styleable.Animation_startOffset, 0)); setFillEnabled(a.getBoolean(com.android.internal.R.styleable.Animation_fillEnabled, mFillEnabled)); setFillBefore(a.getBoolean(com.android.internal.R.styleable.Animation_fillBefore, mFillBefore)); setFillAfter(a.getBoolean(com.android.internal.R.styleable.Animation_fillAfter, mFillAfter)); setRepeatCount(a.getInt(com.android.internal.R.styleable.Animation_repeatCount, mRepeatCount)); setRepeatMode(a.getInt(com.android.internal.R.styleable.Animation_repeatMode, RESTART)); setZAdjustment(a.getInt(com.android.internal.R.styleable.Animation_zAdjustment, ZORDER_NORMAL)); setBackdropColor(a.getInt(com.android.internal.R.styleable.Animation_backdropColor, 0)); setDetachWallpaper( a.getBoolean(com.android.internal.R.styleable.Animation_detachWallpaper, false)); setShowWallpaper( a.getBoolean(com.android.internal.R.styleable.Animation_showWallpaper, false)); setHasRoundedCorners( a.getBoolean(com.android.internal.R.styleable.Animation_hasRoundedCorners, false)); setShowBackdrop( a.getBoolean(com.android.internal.R.styleable.Animation_showBackdrop, false)); final int resID = a.getResourceId(com.android.internal.R.styleable.Animation_interpolator, 0); a.recycle(); if (resID > 0) { setInterpolator(context, resID); } ensureInterpolator(); }
Creates a new animation whose parameters come from the specified context and attributes set. @param context the application environment @param attrs the set of attributes holding the animation parameters
NoImagePreloadHolder::Animation
java
Reginer/aosp-android-jar
android-33/src/android/view/animation/Animation.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/animation/Animation.java
MIT
public void reset() { mPreviousRegion.setEmpty(); mPreviousTransformation.clear(); mInitialized = false; mCycleFlip = false; mRepeated = 0; mMore = true; mOneMoreTime = true; mListenerHandler = null; }
Reset the initialization state of this animation. @see #initialize(int, int, int, int)
NoImagePreloadHolder::reset
java
Reginer/aosp-android-jar
android-33/src/android/view/animation/Animation.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/animation/Animation.java
MIT
public void cancel() { if (mStarted && !mEnded) { fireAnimationEnd(); mEnded = true; guard.close(); } // Make sure we move the animation to the end mStartTime = Long.MIN_VALUE; mMore = mOneMoreTime = false; }
Cancel the animation. Cancelling an animation invokes the animation listener, if set, to notify the end of the animation. If you cancel an animation manually, you must call {@link #reset()} before starting the animation again. @see #reset() @see #start() @see #startNow()
NoImagePreloadHolder::cancel
java
Reginer/aosp-android-jar
android-33/src/android/view/animation/Animation.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/animation/Animation.java
MIT
public boolean isInitialized() { return mInitialized; }
Whether or not the animation has been initialized. @return Has this animation been initialized. @see #initialize(int, int, int, int)
NoImagePreloadHolder::isInitialized
java
Reginer/aosp-android-jar
android-33/src/android/view/animation/Animation.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/animation/Animation.java
MIT
public void initialize(int width, int height, int parentWidth, int parentHeight) { reset(); mInitialized = true; }
Initialize this animation with the dimensions of the object being animated as well as the objects parents. (This is to support animation sizes being specified relative to these dimensions.) <p>Objects that interpret Animations should call this method when the sizes of the object being animated and its parent are known, and before calling {@link #getTransformation}. @param width Width of the object being animated @param height Height of the object being animated @param parentWidth Width of the animated object's parent @param parentHeight Height of the animated object's parent
NoImagePreloadHolder::initialize
java
Reginer/aosp-android-jar
android-33/src/android/view/animation/Animation.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/animation/Animation.java
MIT
public void setListenerHandler(Handler handler) { if (mListenerHandler == null) { mOnStart = new Runnable() { public void run() { dispatchAnimationStart(); } }; mOnRepeat = new Runnable() { public void run() { dispatchAnimationRepeat(); } }; mOnEnd = new Runnable() { public void run() { dispatchAnimationEnd(); } }; } mListenerHandler = handler; }
Sets the handler used to invoke listeners. @hide
NoImagePreloadHolder::setListenerHandler
java
Reginer/aosp-android-jar
android-33/src/android/view/animation/Animation.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/animation/Animation.java
MIT
public void setInterpolator(Context context, @AnimRes @InterpolatorRes int resID) { setInterpolator(AnimationUtils.loadInterpolator(context, resID)); }
Sets the acceleration curve for this animation. The interpolator is loaded as a resource from the specified context. @param context The application environment @param resID The resource identifier of the interpolator to load @attr ref android.R.styleable#Animation_interpolator
NoImagePreloadHolder::setInterpolator
java
Reginer/aosp-android-jar
android-33/src/android/view/animation/Animation.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/animation/Animation.java
MIT
public void setInterpolator(Interpolator i) { mInterpolator = i; }
Sets the acceleration curve for this animation. Defaults to a linear interpolation. @param i The interpolator which defines the acceleration curve @attr ref android.R.styleable#Animation_interpolator
NoImagePreloadHolder::setInterpolator
java
Reginer/aosp-android-jar
android-33/src/android/view/animation/Animation.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/animation/Animation.java
MIT
public void setStartOffset(long startOffset) { mStartOffset = startOffset; }
When this animation should start relative to the start time. This is most useful when composing complex animations using an {@link AnimationSet } where some of the animations components start at different times. @param startOffset When this Animation should start, in milliseconds from the start time of the root AnimationSet. @attr ref android.R.styleable#Animation_startOffset
NoImagePreloadHolder::setStartOffset
java
Reginer/aosp-android-jar
android-33/src/android/view/animation/Animation.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/animation/Animation.java
MIT
public void setDuration(long durationMillis) { if (durationMillis < 0) { throw new IllegalArgumentException("Animation duration cannot be negative"); } mDuration = durationMillis; }
How long this animation should last. The duration cannot be negative. @param durationMillis Duration in milliseconds @throws java.lang.IllegalArgumentException if the duration is < 0 @attr ref android.R.styleable#Animation_duration
NoImagePreloadHolder::setDuration
java
Reginer/aosp-android-jar
android-33/src/android/view/animation/Animation.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/animation/Animation.java
MIT
public void restrictDuration(long durationMillis) { // If we start after the duration, then we just won't run. if (mStartOffset > durationMillis) { mStartOffset = durationMillis; mDuration = 0; mRepeatCount = 0; return; } long dur = mDuration + mStartOffset; if (dur > durationMillis) { mDuration = durationMillis-mStartOffset; dur = durationMillis; } // If the duration is 0 or less, then we won't run. if (mDuration <= 0) { mDuration = 0; mRepeatCount = 0; return; } // Reduce the number of repeats to keep below the maximum duration. // The comparison between mRepeatCount and duration is to catch // overflows after multiplying them. if (mRepeatCount < 0 || mRepeatCount > durationMillis || (dur*mRepeatCount) > durationMillis) { // Figure out how many times to do the animation. Subtract 1 since // repeat count is the number of times to repeat so 0 runs once. mRepeatCount = (int)(durationMillis/dur) - 1; if (mRepeatCount < 0) { mRepeatCount = 0; } } }
Ensure that the duration that this animation will run is not longer than <var>durationMillis</var>. In addition to adjusting the duration itself, this ensures that the repeat count also will not make it run longer than the given time. @param durationMillis The maximum duration the animation is allowed to run.
NoImagePreloadHolder::restrictDuration
java
Reginer/aosp-android-jar
android-33/src/android/view/animation/Animation.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/animation/Animation.java
MIT
public void scaleCurrentDuration(float scale) { mDuration = (long) (mDuration * scale); mStartOffset = (long) (mStartOffset * scale); }
How much to scale the duration by. @param scale The amount to scale the duration.
NoImagePreloadHolder::scaleCurrentDuration
java
Reginer/aosp-android-jar
android-33/src/android/view/animation/Animation.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/animation/Animation.java
MIT
public void setStartTime(long startTimeMillis) { mStartTime = startTimeMillis; mStarted = mEnded = false; mCycleFlip = false; mRepeated = 0; mMore = true; }
When this animation should start. When the start time is set to {@link #START_ON_FIRST_FRAME}, the animation will start the first time {@link #getTransformation(long, Transformation)} is invoked. The time passed to this method should be obtained by calling {@link AnimationUtils#currentAnimationTimeMillis()} instead of {@link System#currentTimeMillis()}. @param startTimeMillis the start time in milliseconds
NoImagePreloadHolder::setStartTime
java
Reginer/aosp-android-jar
android-33/src/android/view/animation/Animation.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/animation/Animation.java
MIT
public void start() { setStartTime(-1); }
Convenience method to start the animation the first time {@link #getTransformation(long, Transformation)} is invoked.
NoImagePreloadHolder::start
java
Reginer/aosp-android-jar
android-33/src/android/view/animation/Animation.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/animation/Animation.java
MIT
public void startNow() { setStartTime(AnimationUtils.currentAnimationTimeMillis()); }
Convenience method to start the animation at the current time in milliseconds.
NoImagePreloadHolder::startNow
java
Reginer/aosp-android-jar
android-33/src/android/view/animation/Animation.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/animation/Animation.java
MIT
public void setRepeatMode(int repeatMode) { mRepeatMode = repeatMode; }
Defines what this animation should do when it reaches the end. This setting is applied only when the repeat count is either greater than 0 or {@link #INFINITE}. Defaults to {@link #RESTART}. @param repeatMode {@link #RESTART} or {@link #REVERSE} @attr ref android.R.styleable#Animation_repeatMode
NoImagePreloadHolder::setRepeatMode
java
Reginer/aosp-android-jar
android-33/src/android/view/animation/Animation.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/animation/Animation.java
MIT
public void setRepeatCount(int repeatCount) { if (repeatCount < 0) { repeatCount = INFINITE; } mRepeatCount = repeatCount; }
Sets how many times the animation should be repeated. If the repeat count is 0, the animation is never repeated. If the repeat count is greater than 0 or {@link #INFINITE}, the repeat mode will be taken into account. The repeat count is 0 by default. @param repeatCount the number of times the animation should be repeated @attr ref android.R.styleable#Animation_repeatCount
NoImagePreloadHolder::setRepeatCount
java
Reginer/aosp-android-jar
android-33/src/android/view/animation/Animation.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/animation/Animation.java
MIT
public boolean isFillEnabled() { return mFillEnabled; }
If fillEnabled is true, this animation will apply the value of fillBefore. @return true if the animation will take fillBefore into account @attr ref android.R.styleable#Animation_fillEnabled
NoImagePreloadHolder::isFillEnabled
java
Reginer/aosp-android-jar
android-33/src/android/view/animation/Animation.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/animation/Animation.java
MIT
public void setFillEnabled(boolean fillEnabled) { mFillEnabled = fillEnabled; }
If fillEnabled is true, the animation will apply the value of fillBefore. Otherwise, fillBefore is ignored and the animation transformation is always applied until the animation ends. @param fillEnabled true if the animation should take the value of fillBefore into account @attr ref android.R.styleable#Animation_fillEnabled @see #setFillBefore(boolean) @see #setFillAfter(boolean)
NoImagePreloadHolder::setFillEnabled
java
Reginer/aosp-android-jar
android-33/src/android/view/animation/Animation.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/animation/Animation.java
MIT
public void setFillBefore(boolean fillBefore) { mFillBefore = fillBefore; }
If fillBefore is true, this animation will apply its transformation before the start time of the animation. Defaults to true if {@link #setFillEnabled(boolean)} is not set to true. Note that this applies when using an {@link android.view.animation.AnimationSet AnimationSet} to chain animations. The transformation is not applied before the AnimationSet itself starts. @param fillBefore true if the animation should apply its transformation before it starts @attr ref android.R.styleable#Animation_fillBefore @see #setFillEnabled(boolean)
NoImagePreloadHolder::setFillBefore
java
Reginer/aosp-android-jar
android-33/src/android/view/animation/Animation.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/animation/Animation.java
MIT
public void setFillAfter(boolean fillAfter) { mFillAfter = fillAfter; }
If fillAfter is true, the transformation that this animation performed will persist when it is finished. Defaults to false if not set. Note that this applies to individual animations and when using an {@link android.view.animation.AnimationSet AnimationSet} to chain animations. @param fillAfter true if the animation should apply its transformation after it ends @attr ref android.R.styleable#Animation_fillAfter @see #setFillEnabled(boolean)
NoImagePreloadHolder::setFillAfter
java
Reginer/aosp-android-jar
android-33/src/android/view/animation/Animation.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/animation/Animation.java
MIT
public void setZAdjustment(int zAdjustment) { mZAdjustment = zAdjustment; }
Set the Z ordering mode to use while running the animation. @param zAdjustment The desired mode, one of {@link #ZORDER_NORMAL}, {@link #ZORDER_TOP}, or {@link #ZORDER_BOTTOM}. @attr ref android.R.styleable#Animation_zAdjustment
NoImagePreloadHolder::setZAdjustment
java
Reginer/aosp-android-jar
android-33/src/android/view/animation/Animation.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/animation/Animation.java
MIT
protected float getScaleFactor() { return mScaleFactor; }
The scale factor is set by the call to <code>getTransformation</code>. Overrides of {@link #getTransformation(long, Transformation, float)} will get this value directly. Overrides of {@link #applyTransformation(float, Transformation)} can call this method to get the value. @return float The scale factor that should be applied to pre-scaled values in an Animation such as the pivot points in {@link ScaleAnimation} and {@link RotateAnimation}.
NoImagePreloadHolder::getScaleFactor
java
Reginer/aosp-android-jar
android-33/src/android/view/animation/Animation.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/animation/Animation.java
MIT
public void setShowWallpaper(boolean showWallpaper) { mShowWallpaper = showWallpaper; }
If this animation is run as a window animation, this will make the wallpaper visible behind the animation. @param showWallpaper Whether the wallpaper should be shown during the animation. @attr ref android.R.styleable#Animation_detachWallpaper @hide
NoImagePreloadHolder::setShowWallpaper
java
Reginer/aosp-android-jar
android-33/src/android/view/animation/Animation.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/animation/Animation.java
MIT
public void setHasRoundedCorners(boolean hasRoundedCorners) { mHasRoundedCorners = hasRoundedCorners; }
If this is a window animation, the window will have rounded corners matching the display corner radius. @param hasRoundedCorners Whether the window should have rounded corners or not. @attr ref android.R.styleable#Animation_hasRoundedCorners @see com.android.internal.policy.ScreenDecorationsUtils#getWindowCornerRadius(Resources) @hide
NoImagePreloadHolder::setHasRoundedCorners
java
Reginer/aosp-android-jar
android-33/src/android/view/animation/Animation.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/animation/Animation.java
MIT
public void setShowBackdrop(boolean showBackdrop) { mShowBackdrop = showBackdrop; }
If showBackdrop is {@code true} and this animation is applied on a window, then the windows in the animation will animate with the background associated with this window behind them. If no backdrop color is explicitly set, the backdrop's color comes from the {@link android.R.styleable#Theme_colorBackground} that is applied to this window through its theme. If multiple animating windows have showBackdrop set to {@code true} during an animation, the top most window with showBackdrop set to {@code true} and a valid background color takes precedence. @param showBackdrop Whether to show a background behind the windows during the animation. @attr ref android.R.styleable#Animation_showBackdrop
NoImagePreloadHolder::setShowBackdrop
java
Reginer/aosp-android-jar
android-33/src/android/view/animation/Animation.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/animation/Animation.java
MIT
public void setBackdropColor(@ColorInt int backdropColor) { mBackdropColor = backdropColor; }
Set the color to use for the backdrop shown behind the animating windows. Will only show the backdrop if showBackdrop was set to true. See {@link #setShowBackdrop(boolean)}. @param backdropColor The backdrop color. If 0, the backdrop color will not apply. @attr ref android.R.styleable#Animation_backdropColor
NoImagePreloadHolder::setBackdropColor
java
Reginer/aosp-android-jar
android-33/src/android/view/animation/Animation.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/animation/Animation.java
MIT
public Interpolator getInterpolator() { return mInterpolator; }
Gets the acceleration curve type for this animation. @return the {@link Interpolator} associated to this animation @attr ref android.R.styleable#Animation_interpolator
NoImagePreloadHolder::getInterpolator
java
Reginer/aosp-android-jar
android-33/src/android/view/animation/Animation.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/animation/Animation.java
MIT
public long getStartTime() { return mStartTime; }
When this animation should start. If the animation has not startet yet, this method might return {@link #START_ON_FIRST_FRAME}. @return the time in milliseconds when the animation should start or {@link #START_ON_FIRST_FRAME}
NoImagePreloadHolder::getStartTime
java
Reginer/aosp-android-jar
android-33/src/android/view/animation/Animation.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/animation/Animation.java
MIT
public long getDuration() { return mDuration; }
How long this animation should last @return the duration in milliseconds of the animation @attr ref android.R.styleable#Animation_duration
NoImagePreloadHolder::getDuration
java
Reginer/aosp-android-jar
android-33/src/android/view/animation/Animation.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/animation/Animation.java
MIT
public long getStartOffset() { return mStartOffset; }
When this animation should start, relative to StartTime @return the start offset in milliseconds @attr ref android.R.styleable#Animation_startOffset
NoImagePreloadHolder::getStartOffset
java
Reginer/aosp-android-jar
android-33/src/android/view/animation/Animation.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/animation/Animation.java
MIT
public int getRepeatMode() { return mRepeatMode; }
Defines what this animation should do when it reaches the end. @return either one of {@link #REVERSE} or {@link #RESTART} @attr ref android.R.styleable#Animation_repeatMode
NoImagePreloadHolder::getRepeatMode
java
Reginer/aosp-android-jar
android-33/src/android/view/animation/Animation.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/animation/Animation.java
MIT
public int getRepeatCount() { return mRepeatCount; }
Defines how many times the animation should repeat. The default value is 0. @return the number of times the animation should repeat, or {@link #INFINITE} @attr ref android.R.styleable#Animation_repeatCount
NoImagePreloadHolder::getRepeatCount
java
Reginer/aosp-android-jar
android-33/src/android/view/animation/Animation.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/animation/Animation.java
MIT
public boolean getFillBefore() { return mFillBefore; }
If fillBefore is true, this animation will apply its transformation before the start time of the animation. If fillBefore is false and {@link #isFillEnabled() fillEnabled} is true, the transformation will not be applied until the start time of the animation. @return true if the animation applies its transformation before it starts @attr ref android.R.styleable#Animation_fillBefore
NoImagePreloadHolder::getFillBefore
java
Reginer/aosp-android-jar
android-33/src/android/view/animation/Animation.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/animation/Animation.java
MIT
public boolean getFillAfter() { return mFillAfter; }
If fillAfter is true, this animation will apply its transformation after the end time of the animation. @return true if the animation applies its transformation after it ends @attr ref android.R.styleable#Animation_fillAfter
NoImagePreloadHolder::getFillAfter
java
Reginer/aosp-android-jar
android-33/src/android/view/animation/Animation.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/animation/Animation.java
MIT
public int getZAdjustment() { return mZAdjustment; }
Returns the Z ordering mode to use while running the animation as previously set by {@link #setZAdjustment}. @return Returns one of {@link #ZORDER_NORMAL}, {@link #ZORDER_TOP}, or {@link #ZORDER_BOTTOM}. @attr ref android.R.styleable#Animation_zAdjustment
NoImagePreloadHolder::getZAdjustment
java
Reginer/aosp-android-jar
android-33/src/android/view/animation/Animation.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/animation/Animation.java
MIT
public boolean getShowWallpaper() { return mShowWallpaper; }
@return If run as a window animation, returns whether the wallpaper will be shown behind during the animation. @attr ref android.R.styleable#Animation_showWallpaper @hide
NoImagePreloadHolder::getShowWallpaper
java
Reginer/aosp-android-jar
android-33/src/android/view/animation/Animation.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/animation/Animation.java
MIT
public boolean hasRoundedCorners() { return mHasRoundedCorners; }
@return if a window animation should have rounded corners or not. @attr ref android.R.styleable#Animation_hasRoundedCorners @hide
NoImagePreloadHolder::hasRoundedCorners
java
Reginer/aosp-android-jar
android-33/src/android/view/animation/Animation.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/animation/Animation.java
MIT
public boolean hasExtension() { return false; }
@return if a window animation has outsets applied to it. @hide
NoImagePreloadHolder::hasExtension
java
Reginer/aosp-android-jar
android-33/src/android/view/animation/Animation.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/animation/Animation.java
MIT
public boolean getShowBackdrop() { return mShowBackdrop; }
If showBackdrop is {@code true} and this animation is applied on a window, then the windows in the animation will animate with the background associated with this window behind them. If no backdrop color is explicitly set, the backdrop's color comes from the {@link android.R.styleable#Theme_colorBackground} that is applied to this window through its theme. If multiple animating windows have showBackdrop set to {@code true} during an animation, the top most window with showBackdrop set to {@code true} and a valid background color takes precedence. @return if a backdrop should be shown behind the animating windows. @attr ref android.R.styleable#Animation_showBackdrop
NoImagePreloadHolder::getShowBackdrop
java
Reginer/aosp-android-jar
android-33/src/android/view/animation/Animation.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/animation/Animation.java
MIT
public boolean willChangeTransformationMatrix() { // assume we will change the matrix return true; }
<p>Indicates whether or not this animation will affect the transformation matrix. For instance, a fade animation will not affect the matrix whereas a scale animation will.</p> @return true if this animation will change the transformation matrix
NoImagePreloadHolder::willChangeTransformationMatrix
java
Reginer/aosp-android-jar
android-33/src/android/view/animation/Animation.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/animation/Animation.java
MIT
public boolean willChangeBounds() { // assume we will change the bounds return true; }
<p>Indicates whether or not this animation will affect the bounds of the animated view. For instance, a fade animation will not affect the bounds whereas a 200% scale animation will.</p> @return true if this animation will change the view's bounds
NoImagePreloadHolder::willChangeBounds
java
Reginer/aosp-android-jar
android-33/src/android/view/animation/Animation.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/animation/Animation.java
MIT
public void setAnimationListener(AnimationListener listener) { mListener = listener; }
<p>Binds an animation listener to this animation. The animation listener is notified of animation events such as the end of the animation or the repetition of the animation.</p> @param listener the animation listener to be notified
NoImagePreloadHolder::setAnimationListener
java
Reginer/aosp-android-jar
android-33/src/android/view/animation/Animation.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/animation/Animation.java
MIT
protected void ensureInterpolator() { if (mInterpolator == null) { mInterpolator = new AccelerateDecelerateInterpolator(); } }
Gurantees that this animation has an interpolator. Will use a AccelerateDecelerateInterpolator is nothing else was specified.
NoImagePreloadHolder::ensureInterpolator
java
Reginer/aosp-android-jar
android-33/src/android/view/animation/Animation.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/animation/Animation.java
MIT
public long computeDurationHint() { return (getStartOffset() + getDuration()) * (getRepeatCount() + 1); }
Compute a hint at how long the entire animation may last, in milliseconds. Animations can be written to cause themselves to run for a different duration than what is computed here, but generally this should be accurate.
NoImagePreloadHolder::computeDurationHint
java
Reginer/aosp-android-jar
android-33/src/android/view/animation/Animation.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/animation/Animation.java
MIT
public void getTransformationAt(float normalizedTime, Transformation outTransformation) { final float interpolatedTime = mInterpolator.getInterpolation(normalizedTime); applyTransformation(interpolatedTime, outTransformation); }
Gets the transformation to apply a specific point in time. Implementations of this method should always be kept in sync with getTransformation. @param normalizedTime time between 0 and 1 where 0 is the start of the animation and 1 the end. @param outTransformation A transformation object that is provided by the caller and will be filled in by the animation. @hide
NoImagePreloadHolder::getTransformationAt
java
Reginer/aosp-android-jar
android-33/src/android/view/animation/Animation.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/animation/Animation.java
MIT
public boolean getTransformation(long currentTime, Transformation outTransformation) { if (mStartTime == -1) { mStartTime = currentTime; } final long startOffset = getStartOffset(); final long duration = mDuration; float normalizedTime; if (duration != 0) { normalizedTime = ((float) (currentTime - (mStartTime + startOffset))) / (float) duration; } else { // time is a step-change with a zero duration normalizedTime = currentTime < mStartTime ? 0.0f : 1.0f; } final boolean expired = normalizedTime >= 1.0f || isCanceled(); mMore = !expired; if (!mFillEnabled) normalizedTime = Math.max(Math.min(normalizedTime, 1.0f), 0.0f); if ((normalizedTime >= 0.0f || mFillBefore) && (normalizedTime <= 1.0f || mFillAfter)) { if (!mStarted) { fireAnimationStart(); mStarted = true; if (NoImagePreloadHolder.USE_CLOSEGUARD) { guard.open("cancel or detach or getTransformation"); } } if (mFillEnabled) normalizedTime = Math.max(Math.min(normalizedTime, 1.0f), 0.0f); if (mCycleFlip) { normalizedTime = 1.0f - normalizedTime; } getTransformationAt(normalizedTime, outTransformation); } if (expired) { if (mRepeatCount == mRepeated || isCanceled()) { if (!mEnded) { mEnded = true; guard.close(); fireAnimationEnd(); } } else { if (mRepeatCount > 0) { mRepeated++; } if (mRepeatMode == REVERSE) { mCycleFlip = !mCycleFlip; } mStartTime = -1; mMore = true; fireAnimationRepeat(); } } if (!mMore && mOneMoreTime) { mOneMoreTime = false; return true; } return mMore; }
Gets the transformation to apply at a specified point in time. Implementations of this method should always replace the specified Transformation or document they are doing otherwise. @param currentTime Where we are in the animation. This is wall clock time. @param outTransformation A transformation object that is provided by the caller and will be filled in by the animation. @return True if the animation is still running
NoImagePreloadHolder::getTransformation
java
Reginer/aosp-android-jar
android-33/src/android/view/animation/Animation.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/animation/Animation.java
MIT
public boolean getTransformation(long currentTime, Transformation outTransformation, float scale) { mScaleFactor = scale; return getTransformation(currentTime, outTransformation); }
Gets the transformation to apply at a specified point in time. Implementations of this method should always replace the specified Transformation or document they are doing otherwise. @param currentTime Where we are in the animation. This is wall clock time. @param outTransformation A transformation object that is provided by the caller and will be filled in by the animation. @param scale Scaling factor to apply to any inputs to the transform operation, such pivot points being rotated or scaled around. @return True if the animation is still running
NoImagePreloadHolder::getTransformation
java
Reginer/aosp-android-jar
android-33/src/android/view/animation/Animation.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/animation/Animation.java
MIT
public boolean hasStarted() { return mStarted; }
<p>Indicates whether this animation has started or not.</p> @return true if the animation has started, false otherwise
NoImagePreloadHolder::hasStarted
java
Reginer/aosp-android-jar
android-33/src/android/view/animation/Animation.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/animation/Animation.java
MIT
public boolean hasEnded() { return mEnded; }
<p>Indicates whether this animation has ended or not.</p> @return true if the animation has ended, false otherwise
NoImagePreloadHolder::hasEnded
java
Reginer/aosp-android-jar
android-33/src/android/view/animation/Animation.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/animation/Animation.java
MIT
protected void applyTransformation(float interpolatedTime, Transformation t) { }
Helper for getTransformation. Subclasses should implement this to apply their transforms given an interpolation value. Implementations of this method should always replace the specified Transformation or document they are doing otherwise. @param interpolatedTime The value of the normalized time (0.0 to 1.0) after it has been run through the interpolation function. @param t The Transformation object to fill in with the current transforms.
NoImagePreloadHolder::applyTransformation
java
Reginer/aosp-android-jar
android-33/src/android/view/animation/Animation.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/animation/Animation.java
MIT
protected float resolveSize(int type, float value, int size, int parentSize) { switch (type) { case ABSOLUTE: return value; case RELATIVE_TO_SELF: return size * value; case RELATIVE_TO_PARENT: return parentSize * value; default: return value; } }
Convert the information in the description of a size to an actual dimension @param type One of Animation.ABSOLUTE, Animation.RELATIVE_TO_SELF, or Animation.RELATIVE_TO_PARENT. @param value The dimension associated with the type parameter @param size The size of the object being animated @param parentSize The size of the parent of the object being animated @return The dimension to use for the animation
NoImagePreloadHolder::resolveSize
java
Reginer/aosp-android-jar
android-33/src/android/view/animation/Animation.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/animation/Animation.java
MIT
public boolean hasAlpha() { return false; }
Return true if this animation changes the view's alpha property. @hide
NoImagePreloadHolder::hasAlpha
java
Reginer/aosp-android-jar
android-33/src/android/view/animation/Animation.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/animation/Animation.java
MIT
static Description parseValue(TypedValue value, Context context) { Description d = new Description(); if (value == null) { d.type = ABSOLUTE; d.value = 0; } else { if (value.type == TypedValue.TYPE_FRACTION) { d.type = (value.data & TypedValue.COMPLEX_UNIT_MASK) == TypedValue.COMPLEX_UNIT_FRACTION_PARENT ? RELATIVE_TO_PARENT : RELATIVE_TO_SELF; d.value = TypedValue.complexToFloat(value.data); return d; } else if (value.type == TypedValue.TYPE_FLOAT) { d.type = ABSOLUTE; d.value = value.getFloat(); return d; } else if (value.type >= TypedValue.TYPE_FIRST_INT && value.type <= TypedValue.TYPE_LAST_INT) { d.type = ABSOLUTE; d.value = value.data; return d; } else if (value.type == TypedValue.TYPE_DIMENSION) { d.type = ABSOLUTE; d.value = TypedValue.complexToDimension(value.data, context.getResources().getDisplayMetrics()); return d; } } d.type = ABSOLUTE; d.value = 0.0f; return d; }
Size descriptions can appear in four forms: <ol> <li>An absolute size. This is represented by a number.</li> <li>A size relative to the size of the object being animated. This is represented by a number followed by "%".</li> <li>A size relative to the size of the parent of object being animated. This is represented by a number followed by "%p".</li> <li>(Starting from API 32) A complex number.</li> </ol> @param value The typed value to parse @return The parsed version of the description
Description::parseValue
java
Reginer/aosp-android-jar
android-33/src/android/view/animation/Animation.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/animation/Animation.java
MIT
public static float getDisabledAlpha(Context context) { final TypedArray ta = context.obtainStyledAttributes( new int[]{android.R.attr.disabledAlpha}); final float alpha = ta.getFloat(0, 0); ta.recycle(); return alpha; }
Returns android:disabledAlpha value in context
ColorUtil::getDisabledAlpha
java
Reginer/aosp-android-jar
android-33/src/com/android/settingslib/utils/ColorUtil.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/settingslib/utils/ColorUtil.java
MIT
public NoClassDefFoundError() { super(); }
Constructs a <code>NoClassDefFoundError</code> with no detail message.
NoClassDefFoundError::NoClassDefFoundError
java
Reginer/aosp-android-jar
android-32/src/java/lang/NoClassDefFoundError.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/java/lang/NoClassDefFoundError.java
MIT
public NoClassDefFoundError(String s) { super(s); }
Constructs a <code>NoClassDefFoundError</code> with the specified detail message. @param s the detail message.
NoClassDefFoundError::NoClassDefFoundError
java
Reginer/aosp-android-jar
android-32/src/java/lang/NoClassDefFoundError.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/java/lang/NoClassDefFoundError.java
MIT
private NoClassDefFoundError(String detailMessage, Throwable throwable) { super(detailMessage, throwable); }
Constructs a new {@code NoClassDefFoundError} with the current stack trace, the specified detail message and the specified cause. Used internally by the Android runtime. @param detailMessage the detail message for this error. @param throwable the cause of this error.
NoClassDefFoundError::NoClassDefFoundError
java
Reginer/aosp-android-jar
android-32/src/java/lang/NoClassDefFoundError.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/java/lang/NoClassDefFoundError.java
MIT
public void setListener( @NonNull Executor executor, @NonNull OnRecordStatusChangedListener listener) { synchronized (mListenerLock) { mExecutor = executor; mListener = listener; } }
Digital Video Record (DVR) recorder class which provides record control on Demux's output buffer. @hide @SystemApi public class DvrRecorder implements AutoCloseable { private static final String TAG = "TvTunerRecord"; private long mNativeContext; private OnRecordStatusChangedListener mListener; private Executor mExecutor; private int mUserId; private static int sInstantId = 0; private int mSegmentId = 0; private int mOverflow; private Boolean mIsStopped = true; private final Object mListenerLock = new Object(); private native int nativeAttachFilter(Filter filter); private native int nativeDetachFilter(Filter filter); private native int nativeConfigureDvr(DvrSettings settings); private native int nativeStartDvr(); private native int nativeStopDvr(); private native int nativeFlushDvr(); private native int nativeClose(); private native void nativeSetFileDescriptor(int fd); private native long nativeWrite(long size); private native long nativeWrite(byte[] bytes, long offset, long size); private DvrRecorder() { mUserId = Process.myUid(); mSegmentId = (sInstantId & 0x0000ffff) << 16; sInstantId++; } /** @hide
DvrRecorder::setListener
java
Reginer/aosp-android-jar
android-32/src/android/media/tv/tuner/dvr/DvrRecorder.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/android/media/tv/tuner/dvr/DvrRecorder.java
MIT
public void setFileDescriptor(@NonNull ParcelFileDescriptor fd) { nativeSetFileDescriptor(fd.getFd()); }
Sets file descriptor to write data. <p>When a write operation of the filter object is happening, this method should not be called. @param fd the file descriptor to write data. @see #write(long) @see #write(byte[], long, long)
DvrRecorder::setFileDescriptor
java
Reginer/aosp-android-jar
android-32/src/android/media/tv/tuner/dvr/DvrRecorder.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/android/media/tv/tuner/dvr/DvrRecorder.java
MIT
public final boolean isLoaded() { checkMapped(); if ((address == 0) || (capacity() == 0)) return true; long offset = mappingOffset(); long length = mappingLength(offset); return isLoaded0(mappingAddress(offset), length, Bits.pageCount(length)); }
Tells whether or not this buffer's content is resident in physical memory. <p> A return value of <tt>true</tt> implies that it is highly likely that all of the data in this buffer is resident in physical memory and may therefore be accessed without incurring any virtual-memory page faults or I/O operations. A return value of <tt>false</tt> does not necessarily imply that the buffer's content is not resident in physical memory. <p> The returned value is a hint, rather than a guarantee, because the underlying operating system may have paged out some of the buffer's data by the time that an invocation of this method returns. </p> @return <tt>true</tt> if it is likely that this buffer's content is resident in physical memory
MappedByteBuffer::isLoaded
java
Reginer/aosp-android-jar
android-31/src/java/nio/MappedByteBuffer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/java/nio/MappedByteBuffer.java
MIT
public final MappedByteBuffer load() { checkMapped(); if ((address == 0) || (capacity() == 0)) return this; long offset = mappingOffset(); long length = mappingLength(offset); load0(mappingAddress(offset), length); // Read a byte from each page to bring it into memory. A checksum // is computed as we go along to prevent the compiler from otherwise // considering the loop as dead code. Unsafe unsafe = Unsafe.getUnsafe(); int ps = Bits.pageSize(); int count = Bits.pageCount(length); long a = mappingAddress(offset); byte x = 0; for (int i=0; i<count; i++) { x ^= unsafe.getByte(a); a += ps; } if (unused != 0) unused = x; return this; }
Loads this buffer's content into physical memory. <p> This method makes a best effort to ensure that, when it returns, this buffer's content is resident in physical memory. Invoking this method may cause some number of page faults and I/O operations to occur. </p> @return This buffer
MappedByteBuffer::load
java
Reginer/aosp-android-jar
android-31/src/java/nio/MappedByteBuffer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/java/nio/MappedByteBuffer.java
MIT
public final MappedByteBuffer force() { checkMapped(); if ((address != 0) && (capacity() != 0)) { long offset = mappingOffset(); force0(fd, mappingAddress(offset), mappingLength(offset)); } return this; }
Forces any changes made to this buffer's content to be written to the storage device containing the mapped file. <p> If the file mapped into this buffer resides on a local storage device then when this method returns it is guaranteed that all changes made to the buffer since it was created, or since this method was last invoked, will have been written to that device. <p> If the file does not reside on a local device then no such guarantee is made. <p> If this buffer was not mapped in read/write mode ({@link java.nio.channels.FileChannel.MapMode#READ_WRITE}) then invoking this method has no effect. </p> @return This buffer
MappedByteBuffer::force
java
Reginer/aosp-android-jar
android-31/src/java/nio/MappedByteBuffer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/java/nio/MappedByteBuffer.java
MIT
public static IncrementalFileStorages initialize(Context context, @NonNull File stageDir, @Nullable File inheritedDir, @NonNull DataLoaderParams dataLoaderParams, @Nullable IDataLoaderStatusListener statusListener, @Nullable StorageHealthCheckParams healthCheckParams, @Nullable IStorageHealthListener healthListener, @NonNull List<InstallationFileParcel> addedFiles, @NonNull PerUidReadTimeouts[] perUidReadTimeouts, @Nullable IPackageLoadingProgressCallback progressCallback) throws IOException { IncrementalManager incrementalManager = (IncrementalManager) context.getSystemService( Context.INCREMENTAL_SERVICE); if (incrementalManager == null) { throw new IOException("Failed to obtain incrementalManager."); } final IncrementalFileStorages result = new IncrementalFileStorages(stageDir, inheritedDir, incrementalManager, dataLoaderParams); for (InstallationFileParcel file : addedFiles) { if (file.location == LOCATION_DATA_APP) { try { result.addApkFile(file); } catch (IOException e) { throw new IOException( "Failed to add file to IncFS: " + file.name + ", reason: ", e); } } else { throw new IOException("Unknown file location: " + file.location); } } // Register progress loading callback after files have been added if (progressCallback != null) { incrementalManager.registerLoadingProgressCallback(stageDir.getAbsolutePath(), progressCallback); } result.startLoading(dataLoaderParams, statusListener, healthCheckParams, healthListener, perUidReadTimeouts); return result; }
Set up files and directories used in an installation session. Only used by Incremental. All the files will be created in defaultStorage. @throws IllegalStateException the session is not an Incremental installation session. @throws IOException if fails to setup files or directories.
IncrementalFileStorages::initialize
java
Reginer/aosp-android-jar
android-32/src/android/os/incremental/IncrementalFileStorages.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/android/os/incremental/IncrementalFileStorages.java
MIT
public void startLoading( @NonNull DataLoaderParams dataLoaderParams, @Nullable IDataLoaderStatusListener statusListener, @Nullable StorageHealthCheckParams healthCheckParams, @Nullable IStorageHealthListener healthListener, @NonNull PerUidReadTimeouts[] perUidReadTimeouts) throws IOException { if (!mDefaultStorage.startLoading(dataLoaderParams, statusListener, healthCheckParams, healthListener, perUidReadTimeouts)) { throw new IOException( "Failed to start or restart loading data for Incremental installation."); } }
Starts or re-starts loading of data.
IncrementalFileStorages::startLoading
java
Reginer/aosp-android-jar
android-32/src/android/os/incremental/IncrementalFileStorages.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/android/os/incremental/IncrementalFileStorages.java
MIT
public void makeFile(@NonNull String name, @NonNull byte[] content) throws IOException { mDefaultStorage.makeFile(name, content.length, UUID.randomUUID(), null, null, content); }
Creates file in default storage and sets its content.
IncrementalFileStorages::makeFile
java
Reginer/aosp-android-jar
android-32/src/android/os/incremental/IncrementalFileStorages.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/android/os/incremental/IncrementalFileStorages.java
MIT
public boolean makeLink(@NonNull String relativePath, @NonNull String fromBase, @NonNull String toBase) throws IOException { if (mInheritedStorage == null) { return false; } final File sourcePath = new File(fromBase, relativePath); final File destPath = new File(toBase, relativePath); mInheritedStorage.makeLink(sourcePath.getAbsolutePath(), mDefaultStorage, destPath.getAbsolutePath()); return true; }
Creates a hardlink from inherited storage to default.
IncrementalFileStorages::makeLink
java
Reginer/aosp-android-jar
android-32/src/android/os/incremental/IncrementalFileStorages.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/android/os/incremental/IncrementalFileStorages.java
MIT
public void disallowReadLogs() { mDefaultStorage.disallowReadLogs(); }
Permanently disables readlogs.
IncrementalFileStorages::disallowReadLogs
java
Reginer/aosp-android-jar
android-32/src/android/os/incremental/IncrementalFileStorages.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/android/os/incremental/IncrementalFileStorages.java
MIT
public void cleanUpAndMarkComplete() { IncrementalStorage defaultStorage = cleanUp(); if (defaultStorage != null) { defaultStorage.onInstallationComplete(); } }
Resets the states and unbinds storage instances for an installation session.
IncrementalFileStorages::cleanUpAndMarkComplete
java
Reginer/aosp-android-jar
android-32/src/android/os/incremental/IncrementalFileStorages.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/android/os/incremental/IncrementalFileStorages.java
MIT
public static FloatBuffer allocate(int capacity) { if (capacity < 0) throw new IllegalArgumentException(); return new HeapFloatBuffer(capacity, capacity); }
Allocates a new float buffer. <p> The new buffer's position will be zero, its limit will be its capacity, its mark will be undefined, and each of its elements will be initialized to zero. It will have a {@link #array backing array}, and its {@link #arrayOffset array offset} will be zero. @param capacity The new buffer's capacity, in floats @return The new float buffer @throws IllegalArgumentException If the <tt>capacity</tt> is a negative integer
FloatBuffer::allocate
java
Reginer/aosp-android-jar
android-31/src/java/nio/FloatBuffer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/java/nio/FloatBuffer.java
MIT
public static FloatBuffer wrap(float[] array, int offset, int length) { try { return new HeapFloatBuffer(array, offset, length); } catch (IllegalArgumentException x) { throw new IndexOutOfBoundsException(); } }
Wraps a float array into a buffer. <p> The new buffer will be backed by the given float array; that is, modifications to the buffer will cause the array to be modified and vice versa. The new buffer's capacity will be <tt>array.length</tt>, its position will be <tt>offset</tt>, its limit will be <tt>offset + length</tt>, and its mark will be undefined. Its {@link #array backing array} will be the given array, and its {@link #arrayOffset array offset} will be zero. </p> @param array The array that will back the new buffer @param offset The offset of the subarray to be used; must be non-negative and no larger than <tt>array.length</tt>. The new buffer's position will be set to this value. @param length The length of the subarray to be used; must be non-negative and no larger than <tt>array.length - offset</tt>. The new buffer's limit will be set to <tt>offset + length</tt>. @return The new float buffer @throws IndexOutOfBoundsException If the preconditions on the <tt>offset</tt> and <tt>length</tt> parameters do not hold
FloatBuffer::wrap
java
Reginer/aosp-android-jar
android-31/src/java/nio/FloatBuffer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/java/nio/FloatBuffer.java
MIT
public static FloatBuffer wrap(float[] array) { return wrap(array, 0, array.length); }
Wraps a float array into a buffer. <p> The new buffer will be backed by the given float array; that is, modifications to the buffer will cause the array to be modified and vice versa. The new buffer's capacity and limit will be <tt>array.length</tt>, its position will be zero, and its mark will be undefined. Its {@link #array backing array} will be the given array, and its {@link #arrayOffset array offset>} will be zero. </p> @param array The array that will back this buffer @return The new float buffer
FloatBuffer::wrap
java
Reginer/aosp-android-jar
android-31/src/java/nio/FloatBuffer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/java/nio/FloatBuffer.java
MIT
public FloatBuffer get(float[] dst, int offset, int length) { checkBounds(offset, length, dst.length); if (length > remaining()) throw new BufferUnderflowException(); int end = offset + length; for (int i = offset; i < end; i++) dst[i] = get(); return this; }
Relative bulk <i>get</i> method. <p> This method transfers floats from this buffer into the given destination array. If there are fewer floats remaining in the buffer than are required to satisfy the request, that is, if <tt>length</tt>&nbsp;<tt>&gt;</tt>&nbsp;<tt>remaining()</tt>, then no floats are transferred and a {@link BufferUnderflowException} is thrown. <p> Otherwise, this method copies <tt>length</tt> floats from this buffer into the given array, starting at the current position of this buffer and at the given offset in the array. The position of this buffer is then incremented by <tt>length</tt>. <p> In other words, an invocation of this method of the form <tt>src.get(dst,&nbsp;off,&nbsp;len)</tt> has exactly the same effect as the loop <pre>{@code for (int i = off; i < off + len; i++) dst[i] = src.get(); }</pre> except that it first checks that there are sufficient floats in this buffer and it is potentially much more efficient. @param dst The array into which floats are to be written @param offset The offset within the array of the first float to be written; must be non-negative and no larger than <tt>dst.length</tt> @param length The maximum number of floats to be written to the given array; must be non-negative and no larger than <tt>dst.length - offset</tt> @return This buffer @throws BufferUnderflowException If there are fewer than <tt>length</tt> floats remaining in this buffer @throws IndexOutOfBoundsException If the preconditions on the <tt>offset</tt> and <tt>length</tt> parameters do not hold
FloatBuffer::get
java
Reginer/aosp-android-jar
android-31/src/java/nio/FloatBuffer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/java/nio/FloatBuffer.java
MIT
public FloatBuffer get(float[] dst) { return get(dst, 0, dst.length); }
Relative bulk <i>get</i> method. <p> This method transfers floats from this buffer into the given destination array. An invocation of this method of the form <tt>src.get(a)</tt> behaves in exactly the same way as the invocation <pre> src.get(a, 0, a.length) </pre> @param dst The destination array @return This buffer @throws BufferUnderflowException If there are fewer than <tt>length</tt> floats remaining in this buffer
FloatBuffer::get
java
Reginer/aosp-android-jar
android-31/src/java/nio/FloatBuffer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/java/nio/FloatBuffer.java
MIT
public FloatBuffer put(FloatBuffer src) { if (src == this) throw new IllegalArgumentException(); if (isReadOnly()) throw new ReadOnlyBufferException(); int n = src.remaining(); if (n > remaining()) throw new BufferOverflowException(); for (int i = 0; i < n; i++) put(src.get()); return this; }
Relative bulk <i>put</i> method&nbsp;&nbsp;<i>(optional operation)</i>. <p> This method transfers the floats remaining in the given source buffer into this buffer. If there are more floats remaining in the source buffer than in this buffer, that is, if <tt>src.remaining()</tt>&nbsp;<tt>&gt;</tt>&nbsp;<tt>remaining()</tt>, then no floats are transferred and a {@link BufferOverflowException} is thrown. <p> Otherwise, this method copies <i>n</i>&nbsp;=&nbsp;<tt>src.remaining()</tt> floats from the given buffer into this buffer, starting at each buffer's current position. The positions of both buffers are then incremented by <i>n</i>. <p> In other words, an invocation of this method of the form <tt>dst.put(src)</tt> has exactly the same effect as the loop <pre> while (src.hasRemaining()) dst.put(src.get()); </pre> except that it first checks that there is sufficient space in this buffer and it is potentially much more efficient. @param src The source buffer from which floats are to be read; must not be this buffer @return This buffer @throws BufferOverflowException If there is insufficient space in this buffer for the remaining floats in the source buffer @throws IllegalArgumentException If the source buffer is this buffer @throws ReadOnlyBufferException If this buffer is read-only
FloatBuffer::put
java
Reginer/aosp-android-jar
android-31/src/java/nio/FloatBuffer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/java/nio/FloatBuffer.java
MIT
public FloatBuffer put(float[] src, int offset, int length) { checkBounds(offset, length, src.length); if (length > remaining()) throw new BufferOverflowException(); int end = offset + length; for (int i = offset; i < end; i++) this.put(src[i]); return this; }
Relative bulk <i>put</i> method&nbsp;&nbsp;<i>(optional operation)</i>. <p> This method transfers floats into this buffer from the given source array. If there are more floats to be copied from the array than remain in this buffer, that is, if <tt>length</tt>&nbsp;<tt>&gt;</tt>&nbsp;<tt>remaining()</tt>, then no floats are transferred and a {@link BufferOverflowException} is thrown. <p> Otherwise, this method copies <tt>length</tt> floats from the given array into this buffer, starting at the given offset in the array and at the current position of this buffer. The position of this buffer is then incremented by <tt>length</tt>. <p> In other words, an invocation of this method of the form <tt>dst.put(src,&nbsp;off,&nbsp;len)</tt> has exactly the same effect as the loop <pre>{@code for (int i = off; i < off + len; i++) dst.put(a[i]); }</pre> except that it first checks that there is sufficient space in this buffer and it is potentially much more efficient. @param src The array from which floats are to be read @param offset The offset within the array of the first float to be read; must be non-negative and no larger than <tt>array.length</tt> @param length The number of floats to be read from the given array; must be non-negative and no larger than <tt>array.length - offset</tt> @return This buffer @throws BufferOverflowException If there is insufficient space in this buffer @throws IndexOutOfBoundsException If the preconditions on the <tt>offset</tt> and <tt>length</tt> parameters do not hold @throws ReadOnlyBufferException If this buffer is read-only
FloatBuffer::put
java
Reginer/aosp-android-jar
android-31/src/java/nio/FloatBuffer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/java/nio/FloatBuffer.java
MIT
public final FloatBuffer put(float[] src) { return put(src, 0, src.length); }
Relative bulk <i>put</i> method&nbsp;&nbsp;<i>(optional operation)</i>. <p> This method transfers the entire content of the given source float array into this buffer. An invocation of this method of the form <tt>dst.put(a)</tt> behaves in exactly the same way as the invocation <pre> dst.put(a, 0, a.length) </pre> @param src The source array @return This buffer @throws BufferOverflowException If there is insufficient space in this buffer @throws ReadOnlyBufferException If this buffer is read-only
FloatBuffer::put
java
Reginer/aosp-android-jar
android-31/src/java/nio/FloatBuffer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/java/nio/FloatBuffer.java
MIT
public final boolean hasArray() { return (hb != null) && !isReadOnly; }
Tells whether or not this buffer is backed by an accessible float array. <p> If this method returns <tt>true</tt> then the {@link #array() array} and {@link #arrayOffset() arrayOffset} methods may safely be invoked. </p> @return <tt>true</tt> if, and only if, this buffer is backed by an array and is not read-only
FloatBuffer::hasArray
java
Reginer/aosp-android-jar
android-31/src/java/nio/FloatBuffer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/java/nio/FloatBuffer.java
MIT
public final float[] array() { if (hb == null) throw new UnsupportedOperationException(); if (isReadOnly) throw new ReadOnlyBufferException(); return hb; }
Returns the float array that backs this buffer&nbsp;&nbsp;<i>(optional operation)</i>. <p> Modifications to this buffer's content will cause the returned array's content to be modified, and vice versa. <p> Invoke the {@link #hasArray hasArray} method before invoking this method in order to ensure that this buffer has an accessible backing array. </p> @return The array that backs this buffer @throws ReadOnlyBufferException If this buffer is backed by an array but is read-only @throws UnsupportedOperationException If this buffer is not backed by an accessible array
FloatBuffer::array
java
Reginer/aosp-android-jar
android-31/src/java/nio/FloatBuffer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/java/nio/FloatBuffer.java
MIT
public final int arrayOffset() { if (hb == null) throw new UnsupportedOperationException(); if (isReadOnly) throw new ReadOnlyBufferException(); return offset; }
Returns the offset within this buffer's backing array of the first element of the buffer&nbsp;&nbsp;<i>(optional operation)</i>. <p> If this buffer is backed by an array then buffer position <i>p</i> corresponds to array index <i>p</i>&nbsp;+&nbsp;<tt>arrayOffset()</tt>. <p> Invoke the {@link #hasArray hasArray} method before invoking this method in order to ensure that this buffer has an accessible backing array. </p> @return The offset within this buffer's array of the first element of the buffer @throws ReadOnlyBufferException If this buffer is backed by an array but is read-only @throws UnsupportedOperationException If this buffer is not backed by an accessible array
FloatBuffer::arrayOffset
java
Reginer/aosp-android-jar
android-31/src/java/nio/FloatBuffer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/java/nio/FloatBuffer.java
MIT
public String toString() { StringBuffer sb = new StringBuffer(); sb.append(getClass().getName()); sb.append("[pos="); sb.append(position()); sb.append(" lim="); sb.append(limit()); sb.append(" cap="); sb.append(capacity()); sb.append("]"); return sb.toString(); }
Returns a string summarizing the state of this buffer. @return A summary string
presentAfter::toString
java
Reginer/aosp-android-jar
android-31/src/java/nio/FloatBuffer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/java/nio/FloatBuffer.java
MIT
public int hashCode() { int h = 1; int p = position(); for (int i = limit() - 1; i >= p; i--) h = 31 * h + (int) get(i); return h; }
Returns the current hash code of this buffer. <p> The hash code of a float buffer depends only upon its remaining elements; that is, upon the elements from <tt>position()</tt> up to, and including, the element at <tt>limit()</tt>&nbsp;-&nbsp;<tt>1</tt>. <p> Because buffer hash codes are content-dependent, it is inadvisable to use buffers as keys in hash maps or similar data structures unless it is known that their contents will not change. </p> @return The current hash code of this buffer
presentAfter::hashCode
java
Reginer/aosp-android-jar
android-31/src/java/nio/FloatBuffer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/java/nio/FloatBuffer.java
MIT
public boolean equals(Object ob) { if (this == ob) return true; if (!(ob instanceof FloatBuffer)) return false; FloatBuffer that = (FloatBuffer)ob; if (this.remaining() != that.remaining()) return false; int p = this.position(); for (int i = this.limit() - 1, j = that.limit() - 1; i >= p; i--, j--) if (!equals(this.get(i), that.get(j))) return false; return true; }
Tells whether or not this buffer is equal to another object. <p> Two float buffers are equal if, and only if, <ol> <li><p> They have the same element type, </p></li> <li><p> They have the same number of remaining elements, and </p></li> <li><p> The two sequences of remaining elements, considered independently of their starting positions, are pointwise equal. This method considers two float elements {@code a} and {@code b} to be equal if {@code (a == b) || (Float.isNaN(a) && Float.isNaN(b))}. The values {@code -0.0} and {@code +0.0} are considered to be equal, unlike {@link Float#equals(Object)}. </p></li> </ol> <p> A float buffer is not equal to any other type of object. </p> @param ob The object to which this buffer is to be compared @return <tt>true</tt> if, and only if, this buffer is equal to the given object
presentAfter::equals
java
Reginer/aosp-android-jar
android-31/src/java/nio/FloatBuffer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/java/nio/FloatBuffer.java
MIT
public int compareTo(FloatBuffer that) { int n = this.position() + Math.min(this.remaining(), that.remaining()); for (int i = this.position(), j = that.position(); i < n; i++, j++) { int cmp = compare(this.get(i), that.get(j)); if (cmp != 0) return cmp; } return this.remaining() - that.remaining(); }
Compares this buffer to another. <p> Two float buffers are compared by comparing their sequences of remaining elements lexicographically, without regard to the starting position of each sequence within its corresponding buffer. Pairs of {@code float} elements are compared as if by invoking {@link Float#compare(float,float)}, except that {@code -0.0} and {@code 0.0} are considered to be equal. {@code Float.NaN} is considered by this method to be equal to itself and greater than all other {@code float} values (including {@code Float.POSITIVE_INFINITY}). <p> A float buffer is not comparable to any other type of object. @return A negative integer, zero, or a positive integer as this buffer is less than, equal to, or greater than the given buffer
presentAfter::compareTo
java
Reginer/aosp-android-jar
android-31/src/java/nio/FloatBuffer.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/java/nio/FloatBuffer.java
MIT
private void setupWmComponent(Context context) { WMComponent.Builder wmBuilder = mRootComponent.getWMComponentBuilder(); if (!mInitializeComponents || !WMShellConcurrencyModule.enableShellMainThread(context)) { // If running under tests or shell thread is not enabled, we don't need anything special mWMComponent = wmBuilder.build(); return; } // If the shell main thread is enabled, initialize the component on that thread HandlerThread shellThread = WMShellConcurrencyModule.createShellMainThread(); shellThread.start(); // Use an async handler since we don't care about synchronization Handler shellHandler = Handler.createAsync(shellThread.getLooper()); boolean built = shellHandler.runWithScissors(() -> { wmBuilder.setShellMainThread(shellThread); mWMComponent = wmBuilder.build(); }, 5000); if (!built) { Log.w(TAG, "Failed to initialize WMComponent"); throw new RuntimeException(); } }
Sets up {@link #mWMComponent}. On devices where the Shell runs on its own main thread, this will pre-create the thread to ensure that the components are constructed on the same thread, to reduce the likelihood of side effects from running the constructors on a different thread than the rest of the class logic.
SystemUIFactory::setupWmComponent
java
Reginer/aosp-android-jar
android-33/src/com/android/systemui/SystemUIFactory.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/systemui/SystemUIFactory.java
MIT
protected SysUIComponent.Builder prepareSysUIComponentBuilder( SysUIComponent.Builder sysUIBuilder, WMComponent wm) { return sysUIBuilder; }
Prepares the SysUIComponent builder before it is built. @param sysUIBuilder the builder provided by the root component's getSysUIComponent() method @param wm the built WMComponent from the root component's getWMComponent() method
SystemUIFactory::prepareSysUIComponentBuilder
java
Reginer/aosp-android-jar
android-33/src/com/android/systemui/SystemUIFactory.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/systemui/SystemUIFactory.java
MIT
public Map<Class<?>, Provider<CoreStartable>> getStartableComponents() { return mSysUIComponent.getStartables(); }
Returns the list of {@link CoreStartable} components that should be started at startup.
SystemUIFactory::getStartableComponents
java
Reginer/aosp-android-jar
android-33/src/com/android/systemui/SystemUIFactory.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/systemui/SystemUIFactory.java
MIT
public String getVendorComponent(Resources resources) { return resources.getString(R.string.config_systemUIVendorServiceComponent); }
Returns the list of additional system UI components that should be started.
SystemUIFactory::getVendorComponent
java
Reginer/aosp-android-jar
android-33/src/com/android/systemui/SystemUIFactory.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/systemui/SystemUIFactory.java
MIT
public Map<Class<?>, Provider<CoreStartable>> getStartableComponentsPerUser() { return mSysUIComponent.getPerUserStartables(); }
Returns the list of {@link CoreStartable} components that should be started per user.
SystemUIFactory::getStartableComponentsPerUser
java
Reginer/aosp-android-jar
android-33/src/com/android/systemui/SystemUIFactory.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/systemui/SystemUIFactory.java
MIT
public BackGestureTfClassifierProvider createBackGestureTfClassifierProvider( AssetManager am, String modelName) { return new BackGestureTfClassifierProvider(); }
Creates an instance of BackGestureTfClassifierProvider. This method is overridden in vendor specific implementation of Sys UI.
SystemUIFactory::createBackGestureTfClassifierProvider
java
Reginer/aosp-android-jar
android-33/src/com/android/systemui/SystemUIFactory.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/systemui/SystemUIFactory.java
MIT
public long getFirstAtomicBucketMillis() { if (mStartMillis == Long.MAX_VALUE) { return Long.MAX_VALUE; } else { return mStartMillis + mBucketDuration; } }
Return first atomic bucket in this collection, which is more conservative than {@link #mStartMillis}.
NetworkStatsCollection::getFirstAtomicBucketMillis
java
Reginer/aosp-android-jar
android-31/src/com/android/server/net/NetworkStatsCollection.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/net/NetworkStatsCollection.java
MIT
public NetworkStatsHistory getHistory(NetworkTemplate template, SubscriptionPlan augmentPlan, int uid, int set, int tag, int fields, long start, long end, @NetworkStatsAccess.Level int accessLevel, int callerUid) { if (!NetworkStatsAccess.isAccessibleToUser(uid, callerUid, accessLevel)) { throw new SecurityException("Network stats history of uid " + uid + " is forbidden for caller " + callerUid); } // 180 days of history should be enough for anyone; if we end up needing // more, we'll dynamically grow the history object. final int bucketEstimate = (int) MathUtils.constrain(((end - start) / mBucketDuration), 0, (180 * DateUtils.DAY_IN_MILLIS) / mBucketDuration); final NetworkStatsHistory combined = new NetworkStatsHistory( mBucketDuration, bucketEstimate, fields); // shortcut when we know stats will be empty if (start == end) return combined; // Figure out the window of time that we should be augmenting (if any) long augmentStart = SubscriptionPlan.TIME_UNKNOWN; long augmentEnd = (augmentPlan != null) ? augmentPlan.getDataUsageTime() : SubscriptionPlan.TIME_UNKNOWN; // And if augmenting, we might need to collect more data to adjust with long collectStart = start; long collectEnd = end; if (augmentEnd != SubscriptionPlan.TIME_UNKNOWN) { final Iterator<Range<ZonedDateTime>> it = augmentPlan.cycleIterator(); while (it.hasNext()) { final Range<ZonedDateTime> cycle = it.next(); final long cycleStart = cycle.getLower().toInstant().toEpochMilli(); final long cycleEnd = cycle.getUpper().toInstant().toEpochMilli(); if (cycleStart <= augmentEnd && augmentEnd < cycleEnd) { augmentStart = cycleStart; collectStart = Long.min(collectStart, augmentStart); collectEnd = Long.max(collectEnd, augmentEnd); break; } } } if (augmentStart != SubscriptionPlan.TIME_UNKNOWN) { // Shrink augmentation window so we don't risk undercounting. augmentStart = roundUp(augmentStart); augmentEnd = roundDown(augmentEnd); // Grow collection window so we get all the stats needed. collectStart = roundDown(collectStart); collectEnd = roundUp(collectEnd); } for (int i = 0; i < mStats.size(); i++) { final Key key = mStats.keyAt(i); if (key.uid == uid && NetworkStats.setMatches(set, key.set) && key.tag == tag && templateMatches(template, key.ident)) { final NetworkStatsHistory value = mStats.valueAt(i); combined.recordHistory(value, collectStart, collectEnd); } } if (augmentStart != SubscriptionPlan.TIME_UNKNOWN) { final NetworkStatsHistory.Entry entry = combined.getValues( augmentStart, augmentEnd, null); // If we don't have any recorded data for this time period, give // ourselves something to scale with. if (entry.rxBytes == 0 || entry.txBytes == 0) { combined.recordData(augmentStart, augmentEnd, new NetworkStats.Entry(1, 0, 1, 0, 0)); combined.getValues(augmentStart, augmentEnd, entry); } final long rawBytes = entry.rxBytes + entry.txBytes; final long rawRxBytes = entry.rxBytes == 0 ? 1 : entry.rxBytes; final long rawTxBytes = entry.txBytes == 0 ? 1 : entry.txBytes; final long targetBytes = augmentPlan.getDataUsageBytes(); final long targetRxBytes = multiplySafeByRational(targetBytes, rawRxBytes, rawBytes); final long targetTxBytes = multiplySafeByRational(targetBytes, rawTxBytes, rawBytes); // Scale all matching buckets to reach anchor target final long beforeTotal = combined.getTotalBytes(); for (int i = 0; i < combined.size(); i++) { combined.getValues(i, entry); if (entry.bucketStart >= augmentStart && entry.bucketStart + entry.bucketDuration <= augmentEnd) { entry.rxBytes = multiplySafeByRational( targetRxBytes, entry.rxBytes, rawRxBytes); entry.txBytes = multiplySafeByRational( targetTxBytes, entry.txBytes, rawTxBytes); // We purposefully clear out packet counters to indicate // that this data has been augmented. entry.rxPackets = 0; entry.txPackets = 0; combined.setValues(i, entry); } } final long deltaTotal = combined.getTotalBytes() - beforeTotal; if (deltaTotal != 0) { Slog.d(TAG, "Augmented network usage by " + deltaTotal + " bytes"); } // Finally we can slice data as originally requested final NetworkStatsHistory sliced = new NetworkStatsHistory( mBucketDuration, bucketEstimate, fields); sliced.recordHistory(combined, start, end); return sliced; } else { return combined; } }
Combine all {@link NetworkStatsHistory} in this collection which match the requested parameters.
NetworkStatsCollection::getHistory
java
Reginer/aosp-android-jar
android-31/src/com/android/server/net/NetworkStatsCollection.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/net/NetworkStatsCollection.java
MIT
public NetworkStats getSummary(NetworkTemplate template, long start, long end, @NetworkStatsAccess.Level int accessLevel, int callerUid) { final long now = System.currentTimeMillis(); final NetworkStats stats = new NetworkStats(end - start, 24); // shortcut when we know stats will be empty if (start == end) return stats; final NetworkStats.Entry entry = new NetworkStats.Entry(); NetworkStatsHistory.Entry historyEntry = null; for (int i = 0; i < mStats.size(); i++) { final Key key = mStats.keyAt(i); if (templateMatches(template, key.ident) && NetworkStatsAccess.isAccessibleToUser(key.uid, callerUid, accessLevel) && key.set < NetworkStats.SET_DEBUG_START) { final NetworkStatsHistory value = mStats.valueAt(i); historyEntry = value.getValues(start, end, now, historyEntry); entry.iface = IFACE_ALL; entry.uid = key.uid; entry.set = key.set; entry.tag = key.tag; entry.defaultNetwork = key.ident.areAllMembersOnDefaultNetwork() ? DEFAULT_NETWORK_YES : DEFAULT_NETWORK_NO; entry.metered = key.ident.isAnyMemberMetered() ? METERED_YES : METERED_NO; entry.roaming = key.ident.isAnyMemberRoaming() ? ROAMING_YES : ROAMING_NO; entry.rxBytes = historyEntry.rxBytes; entry.rxPackets = historyEntry.rxPackets; entry.txBytes = historyEntry.txBytes; entry.txPackets = historyEntry.txPackets; entry.operations = historyEntry.operations; if (!entry.isEmpty()) { stats.combineValues(entry); } } } return stats; }
Summarize all {@link NetworkStatsHistory} in this collection which match the requested parameters.
NetworkStatsCollection::getSummary
java
Reginer/aosp-android-jar
android-31/src/com/android/server/net/NetworkStatsCollection.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/net/NetworkStatsCollection.java
MIT
public void recordData(NetworkIdentitySet ident, int uid, int set, int tag, long start, long end, NetworkStats.Entry entry) { final NetworkStatsHistory history = findOrCreateHistory(ident, uid, set, tag); history.recordData(start, end, entry); noteRecordedHistory(history.getStart(), history.getEnd(), entry.rxBytes + entry.txBytes); }
Record given {@link android.net.NetworkStats.Entry} into this collection.
NetworkStatsCollection::recordData
java
Reginer/aosp-android-jar
android-31/src/com/android/server/net/NetworkStatsCollection.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/net/NetworkStatsCollection.java
MIT
private void recordHistory(Key key, NetworkStatsHistory history) { if (history.size() == 0) return; noteRecordedHistory(history.getStart(), history.getEnd(), history.getTotalBytes()); NetworkStatsHistory target = mStats.get(key); if (target == null) { target = new NetworkStatsHistory(history.getBucketDuration()); mStats.put(key, target); } target.recordEntireHistory(history); }
Record given {@link NetworkStatsHistory} into this collection.
NetworkStatsCollection::recordHistory
java
Reginer/aosp-android-jar
android-31/src/com/android/server/net/NetworkStatsCollection.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/net/NetworkStatsCollection.java
MIT
public void recordCollection(NetworkStatsCollection another) { for (int i = 0; i < another.mStats.size(); i++) { final Key key = another.mStats.keyAt(i); final NetworkStatsHistory value = another.mStats.valueAt(i); recordHistory(key, value); } }
Record all {@link NetworkStatsHistory} contained in the given collection into this collection.
NetworkStatsCollection::recordCollection
java
Reginer/aosp-android-jar
android-31/src/com/android/server/net/NetworkStatsCollection.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/net/NetworkStatsCollection.java
MIT
public void removeUids(int[] uids) { final ArrayList<Key> knownKeys = Lists.newArrayList(); knownKeys.addAll(mStats.keySet()); // migrate all UID stats into special "removed" bucket for (Key key : knownKeys) { if (ArrayUtils.contains(uids, key.uid)) { // only migrate combined TAG_NONE history if (key.tag == TAG_NONE) { final NetworkStatsHistory uidHistory = mStats.get(key); final NetworkStatsHistory removedHistory = findOrCreateHistory( key.ident, UID_REMOVED, SET_DEFAULT, TAG_NONE); removedHistory.recordEntireHistory(uidHistory); } mStats.remove(key); mDirty = true; } } }
Remove any {@link NetworkStatsHistory} attributed to the requested UID, moving any {@link NetworkStats#TAG_NONE} series to {@link TrafficStats#UID_REMOVED}.
NetworkStatsCollection::removeUids
java
Reginer/aosp-android-jar
android-31/src/com/android/server/net/NetworkStatsCollection.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/net/NetworkStatsCollection.java
MIT