Loading Android.mk +2 −1 Original line number Diff line number Diff line Loading @@ -264,7 +264,8 @@ framework_metalava_docs_LOCAL_DROIDDOC_OPTIONS := \ --hide RequiresPermission \ --hide MissingPermission --hide BroadcastBehavior \ --hide HiddenSuperclass --hide DeprecationMismatch --hide UnavailableSymbol \ --hide SdkConstant --hide HiddenTypeParameter --hide Todo --hide Typo --hide SdkConstant --hide HiddenTypeParameter --hide Todo --hide Typo \ --include-annotation-classes tools/metalava/stub-annotations \ # ==== Public API diff =========================== include $(CLEAR_VARS) Loading cmds/bootanimation/BootAnimation.cpp +48 −1 Original line number Diff line number Diff line Loading @@ -302,6 +302,7 @@ status_t BootAnimation::readyToRun() { mHeight = h; mFlingerSurfaceControl = control; mFlingerSurface = s; mTargetInset = -1; // If the device has encryption turned on or is in process // of being encrypted we show the encrypted boot animation. Loading Loading @@ -942,6 +943,7 @@ bool BootAnimation::playAnimation(const Animation& animation) if (mClockEnabled && mTimeIsAccurate && validClock(part)) { drawClock(animation.clockFont, part.clockPosX, part.clockPosY); } handleViewport(frameDuration); eglSwapBuffers(mDisplay, mSurface); Loading @@ -966,7 +968,7 @@ bool BootAnimation::playAnimation(const Animation& animation) usleep(part.pause * ns2us(frameDuration)); // For infinite parts, we've now played them at least once, so perhaps exit if(exitPending() && !part.count) if(exitPending() && !part.count && mCurrentInset >= mTargetInset) break; } Loading @@ -986,6 +988,51 @@ bool BootAnimation::playAnimation(const Animation& animation) return true; } void BootAnimation::handleViewport(nsecs_t timestep) { if (mShuttingDown || !mFlingerSurfaceControl || mTargetInset == 0) { return; } if (mTargetInset < 0) { // Poll the amount for the top display inset. This will return -1 until persistent properties // have been loaded. mTargetInset = android::base::GetIntProperty("persist.sys.displayinset.top", -1 /* default */, -1 /* min */, mHeight / 2 /* max */); } if (mTargetInset <= 0) { return; } if (mCurrentInset < mTargetInset) { // After the device boots, the inset will effectively be cropped away. We animate this here. float fraction = static_cast<float>(mCurrentInset) / mTargetInset; int interpolatedInset = (cosf((fraction + 1) * M_PI) / 2.0f + 0.5f) * mTargetInset; SurfaceComposerClient::Transaction() .setCrop(mFlingerSurfaceControl, Rect(0, interpolatedInset, mWidth, mHeight)) .apply(); } else { // At the end of the animation, we switch to the viewport that DisplayManager will apply // later. This changes the coordinate system, and means we must move the surface up by // the inset amount. sp<IBinder> dtoken(SurfaceComposerClient::getBuiltInDisplay( ISurfaceComposer::eDisplayIdMain)); Rect layerStackRect(0, 0, mWidth, mHeight - mTargetInset); Rect displayRect(0, mTargetInset, mWidth, mHeight); SurfaceComposerClient::Transaction t; t.setPosition(mFlingerSurfaceControl, 0, -mTargetInset) .setCrop(mFlingerSurfaceControl, Rect(0, mTargetInset, mWidth, mHeight)); t.setDisplayProjection(dtoken, 0 /* orientation */, layerStackRect, displayRect); t.apply(); mTargetInset = mCurrentInset = 0; } int delta = timestep * mTargetInset / ms2ns(200); mCurrentInset += delta; } void BootAnimation::releaseAnimation(Animation* animation) const { for (Vector<Animation::Part>::iterator it = animation->parts.begin(), Loading cmds/bootanimation/BootAnimation.h +4 −0 Original line number Diff line number Diff line Loading @@ -157,11 +157,15 @@ private: void checkExit(); void handleViewport(nsecs_t timestep); sp<SurfaceComposerClient> mSession; AssetManager mAssets; Texture mAndroid[2]; int mWidth; int mHeight; int mCurrentInset; int mTargetInset; bool mUseNpotTextures = false; EGLDisplay mDisplay; EGLDisplay mContext; Loading core/java/android/accessibilityservice/AccessibilityServiceInfo.java +15 −18 Original line number Diff line number Diff line Loading @@ -29,7 +29,6 @@ import android.content.res.Resources; import android.content.res.TypedArray; import android.content.res.XmlResourceParser; import android.hardware.fingerprint.FingerprintManager; import android.os.Build; import android.os.Parcel; import android.os.Parcelable; import android.util.AttributeSet; Loading Loading @@ -189,12 +188,10 @@ public class AccessibilityServiceInfo implements Parcelable { * content and also the accessibility service will receive accessibility events from * them. * <p> * <strong>Note:</strong> For accessibility services targeting API version * {@link Build.VERSION_CODES#JELLY_BEAN} or higher this flag has to be explicitly * set for the system to regard views that are not important for accessibility. For * accessibility services targeting API version lower than * {@link Build.VERSION_CODES#JELLY_BEAN} this flag is ignored and all views are * regarded for accessibility purposes. * <strong>Note:</strong> For accessibility services targeting Android 4.1 (API level 16) or * higher, this flag has to be explicitly set for the system to regard views that are not * important for accessibility. For accessibility services targeting Android 4.0.4 (API level * 15) or lower, this flag is ignored and all views are regarded for accessibility purposes. * </p> * <p> * Usually views not important for accessibility are layout managers that do not Loading @@ -219,19 +216,19 @@ public class AccessibilityServiceInfo implements Parcelable { * flag does not guarantee that the device will not be in touch exploration * mode since there may be another enabled service that requested it. * <p> * For accessibility services targeting API version higher than * {@link Build.VERSION_CODES#JELLY_BEAN_MR1} that want to set * this flag have to declare this capability in their meta-data by setting * the attribute {@link android.R.attr#canRequestTouchExplorationMode * canRequestTouchExplorationMode} to true, otherwise this flag will * For accessibility services targeting Android 4.3 (API level 18) or higher * that want to set this flag have to declare this capability in their * meta-data by setting the attribute * {@link android.R.attr#canRequestTouchExplorationMode * canRequestTouchExplorationMode} to true. Otherwise, this flag will * be ignored. For how to declare the meta-data of a service refer to * {@value AccessibilityService#SERVICE_META_DATA}. * </p> * <p> * Services targeting API version equal to or lower than * {@link Build.VERSION_CODES#JELLY_BEAN_MR1} will work normally, i.e. * the first time they are run, if this flag is specified, a dialog is * shown to the user to confirm enabling explore by touch. * Services targeting Android 4.2.2 (API level 17) or lower will work * normally. In other words, the first time they are run, if this flag is * specified, a dialog is shown to the user to confirm enabling explore by * touch. * </p> * @see android.R.styleable#AccessibilityService_canRequestTouchExplorationMode */ Loading Loading @@ -387,10 +384,10 @@ public class AccessibilityServiceInfo implements Parcelable { public int feedbackType; /** * The timeout after the most recent event of a given type before an * The timeout, in milliseconds, after the most recent event of a given type before an * {@link AccessibilityService} is notified. * <p> * <strong>Can be dynamically set at runtime.</strong>. * <strong>Can be dynamically set at runtime.</strong> * </p> * <p> * <strong>Note:</strong> The event notification timeout is useful to avoid propagating Loading core/java/android/animation/IntEvaluator.java +2 −2 Original line number Diff line number Diff line Loading @@ -24,7 +24,7 @@ public class IntEvaluator implements TypeEvaluator<Integer> { /** * This function returns the result of linearly interpolating the start and end values, with * <code>fraction</code> representing the proportion between the start and end values. The * calculation is a simple parametric calculation: <code>result = x0 + t * (v1 - v0)</code>, * calculation is a simple parametric calculation: <code>result = x0 + t * (x1 - x0)</code>, * where <code>x0</code> is <code>startValue</code>, <code>x1</code> is <code>endValue</code>, * and <code>t</code> is <code>fraction</code>. * Loading Loading
Android.mk +2 −1 Original line number Diff line number Diff line Loading @@ -264,7 +264,8 @@ framework_metalava_docs_LOCAL_DROIDDOC_OPTIONS := \ --hide RequiresPermission \ --hide MissingPermission --hide BroadcastBehavior \ --hide HiddenSuperclass --hide DeprecationMismatch --hide UnavailableSymbol \ --hide SdkConstant --hide HiddenTypeParameter --hide Todo --hide Typo --hide SdkConstant --hide HiddenTypeParameter --hide Todo --hide Typo \ --include-annotation-classes tools/metalava/stub-annotations \ # ==== Public API diff =========================== include $(CLEAR_VARS) Loading
cmds/bootanimation/BootAnimation.cpp +48 −1 Original line number Diff line number Diff line Loading @@ -302,6 +302,7 @@ status_t BootAnimation::readyToRun() { mHeight = h; mFlingerSurfaceControl = control; mFlingerSurface = s; mTargetInset = -1; // If the device has encryption turned on or is in process // of being encrypted we show the encrypted boot animation. Loading Loading @@ -942,6 +943,7 @@ bool BootAnimation::playAnimation(const Animation& animation) if (mClockEnabled && mTimeIsAccurate && validClock(part)) { drawClock(animation.clockFont, part.clockPosX, part.clockPosY); } handleViewport(frameDuration); eglSwapBuffers(mDisplay, mSurface); Loading @@ -966,7 +968,7 @@ bool BootAnimation::playAnimation(const Animation& animation) usleep(part.pause * ns2us(frameDuration)); // For infinite parts, we've now played them at least once, so perhaps exit if(exitPending() && !part.count) if(exitPending() && !part.count && mCurrentInset >= mTargetInset) break; } Loading @@ -986,6 +988,51 @@ bool BootAnimation::playAnimation(const Animation& animation) return true; } void BootAnimation::handleViewport(nsecs_t timestep) { if (mShuttingDown || !mFlingerSurfaceControl || mTargetInset == 0) { return; } if (mTargetInset < 0) { // Poll the amount for the top display inset. This will return -1 until persistent properties // have been loaded. mTargetInset = android::base::GetIntProperty("persist.sys.displayinset.top", -1 /* default */, -1 /* min */, mHeight / 2 /* max */); } if (mTargetInset <= 0) { return; } if (mCurrentInset < mTargetInset) { // After the device boots, the inset will effectively be cropped away. We animate this here. float fraction = static_cast<float>(mCurrentInset) / mTargetInset; int interpolatedInset = (cosf((fraction + 1) * M_PI) / 2.0f + 0.5f) * mTargetInset; SurfaceComposerClient::Transaction() .setCrop(mFlingerSurfaceControl, Rect(0, interpolatedInset, mWidth, mHeight)) .apply(); } else { // At the end of the animation, we switch to the viewport that DisplayManager will apply // later. This changes the coordinate system, and means we must move the surface up by // the inset amount. sp<IBinder> dtoken(SurfaceComposerClient::getBuiltInDisplay( ISurfaceComposer::eDisplayIdMain)); Rect layerStackRect(0, 0, mWidth, mHeight - mTargetInset); Rect displayRect(0, mTargetInset, mWidth, mHeight); SurfaceComposerClient::Transaction t; t.setPosition(mFlingerSurfaceControl, 0, -mTargetInset) .setCrop(mFlingerSurfaceControl, Rect(0, mTargetInset, mWidth, mHeight)); t.setDisplayProjection(dtoken, 0 /* orientation */, layerStackRect, displayRect); t.apply(); mTargetInset = mCurrentInset = 0; } int delta = timestep * mTargetInset / ms2ns(200); mCurrentInset += delta; } void BootAnimation::releaseAnimation(Animation* animation) const { for (Vector<Animation::Part>::iterator it = animation->parts.begin(), Loading
cmds/bootanimation/BootAnimation.h +4 −0 Original line number Diff line number Diff line Loading @@ -157,11 +157,15 @@ private: void checkExit(); void handleViewport(nsecs_t timestep); sp<SurfaceComposerClient> mSession; AssetManager mAssets; Texture mAndroid[2]; int mWidth; int mHeight; int mCurrentInset; int mTargetInset; bool mUseNpotTextures = false; EGLDisplay mDisplay; EGLDisplay mContext; Loading
core/java/android/accessibilityservice/AccessibilityServiceInfo.java +15 −18 Original line number Diff line number Diff line Loading @@ -29,7 +29,6 @@ import android.content.res.Resources; import android.content.res.TypedArray; import android.content.res.XmlResourceParser; import android.hardware.fingerprint.FingerprintManager; import android.os.Build; import android.os.Parcel; import android.os.Parcelable; import android.util.AttributeSet; Loading Loading @@ -189,12 +188,10 @@ public class AccessibilityServiceInfo implements Parcelable { * content and also the accessibility service will receive accessibility events from * them. * <p> * <strong>Note:</strong> For accessibility services targeting API version * {@link Build.VERSION_CODES#JELLY_BEAN} or higher this flag has to be explicitly * set for the system to regard views that are not important for accessibility. For * accessibility services targeting API version lower than * {@link Build.VERSION_CODES#JELLY_BEAN} this flag is ignored and all views are * regarded for accessibility purposes. * <strong>Note:</strong> For accessibility services targeting Android 4.1 (API level 16) or * higher, this flag has to be explicitly set for the system to regard views that are not * important for accessibility. For accessibility services targeting Android 4.0.4 (API level * 15) or lower, this flag is ignored and all views are regarded for accessibility purposes. * </p> * <p> * Usually views not important for accessibility are layout managers that do not Loading @@ -219,19 +216,19 @@ public class AccessibilityServiceInfo implements Parcelable { * flag does not guarantee that the device will not be in touch exploration * mode since there may be another enabled service that requested it. * <p> * For accessibility services targeting API version higher than * {@link Build.VERSION_CODES#JELLY_BEAN_MR1} that want to set * this flag have to declare this capability in their meta-data by setting * the attribute {@link android.R.attr#canRequestTouchExplorationMode * canRequestTouchExplorationMode} to true, otherwise this flag will * For accessibility services targeting Android 4.3 (API level 18) or higher * that want to set this flag have to declare this capability in their * meta-data by setting the attribute * {@link android.R.attr#canRequestTouchExplorationMode * canRequestTouchExplorationMode} to true. Otherwise, this flag will * be ignored. For how to declare the meta-data of a service refer to * {@value AccessibilityService#SERVICE_META_DATA}. * </p> * <p> * Services targeting API version equal to or lower than * {@link Build.VERSION_CODES#JELLY_BEAN_MR1} will work normally, i.e. * the first time they are run, if this flag is specified, a dialog is * shown to the user to confirm enabling explore by touch. * Services targeting Android 4.2.2 (API level 17) or lower will work * normally. In other words, the first time they are run, if this flag is * specified, a dialog is shown to the user to confirm enabling explore by * touch. * </p> * @see android.R.styleable#AccessibilityService_canRequestTouchExplorationMode */ Loading Loading @@ -387,10 +384,10 @@ public class AccessibilityServiceInfo implements Parcelable { public int feedbackType; /** * The timeout after the most recent event of a given type before an * The timeout, in milliseconds, after the most recent event of a given type before an * {@link AccessibilityService} is notified. * <p> * <strong>Can be dynamically set at runtime.</strong>. * <strong>Can be dynamically set at runtime.</strong> * </p> * <p> * <strong>Note:</strong> The event notification timeout is useful to avoid propagating Loading
core/java/android/animation/IntEvaluator.java +2 −2 Original line number Diff line number Diff line Loading @@ -24,7 +24,7 @@ public class IntEvaluator implements TypeEvaluator<Integer> { /** * This function returns the result of linearly interpolating the start and end values, with * <code>fraction</code> representing the proportion between the start and end values. The * calculation is a simple parametric calculation: <code>result = x0 + t * (v1 - v0)</code>, * calculation is a simple parametric calculation: <code>result = x0 + t * (x1 - x0)</code>, * where <code>x0</code> is <code>startValue</code>, <code>x1</code> is <code>endValue</code>, * and <code>t</code> is <code>fraction</code>. * Loading