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

Commit 6dd005b4 authored by Dianne Hackborn's avatar Dianne Hackborn
Browse files

I. Can. Not. Stand. ViewAncestor.

It was done so we would have the name "ViewRoot" available for a
public API.  However, the name "ViewAncestor" just makes no sense.
So instead, change it to ViewRootImpl.

Change-Id: If9599ca67896f339f6fefa7d1dde121201171d97
parent f40aa383
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -70,7 +70,7 @@ import android.view.HardwareRenderer;
import android.view.View;
import android.view.ViewDebug;
import android.view.ViewManager;
import android.view.ViewAncestor;
import android.view.ViewRootImpl;
import android.view.Window;
import android.view.WindowManager;
import android.view.WindowManagerImpl;
@@ -4072,7 +4072,7 @@ public final class ActivityThread {
        sThreadLocal.set(this);
        mSystemThread = system;
        if (!system) {
            ViewAncestor.addFirstDrawHandler(new Runnable() {
            ViewRootImpl.addFirstDrawHandler(new Runnable() {
                public void run() {
                    ensureJitEnabled();
                }
@@ -4102,7 +4102,7 @@ public final class ActivityThread {
            }
        }
        
        ViewAncestor.addConfigCallback(new ComponentCallbacks() {
        ViewRootImpl.addConfigCallback(new ComponentCallbacks() {
            public void onConfigurationChanged(Configuration newConfig) {
                synchronized (mPackages) {
                    // We need to apply this change to the resources
+4 −4
Original line number Diff line number Diff line
@@ -40,7 +40,7 @@ import android.os.RemoteException;
import android.os.ServiceManager;
import android.util.DisplayMetrics;
import android.util.Log;
import android.view.ViewAncestor;
import android.view.ViewRootImpl;

import java.io.FileOutputStream;
import java.io.IOException;
@@ -592,7 +592,7 @@ public class WallpaperManager {
    public void setWallpaperOffsets(IBinder windowToken, float xOffset, float yOffset) {
        try {
            //Log.v(TAG, "Sending new wallpaper offsets from app...");
            ViewAncestor.getWindowSession(mContext.getMainLooper()).setWallpaperPosition(
            ViewRootImpl.getWindowSession(mContext.getMainLooper()).setWallpaperPosition(
                    windowToken, xOffset, yOffset, mWallpaperXStep, mWallpaperYStep);
            //Log.v(TAG, "...app returning after sending offsets!");
        } catch (RemoteException e) {
@@ -630,7 +630,7 @@ public class WallpaperManager {
            int x, int y, int z, Bundle extras) {
        try {
            //Log.v(TAG, "Sending new wallpaper offsets from app...");
            ViewAncestor.getWindowSession(mContext.getMainLooper()).sendWallpaperCommand(
            ViewRootImpl.getWindowSession(mContext.getMainLooper()).sendWallpaperCommand(
                    windowToken, action, x, y, z, extras, false);
            //Log.v(TAG, "...app returning after sending offsets!");
        } catch (RemoteException e) {
@@ -650,7 +650,7 @@ public class WallpaperManager {
     */
    public void clearWallpaperOffsets(IBinder windowToken) {
        try {
            ViewAncestor.getWindowSession(mContext.getMainLooper()).setWallpaperPosition(
            ViewRootImpl.getWindowSession(mContext.getMainLooper()).setWallpaperPosition(
                    windowToken, -1, -1, -1, -1);
        } catch (RemoteException e) {
            // Ignore.
+2 −2
Original line number Diff line number Diff line
@@ -51,7 +51,7 @@ import android.view.MotionEvent;
import android.view.SurfaceHolder;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewAncestor;
import android.view.ViewRootImpl;
import android.view.WindowManager;
import android.view.WindowManagerImpl;
import android.view.WindowManagerPolicy;
@@ -650,7 +650,7 @@ public abstract class WallpaperService extends Service {
            mWindowToken = wrapper.mWindowToken;
            mSurfaceHolder.setSizeFromLayout();
            mInitializing = true;
            mSession = ViewAncestor.getWindowSession(getMainLooper());
            mSession = ViewRootImpl.getWindowSession(getMainLooper());
            
            mWindow.setSession(mSession);
            
+1 −1
Original line number Diff line number Diff line
@@ -426,7 +426,7 @@ public class SurfaceView extends View {
        if (!mHaveFrame) {
            return;
        }
        ViewAncestor viewRoot = (ViewAncestor) getRootView().getParent();
        ViewRootImpl viewRoot = (ViewRootImpl) getRootView().getParent();
        if (viewRoot != null) {
            mTranslator = viewRoot.mTranslator;
        }
+11 −11
Original line number Diff line number Diff line
@@ -5043,9 +5043,9 @@ public class View implements Drawable.Callback2, KeyEvent.Callback, Accessibilit
    }

    /** Gets the ViewAncestor, or null if not attached. */
    /*package*/ ViewAncestor getViewAncestor() {
    /*package*/ ViewRootImpl getViewRootImpl() {
        View root = getRootView();
        return root != null ? (ViewAncestor)root.getParent() : null;
        return root != null ? (ViewRootImpl)root.getParent() : null;
    }

    /**
@@ -5061,7 +5061,7 @@ public class View implements Drawable.Callback2, KeyEvent.Callback, Accessibilit
    public final boolean requestFocusFromTouch() {
        // Leave touch mode if we need to
        if (isInTouchMode()) {
            ViewAncestor viewRoot = getViewAncestor();
            ViewRootImpl viewRoot = getViewRootImpl();
            if (viewRoot != null) {
                viewRoot.ensureTouchMode(false);
            }
@@ -5653,7 +5653,7 @@ public class View implements Drawable.Callback2, KeyEvent.Callback, Accessibilit
        if (mAttachInfo != null) {
            return mAttachInfo.mInTouchMode;
        } else {
            return ViewAncestor.isInTouchMode();
            return ViewRootImpl.isInTouchMode();
        }
    }

@@ -8254,7 +8254,7 @@ public class View implements Drawable.Callback2, KeyEvent.Callback, Accessibilit
            handler = attachInfo.mHandler;
        } else {
            // Assume that post will succeed later
            ViewAncestor.getRunQueue().post(action);
            ViewRootImpl.getRunQueue().post(action);
            return true;
        }

@@ -8284,7 +8284,7 @@ public class View implements Drawable.Callback2, KeyEvent.Callback, Accessibilit
            handler = attachInfo.mHandler;
        } else {
            // Assume that post will succeed later
            ViewAncestor.getRunQueue().postDelayed(action, delayMillis);
            ViewRootImpl.getRunQueue().postDelayed(action, delayMillis);
            return true;
        }

@@ -8308,7 +8308,7 @@ public class View implements Drawable.Callback2, KeyEvent.Callback, Accessibilit
            handler = attachInfo.mHandler;
        } else {
            // Assume that post will succeed later
            ViewAncestor.getRunQueue().removeCallbacks(action);
            ViewRootImpl.getRunQueue().removeCallbacks(action);
            return true;
        }

@@ -11580,9 +11580,9 @@ public class View implements Drawable.Callback2, KeyEvent.Callback, Accessibilit
            viewParent = view.mParent;
        }

        if (viewParent instanceof ViewAncestor) {
        if (viewParent instanceof ViewRootImpl) {
            // *cough*
            final ViewAncestor vr = (ViewAncestor)viewParent;
            final ViewRootImpl vr = (ViewRootImpl)viewParent;
            location[1] -= vr.mCurScrollY;
        }
    }
@@ -12709,7 +12709,7 @@ public class View implements Drawable.Callback2, KeyEvent.Callback, Accessibilit
                    surface.unlockCanvasAndPost(canvas);
                }

                final ViewAncestor root = getViewAncestor();
                final ViewRootImpl root = getViewRootImpl();

                // Cache the local state object for delivery with DragEvents
                root.setLocalDragState(myLocalState);
@@ -13916,7 +13916,7 @@ public class View implements Drawable.Callback2, KeyEvent.Callback, Accessibilit
        Canvas mCanvas;

        /**
         * A Handler supplied by a view's {@link android.view.ViewAncestor}. This
         * A Handler supplied by a view's {@link android.view.ViewRootImpl}. This
         * handler can be used to pump events in the UI events queue.
         */
        final Handler mHandler;
Loading