Loading core/java/android/os/Process.java +6 −0 Original line number Diff line number Diff line Loading @@ -649,6 +649,12 @@ public class Process { */ public static final native int myPid(); /** * Returns the identifier of this process' parent. * @hide */ public static native int myPpid(); /** * Returns the identifier of the calling thread, which be used with * {@link #setThreadPriority(int, int)}. Loading core/java/android/view/HardwareRenderer.java +7 −5 Original line number Diff line number Diff line Loading @@ -1931,6 +1931,7 @@ public abstract class HardwareRenderer { IAssetAtlas atlas = IAssetAtlas.Stub.asInterface(binder); try { if (atlas.isCompatible(android.os.Process.myPpid())) { GraphicBuffer buffer = atlas.getBuffer(); if (buffer != null) { int[] map = atlas.getMap(); Loading @@ -1938,6 +1939,7 @@ public abstract class HardwareRenderer { GLES20Canvas.initAtlas(buffer, map); } } } } catch (RemoteException e) { Log.w(LOG_TAG, "Could not acquire atlas", e); } Loading core/java/android/view/IAssetAtlas.aidl +7 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,13 @@ import android.view.GraphicBuffer; * @hide */ interface IAssetAtlas { /** * Indicates whether the atlas is compatible with the specified * parent process id. If the atlas' ppid does not match, this * method will return false. */ boolean isCompatible(int ppid); /** * Returns the atlas buffer (texture) or null if the atlas is * not available yet. Loading core/jni/android_util_Process.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -99,6 +99,11 @@ jint android_os_Process_myPid(JNIEnv* env, jobject clazz) return getpid(); } jint android_os_Process_myPpid(JNIEnv* env, jobject clazz) { return getppid(); } jint android_os_Process_myUid(JNIEnv* env, jobject clazz) { return getuid(); Loading Loading @@ -990,6 +995,7 @@ jintArray android_os_Process_getPidsForCommands(JNIEnv* env, jobject clazz, static const JNINativeMethod methods[] = { {"myPid", "()I", (void*)android_os_Process_myPid}, {"myPpid", "()I", (void*)android_os_Process_myPpid}, {"myTid", "()I", (void*)android_os_Process_myTid}, {"myUid", "()I", (void*)android_os_Process_myUid}, {"getUidForName", "(Ljava/lang/String;)I", (void*)android_os_Process_getUidForName}, Loading services/java/com/android/server/AssetAtlasService.java +5 −0 Original line number Diff line number Diff line Loading @@ -369,6 +369,11 @@ public class AssetAtlasService extends IAssetAtlas.Stub { private static native void nReleaseAtlasCanvas(Canvas canvas, int bitmap); private static native boolean nUploadAtlas(GraphicBuffer buffer, int bitmap); @Override public boolean isCompatible(int ppid) { return ppid == android.os.Process.myPpid(); } @Override public GraphicBuffer getBuffer() throws RemoteException { return mAtlasReady.get() ? mBuffer : null; Loading Loading
core/java/android/os/Process.java +6 −0 Original line number Diff line number Diff line Loading @@ -649,6 +649,12 @@ public class Process { */ public static final native int myPid(); /** * Returns the identifier of this process' parent. * @hide */ public static native int myPpid(); /** * Returns the identifier of the calling thread, which be used with * {@link #setThreadPriority(int, int)}. Loading
core/java/android/view/HardwareRenderer.java +7 −5 Original line number Diff line number Diff line Loading @@ -1931,6 +1931,7 @@ public abstract class HardwareRenderer { IAssetAtlas atlas = IAssetAtlas.Stub.asInterface(binder); try { if (atlas.isCompatible(android.os.Process.myPpid())) { GraphicBuffer buffer = atlas.getBuffer(); if (buffer != null) { int[] map = atlas.getMap(); Loading @@ -1938,6 +1939,7 @@ public abstract class HardwareRenderer { GLES20Canvas.initAtlas(buffer, map); } } } } catch (RemoteException e) { Log.w(LOG_TAG, "Could not acquire atlas", e); } Loading
core/java/android/view/IAssetAtlas.aidl +7 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,13 @@ import android.view.GraphicBuffer; * @hide */ interface IAssetAtlas { /** * Indicates whether the atlas is compatible with the specified * parent process id. If the atlas' ppid does not match, this * method will return false. */ boolean isCompatible(int ppid); /** * Returns the atlas buffer (texture) or null if the atlas is * not available yet. Loading
core/jni/android_util_Process.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -99,6 +99,11 @@ jint android_os_Process_myPid(JNIEnv* env, jobject clazz) return getpid(); } jint android_os_Process_myPpid(JNIEnv* env, jobject clazz) { return getppid(); } jint android_os_Process_myUid(JNIEnv* env, jobject clazz) { return getuid(); Loading Loading @@ -990,6 +995,7 @@ jintArray android_os_Process_getPidsForCommands(JNIEnv* env, jobject clazz, static const JNINativeMethod methods[] = { {"myPid", "()I", (void*)android_os_Process_myPid}, {"myPpid", "()I", (void*)android_os_Process_myPpid}, {"myTid", "()I", (void*)android_os_Process_myTid}, {"myUid", "()I", (void*)android_os_Process_myUid}, {"getUidForName", "(Ljava/lang/String;)I", (void*)android_os_Process_getUidForName}, Loading
services/java/com/android/server/AssetAtlasService.java +5 −0 Original line number Diff line number Diff line Loading @@ -369,6 +369,11 @@ public class AssetAtlasService extends IAssetAtlas.Stub { private static native void nReleaseAtlasCanvas(Canvas canvas, int bitmap); private static native boolean nUploadAtlas(GraphicBuffer buffer, int bitmap); @Override public boolean isCompatible(int ppid) { return ppid == android.os.Process.myPpid(); } @Override public GraphicBuffer getBuffer() throws RemoteException { return mAtlasReady.get() ? mBuffer : null; Loading