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

Commit 18a4c041 authored by The Android Automerger's avatar The Android Automerger
Browse files

Merge branch 'froyo' into froyo-release

parents 646ef654 71d73a0d
Loading
Loading
Loading
Loading
+41 −0
Original line number Original line Diff line number Diff line
@@ -16,6 +16,7 @@


package android.view;
package android.view;


import android.util.DisplayMetrics;
import com.android.internal.view.BaseIWindow;
import com.android.internal.view.BaseIWindow;


import android.content.Context;
import android.content.Context;
@@ -213,6 +214,46 @@ public class SurfaceView extends View {
        updateWindow(false);
        updateWindow(false);
    }
    }


    /**
     * This method is not intended for general use. It was created
     * temporarily to improve performance of 3D layers in Launcher
     * and should be removed and fixed properly.
     * 
     * Do not call this method. Ever.
     * 
     * @hide
     */
    protected void showSurface() {
        if (mSession != null) {
            updateWindow(true);
        }
    }

    /**
     * This method is not intended for general use. It was created
     * temporarily to improve performance of 3D layers in Launcher
     * and should be removed and fixed properly.
     * 
     * Do not call this method. Ever.
     * 
     * @hide
     */
    protected void hideSurface() {
        if (mSession != null && mWindow != null) {
            mSurfaceLock.lock();
            try {
                DisplayMetrics metrics = getResources().getDisplayMetrics();
                mLayout.x = metrics.widthPixels * 3;
                mSession.relayout(mWindow, mLayout, mWidth, mHeight, VISIBLE, false,
                        mWinFrame, mContentInsets, mVisibleInsets, mConfiguration, mSurface);
            } catch (RemoteException e) {
                // Ignore
            } finally {
                mSurfaceLock.unlock();
            }
        }
    }
    
    @Override
    @Override
    protected void onDetachedFromWindow() {
    protected void onDetachedFromWindow() {
        getViewTreeObserver().removeOnScrollChangedListener(mScrollChangedListener);
        getViewTreeObserver().removeOnScrollChangedListener(mScrollChangedListener);