Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c615c6fc authored by Tor Norbye's avatar Tor Norbye
Browse files

Annotate methods to be called from overrides with @CallSuper

Change-Id: Ibc587c2aaee9f3e7f448079f72a75459fe4e15e7
parent 3aa2d017
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package android.animation;

import android.annotation.CallSuper;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.graphics.Path;
@@ -861,6 +862,7 @@ public final class ObjectAnimator extends ValueAnimator {
     *  <p>Overriders of this method should call the superclass method to cause
     *  internal mechanisms to be set up correctly.</p>
     */
    @CallSuper
    @Override
    void initAnimation() {
        if (!mInitialized) {
@@ -961,6 +963,7 @@ public final class ObjectAnimator extends ValueAnimator {
     *
     * @param fraction The elapsed fraction of the animation.
     */
    @CallSuper
    @Override
    void animateValue(float fraction) {
        final Object target = getTarget();
+3 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package android.animation;

import android.annotation.CallSuper;
import android.os.Looper;
import android.os.Trace;
import android.util.AndroidRuntimeException;
@@ -506,6 +507,7 @@ public class ValueAnimator extends Animator {
     *  <p>Overrides of this method should call the superclass method to ensure
     *  that internal mechanisms for the animation are set up correctly.</p>
     */
    @CallSuper
    void initAnimation() {
        if (!mInitialized) {
            int numValues = mValues.length;
@@ -1375,6 +1377,7 @@ public class ValueAnimator extends Animator {
     *
     * @param fraction The elapsed fraction of the animation.
     */
    @CallSuper
    void animateValue(float fraction) {
        fraction = mInterpolator.getInterpolation(fraction);
        mCurrentFraction = fraction;
+13 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package android.app;

import android.annotation.CallSuper;
import android.annotation.DrawableRes;
import android.annotation.IdRes;
import android.annotation.IntDef;
@@ -921,6 +922,7 @@ public class Activity extends ContextThemeWrapper
     * @see #onRestoreInstanceState
     * @see #onPostCreate
     */
    @CallSuper
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        if (DEBUG_LIFECYCLE) Slog.v(TAG, "onCreate " + this + ": " + savedInstanceState);
        if (mLastNonConfigurationInstances != null) {
@@ -1122,6 +1124,7 @@ public class Activity extends ContextThemeWrapper
     *     recently supplied in {@link #onSaveInstanceState}.  <b><i>Note: Otherwise it is null.</i></b>
     * @see #onCreate
     */
    @CallSuper
    protected void onPostCreate(@Nullable Bundle savedInstanceState) {
        if (!isChild()) {
            mTitleReady = true;
@@ -1159,6 +1162,7 @@ public class Activity extends ContextThemeWrapper
     * @see #onStop
     * @see #onResume
     */
    @CallSuper
    protected void onStart() {
        if (DEBUG_LIFECYCLE) Slog.v(TAG, "onStart " + this);
        mCalled = true;
@@ -1196,6 +1200,7 @@ public class Activity extends ContextThemeWrapper
     * @see #onStart
     * @see #onResume
     */
    @CallSuper
    protected void onRestart() {
        mCalled = true;
    }
@@ -1220,6 +1225,7 @@ public class Activity extends ContextThemeWrapper
     * @see #onPostResume
     * @see #onPause
     */
    @CallSuper
    protected void onResume() {
        if (DEBUG_LIFECYCLE) Slog.v(TAG, "onResume " + this);
        getApplication().dispatchActivityResumed(this);
@@ -1239,6 +1245,7 @@ public class Activity extends ContextThemeWrapper
     *
     * @see #onResume
     */
    @CallSuper
    protected void onPostResume() {
        final Window win = getWindow();
        if (win != null) win.makeActive();
@@ -1464,6 +1471,7 @@ public class Activity extends ContextThemeWrapper
     * @see #onSaveInstanceState
     * @see #onStop
     */
    @CallSuper
    protected void onPause() {
        if (DEBUG_LIFECYCLE) Slog.v(TAG, "onPause " + this);
        getApplication().dispatchActivityPaused(this);
@@ -1570,6 +1578,7 @@ public class Activity extends ContextThemeWrapper
     * @see #onSaveInstanceState
     * @see #onDestroy
     */
    @CallSuper
    protected void onStop() {
        if (DEBUG_LIFECYCLE) Slog.v(TAG, "onStop " + this);
        if (mActionBar != null) mActionBar.setShowHideAnimationEnabled(false);
@@ -1607,6 +1616,7 @@ public class Activity extends ContextThemeWrapper
     * @see #finish
     * @see #isFinishing
     */
    @CallSuper
    protected void onDestroy() {
        if (DEBUG_LIFECYCLE) Slog.v(TAG, "onDestroy " + this);
        mCalled = true;
@@ -5587,6 +5597,7 @@ public class Activity extends ContextThemeWrapper
     * @see #requestVisibleBehind(boolean)
     * @see #onBackgroundVisibleBehindChanged(boolean)
     */
    @CallSuper
    public void onVisibleBehindCanceled() {
        mCalled = true;
    }
@@ -5709,6 +5720,7 @@ public class Activity extends ContextThemeWrapper
     *
     * @param mode The new action mode.
     */
    @CallSuper
    @Override
    public void onActionModeStarted(ActionMode mode) {
    }
@@ -5719,6 +5731,7 @@ public class Activity extends ContextThemeWrapper
     *
     * @param mode The action mode that just finished.
     */
    @CallSuper
    @Override
    public void onActionModeFinished(ActionMode mode) {
    }
+3 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package android.app;

import android.annotation.CallSuper;
import android.annotation.DrawableRes;
import android.annotation.IdRes;
import android.annotation.LayoutRes;
@@ -1010,6 +1011,7 @@ public class Dialog implements DialogInterface, Window.Callback,
     * Note that if you override this method you should always call through
     * to the superclass implementation by calling super.onActionModeStarted(mode).
     */
    @CallSuper
    public void onActionModeStarted(ActionMode mode) {
        mActionMode = mode;
    }
@@ -1020,6 +1022,7 @@ public class Dialog implements DialogInterface, Window.Callback,
     * Note that if you override this method you should always call through
     * to the superclass implementation by calling super.onActionModeFinished(mode).
     */
    @CallSuper
    public void onActionModeFinished(ActionMode mode) {
        if (mode == mActionMode) {
            mActionMode = null;
+2 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package android.preference;


import android.annotation.CallSuper;
import android.annotation.DrawableRes;
import android.annotation.StringRes;
import android.app.AlertDialog;
@@ -360,6 +361,7 @@ public abstract class DialogPreference extends Preference implements
     * 
     * @param view The content View of the dialog, if it is custom.
     */
    @CallSuper
    protected void onBindDialogView(View view) {
        View dialogMessageView = view.findViewById(com.android.internal.R.id.message);
        
Loading