summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmds/bootanimation/BootAnimation.cpp13
-rw-r--r--core/java/android/animation/LayoutTransition.java9
-rw-r--r--core/java/android/app/ActivityThread.java23
-rw-r--r--core/java/android/app/WallpaperManager.java33
-rw-r--r--core/java/android/view/GLES20Canvas.java21
-rw-r--r--core/java/android/view/HardwareRenderer.java90
-rw-r--r--core/java/android/view/ViewRootImpl.java4
-rw-r--r--core/java/android/view/WindowManagerImpl.java27
-rw-r--r--core/java/android/webkit/WebView.java8
-rw-r--r--core/java/com/android/internal/widget/LockPatternView.java2
-rw-r--r--core/jni/Android.mk2
-rw-r--r--core/jni/AndroidRuntime.cpp2
-rw-r--r--core/jni/android_nfc_NdefRecord.cpp2
-rw-r--r--core/jni/android_view_GLES20Canvas.cpp14
-rw-r--r--core/jni/android_view_HardwareRenderer.cpp54
-rw-r--r--core/jni/com_google_android_gles_jni_EGLImpl.cpp14
-rw-r--r--core/res/res/drawable-hdpi/indicator_code_lock_drag_direction_green_up_holo.pngbin860 -> 0 bytes
-rw-r--r--core/res/res/drawable-hdpi/indicator_code_lock_drag_direction_red_up_holo.pngbin1129 -> 0 bytes
-rw-r--r--core/res/res/drawable-large-mdpi/btn_code_lock_default_holo.pngbin298 -> 0 bytes
-rw-r--r--core/res/res/drawable-large-mdpi/btn_code_lock_touched_holo.pngbin298 -> 0 bytes
-rw-r--r--core/res/res/drawable-large-mdpi/indicator_code_lock_point_area_default_holo.pngbin23542 -> 0 bytes
-rw-r--r--core/res/res/drawable-large-mdpi/indicator_code_lock_point_area_green_holo.pngbin15734 -> 0 bytes
-rw-r--r--core/res/res/drawable-large-mdpi/indicator_code_lock_point_area_red_holo.pngbin13778 -> 0 bytes
-rw-r--r--core/res/res/drawable-mdpi/indicator_code_lock_drag_direction_green_up_holo.pngbin573 -> 0 bytes
-rw-r--r--core/res/res/drawable-mdpi/indicator_code_lock_drag_direction_red_up_holo.pngbin729 -> 0 bytes
-rw-r--r--core/res/res/drawable-mdpi/indicator_code_lock_point_area_red.pngbin13778 -> 0 bytes
-rw-r--r--core/res/res/drawable-sw600dp-mdpi/indicator_code_lock_drag_direction_red_up.png (renamed from core/res/res/drawable-large-mdpi/indicator_code_lock_drag_direction_red_up.png)bin729 -> 729 bytes
-rw-r--r--core/res/res/drawable-xhdpi/indicator_code_lock_drag_direction_green_up_holo.pngbin1105 -> 0 bytes
-rw-r--r--core/res/res/drawable-xhdpi/indicator_code_lock_drag_direction_red_up_holo.pngbin1575 -> 0 bytes
-rw-r--r--core/res/res/drawable-xlarge-hdpi/btn_code_lock_default.pngbin332 -> 0 bytes
-rw-r--r--core/res/res/drawable-xlarge-hdpi/btn_code_lock_touched.pngbin332 -> 0 bytes
-rw-r--r--core/res/res/drawable-xlarge-hdpi/ic_lock_idle_alarm.pngbin1190 -> 0 bytes
-rw-r--r--core/res/res/drawable-xlarge-hdpi/ic_lock_idle_charging.pngbin1249 -> 0 bytes
-rw-r--r--core/res/res/drawable-xlarge-hdpi/ic_lock_idle_lock.pngbin960 -> 0 bytes
-rw-r--r--core/res/res/drawable-xlarge-hdpi/ic_lock_idle_low_battery.pngbin1124 -> 0 bytes
-rw-r--r--core/res/res/drawable-xlarge-hdpi/indicator_code_lock_drag_direction_red_up.pngbin1129 -> 0 bytes
-rw-r--r--core/res/res/drawable-xlarge-hdpi/indicator_code_lock_point_area_default.pngbin46951 -> 0 bytes
-rw-r--r--core/res/res/drawable-xlarge-hdpi/indicator_code_lock_point_area_green.pngbin30670 -> 0 bytes
-rw-r--r--core/res/res/drawable-xlarge-hdpi/indicator_code_lock_point_area_red.pngbin26985 -> 0 bytes
-rw-r--r--core/res/res/drawable-xlarge-hdpi/stat_notify_chat.pngbin921 -> 0 bytes
-rw-r--r--core/res/res/drawable-xlarge-hdpi/stat_notify_disk_full.pngbin753 -> 0 bytes
-rw-r--r--core/res/res/drawable-xlarge-hdpi/stat_notify_email_generic.pngbin529 -> 0 bytes
-rw-r--r--core/res/res/drawable-xlarge-hdpi/stat_notify_error.pngbin610 -> 0 bytes
-rw-r--r--core/res/res/drawable-xlarge-hdpi/stat_notify_gmail.pngbin597 -> 0 bytes
-rw-r--r--core/res/res/drawable-xlarge-hdpi/stat_sys_battery_0.pngbin1134 -> 0 bytes
-rw-r--r--core/res/res/drawable-xlarge-hdpi/stat_sys_battery_100.pngbin807 -> 0 bytes
-rw-r--r--core/res/res/drawable-xlarge-hdpi/stat_sys_battery_15.pngbin722 -> 0 bytes
-rw-r--r--core/res/res/drawable-xlarge-hdpi/stat_sys_battery_28.pngbin870 -> 0 bytes
-rw-r--r--core/res/res/drawable-xlarge-hdpi/stat_sys_battery_43.pngbin888 -> 0 bytes
-rw-r--r--core/res/res/drawable-xlarge-hdpi/stat_sys_battery_57.pngbin907 -> 0 bytes
-rw-r--r--core/res/res/drawable-xlarge-hdpi/stat_sys_battery_71.pngbin905 -> 0 bytes
-rw-r--r--core/res/res/drawable-xlarge-hdpi/stat_sys_battery_85.pngbin865 -> 0 bytes
-rw-r--r--core/res/res/drawable-xlarge-hdpi/stat_sys_battery_charge_anim0.pngbin1281 -> 0 bytes
-rw-r--r--core/res/res/drawable-xlarge-hdpi/stat_sys_battery_charge_anim100.pngbin1617 -> 0 bytes
-rw-r--r--core/res/res/drawable-xlarge-hdpi/stat_sys_battery_charge_anim15.pngbin1584 -> 0 bytes
-rw-r--r--core/res/res/drawable-xlarge-hdpi/stat_sys_battery_charge_anim28.pngbin1652 -> 0 bytes
-rw-r--r--core/res/res/drawable-xlarge-hdpi/stat_sys_battery_charge_anim43.pngbin1678 -> 0 bytes
-rw-r--r--core/res/res/drawable-xlarge-hdpi/stat_sys_battery_charge_anim57.pngbin1665 -> 0 bytes
-rw-r--r--core/res/res/drawable-xlarge-hdpi/stat_sys_battery_charge_anim71.pngbin1644 -> 0 bytes
-rw-r--r--core/res/res/drawable-xlarge-hdpi/stat_sys_battery_charge_anim85.pngbin1592 -> 0 bytes
-rw-r--r--core/res/res/drawable-xlarge-hdpi/stat_sys_battery_unknown.pngbin769 -> 0 bytes
-rw-r--r--core/res/res/drawable-xlarge-hdpi/unlock_default.pngbin6388 -> 0 bytes
-rw-r--r--core/res/res/drawable-xlarge-hdpi/unlock_halo.pngbin40174 -> 0 bytes
-rw-r--r--core/res/res/drawable-xlarge-hdpi/unlock_ring.pngbin179660 -> 0 bytes
-rw-r--r--core/res/res/drawable-xlarge-hdpi/unlock_wave.pngbin187426 -> 0 bytes
-rw-r--r--core/res/res/drawable-xlarge-mdpi/ic_lock_idle_alarm.pngbin650 -> 0 bytes
-rw-r--r--core/res/res/drawable-xlarge-mdpi/ic_lock_idle_charging.pngbin679 -> 0 bytes
-rw-r--r--core/res/res/drawable-xlarge-mdpi/ic_lock_idle_lock.pngbin521 -> 0 bytes
-rw-r--r--core/res/res/drawable-xlarge-mdpi/ic_lock_idle_low_battery.pngbin607 -> 0 bytes
-rw-r--r--core/res/res/drawable-xlarge-mdpi/stat_notify_chat.pngbin657 -> 0 bytes
-rw-r--r--core/res/res/drawable-xlarge-mdpi/stat_notify_disk_full.pngbin561 -> 0 bytes
-rw-r--r--core/res/res/drawable-xlarge-mdpi/stat_notify_email_generic.pngbin455 -> 0 bytes
-rw-r--r--core/res/res/drawable-xlarge-mdpi/stat_notify_error.pngbin458 -> 0 bytes
-rw-r--r--core/res/res/drawable-xlarge-mdpi/stat_notify_gmail.pngbin480 -> 0 bytes
-rw-r--r--core/res/res/drawable-xlarge-mdpi/stat_sys_battery_0.pngbin795 -> 0 bytes
-rw-r--r--core/res/res/drawable-xlarge-mdpi/stat_sys_battery_100.pngbin609 -> 0 bytes
-rw-r--r--core/res/res/drawable-xlarge-mdpi/stat_sys_battery_15.pngbin542 -> 0 bytes
-rw-r--r--core/res/res/drawable-xlarge-mdpi/stat_sys_battery_28.pngbin625 -> 0 bytes
-rw-r--r--core/res/res/drawable-xlarge-mdpi/stat_sys_battery_43.pngbin635 -> 0 bytes
-rw-r--r--core/res/res/drawable-xlarge-mdpi/stat_sys_battery_57.pngbin635 -> 0 bytes
-rw-r--r--core/res/res/drawable-xlarge-mdpi/stat_sys_battery_71.pngbin638 -> 0 bytes
-rw-r--r--core/res/res/drawable-xlarge-mdpi/stat_sys_battery_85.pngbin623 -> 0 bytes
-rw-r--r--core/res/res/drawable-xlarge-mdpi/stat_sys_battery_charge_anim0.pngbin859 -> 0 bytes
-rw-r--r--core/res/res/drawable-xlarge-mdpi/stat_sys_battery_charge_anim100.pngbin1090 -> 0 bytes
-rw-r--r--core/res/res/drawable-xlarge-mdpi/stat_sys_battery_charge_anim15.pngbin1044 -> 0 bytes
-rw-r--r--core/res/res/drawable-xlarge-mdpi/stat_sys_battery_charge_anim28.pngbin1068 -> 0 bytes
-rw-r--r--core/res/res/drawable-xlarge-mdpi/stat_sys_battery_charge_anim43.pngbin1078 -> 0 bytes
-rw-r--r--core/res/res/drawable-xlarge-mdpi/stat_sys_battery_charge_anim57.pngbin1085 -> 0 bytes
-rw-r--r--core/res/res/drawable-xlarge-mdpi/stat_sys_battery_charge_anim71.pngbin1070 -> 0 bytes
-rw-r--r--core/res/res/drawable-xlarge-mdpi/stat_sys_battery_charge_anim85.pngbin1051 -> 0 bytes
-rw-r--r--core/res/res/drawable-xlarge-mdpi/stat_sys_battery_unknown.pngbin553 -> 0 bytes
-rw-r--r--core/res/res/drawable-xlarge-xhdpi/btn_code_lock_default.pngbin379 -> 0 bytes
-rw-r--r--core/res/res/drawable-xlarge-xhdpi/btn_code_lock_touched.pngbin379 -> 0 bytes
-rw-r--r--core/res/res/drawable-xlarge-xhdpi/indicator_code_lock_point_area_default.pngbin72735 -> 0 bytes
-rw-r--r--core/res/res/drawable-xlarge-xhdpi/indicator_code_lock_point_area_green.pngbin47249 -> 0 bytes
-rw-r--r--core/res/res/drawable-xlarge-xhdpi/indicator_code_lock_point_area_red.pngbin41326 -> 0 bytes
-rw-r--r--libs/hwui/Caches.cpp44
-rw-r--r--libs/hwui/Caches.h13
-rw-r--r--opengl/java/android/opengl/EGLLogWrapper.java10
-rw-r--r--opengl/java/com/google/android/gles_jni/EGLImpl.java7
-rw-r--r--opengl/java/javax/microedition/khronos/egl/EGL10.java2
-rw-r--r--opengl/libs/EGL/egl_display.h2
-rw-r--r--policy/src/com/android/internal/policy/impl/KeyguardViewMediator.java18
-rwxr-xr-xpolicy/src/com/android/internal/policy/impl/PhoneWindowManager.java5
-rw-r--r--services/java/com/android/server/ConnectivityService.java4
105 files changed, 371 insertions, 52 deletions
diff --git a/cmds/bootanimation/BootAnimation.cpp b/cmds/bootanimation/BootAnimation.cpp
index d816e7ce639b..154dbb873575 100644
--- a/cmds/bootanimation/BootAnimation.cpp
+++ b/cmds/bootanimation/BootAnimation.cpp
@@ -42,6 +42,7 @@
#include <surfaceflinger/ISurfaceComposerClient.h>
#include <core/SkBitmap.h>
+#include <core/SkStream.h>
#include <images/SkImageDecoder.h>
#include <GLES/gl.h>
@@ -150,9 +151,15 @@ status_t BootAnimation::initTexture(void* buffer, size_t len)
//StopWatch watch("blah");
SkBitmap bitmap;
- SkImageDecoder::DecodeMemory(buffer, len,
- &bitmap, SkBitmap::kRGB_565_Config,
- SkImageDecoder::kDecodePixels_Mode);
+ SkMemoryStream stream(buffer, len);
+ SkImageDecoder* codec = SkImageDecoder::Factory(&stream);
+ codec->setDitherImage(false);
+ if (codec) {
+ codec->decode(&stream, &bitmap,
+ SkBitmap::kRGB_565_Config,
+ SkImageDecoder::kDecodePixels_Mode);
+ delete codec;
+ }
// ensure we can call getPixels(). No need to call unlock, since the
// bitmap will go out of scope when we return from this method.
diff --git a/core/java/android/animation/LayoutTransition.java b/core/java/android/animation/LayoutTransition.java
index f383af93851e..7f0ea991af12 100644
--- a/core/java/android/animation/LayoutTransition.java
+++ b/core/java/android/animation/LayoutTransition.java
@@ -657,6 +657,15 @@ public class LayoutTransition {
*/
private void setupChangeAnimation(final ViewGroup parent, final int changeReason,
Animator baseAnimator, final long duration, final View child) {
+
+ // If we already have a listener for this child, then we've already set up the
+ // changing animation we need. Multiple calls for a child may occur when several
+ // add/remove operations are run at once on a container; each one will trigger
+ // changes for the existing children in the container.
+ if (layoutChangeListenerMap.get(child) != null) {
+ return;
+ }
+
// Make a copy of the appropriate animation
final Animator anim = baseAnimator.clone();
diff --git a/core/java/android/app/ActivityThread.java b/core/java/android/app/ActivityThread.java
index a4714cab3542..f9896f7ab4e5 100644
--- a/core/java/android/app/ActivityThread.java
+++ b/core/java/android/app/ActivityThread.java
@@ -45,6 +45,7 @@ import android.graphics.Canvas;
import android.net.IConnectivityManager;
import android.net.Proxy;
import android.net.ProxyProperties;
+import android.opengl.GLUtils;
import android.os.AsyncTask;
import android.os.Bundle;
import android.os.Debug;
@@ -3714,6 +3715,24 @@ public final class ActivityThread {
}
}
+ private void setupGraphicsSupport(LoadedApk info) {
+ try {
+ int uid = Process.myUid();
+ String[] packages = getPackageManager().getPackagesForUid(uid);
+
+ // If there are several packages in this application we won't
+ // initialize the graphics disk caches
+ if (packages.length == 1) {
+ ContextImpl appContext = new ContextImpl();
+ appContext.init(info, null, this);
+
+ HardwareRenderer.setupDiskCache(appContext.getCacheDir());
+ }
+ } catch (RemoteException e) {
+ // Ignore
+ }
+ }
+
private void handleBindApplication(AppBindData data) {
mBoundApplication = data;
mConfiguration = new Configuration(data.config);
@@ -3737,7 +3756,7 @@ public final class ActivityThread {
HardwareRenderer.disable(false);
}
}
-
+
if (mProfiler.profileFd != null) {
mProfiler.startProfiling();
}
@@ -3773,6 +3792,8 @@ public final class ActivityThread {
data.info = getPackageInfoNoCheck(data.appInfo, data.compatInfo);
+ setupGraphicsSupport(data.info);
+
/**
* For system applications on userdebug/eng builds, log stack
* traces of disk and network access to dropbox for analysis.
diff --git a/core/java/android/app/WallpaperManager.java b/core/java/android/app/WallpaperManager.java
index f81ea81be237..91398bce21f3 100644
--- a/core/java/android/app/WallpaperManager.java
+++ b/core/java/android/app/WallpaperManager.java
@@ -212,7 +212,11 @@ public class WallpaperManager {
*/
mHandler.sendEmptyMessage(MSG_CLEAR_WALLPAPER);
}
-
+
+ public Handler getHandler() {
+ return mHandler;
+ }
+
public Bitmap peekWallpaperBitmap(Context context, boolean returnDefault) {
synchronized (this) {
if (mWallpaper != null) {
@@ -604,7 +608,7 @@ public class WallpaperManager {
// Ignore
}
}
-
+
/**
* Set the position of the current wallpaper within any larger space, when
* that wallpaper is visible behind the given window. The X and Y offsets
@@ -619,16 +623,23 @@ public class WallpaperManager {
* @param yOffset The offset along the Y dimension, from 0 to 1.
*/
public void setWallpaperOffsets(IBinder windowToken, float xOffset, float yOffset) {
- try {
- //Log.v(TAG, "Sending new wallpaper offsets from app...");
- ViewRootImpl.getWindowSession(mContext.getMainLooper()).setWallpaperPosition(
- windowToken, xOffset, yOffset, mWallpaperXStep, mWallpaperYStep);
- //Log.v(TAG, "...app returning after sending offsets!");
- } catch (RemoteException e) {
- // Ignore.
- }
+ final IBinder fWindowToken = windowToken;
+ final float fXOffset = xOffset;
+ final float fYOffset = yOffset;
+ sGlobals.getHandler().post(new Runnable() {
+ public void run() {
+ try {
+ //Log.v(TAG, "Sending new wallpaper offsets from app...");
+ ViewRootImpl.getWindowSession(mContext.getMainLooper()).setWallpaperPosition(
+ fWindowToken, fXOffset, fYOffset, mWallpaperXStep, mWallpaperYStep);
+ //Log.v(TAG, "...app returning after sending offsets!");
+ } catch (RemoteException e) {
+ // Ignore.
+ }
+ }
+ });
}
-
+
/**
* For applications that use multiple virtual screens showing a wallpaper,
* specify the step size between virtual screens. For example, if the
diff --git a/core/java/android/view/GLES20Canvas.java b/core/java/android/view/GLES20Canvas.java
index c934c7b92a95..d948ec28cbd2 100644
--- a/core/java/android/view/GLES20Canvas.java
+++ b/core/java/android/view/GLES20Canvas.java
@@ -315,6 +315,27 @@ class GLES20Canvas extends HardwareCanvas {
private static native void nFlushCaches(int level);
+ /**
+ * Release all resources associated with the underlying caches. This should
+ * only be called after a full flushCaches().
+ *
+ * @hide
+ */
+ public static void terminateCaches() {
+ nTerminateCaches();
+ }
+
+ private static native void nTerminateCaches();
+
+ /**
+ * @hide
+ */
+ public static void initCaches() {
+ nInitCaches();
+ }
+
+ private static native void nInitCaches();
+
///////////////////////////////////////////////////////////////////////////
// Display list
///////////////////////////////////////////////////////////////////////////
diff --git a/core/java/android/view/HardwareRenderer.java b/core/java/android/view/HardwareRenderer.java
index b86d21d68822..e0167d82bef0 100644
--- a/core/java/android/view/HardwareRenderer.java
+++ b/core/java/android/view/HardwareRenderer.java
@@ -25,6 +25,7 @@ import android.opengl.GLUtils;
import android.os.SystemClock;
import android.os.SystemProperties;
import android.util.Log;
+import com.google.android.gles_jni.EGLImpl;
import javax.microedition.khronos.egl.EGL10;
import javax.microedition.khronos.egl.EGL11;
@@ -34,6 +35,8 @@ import javax.microedition.khronos.egl.EGLDisplay;
import javax.microedition.khronos.egl.EGLSurface;
import javax.microedition.khronos.opengles.GL;
+import java.io.File;
+
import static javax.microedition.khronos.egl.EGL10.*;
/**
@@ -45,6 +48,11 @@ public abstract class HardwareRenderer {
static final String LOG_TAG = "HardwareRenderer";
/**
+ * Name of the file that holds the shaders cache.
+ */
+ private static final String CACHE_PATH_SHADERS = "com.android.opengl.shaders_cache";
+
+ /**
* Turn on to only refresh the parts of the screen that need updating.
* When turned on the property defined by {@link #RENDER_DIRTY_REGIONS_PROPERTY}
* must also have the value "true".
@@ -200,6 +208,18 @@ public abstract class HardwareRenderer {
abstract int getHeight();
/**
+ * Sets the directory to use as a persistent storage for hardware rendering
+ * resources.
+ *
+ * @param cacheDir A directory the current process can write to
+ */
+ public static void setupDiskCache(File cacheDir) {
+ nSetupShadersDiskCache(new File(cacheDir, CACHE_PATH_SHADERS).getAbsolutePath());
+ }
+
+ private static native void nSetupShadersDiskCache(String cacheFile);
+
+ /**
* Interface used to receive callbacks whenever a view is drawn by
* a hardware renderer instance.
*/
@@ -325,6 +345,15 @@ public abstract class HardwareRenderer {
}
/**
+ * Invoke this method when the system needs to clean up all resources
+ * associated with hardware rendering.
+ */
+ static void terminate() {
+ Log.d(LOG_TAG, "Terminating hardware rendering");
+ Gl20Renderer.terminate();
+ }
+
+ /**
* Indicates whether hardware acceleration is currently enabled.
*
* @return True if hardware acceleration is in use, false otherwise.
@@ -632,6 +661,8 @@ public abstract class HardwareRenderer {
throw new Surface.OutOfResourcesException("eglMakeCurrent failed "
+ GLUtils.getEGLErrorString(sEgl.eglGetError()));
}
+
+ initCaches();
// If mDirtyRegions is set, this means we have an EGL configuration
// with EGL_SWAP_BEHAVIOR_PRESERVED_BIT set
@@ -652,6 +683,8 @@ public abstract class HardwareRenderer {
return mEglContext.getGL();
}
+ abstract void initCaches();
+
EGLContext createContext(EGL10 egl, EGLDisplay eglDisplay, EGLConfig eglConfig) {
int[] attribs = { EGL_CONTEXT_CLIENT_VERSION, mGlVersion, EGL_NONE };
@@ -895,6 +928,11 @@ public abstract class HardwareRenderer {
EGL_NONE
};
}
+
+ @Override
+ void initCaches() {
+ GLES20Canvas.initCaches();
+ }
@Override
boolean canDraw() {
@@ -987,16 +1025,7 @@ public abstract class HardwareRenderer {
if (eglContext == null) {
return;
} else {
- synchronized (sPbufferLock) {
- // Create a temporary 1x1 pbuffer so we have a context
- // to clear our OpenGL objects
- if (sPbuffer == null) {
- sPbuffer = sEgl.eglCreatePbufferSurface(sEglDisplay, sEglConfig, new int[] {
- EGL_WIDTH, 1, EGL_HEIGHT, 1, EGL_NONE
- });
- }
- }
- sEgl.eglMakeCurrent(sEglDisplay, sPbuffer, sPbuffer, eglContext);
+ usePbufferSurface(eglContext);
}
switch (level) {
@@ -1010,5 +1039,46 @@ public abstract class HardwareRenderer {
break;
}
}
+
+ private static void usePbufferSurface(EGLContext eglContext) {
+ synchronized (sPbufferLock) {
+ // Create a temporary 1x1 pbuffer so we have a context
+ // to clear our OpenGL objects
+ if (sPbuffer == null) {
+ sPbuffer = sEgl.eglCreatePbufferSurface(sEglDisplay, sEglConfig, new int[] {
+ EGL_WIDTH, 1, EGL_HEIGHT, 1, EGL_NONE
+ });
+ }
+ }
+ sEgl.eglMakeCurrent(sEglDisplay, sPbuffer, sPbuffer, eglContext);
+ }
+
+ static void terminate() {
+ synchronized (sEglLock) {
+ if (sEgl == null) return;
+
+ if (EGLImpl.getInitCount(sEglDisplay) == 1) {
+ EGLContext eglContext = sEglContextStorage.get();
+ if (eglContext == null) return;
+
+ usePbufferSurface(eglContext);
+ GLES20Canvas.terminateCaches();
+
+ sEgl.eglDestroyContext(sEglDisplay, eglContext);
+ sEglContextStorage.remove();
+
+ sEgl.eglDestroySurface(sEglDisplay, sPbuffer);
+ sEgl.eglMakeCurrent(sEglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
+
+ sEgl.eglReleaseThread();
+ sEgl.eglTerminate(sEglDisplay);
+
+ sEgl = null;
+ sEglDisplay = null;
+ sEglConfig = null;
+ sPbuffer = null;
+ }
+ }
+ }
}
}
diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java
index f7078ecd3ec6..b15b155d9bc1 100644
--- a/core/java/android/view/ViewRootImpl.java
+++ b/core/java/android/view/ViewRootImpl.java
@@ -567,7 +567,7 @@ public final class ViewRootImpl extends Handler implements ViewParent,
}
}
- private void destroyHardwareResources() {
+ void destroyHardwareResources() {
if (mAttachInfo.mHardwareRenderer != null) {
if (mAttachInfo.mHardwareRenderer.isEnabled()) {
mAttachInfo.mHardwareRenderer.destroyLayers(mView);
@@ -880,12 +880,10 @@ public final class ViewRootImpl extends Handler implements ViewParent,
|| mNewSurfaceNeeded;
WindowManager.LayoutParams params = null;
- int windowAttributesChanges = 0;
if (mWindowAttributesChanged) {
mWindowAttributesChanged = false;
surfaceChanged = true;
params = lp;
- windowAttributesChanges = mWindowAttributesChangesFlag;
}
CompatibilityInfo compatibilityInfo = mCompatibilityInfo.get();
if (compatibilityInfo.supportsScreen() == mLastInCompatMode) {
diff --git a/core/java/android/view/WindowManagerImpl.java b/core/java/android/view/WindowManagerImpl.java
index 5ef4f3eb31e7..d89bc36ad8d4 100644
--- a/core/java/android/view/WindowManagerImpl.java
+++ b/core/java/android/view/WindowManagerImpl.java
@@ -16,6 +16,8 @@
package android.view;
+import android.app.ActivityManager;
+import android.content.ComponentCallbacks2;
import android.content.res.CompatibilityInfo;
import android.content.res.Configuration;
import android.graphics.PixelFormat;
@@ -409,7 +411,30 @@ public class WindowManagerImpl implements WindowManager {
*/
public void trimMemory(int level) {
if (HardwareRenderer.isAvailable()) {
- HardwareRenderer.trimMemory(level);
+ switch (level) {
+ case ComponentCallbacks2.TRIM_MEMORY_COMPLETE:
+ case ComponentCallbacks2.TRIM_MEMORY_MODERATE:
+ // On low and medium end gfx devices
+ if (!ActivityManager.isHighEndGfx(getDefaultDisplay())) {
+ // Force a full memory flush
+ HardwareRenderer.trimMemory(ComponentCallbacks2.TRIM_MEMORY_COMPLETE);
+ // Destroy all hardware surfaces and resources associated to
+ // known windows
+ synchronized (this) {
+ if (mViews == null) return;
+ int count = mViews.length;
+ for (int i = 0; i < count; i++) {
+ mRoots[i].destroyHardwareResources();
+ }
+ }
+ // Terminate the hardware renderer to free all resources
+ HardwareRenderer.terminate();
+ break;
+ }
+ // high end gfx devices fall through to next case
+ default:
+ HardwareRenderer.trimMemory(level);
+ }
}
}
diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java
index 03d65113accc..7249497120b2 100644
--- a/core/java/android/webkit/WebView.java
+++ b/core/java/android/webkit/WebView.java
@@ -2861,8 +2861,8 @@ public class WebView extends AbsoluteLayout
}
// Used to avoid sending many visible rect messages.
- private Rect mLastVisibleRectSent;
- private Rect mLastGlobalRect;
+ private Rect mLastVisibleRectSent = new Rect();
+ private Rect mLastGlobalRect = new Rect();
private Rect mVisibleRect = new Rect();
private Rect mGlobalVisibleRect = new Rect();
private Point mScrollOffset = new Point();
@@ -2878,7 +2878,7 @@ public class WebView extends AbsoluteLayout
mWebViewCore.sendMessage(EventHub.SET_SCROLL_OFFSET,
nativeMoveGeneration(), mSendScrollEvent ? 1 : 0, mScrollOffset);
}
- mLastVisibleRectSent = mVisibleRect;
+ mLastVisibleRectSent.set(mVisibleRect);
mPrivateHandler.removeMessages(SWITCH_TO_LONGPRESS);
}
if (getGlobalVisibleRect(mGlobalVisibleRect)
@@ -2894,7 +2894,7 @@ public class WebView extends AbsoluteLayout
if (!mBlockWebkitViewMessages) {
mWebViewCore.sendMessage(EventHub.SET_GLOBAL_BOUNDS, mGlobalVisibleRect);
}
- mLastGlobalRect = mGlobalVisibleRect;
+ mLastGlobalRect.set(mGlobalVisibleRect);
}
return mVisibleRect;
}
diff --git a/core/java/com/android/internal/widget/LockPatternView.java b/core/java/com/android/internal/widget/LockPatternView.java
index a2fc6e2efdcd..0d9cf9ac4d27 100644
--- a/core/java/com/android/internal/widget/LockPatternView.java
+++ b/core/java/com/android/internal/widget/LockPatternView.java
@@ -463,7 +463,7 @@ public class LockPatternView extends View {
result = desired;
break;
case MeasureSpec.AT_MOST:
- result = Math.min(specSize, desired);
+ result = Math.max(specSize, desired);
break;
case MeasureSpec.EXACTLY:
default:
diff --git a/core/jni/Android.mk b/core/jni/Android.mk
index 59a03e7833c5..71c5d2662292 100644
--- a/core/jni/Android.mk
+++ b/core/jni/Android.mk
@@ -53,6 +53,7 @@ LOCAL_SRC_FILES:= \
android_view_InputQueue.cpp \
android_view_KeyEvent.cpp \
android_view_KeyCharacterMap.cpp \
+ android_view_HardwareRenderer.cpp \
android_view_GLES20Canvas.cpp \
android_view_MotionEvent.cpp \
android_view_PointerIcon.cpp \
@@ -160,6 +161,7 @@ LOCAL_C_INCLUDES += \
$(JNI_H_INCLUDE) \
$(LOCAL_PATH)/android/graphics \
$(LOCAL_PATH)/../../libs/hwui \
+ $(LOCAL_PATH)/../../opengl/libs \
$(call include-path-for, bluedroid) \
$(call include-path-for, libhardware)/hardware \
$(call include-path-for, libhardware_legacy)/hardware_legacy \
diff --git a/core/jni/AndroidRuntime.cpp b/core/jni/AndroidRuntime.cpp
index 12ec1b65da94..c00e6c9a09fa 100644
--- a/core/jni/AndroidRuntime.cpp
+++ b/core/jni/AndroidRuntime.cpp
@@ -116,6 +116,7 @@ extern int register_android_graphics_Xfermode(JNIEnv* env);
extern int register_android_graphics_PixelFormat(JNIEnv* env);
extern int register_android_view_Display(JNIEnv* env);
extern int register_android_view_GLES20Canvas(JNIEnv* env);
+extern int register_android_view_HardwareRenderer(JNIEnv* env);
extern int register_android_view_Surface(JNIEnv* env);
extern int register_android_view_TextureView(JNIEnv* env);
extern int register_android_database_CursorWindow(JNIEnv* env);
@@ -1101,6 +1102,7 @@ static const RegJNIRec gRegJNI[] = {
REG_JNI(register_android_graphics_PixelFormat),
REG_JNI(register_android_graphics_Graphics),
REG_JNI(register_android_view_GLES20Canvas),
+ REG_JNI(register_android_view_HardwareRenderer),
REG_JNI(register_android_view_Surface),
REG_JNI(register_android_view_TextureView),
REG_JNI(register_com_google_android_gles_jni_EGLImpl),
diff --git a/core/jni/android_nfc_NdefRecord.cpp b/core/jni/android_nfc_NdefRecord.cpp
index e8cc4c68eaa2..67907b69d20c 100644
--- a/core/jni/android_nfc_NdefRecord.cpp
+++ b/core/jni/android_nfc_NdefRecord.cpp
@@ -149,7 +149,7 @@ static jint android_nfc_NdefRecord_parseNdefRecord(JNIEnv *e, jobject o,
/* Set flags field */
mFlags = e->GetFieldID(record_cls, "mFlags", "B");
- e->SetIntField(o, mFlags, record.Flags);
+ e->SetByteField(o, mFlags, record.Flags);
ret = 0;
diff --git a/core/jni/android_view_GLES20Canvas.cpp b/core/jni/android_view_GLES20Canvas.cpp
index e79de2d98bb4..4f75fad684f3 100644
--- a/core/jni/android_view_GLES20Canvas.cpp
+++ b/core/jni/android_view_GLES20Canvas.cpp
@@ -134,6 +134,18 @@ static void android_view_GLES20Canvas_flushCaches(JNIEnv* env, jobject clazz,
}
}
+static void android_view_GLES20Canvas_initCaches(JNIEnv* env, jobject clazz) {
+ if (Caches::hasInstance()) {
+ Caches::getInstance().init();
+ }
+}
+
+static void android_view_GLES20Canvas_terminateCaches(JNIEnv* env, jobject clazz) {
+ if (Caches::hasInstance()) {
+ Caches::getInstance().terminate();
+ }
+}
+
// ----------------------------------------------------------------------------
// Constructors
// ----------------------------------------------------------------------------
@@ -756,6 +768,8 @@ static JNINativeMethod gMethods[] = {
{ "nPreserveBackBuffer", "()Z", (void*) android_view_GLES20Canvas_preserveBackBuffer },
{ "nDisableVsync", "()V", (void*) android_view_GLES20Canvas_disableVsync },
{ "nFlushCaches", "(I)V", (void*) android_view_GLES20Canvas_flushCaches },
+ { "nInitCaches", "()V", (void*) android_view_GLES20Canvas_initCaches },
+ { "nTerminateCaches", "()V", (void*) android_view_GLES20Canvas_terminateCaches },
{ "nCreateRenderer", "()I", (void*) android_view_GLES20Canvas_createRenderer },
{ "nDestroyRenderer", "(I)V", (void*) android_view_GLES20Canvas_destroyRenderer },
diff --git a/core/jni/android_view_HardwareRenderer.cpp b/core/jni/android_view_HardwareRenderer.cpp
new file mode 100644
index 000000000000..09809ecf49fb
--- /dev/null
+++ b/core/jni/android_view_HardwareRenderer.cpp
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#define LOG_TAG "HardwareRenderer"
+
+#include "jni.h"
+#include <nativehelper/JNIHelp.h>
+#include <android_runtime/AndroidRuntime.h>
+
+#include <EGL/egl_cache.h>
+
+namespace android {
+
+// ----------------------------------------------------------------------------
+// Misc
+// ----------------------------------------------------------------------------
+
+static void android_view_HardwareRenderer_setupShadersDiskCache(JNIEnv* env, jobject clazz,
+ jstring diskCachePath) {
+
+ const char* cacheArray = env->GetStringUTFChars(diskCachePath, NULL);
+ egl_cache_t::get()->setCacheFilename(cacheArray);
+ env->ReleaseStringUTFChars(diskCachePath, cacheArray);
+}
+
+// ----------------------------------------------------------------------------
+// JNI Glue
+// ----------------------------------------------------------------------------
+
+const char* const kClassPathName = "android/view/HardwareRenderer";
+
+static JNINativeMethod gMethods[] = {
+ { "nSetupShadersDiskCache", "(Ljava/lang/String;)V",
+ (void*) android_view_HardwareRenderer_setupShadersDiskCache },
+};
+
+int register_android_view_HardwareRenderer(JNIEnv* env) {
+ return AndroidRuntime::registerNativeMethods(env, kClassPathName, gMethods, NELEM(gMethods));
+}
+
+};
diff --git a/core/jni/com_google_android_gles_jni_EGLImpl.cpp b/core/jni/com_google_android_gles_jni_EGLImpl.cpp
index 02974f9a9983..4fe76002d0bc 100644
--- a/core/jni/com_google_android_gles_jni_EGLImpl.cpp
+++ b/core/jni/com_google_android_gles_jni_EGLImpl.cpp
@@ -24,6 +24,8 @@
#include <EGL/egl.h>
#include <GLES/gl.h>
+#include <EGL/egl_display.h>
+
#include <surfaceflinger/Surface.h>
#include <SkBitmap.h>
#include <SkPixelRef.h>
@@ -173,6 +175,16 @@ static jboolean jni_eglQuerySurface(JNIEnv *_env, jobject _this, jobject display
return success;
}
+static jint jni_getInitCount(JNIEnv *_env, jobject _clazz, jobject display) {
+ EGLDisplay dpy = getDisplay(_env, display);
+ egl_display_t* eglDisplay = get_display(dpy);
+ return eglDisplay ? eglDisplay->getRefsCount() : 0;
+}
+
+static jboolean jni_eglReleaseThread(JNIEnv *_env, jobject _this) {
+ return eglReleaseThread();
+}
+
static jboolean jni_eglChooseConfig(JNIEnv *_env, jobject _this, jobject display,
jintArray attrib_list, jobjectArray configs, jint config_size, jintArray num_config) {
if (display == NULL
@@ -526,6 +538,8 @@ static JNINativeMethod methods[] = {
{"eglInitialize", "(" DISPLAY "[I)Z", (void*)jni_eglInitialize },
{"eglQueryContext", "(" DISPLAY CONTEXT "I[I)Z", (void*)jni_eglQueryContext },
{"eglQuerySurface", "(" DISPLAY SURFACE "I[I)Z", (void*)jni_eglQuerySurface },
+{"eglReleaseThread","()Z", (void*)jni_eglReleaseThread },
+{"getInitCount", "(" DISPLAY ")I", (void*)jni_getInitCount },
{"eglChooseConfig", "(" DISPLAY "[I[" CONFIG "I[I)Z", (void*)jni_eglChooseConfig },
{"_eglCreateContext","(" DISPLAY CONFIG CONTEXT "[I)I", (void*)jni_eglCreateContext },
{"eglGetConfigs", "(" DISPLAY "[" CONFIG "I[I)Z", (void*)jni_eglGetConfigs },
diff --git a/core/res/res/drawable-hdpi/indicator_code_lock_drag_direction_green_up_holo.png b/core/res/res/drawable-hdpi/indicator_code_lock_drag_direction_green_up_holo.png
deleted file mode 100644
index a68697507a7e..000000000000
--- a/core/res/res/drawable-hdpi/indicator_code_lock_drag_direction_green_up_holo.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-hdpi/indicator_code_lock_drag_direction_red_up_holo.png b/core/res/res/drawable-hdpi/indicator_code_lock_drag_direction_red_up_holo.png
deleted file mode 100644
index 92db8efa14d7..000000000000
--- a/core/res/res/drawable-hdpi/indicator_code_lock_drag_direction_red_up_holo.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-large-mdpi/btn_code_lock_default_holo.png b/core/res/res/drawable-large-mdpi/btn_code_lock_default_holo.png
deleted file mode 100644
index 45cc20dd6ddf..000000000000
--- a/core/res/res/drawable-large-mdpi/btn_code_lock_default_holo.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-large-mdpi/btn_code_lock_touched_holo.png b/core/res/res/drawable-large-mdpi/btn_code_lock_touched_holo.png
deleted file mode 100644
index 45cc20dd6ddf..000000000000
--- a/core/res/res/drawable-large-mdpi/btn_code_lock_touched_holo.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-large-mdpi/indicator_code_lock_point_area_default_holo.png b/core/res/res/drawable-large-mdpi/indicator_code_lock_point_area_default_holo.png
deleted file mode 100644
index fe72d000d4bf..000000000000
--- a/core/res/res/drawable-large-mdpi/indicator_code_lock_point_area_default_holo.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-large-mdpi/indicator_code_lock_point_area_green_holo.png b/core/res/res/drawable-large-mdpi/indicator_code_lock_point_area_green_holo.png
deleted file mode 100644
index be666c6f553c..000000000000
--- a/core/res/res/drawable-large-mdpi/indicator_code_lock_point_area_green_holo.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-large-mdpi/indicator_code_lock_point_area_red_holo.png b/core/res/res/drawable-large-mdpi/indicator_code_lock_point_area_red_holo.png
deleted file mode 100644
index 962719725f26..000000000000
--- a/core/res/res/drawable-large-mdpi/indicator_code_lock_point_area_red_holo.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-mdpi/indicator_code_lock_drag_direction_green_up_holo.png b/core/res/res/drawable-mdpi/indicator_code_lock_drag_direction_green_up_holo.png
deleted file mode 100644
index 89d209c3c724..000000000000
--- a/core/res/res/drawable-mdpi/indicator_code_lock_drag_direction_green_up_holo.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-mdpi/indicator_code_lock_drag_direction_red_up_holo.png b/core/res/res/drawable-mdpi/indicator_code_lock_drag_direction_red_up_holo.png
deleted file mode 100644
index 1d4cb32100d1..000000000000
--- a/core/res/res/drawable-mdpi/indicator_code_lock_drag_direction_red_up_holo.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-mdpi/indicator_code_lock_point_area_red.png b/core/res/res/drawable-mdpi/indicator_code_lock_point_area_red.png
deleted file mode 100644
index 962719725f26..000000000000
--- a/core/res/res/drawable-mdpi/indicator_code_lock_point_area_red.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-large-mdpi/indicator_code_lock_drag_direction_red_up.png b/core/res/res/drawable-sw600dp-mdpi/indicator_code_lock_drag_direction_red_up.png
index 2ab45477a1b8..2ab45477a1b8 100644
--- a/core/res/res/drawable-large-mdpi/indicator_code_lock_drag_direction_red_up.png
+++ b/core/res/res/drawable-sw600dp-mdpi/indicator_code_lock_drag_direction_red_up.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/indicator_code_lock_drag_direction_green_up_holo.png b/core/res/res/drawable-xhdpi/indicator_code_lock_drag_direction_green_up_holo.png
deleted file mode 100644
index 66c1b58b9871..000000000000
--- a/core/res/res/drawable-xhdpi/indicator_code_lock_drag_direction_green_up_holo.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/indicator_code_lock_drag_direction_red_up_holo.png b/core/res/res/drawable-xhdpi/indicator_code_lock_drag_direction_red_up_holo.png
deleted file mode 100644
index b5f807f73b38..000000000000
--- a/core/res/res/drawable-xhdpi/indicator_code_lock_drag_direction_red_up_holo.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-hdpi/btn_code_lock_default.png b/core/res/res/drawable-xlarge-hdpi/btn_code_lock_default.png
deleted file mode 100644
index 719eb89abd4e..000000000000
--- a/core/res/res/drawable-xlarge-hdpi/btn_code_lock_default.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-hdpi/btn_code_lock_touched.png b/core/res/res/drawable-xlarge-hdpi/btn_code_lock_touched.png
deleted file mode 100644
index 719eb89abd4e..000000000000
--- a/core/res/res/drawable-xlarge-hdpi/btn_code_lock_touched.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-hdpi/ic_lock_idle_alarm.png b/core/res/res/drawable-xlarge-hdpi/ic_lock_idle_alarm.png
deleted file mode 100644
index 29cd47139d72..000000000000
--- a/core/res/res/drawable-xlarge-hdpi/ic_lock_idle_alarm.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-hdpi/ic_lock_idle_charging.png b/core/res/res/drawable-xlarge-hdpi/ic_lock_idle_charging.png
deleted file mode 100644
index 211aa0b996a0..000000000000
--- a/core/res/res/drawable-xlarge-hdpi/ic_lock_idle_charging.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-hdpi/ic_lock_idle_lock.png b/core/res/res/drawable-xlarge-hdpi/ic_lock_idle_lock.png
deleted file mode 100644
index 683ba22ce052..000000000000
--- a/core/res/res/drawable-xlarge-hdpi/ic_lock_idle_lock.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-hdpi/ic_lock_idle_low_battery.png b/core/res/res/drawable-xlarge-hdpi/ic_lock_idle_low_battery.png
deleted file mode 100644
index f4383f3a2f8c..000000000000
--- a/core/res/res/drawable-xlarge-hdpi/ic_lock_idle_low_battery.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-hdpi/indicator_code_lock_drag_direction_red_up.png b/core/res/res/drawable-xlarge-hdpi/indicator_code_lock_drag_direction_red_up.png
deleted file mode 100644
index a7988635f9d0..000000000000
--- a/core/res/res/drawable-xlarge-hdpi/indicator_code_lock_drag_direction_red_up.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-hdpi/indicator_code_lock_point_area_default.png b/core/res/res/drawable-xlarge-hdpi/indicator_code_lock_point_area_default.png
deleted file mode 100644
index 07e616502425..000000000000
--- a/core/res/res/drawable-xlarge-hdpi/indicator_code_lock_point_area_default.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-hdpi/indicator_code_lock_point_area_green.png b/core/res/res/drawable-xlarge-hdpi/indicator_code_lock_point_area_green.png
deleted file mode 100644
index ec178416c9f9..000000000000
--- a/core/res/res/drawable-xlarge-hdpi/indicator_code_lock_point_area_green.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-hdpi/indicator_code_lock_point_area_red.png b/core/res/res/drawable-xlarge-hdpi/indicator_code_lock_point_area_red.png
deleted file mode 100644
index a0cb1ecf7f45..000000000000
--- a/core/res/res/drawable-xlarge-hdpi/indicator_code_lock_point_area_red.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-hdpi/stat_notify_chat.png b/core/res/res/drawable-xlarge-hdpi/stat_notify_chat.png
deleted file mode 100644
index 8cc5535c21e1..000000000000
--- a/core/res/res/drawable-xlarge-hdpi/stat_notify_chat.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-hdpi/stat_notify_disk_full.png b/core/res/res/drawable-xlarge-hdpi/stat_notify_disk_full.png
deleted file mode 100644
index 4441ba20b86a..000000000000
--- a/core/res/res/drawable-xlarge-hdpi/stat_notify_disk_full.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-hdpi/stat_notify_email_generic.png b/core/res/res/drawable-xlarge-hdpi/stat_notify_email_generic.png
deleted file mode 100644
index 73891a387641..000000000000
--- a/core/res/res/drawable-xlarge-hdpi/stat_notify_email_generic.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-hdpi/stat_notify_error.png b/core/res/res/drawable-xlarge-hdpi/stat_notify_error.png
deleted file mode 100644
index db68eeae3357..000000000000
--- a/core/res/res/drawable-xlarge-hdpi/stat_notify_error.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-hdpi/stat_notify_gmail.png b/core/res/res/drawable-xlarge-hdpi/stat_notify_gmail.png
deleted file mode 100644
index 7af6921a84f1..000000000000
--- a/core/res/res/drawable-xlarge-hdpi/stat_notify_gmail.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_0.png b/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_0.png
deleted file mode 100644
index 16424b98ae85..000000000000
--- a/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_0.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_100.png b/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_100.png
deleted file mode 100644
index 95cdc4516a8a..000000000000
--- a/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_100.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_15.png b/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_15.png
deleted file mode 100644
index f61ccfae1dc9..000000000000
--- a/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_15.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_28.png b/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_28.png
deleted file mode 100644
index 5666654c707c..000000000000
--- a/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_28.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_43.png b/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_43.png
deleted file mode 100644
index f9f4d81daed8..000000000000
--- a/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_43.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_57.png b/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_57.png
deleted file mode 100644
index 973ccc23e727..000000000000
--- a/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_57.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_71.png b/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_71.png
deleted file mode 100644
index 1c7d446303ef..000000000000
--- a/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_71.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_85.png b/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_85.png
deleted file mode 100644
index 2120bdcb26a8..000000000000
--- a/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_85.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_charge_anim0.png b/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_charge_anim0.png
deleted file mode 100644
index a526fcf65441..000000000000
--- a/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_charge_anim0.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_charge_anim100.png b/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_charge_anim100.png
deleted file mode 100644
index 85be2e3e14e8..000000000000
--- a/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_charge_anim100.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_charge_anim15.png b/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_charge_anim15.png
deleted file mode 100644
index 589b30b51df8..000000000000
--- a/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_charge_anim15.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_charge_anim28.png b/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_charge_anim28.png
deleted file mode 100644
index 4debfc0a5218..000000000000
--- a/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_charge_anim28.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_charge_anim43.png b/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_charge_anim43.png
deleted file mode 100644
index 3920ab1500ea..000000000000
--- a/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_charge_anim43.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_charge_anim57.png b/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_charge_anim57.png
deleted file mode 100644
index a15716fa45ea..000000000000
--- a/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_charge_anim57.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_charge_anim71.png b/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_charge_anim71.png
deleted file mode 100644
index 8d7352fcf4e4..000000000000
--- a/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_charge_anim71.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_charge_anim85.png b/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_charge_anim85.png
deleted file mode 100644
index 45f8e81247bf..000000000000
--- a/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_charge_anim85.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_unknown.png b/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_unknown.png
deleted file mode 100644
index 696d9fb1982d..000000000000
--- a/core/res/res/drawable-xlarge-hdpi/stat_sys_battery_unknown.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-hdpi/unlock_default.png b/core/res/res/drawable-xlarge-hdpi/unlock_default.png
deleted file mode 100644
index 67311b9338bd..000000000000
--- a/core/res/res/drawable-xlarge-hdpi/unlock_default.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-hdpi/unlock_halo.png b/core/res/res/drawable-xlarge-hdpi/unlock_halo.png
deleted file mode 100644
index d841dea98f6f..000000000000
--- a/core/res/res/drawable-xlarge-hdpi/unlock_halo.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-hdpi/unlock_ring.png b/core/res/res/drawable-xlarge-hdpi/unlock_ring.png
deleted file mode 100644
index 172efb8e89b8..000000000000
--- a/core/res/res/drawable-xlarge-hdpi/unlock_ring.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-hdpi/unlock_wave.png b/core/res/res/drawable-xlarge-hdpi/unlock_wave.png
deleted file mode 100644
index 1ad26c3f420c..000000000000
--- a/core/res/res/drawable-xlarge-hdpi/unlock_wave.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-mdpi/ic_lock_idle_alarm.png b/core/res/res/drawable-xlarge-mdpi/ic_lock_idle_alarm.png
deleted file mode 100644
index 97ac02361a2d..000000000000
--- a/core/res/res/drawable-xlarge-mdpi/ic_lock_idle_alarm.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-mdpi/ic_lock_idle_charging.png b/core/res/res/drawable-xlarge-mdpi/ic_lock_idle_charging.png
deleted file mode 100644
index 4210db26765a..000000000000
--- a/core/res/res/drawable-xlarge-mdpi/ic_lock_idle_charging.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-mdpi/ic_lock_idle_lock.png b/core/res/res/drawable-xlarge-mdpi/ic_lock_idle_lock.png
deleted file mode 100644
index 1060f5a8da15..000000000000
--- a/core/res/res/drawable-xlarge-mdpi/ic_lock_idle_lock.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-mdpi/ic_lock_idle_low_battery.png b/core/res/res/drawable-xlarge-mdpi/ic_lock_idle_low_battery.png
deleted file mode 100644
index 72e4afa14bec..000000000000
--- a/core/res/res/drawable-xlarge-mdpi/ic_lock_idle_low_battery.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-mdpi/stat_notify_chat.png b/core/res/res/drawable-xlarge-mdpi/stat_notify_chat.png
deleted file mode 100644
index 22adc672d9d2..000000000000
--- a/core/res/res/drawable-xlarge-mdpi/stat_notify_chat.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-mdpi/stat_notify_disk_full.png b/core/res/res/drawable-xlarge-mdpi/stat_notify_disk_full.png
deleted file mode 100644
index c434d12449bf..000000000000
--- a/core/res/res/drawable-xlarge-mdpi/stat_notify_disk_full.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-mdpi/stat_notify_email_generic.png b/core/res/res/drawable-xlarge-mdpi/stat_notify_email_generic.png
deleted file mode 100644
index daf3b84fb413..000000000000
--- a/core/res/res/drawable-xlarge-mdpi/stat_notify_email_generic.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-mdpi/stat_notify_error.png b/core/res/res/drawable-xlarge-mdpi/stat_notify_error.png
deleted file mode 100644
index 7b097b157d10..000000000000
--- a/core/res/res/drawable-xlarge-mdpi/stat_notify_error.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-mdpi/stat_notify_gmail.png b/core/res/res/drawable-xlarge-mdpi/stat_notify_gmail.png
deleted file mode 100644
index 8daef7cbbe08..000000000000
--- a/core/res/res/drawable-xlarge-mdpi/stat_notify_gmail.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_0.png b/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_0.png
deleted file mode 100644
index ad483214bbae..000000000000
--- a/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_0.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_100.png b/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_100.png
deleted file mode 100644
index 16481d6f511e..000000000000
--- a/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_100.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_15.png b/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_15.png
deleted file mode 100644
index c3cdcc8b33e0..000000000000
--- a/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_15.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_28.png b/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_28.png
deleted file mode 100644
index ec58d318eed7..000000000000
--- a/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_28.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_43.png b/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_43.png
deleted file mode 100644
index 1fb3696a6029..000000000000
--- a/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_43.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_57.png b/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_57.png
deleted file mode 100644
index d6d143a168e5..000000000000
--- a/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_57.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_71.png b/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_71.png
deleted file mode 100644
index 8de99fa914db..000000000000
--- a/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_71.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_85.png b/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_85.png
deleted file mode 100644
index 4600b253d438..000000000000
--- a/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_85.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_charge_anim0.png b/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_charge_anim0.png
deleted file mode 100644
index 3640f554e21b..000000000000
--- a/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_charge_anim0.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_charge_anim100.png b/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_charge_anim100.png
deleted file mode 100644
index 53af703d6385..000000000000
--- a/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_charge_anim100.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_charge_anim15.png b/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_charge_anim15.png
deleted file mode 100644
index c2282e60ea32..000000000000
--- a/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_charge_anim15.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_charge_anim28.png b/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_charge_anim28.png
deleted file mode 100644
index 704f96253a8f..000000000000
--- a/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_charge_anim28.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_charge_anim43.png b/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_charge_anim43.png
deleted file mode 100644
index b275dbba677f..000000000000
--- a/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_charge_anim43.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_charge_anim57.png b/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_charge_anim57.png
deleted file mode 100644
index 5b0649f89c47..000000000000
--- a/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_charge_anim57.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_charge_anim71.png b/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_charge_anim71.png
deleted file mode 100644
index 8bc888ede18b..000000000000
--- a/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_charge_anim71.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_charge_anim85.png b/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_charge_anim85.png
deleted file mode 100644
index ede370db0d49..000000000000
--- a/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_charge_anim85.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_unknown.png b/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_unknown.png
deleted file mode 100644
index 5f39f622f760..000000000000
--- a/core/res/res/drawable-xlarge-mdpi/stat_sys_battery_unknown.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-xhdpi/btn_code_lock_default.png b/core/res/res/drawable-xlarge-xhdpi/btn_code_lock_default.png
deleted file mode 100644
index 9f7a132dccdf..000000000000
--- a/core/res/res/drawable-xlarge-xhdpi/btn_code_lock_default.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-xhdpi/btn_code_lock_touched.png b/core/res/res/drawable-xlarge-xhdpi/btn_code_lock_touched.png
deleted file mode 100644
index 9f7a132dccdf..000000000000
--- a/core/res/res/drawable-xlarge-xhdpi/btn_code_lock_touched.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-xhdpi/indicator_code_lock_point_area_default.png b/core/res/res/drawable-xlarge-xhdpi/indicator_code_lock_point_area_default.png
deleted file mode 100644
index 6662eb16c7e6..000000000000
--- a/core/res/res/drawable-xlarge-xhdpi/indicator_code_lock_point_area_default.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-xhdpi/indicator_code_lock_point_area_green.png b/core/res/res/drawable-xlarge-xhdpi/indicator_code_lock_point_area_green.png
deleted file mode 100644
index dce220a98a97..000000000000
--- a/core/res/res/drawable-xlarge-xhdpi/indicator_code_lock_point_area_green.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xlarge-xhdpi/indicator_code_lock_point_area_red.png b/core/res/res/drawable-xlarge-xhdpi/indicator_code_lock_point_area_red.png
deleted file mode 100644
index 746a3ea415b2..000000000000
--- a/core/res/res/drawable-xlarge-xhdpi/indicator_code_lock_point_area_red.png
+++ /dev/null
Binary files differ
diff --git a/libs/hwui/Caches.cpp b/libs/hwui/Caches.cpp
index 75b07de49b6c..f293cba652f5 100644
--- a/libs/hwui/Caches.cpp
+++ b/libs/hwui/Caches.cpp
@@ -46,22 +46,16 @@ namespace uirenderer {
// Constructors/destructor
///////////////////////////////////////////////////////////////////////////////
-Caches::Caches(): Singleton<Caches>(), blend(false), lastSrcMode(GL_ZERO),
- lastDstMode(GL_ZERO), currentProgram(NULL) {
+Caches::Caches(): Singleton<Caches>(), mInitialized(false) {
GLint maxTextureUnits;
glGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, &maxTextureUnits);
if (maxTextureUnits < REQUIRED_TEXTURE_UNITS_COUNT) {
LOGW("At least %d texture units are required!", REQUIRED_TEXTURE_UNITS_COUNT);
}
- glGenBuffers(1, &meshBuffer);
- glBindBuffer(GL_ARRAY_BUFFER, meshBuffer);
- glBufferData(GL_ARRAY_BUFFER, sizeof(gMeshVertices), gMeshVertices, GL_STATIC_DRAW);
-
glGetIntegerv(GL_MAX_TEXTURE_SIZE, &maxTextureSize);
- mCurrentBuffer = meshBuffer;
- mRegionMesh = NULL;
+ init();
mDebugLevel = readDebugLevel();
LOGD("Enabling debug mode %d", mDebugLevel);
@@ -71,8 +65,40 @@ Caches::Caches(): Singleton<Caches>(), blend(false), lastSrcMode(GL_ZERO),
#endif
}
-Caches::~Caches() {
+void Caches::init() {
+ if (mInitialized) return;
+
+ glGenBuffers(1, &meshBuffer);
+ glBindBuffer(GL_ARRAY_BUFFER, meshBuffer);
+ glBufferData(GL_ARRAY_BUFFER, sizeof(gMeshVertices), gMeshVertices, GL_STATIC_DRAW);
+
+ mCurrentBuffer = meshBuffer;
+ mRegionMesh = NULL;
+
+ blend = false;
+ lastSrcMode = GL_ZERO;
+ lastDstMode = GL_ZERO;
+ currentProgram = NULL;
+
+ mInitialized = true;
+}
+
+void Caches::terminate() {
+ if (!mInitialized) return;
+
+ glDeleteBuffers(1, &meshBuffer);
+ mCurrentBuffer = 0;
+
+ glDeleteBuffers(1, &mRegionMeshIndices);
delete[] mRegionMesh;
+ mRegionMesh = NULL;
+
+ fboCache.clear();
+
+ programCache.clear();
+ currentProgram = NULL;
+
+ mInitialized = false;
}
///////////////////////////////////////////////////////////////////////////////
diff --git a/libs/hwui/Caches.h b/libs/hwui/Caches.h
index 9b0d7c6e6009..5e58a9e6e7b6 100644
--- a/libs/hwui/Caches.h
+++ b/libs/hwui/Caches.h
@@ -86,7 +86,6 @@ struct CacheLogger {
class ANDROID_API Caches: public Singleton<Caches> {
Caches();
- ~Caches();
friend class Singleton<Caches>;
@@ -109,6 +108,11 @@ public:
};
/**
+ * Initializes the cache.
+ */
+ void init();
+
+ /**
* Flush the cache.
*
* @param mode Indicates how much of the cache should be flushed
@@ -116,6 +120,12 @@ public:
void flush(FlushMode mode);
/**
+ * Destroys all resources associated with this cache. This should
+ * be called after a flush(kFlushMode_Full).
+ */
+ void terminate();
+
+ /**
* Indicates whether the renderer is in debug mode.
* This debug mode provides limited information to app developers.
*/
@@ -194,6 +204,7 @@ public:
private:
DebugLevel mDebugLevel;
+ bool mInitialized;
}; // class Caches
}; // namespace uirenderer
diff --git a/opengl/java/android/opengl/EGLLogWrapper.java b/opengl/java/android/opengl/EGLLogWrapper.java
index 6c0fdb33f429..36e88a2b8f0b 100644
--- a/opengl/java/android/opengl/EGLLogWrapper.java
+++ b/opengl/java/android/opengl/EGLLogWrapper.java
@@ -314,6 +314,16 @@ class EGLLogWrapper implements EGL11 {
checkError();
return result;
}
+
+ /** @hide **/
+ public boolean eglReleaseThread() {
+ begin("eglReleaseThread");
+ end();
+ boolean result = mEgl10.eglReleaseThread();
+ returns(result);
+ checkError();
+ return result;
+ }
public boolean eglSwapBuffers(EGLDisplay display, EGLSurface surface) {
begin("eglInitialize");
diff --git a/opengl/java/com/google/android/gles_jni/EGLImpl.java b/opengl/java/com/google/android/gles_jni/EGLImpl.java
index 51d6ca881a0f..69920199b088 100644
--- a/opengl/java/com/google/android/gles_jni/EGLImpl.java
+++ b/opengl/java/com/google/android/gles_jni/EGLImpl.java
@@ -31,6 +31,8 @@ public class EGLImpl implements EGL10 {
public native boolean eglInitialize(EGLDisplay display, int[] major_minor);
public native boolean eglQueryContext(EGLDisplay display, EGLContext context, int attribute, int[] value);
public native boolean eglQuerySurface(EGLDisplay display, EGLSurface surface, int attribute, int[] value);
+ /** @hide **/
+ public native boolean eglReleaseThread();
public native boolean eglChooseConfig(EGLDisplay display, int[] attrib_list, EGLConfig[] configs, int config_size, int[] num_config);
public native boolean eglGetConfigAttrib(EGLDisplay display, EGLConfig config, int attribute, int[] value);
public native boolean eglGetConfigs(EGLDisplay display, EGLConfig[] configs, int config_size, int[] num_config);
@@ -44,6 +46,9 @@ public class EGLImpl implements EGL10 {
public native boolean eglCopyBuffers(EGLDisplay display, EGLSurface surface, Object native_pixmap);
public native boolean eglWaitGL();
public native boolean eglWaitNative(int engine, Object bindTarget);
+
+ /** @hide **/
+ public static native int getInitCount(EGLDisplay display);
public EGLContext eglCreateContext(EGLDisplay display, EGLConfig config, EGLContext share_context, int[] attrib_list) {
int eglContextId = _eglCreateContext(display, config, share_context, attrib_list);
@@ -85,7 +90,7 @@ public class EGLImpl implements EGL10 {
eglSurfaceId = _eglCreateWindowSurface(display, config, sur, attrib_list);
} else if (native_window instanceof SurfaceTexture) {
eglSurfaceId = _eglCreateWindowSurfaceTexture(display, config,
- (SurfaceTexture) native_window, attrib_list);
+ native_window, attrib_list);
} else {
throw new java.lang.UnsupportedOperationException(
"eglCreateWindowSurface() can only be called with an instance of " +
diff --git a/opengl/java/javax/microedition/khronos/egl/EGL10.java b/opengl/java/javax/microedition/khronos/egl/EGL10.java
index 2ae793acf231..cf58888effae 100644
--- a/opengl/java/javax/microedition/khronos/egl/EGL10.java
+++ b/opengl/java/javax/microedition/khronos/egl/EGL10.java
@@ -114,6 +114,8 @@ public interface EGL10 extends EGL {
boolean eglQueryContext(EGLDisplay display, EGLContext context, int attribute, int[] value);
String eglQueryString(EGLDisplay display, int name);
boolean eglQuerySurface(EGLDisplay display, EGLSurface surface, int attribute, int[] value);
+ /** @hide **/
+ boolean eglReleaseThread();
boolean eglSwapBuffers(EGLDisplay display, EGLSurface surface);
boolean eglTerminate(EGLDisplay display);
boolean eglWaitGL();
diff --git a/opengl/libs/EGL/egl_display.h b/opengl/libs/EGL/egl_display.h
index 1c1092cd428d..e0a367d4c50d 100644
--- a/opengl/libs/EGL/egl_display.h
+++ b/opengl/libs/EGL/egl_display.h
@@ -91,6 +91,8 @@ public:
inline bool isValid() const { return magic == '_dpy'; }
inline bool isAlive() const { return isValid(); }
+ inline uint32_t getRefsCount() const { return refs; }
+
struct strings_t {
char const * vendor;
char const * version;
diff --git a/policy/src/com/android/internal/policy/impl/KeyguardViewMediator.java b/policy/src/com/android/internal/policy/impl/KeyguardViewMediator.java
index c802bc1fc626..b5146892244c 100644
--- a/policy/src/com/android/internal/policy/impl/KeyguardViewMediator.java
+++ b/policy/src/com/android/internal/policy/impl/KeyguardViewMediator.java
@@ -830,12 +830,13 @@ public class KeyguardViewMediator implements KeyguardViewCallback,
* action should be posted to a handler.
*
* @param keyCode The keycode of the key that woke the device
+ * @param isDocked True if the device is in the dock
* @return Whether we poked the wake lock (and turned the screen on)
*/
- public boolean onWakeKeyWhenKeyguardShowingTq(int keyCode) {
+ public boolean onWakeKeyWhenKeyguardShowingTq(int keyCode, boolean isDocked) {
if (DEBUG) Log.d(TAG, "onWakeKeyWhenKeyguardShowing(" + keyCode + ")");
- if (isWakeKeyWhenKeyguardShowing(keyCode)) {
+ if (isWakeKeyWhenKeyguardShowing(keyCode, isDocked)) {
// give the keyguard view manager a chance to adjust the state of the
// keyguard based on the key that woke the device before poking
// the wake lock
@@ -846,11 +847,22 @@ public class KeyguardViewMediator implements KeyguardViewCallback,
}
}
- private boolean isWakeKeyWhenKeyguardShowing(int keyCode) {
+ /**
+ * When the keyguard is showing we ignore some keys that might otherwise typically
+ * be considered wake keys. We filter them out here.
+ *
+ * {@link KeyEvent#KEYCODE_POWER} is notably absent from this list because it
+ * is always considered a wake key.
+ */
+ private boolean isWakeKeyWhenKeyguardShowing(int keyCode, boolean isDocked) {
switch (keyCode) {
+ // ignore volume keys unless docked
case KeyEvent.KEYCODE_VOLUME_UP:
case KeyEvent.KEYCODE_VOLUME_DOWN:
case KeyEvent.KEYCODE_VOLUME_MUTE:
+ return isDocked;
+
+ // ignore media and camera keys
case KeyEvent.KEYCODE_MUTE:
case KeyEvent.KEYCODE_HEADSETHOOK:
case KeyEvent.KEYCODE_MEDIA_PLAY:
diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
index 1a068a3dab36..ed9ba79f74d3 100755
--- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
+++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
@@ -2486,7 +2486,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
// keyguard, then we need to have it turn on the
// screen once it is shown.
mKeyguardMediator.onWakeKeyWhenKeyguardShowingTq(
- KeyEvent.KEYCODE_POWER);
+ KeyEvent.KEYCODE_POWER, mDockMode != Intent.EXTRA_DOCK_STATE_UNDOCKED);
}
} else {
// Light up the keyboard if we are sliding up.
@@ -2706,7 +2706,8 @@ public class PhoneWindowManager implements WindowManagerPolicy {
if (down && isWakeKey) {
if (keyguardActive) {
// If the keyguard is showing, let it decide what to do with the wake key.
- mKeyguardMediator.onWakeKeyWhenKeyguardShowingTq(keyCode);
+ mKeyguardMediator.onWakeKeyWhenKeyguardShowingTq(keyCode,
+ mDockMode != Intent.EXTRA_DOCK_STATE_UNDOCKED);
} else {
// Otherwise, wake the device ourselves.
result |= ACTION_POKE_USER_ACTIVITY;
diff --git a/services/java/com/android/server/ConnectivityService.java b/services/java/com/android/server/ConnectivityService.java
index 4af61129e211..fc870337579d 100644
--- a/services/java/com/android/server/ConnectivityService.java
+++ b/services/java/com/android/server/ConnectivityService.java
@@ -514,7 +514,9 @@ public class ConnectivityService extends IConnectivityManager.Stub {
continue;
}
mCurrentLinkProperties[netType] = null;
- if (mNetConfigs[netType].isDefault()) mNetTrackers[netType].reconnect();
+ if (mNetTrackers[netType] != null && mNetConfigs[netType].isDefault()) {
+ mNetTrackers[netType].reconnect();
+ }
}
IBinder b = ServiceManager.getService(Context.NETWORKMANAGEMENT_SERVICE);