Loading core/java/android/webkit/WebView.java +35 −0 Original line number Diff line number Diff line Loading @@ -383,6 +383,39 @@ public class WebView extends AbsoluteLayout } } private static class OnTrimMemoryListener implements ComponentCallbacks2 { private static OnTrimMemoryListener sInstance = null; static void init(Context c) { if (sInstance == null) { sInstance = new OnTrimMemoryListener(c.getApplicationContext()); } } private OnTrimMemoryListener(Context c) { c.registerComponentCallbacks(this); } @Override public void onConfigurationChanged(Configuration newConfig) { // Ignore } @Override public void onLowMemory() { // Ignore } @Override public void onTrimMemory(int level) { if (DebugFlags.WEB_VIEW) { Log.d("WebView", "onTrimMemory: " + level); } WebView.nativeOnTrimMemory(level); } } // A final CallbackProxy shared by WebViewCore and BrowserFrame. private final CallbackProxy mCallbackProxy; Loading Loading @@ -1195,6 +1228,8 @@ public class WebView extends AbsoluteLayout } private void init() { OnTrimMemoryListener.init(getContext()); setWillNotDraw(false); setFocusable(true); setFocusableInTouchMode(true); Loading Loading
core/java/android/webkit/WebView.java +35 −0 Original line number Diff line number Diff line Loading @@ -383,6 +383,39 @@ public class WebView extends AbsoluteLayout } } private static class OnTrimMemoryListener implements ComponentCallbacks2 { private static OnTrimMemoryListener sInstance = null; static void init(Context c) { if (sInstance == null) { sInstance = new OnTrimMemoryListener(c.getApplicationContext()); } } private OnTrimMemoryListener(Context c) { c.registerComponentCallbacks(this); } @Override public void onConfigurationChanged(Configuration newConfig) { // Ignore } @Override public void onLowMemory() { // Ignore } @Override public void onTrimMemory(int level) { if (DebugFlags.WEB_VIEW) { Log.d("WebView", "onTrimMemory: " + level); } WebView.nativeOnTrimMemory(level); } } // A final CallbackProxy shared by WebViewCore and BrowserFrame. private final CallbackProxy mCallbackProxy; Loading Loading @@ -1195,6 +1228,8 @@ public class WebView extends AbsoluteLayout } private void init() { OnTrimMemoryListener.init(getContext()); setWillNotDraw(false); setFocusable(true); setFocusableInTouchMode(true); Loading