Example usage for android.view WindowManagerGlobal getInstance

List of usage examples for android.view WindowManagerGlobal getInstance

Introduction

In this page you can find the example usage for android.view WindowManagerGlobal getInstance.

Prototype

@UnsupportedAppUsage
    public static WindowManagerGlobal getInstance() 

Source Link

Usage

From source file:android.app.Activity.java

/**
 * Convert a translucent themed Activity {@link android.R.attr#windowIsTranslucent} to a
 * fullscreen opaque Activity./*from  w w  w  . ja v  a 2  s.com*/
 * <p>
 * Call this whenever the background of a translucent Activity has changed to become opaque.
 * Doing so will allow the {@link android.view.Surface} of the Activity behind to be released.
 * <p>
 * This call has no effect on non-translucent activities or on activities with the
 * {@link android.R.attr#windowIsFloating} attribute.
 *
 * @see #convertToTranslucent(TranslucentConversionListener)
 * @see TranslucentConversionListener
 *
 * @hide
 */
public void convertFromTranslucent() {
    try {
        mTranslucentCallback = null;
        if (ActivityManagerNative.getDefault().convertFromTranslucent(mToken)) {
            WindowManagerGlobal.getInstance().changeCanvasOpacity(mToken, true);
        }
    } catch (RemoteException e) {
        // pass
    }
}

From source file:android.app.Activity.java

/** @hide */
void onTranslucentConversionComplete(boolean drawComplete) {
    if (mTranslucentCallback != null) {
        mTranslucentCallback.onTranslucentConversionComplete(drawComplete);
        mTranslucentCallback = null;/* w ww . j a  v a 2 s .  c om*/
    }
    if (mChangeCanvasToTranslucent) {
        WindowManagerGlobal.getInstance().changeCanvasOpacity(mToken, false);
    }
}

From source file:android.app.Activity.java

final void performRestart() {
    mFragments.noteStateNotSaved();//from w  ww  . j av a 2 s  .com

    if (mStopped) {
        mStopped = false;
        if (mToken != null && mParent == null) {
            WindowManagerGlobal.getInstance().setStoppedState(mToken, false);
        }

        synchronized (mManagedCursors) {
            final int N = mManagedCursors.size();
            for (int i = 0; i < N; i++) {
                ManagedCursor mc = mManagedCursors.get(i);
                if (mc.mReleased || mc.mUpdated) {
                    if (!mc.mCursor.requery()) {
                        if (getApplicationInfo().targetSdkVersion >= android.os.Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
                            throw new IllegalStateException(
                                    "trying to requery an already closed cursor  " + mc.mCursor);
                        }
                    }
                    mc.mReleased = false;
                    mc.mUpdated = false;
                }
            }
        }

        mCalled = false;
        mInstrumentation.callActivityOnRestart(this);
        if (!mCalled) {
            throw new SuperNotCalledException(
                    "Activity " + mComponent.toShortString() + " did not call through to super.onRestart()");
        }
        performStart();
    }
}

From source file:android.app.Activity.java

final void performStop() {
    mDoReportFullyDrawn = false;//  w ww  .  j a v a  2s .c  o m
    if (mLoadersStarted) {
        mLoadersStarted = false;
        if (mLoaderManager != null) {
            if (!mChangingConfigurations) {
                mLoaderManager.doStop();
            } else {
                mLoaderManager.doRetain();
            }
        }
    }

    if (!mStopped) {
        if (mWindow != null) {
            mWindow.closeAllPanels();
        }

        if (mToken != null && mParent == null) {
            WindowManagerGlobal.getInstance().setStoppedState(mToken, true);
        }

        mFragments.dispatchStop();

        mCalled = false;
        mInstrumentation.callActivityOnStop(this);
        if (!mCalled) {
            throw new SuperNotCalledException(
                    "Activity " + mComponent.toShortString() + " did not call through to super.onStop()");
        }

        synchronized (mManagedCursors) {
            final int N = mManagedCursors.size();
            for (int i = 0; i < N; i++) {
                ManagedCursor mc = mManagedCursors.get(i);
                if (!mc.mReleased) {
                    mc.mCursor.deactivate();
                    mc.mReleased = true;
                }
            }
        }

        mStopped = true;
    }
    mResumed = false;
}