From 9219b31067f0498c1a9872460249e7a144a9e0c3 Mon Sep 17 00:00:00 2001 From: Tarandeep Singh Date: Thu, 8 Mar 2018 17:05:02 -0800 Subject: [PATCH] Revert "Revert "Remove a compat hack SurfaceView#setWindowType()"" This reverts commit 9309c19513ef569043cfd08deae78e04d5eb5c24. Reason for revert: We can now remove the deprecated method. Compat hack is no longer required for keyboards. Fixes: 62054282 Test: Manually flashed and verified keyboard apps work. Change-Id: Iae0c82b6fd3fd5930e9eea3216fab76925839e4d --- core/java/android/view/SurfaceView.java | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/core/java/android/view/SurfaceView.java b/core/java/android/view/SurfaceView.java index 4a9da4a6672f..7213923415b8 100644 --- a/core/java/android/view/SurfaceView.java +++ b/core/java/android/view/SurfaceView.java @@ -16,7 +16,6 @@ package android.view; -import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION_PANEL; import static android.view.WindowManagerPolicyConstants.APPLICATION_MEDIA_OVERLAY_SUBLAYER; import static android.view.WindowManagerPolicyConstants.APPLICATION_MEDIA_SUBLAYER; import static android.view.WindowManagerPolicyConstants.APPLICATION_PANEL_SUBLAYER; @@ -877,31 +876,6 @@ public class SurfaceView extends View implements ViewRootImpl.WindowStoppedCallb return callbacks; } - /** - * This method still exists only for compatibility reasons because some applications have relied - * on this method via reflection. See Issue 36345857 for details. - * - * @deprecated No platform code is using this method anymore. - * @hide - */ - @Deprecated - public void setWindowType(int type) { - if (getContext().getApplicationInfo().targetSdkVersion >= Build.VERSION_CODES.O) { - throw new UnsupportedOperationException( - "SurfaceView#setWindowType() has never been a public API."); - } - - if (type == TYPE_APPLICATION_PANEL) { - Log.e(TAG, "If you are calling SurfaceView#setWindowType(TYPE_APPLICATION_PANEL) " - + "just to make the SurfaceView to be placed on top of its window, you must " - + "call setZOrderOnTop(true) instead.", new Throwable()); - setZOrderOnTop(true); - return; - } - Log.e(TAG, "SurfaceView#setWindowType(int) is deprecated and now does nothing. " - + "type=" + type, new Throwable()); - } - private void runOnUiThread(Runnable runnable) { Handler handler = getHandler(); if (handler != null && handler.getLooper() != Looper.myLooper()) { -- 2.11.0