|
16 | 16 |
|
17 | 17 | package android.view; |
18 | 18 |
|
| 19 | +import android.util.DisplayMetrics; |
19 | 20 | import com.android.internal.view.BaseIWindow; |
20 | 21 |
|
21 | 22 | import android.content.Context; |
@@ -212,6 +213,46 @@ public void setVisibility(int visibility) { |
212 | 213 | mRequestedVisible = mWindowVisibility && mViewVisibility; |
213 | 214 | updateWindow(false); |
214 | 215 | } |
| 216 | + |
| 217 | + /** |
| 218 | + * This method is not intended for general use. It was created |
| 219 | + * temporarily to improve performance of 3D layers in Launcher |
| 220 | + * and should be removed and fixed properly. |
| 221 | + * |
| 222 | + * Do not call this method. Ever. |
| 223 | + * |
| 224 | + * @hide |
| 225 | + */ |
| 226 | + protected void showSurface() { |
| 227 | + if (mSession != null) { |
| 228 | + updateWindow(true); |
| 229 | + } |
| 230 | + } |
| 231 | + |
| 232 | + /** |
| 233 | + * This method is not intended for general use. It was created |
| 234 | + * temporarily to improve performance of 3D layers in Launcher |
| 235 | + * and should be removed and fixed properly. |
| 236 | + * |
| 237 | + * Do not call this method. Ever. |
| 238 | + * |
| 239 | + * @hide |
| 240 | + */ |
| 241 | + protected void hideSurface() { |
| 242 | + if (mSession != null && mWindow != null) { |
| 243 | + mSurfaceLock.lock(); |
| 244 | + try { |
| 245 | + DisplayMetrics metrics = getResources().getDisplayMetrics(); |
| 246 | + mLayout.x = metrics.widthPixels * 3; |
| 247 | + mSession.relayout(mWindow, mLayout, mWidth, mHeight, VISIBLE, false, |
| 248 | + mWinFrame, mContentInsets, mVisibleInsets, mConfiguration, mSurface); |
| 249 | + } catch (RemoteException e) { |
| 250 | + // Ignore |
| 251 | + } finally { |
| 252 | + mSurfaceLock.unlock(); |
| 253 | + } |
| 254 | + } |
| 255 | + } |
215 | 256 |
|
216 | 257 | @Override |
217 | 258 | protected void onDetachedFromWindow() { |
|
0 commit comments