Loading cmds/bootanimation/BootAnimation.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -207,7 +207,7 @@ BootAnimation::BootAnimation(sp<Callbacks> callbacks) : Thread(false), mLooper(new Looper(false)), mClockEnabled(true), mTimeIsAccurate(false), mTimeFormat12Hour(false), mTimeCheckThread(nullptr), mCallbacks(callbacks) { ATRACE_CALL(); mSession = new SurfaceComposerClient(); mSession = sp<SurfaceComposerClient>::make(); std::string powerCtl = android::base::GetProperty("sys.powerctl", ""); if (powerCtl.empty()) { Loading core/jni/android_media_ImageWriter.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -399,7 +399,7 @@ static jlong ImageWriter_init(JNIEnv* env, jobject thiz, jobject weakThiz, jobje } sp<JNIImageWriterContext> ctx(new JNIImageWriterContext(env, weakThiz, clazz)); sp<Surface> producer = new Surface(bufferProducer, /*controlledByApp*/false); sp<Surface> producer = sp<Surface>::make(bufferProducer, /*controlledByApp*/ false); ctx->setProducer(producer); /** * NATIVE_WINDOW_API_CPU isn't a good choice here, as it makes the bufferQueue not connectable Loading core/jni/android_view_Surface.cpp +4 −4 Original line number Diff line number Diff line Loading @@ -139,7 +139,7 @@ jobject android_view_Surface_createFromIGraphicBufferProducer(JNIEnv* env, return NULL; } sp<Surface> surface(new Surface(bufferProducer, true)); sp<Surface> surface = sp<Surface>::make(bufferProducer, true); return android_view_Surface_createFromSurface(env, surface); } Loading @@ -161,7 +161,7 @@ static jlong nativeCreateFromSurfaceTexture(JNIEnv* env, jclass clazz, return 0; } sp<Surface> surface(new Surface(producer, true)); sp<Surface> surface = sp<Surface>::make(producer, true); if (surface == NULL) { jniThrowException(env, OutOfResourcesException, NULL); return 0; Loading Loading @@ -358,7 +358,7 @@ static jlong nativeReadFromParcel(JNIEnv* env, jclass clazz, sp<Surface> sur; if (surfaceShim.graphicBufferProducer != nullptr) { // we have a new IGraphicBufferProducer, create a new Surface for it sur = new Surface(surfaceShim.graphicBufferProducer, true, sur = sp<Surface>::make(surfaceShim.graphicBufferProducer, true, surfaceShim.surfaceControlHandle); // and keep a reference before passing to java sur->incStrong(&sRefBaseOwner); Loading core/jni/android_view_SurfaceSession.cpp +4 −4 Original line number Diff line number Diff line Loading @@ -42,14 +42,14 @@ sp<SurfaceComposerClient> android_view_SurfaceSession_getClient( static jlong nativeCreate(JNIEnv* env, jclass clazz) { SurfaceComposerClient* client = new SurfaceComposerClient(); client->incStrong((void*)nativeCreate); return reinterpret_cast<jlong>(client); // Will be deleted via decStrong() in nativeDestroy. auto client = sp<SurfaceComposerClient>::make(); return reinterpret_cast<jlong>(client.release()); } static void nativeDestroy(JNIEnv* env, jclass clazz, jlong ptr) { SurfaceComposerClient* client = reinterpret_cast<SurfaceComposerClient*>(ptr); client->decStrong((void*)nativeCreate); client->decStrong((void*)client); } static const JNINativeMethod gMethods[] = { Loading core/jni/android_view_TextureView.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -85,7 +85,7 @@ static void android_view_TextureView_createNativeWindow(JNIEnv* env, jobject tex jobject surface) { sp<IGraphicBufferProducer> producer(SurfaceTexture_getProducer(env, surface)); sp<ANativeWindow> window = new Surface(producer, true); sp<ANativeWindow> window = sp<Surface>::make(producer, true); window->incStrong((void*)android_view_TextureView_createNativeWindow); SET_LONG(textureView, gTextureViewClassInfo.nativeWindow, jlong(window.get())); Loading Loading
cmds/bootanimation/BootAnimation.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -207,7 +207,7 @@ BootAnimation::BootAnimation(sp<Callbacks> callbacks) : Thread(false), mLooper(new Looper(false)), mClockEnabled(true), mTimeIsAccurate(false), mTimeFormat12Hour(false), mTimeCheckThread(nullptr), mCallbacks(callbacks) { ATRACE_CALL(); mSession = new SurfaceComposerClient(); mSession = sp<SurfaceComposerClient>::make(); std::string powerCtl = android::base::GetProperty("sys.powerctl", ""); if (powerCtl.empty()) { Loading
core/jni/android_media_ImageWriter.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -399,7 +399,7 @@ static jlong ImageWriter_init(JNIEnv* env, jobject thiz, jobject weakThiz, jobje } sp<JNIImageWriterContext> ctx(new JNIImageWriterContext(env, weakThiz, clazz)); sp<Surface> producer = new Surface(bufferProducer, /*controlledByApp*/false); sp<Surface> producer = sp<Surface>::make(bufferProducer, /*controlledByApp*/ false); ctx->setProducer(producer); /** * NATIVE_WINDOW_API_CPU isn't a good choice here, as it makes the bufferQueue not connectable Loading
core/jni/android_view_Surface.cpp +4 −4 Original line number Diff line number Diff line Loading @@ -139,7 +139,7 @@ jobject android_view_Surface_createFromIGraphicBufferProducer(JNIEnv* env, return NULL; } sp<Surface> surface(new Surface(bufferProducer, true)); sp<Surface> surface = sp<Surface>::make(bufferProducer, true); return android_view_Surface_createFromSurface(env, surface); } Loading @@ -161,7 +161,7 @@ static jlong nativeCreateFromSurfaceTexture(JNIEnv* env, jclass clazz, return 0; } sp<Surface> surface(new Surface(producer, true)); sp<Surface> surface = sp<Surface>::make(producer, true); if (surface == NULL) { jniThrowException(env, OutOfResourcesException, NULL); return 0; Loading Loading @@ -358,7 +358,7 @@ static jlong nativeReadFromParcel(JNIEnv* env, jclass clazz, sp<Surface> sur; if (surfaceShim.graphicBufferProducer != nullptr) { // we have a new IGraphicBufferProducer, create a new Surface for it sur = new Surface(surfaceShim.graphicBufferProducer, true, sur = sp<Surface>::make(surfaceShim.graphicBufferProducer, true, surfaceShim.surfaceControlHandle); // and keep a reference before passing to java sur->incStrong(&sRefBaseOwner); Loading
core/jni/android_view_SurfaceSession.cpp +4 −4 Original line number Diff line number Diff line Loading @@ -42,14 +42,14 @@ sp<SurfaceComposerClient> android_view_SurfaceSession_getClient( static jlong nativeCreate(JNIEnv* env, jclass clazz) { SurfaceComposerClient* client = new SurfaceComposerClient(); client->incStrong((void*)nativeCreate); return reinterpret_cast<jlong>(client); // Will be deleted via decStrong() in nativeDestroy. auto client = sp<SurfaceComposerClient>::make(); return reinterpret_cast<jlong>(client.release()); } static void nativeDestroy(JNIEnv* env, jclass clazz, jlong ptr) { SurfaceComposerClient* client = reinterpret_cast<SurfaceComposerClient*>(ptr); client->decStrong((void*)nativeCreate); client->decStrong((void*)client); } static const JNINativeMethod gMethods[] = { Loading
core/jni/android_view_TextureView.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -85,7 +85,7 @@ static void android_view_TextureView_createNativeWindow(JNIEnv* env, jobject tex jobject surface) { sp<IGraphicBufferProducer> producer(SurfaceTexture_getProducer(env, surface)); sp<ANativeWindow> window = new Surface(producer, true); sp<ANativeWindow> window = sp<Surface>::make(producer, true); window->incStrong((void*)android_view_TextureView_createNativeWindow); SET_LONG(textureView, gTextureViewClassInfo.nativeWindow, jlong(window.get())); Loading