/// <summary>Return the maximum screen size dimension that will happen.</summary> /// <remarks> /// Return the maximum screen size dimension that will happen. This is /// mostly for wallpapers. /// </remarks> /// <hide></hide> public virtual int getMaximumSizeDimension() { try { android.view.IWindowManager wm = getWindowManager(); return(wm.getMaximumSizeDimension()); } catch (android.os.RemoteException e) { android.util.Slog.w("Display", "Unable to get display maximum size dimension", e); return(0); } }
private void getSizeInternal(android.graphics.Point outSize, bool doCompat) { try { android.view.IWindowManager wm = getWindowManager(); if (wm != null) { wm.getDisplaySize(outSize); android.content.res.CompatibilityInfo ci; if (doCompat && (ci = mCompatibilityInfo.getIfNeeded()) != null) { lock (mTmpMetrics) { mTmpMetrics.noncompatWidthPixels = outSize.x; mTmpMetrics.noncompatHeightPixels = outSize.y; mTmpMetrics.density = mDensity; ci.applyToDisplayMetrics(mTmpMetrics); outSize.x = mTmpMetrics.widthPixels; outSize.y = mTmpMetrics.heightPixels; } } } else { // This is just for boot-strapping, initializing the // system process before the window manager is up. outSize.x = getRawWidth(); outSize.y = getRawHeight(); } if (false) { java.lang.RuntimeException here = new java.lang.RuntimeException("here"); XobotOS.Runtime.Util.FillInStackTrace(here); android.util.Slog.v(TAG, "Returning display size: " + outSize, here); } if (DEBUG_DISPLAY_SIZE && doCompat) { android.util.Slog.v(TAG, "Returning display size: " + outSize); } } catch (android.os.RemoteException e) { android.util.Slog.w("Display", "Unable to get display size", e); } }
/// <summary> /// Gets the real size of the display without subtracting any window decor or /// applying any compatibility scale factors. /// </summary> /// <remarks> /// Gets the real size of the display without subtracting any window decor or /// applying any compatibility scale factors. /// <p> /// The real size may be smaller than the raw size when the window manager /// is emulating a smaller display (using adb shell am display-size). /// </p><p> /// The size is adjusted based on the current rotation of the display. /// </p> /// </remarks> /// <hide></hide> public virtual void getRealSize(android.graphics.Point outSize) { try { android.view.IWindowManager wm = getWindowManager(); if (wm != null) { wm.getRealDisplaySize(outSize); } else { // This is just for boot-strapping, initializing the // system process before the window manager is up. outSize.x = getRawWidth(); outSize.y = getRawHeight(); } } catch (android.os.RemoteException e) { android.util.Slog.w("Display", "Unable to get real display size", e); } }