Move libandroid_runtime headers into frameworks/base/core/jni
Move libandroid_runtime's headers into its source directory, and export
them to modules that link against libandroid_runtime. Also fixes
one unused-paramter warning that was hidden by the use of -isystem to
include frameworks/base/include.
Bug: 33630870
Test: m -j native
Change-Id: Id6c2561d6c7d82a7ca2d183f11b1d3d3dcb42843
diff --git a/core/jni/Android.mk b/core/jni/Android.mk
index 9a596c6..5fcde8b 100644
--- a/core/jni/Android.mk
+++ b/core/jni/Android.mk
@@ -185,6 +185,7 @@
hwbinder/EphemeralStorage.cpp \
LOCAL_C_INCLUDES += \
+ $(LOCAL_PATH)/include \
$(JNI_H_INCLUDE) \
$(LOCAL_PATH)/android/graphics \
$(LOCAL_PATH)/../../libs/hwui \
@@ -279,8 +280,10 @@
# <bionic_tls.h> in com_google_android_gles_jni_GLImpl.cpp
LOCAL_C_INCLUDES += bionic/libc/private
+LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
+
# AndroidRuntime.h depends on nativehelper/jni.h
-LOCAL_EXPORT_C_INCLUDE_DIRS := libnativehelper/include
+LOCAL_EXPORT_C_INCLUDE_DIRS += libnativehelper/include
LOCAL_MODULE:= libandroid_runtime
diff --git a/core/jni/include/android_runtime/AndroidRuntime.h b/core/jni/include/android_runtime/AndroidRuntime.h
new file mode 100644
index 0000000..c2189d4
--- /dev/null
+++ b/core/jni/include/android_runtime/AndroidRuntime.h
@@ -0,0 +1,159 @@
+/*
+ * Copyright (C) 2005 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.
+ */
+
+//
+
+#ifndef _RUNTIME_ANDROID_RUNTIME_H
+#define _RUNTIME_ANDROID_RUNTIME_H
+
+#include <utils/Errors.h>
+#include <binder/IBinder.h>
+#include <utils/String8.h>
+#include <utils/String16.h>
+#include <utils/Vector.h>
+#include <utils/threads.h>
+#include <pthread.h>
+#include <nativehelper/jni.h>
+
+
+namespace android {
+
+class AndroidRuntime
+{
+public:
+ AndroidRuntime(char* argBlockStart, size_t argBlockSize);
+ virtual ~AndroidRuntime();
+
+ enum StartMode {
+ Zygote,
+ SystemServer,
+ Application,
+ Tool,
+ };
+
+ void setArgv0(const char* argv0, bool setProcName = false);
+ void addOption(const char* optionString, void* extra_info = NULL);
+
+ /**
+ * Register a set of methods in the specified class.
+ */
+ static int registerNativeMethods(JNIEnv* env,
+ const char* className, const JNINativeMethod* gMethods, int numMethods);
+
+ /**
+ * Call a class's static main method with the given arguments,
+ */
+ status_t callMain(const String8& className, jclass clazz, const Vector<String8>& args);
+
+ /**
+ * Find a class, with the input either of the form
+ * "package/class" or "package.class".
+ */
+ static jclass findClass(JNIEnv* env, const char* className);
+
+ void start(const char *classname, const Vector<String8>& options, bool zygote);
+
+ void exit(int code);
+
+ void setExitWithoutCleanup(bool exitWithoutCleanup) {
+ mExitWithoutCleanup = exitWithoutCleanup;
+ }
+
+ static AndroidRuntime* getRuntime();
+
+ /**
+ * This gets called after the VM has been created, but before we
+ * run any code. Override it to make any FindClass calls that need
+ * to use CLASSPATH.
+ */
+ virtual void onVmCreated(JNIEnv* env);
+
+ /**
+ * This gets called after the JavaVM has initialized. Override it
+ * with the system's native entry point.
+ */
+ virtual void onStarted() = 0;
+
+ /**
+ * This gets called after the JavaVM has initialized after a Zygote
+ * fork. Override it to initialize threads, etc. Upon return, the
+ * correct static main will be invoked.
+ */
+ virtual void onZygoteInit() { }
+
+ /**
+ * Called when the Java application exits to perform additional cleanup actions
+ * before the process is terminated.
+ */
+ virtual void onExit(int /*code*/) { }
+
+ /** create a new thread that is visible from Java */
+ static android_thread_id_t createJavaThread(const char* name, void (*start)(void *),
+ void* arg);
+
+ /** return a pointer to the VM running in this process */
+ static JavaVM* getJavaVM() { return mJavaVM; }
+
+ /** return a pointer to the JNIEnv pointer for this thread */
+ static JNIEnv* getJNIEnv();
+
+ /** return a new string corresponding to 'className' with all '.'s replaced by '/'s. */
+ static char* toSlashClassName(const char* className);
+
+ /** Create a Java string from an ASCII or Latin-1 string */
+ static jstring NewStringLatin1(JNIEnv* env, const char* bytes);
+
+private:
+ static int startReg(JNIEnv* env);
+ bool parseRuntimeOption(const char* property,
+ char* buffer,
+ const char* runtimeArg,
+ const char* defaultArg = "");
+ bool parseCompilerOption(const char* property,
+ char* buffer,
+ const char* compilerArg,
+ const char* quotingArg);
+ bool parseCompilerRuntimeOption(const char* property,
+ char* buffer,
+ const char* runtimeArg,
+ const char* quotingArg);
+ void parseExtraOpts(char* extraOptsBuf, const char* quotingArg);
+ int startVm(JavaVM** pJavaVM, JNIEnv** pEnv, bool zygote);
+
+ Vector<JavaVMOption> mOptions;
+ bool mExitWithoutCleanup;
+ char* const mArgBlockStart;
+ const size_t mArgBlockLength;
+
+ /* JNI JavaVM pointer */
+ static JavaVM* mJavaVM;
+
+ /*
+ * Thread creation helpers.
+ */
+ static int javaCreateThreadEtc(
+ android_thread_func_t entryFunction,
+ void* userData,
+ const char* threadName,
+ int32_t threadPriority,
+ size_t threadStackSize,
+ android_thread_id_t* threadId);
+ static int javaThreadShell(void* args);
+};
+
+}
+
+#endif
diff --git a/core/jni/include/android_runtime/Log.h b/core/jni/include/android_runtime/Log.h
new file mode 100644
index 0000000..aa6d202
--- /dev/null
+++ b/core/jni/include/android_runtime/Log.h
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2013 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.
+ */
+
+#ifndef _RUNTIME_ANDROID_LOG_H
+#define _RUNTIME_ANDROID_LOG_H
+
+// This relies on JNIHelp.h
+
+/* Logging macros.
+ *
+ * Logs an exception. If the exception is omitted or NULL, logs the current exception
+ * from the JNI environment, if any.
+ */
+#define LOG_EX(env, priority, tag, ...) \
+ jniLogException(env, ANDROID_##priority, tag, ##__VA_ARGS__)
+#define LOGV_EX(env, ...) LOG_EX(env, LOG_VERBOSE, LOG_TAG, ##__VA_ARGS__)
+#define LOGD_EX(env, ...) LOG_EX(env, LOG_DEBUG, LOG_TAG, ##__VA_ARGS__)
+#define LOGI_EX(env, ...) LOG_EX(env, LOG_INFO, LOG_TAG, ##__VA_ARGS__)
+#define LOGW_EX(env, ...) LOG_EX(env, LOG_WARN, LOG_TAG, ##__VA_ARGS__)
+#define LOGE_EX(env, ...) LOG_EX(env, LOG_ERROR, LOG_TAG, ##__VA_ARGS__)
+
+#endif // _RUNTIME_ANDROID_LOG_H
diff --git a/core/jni/include/android_runtime/android_app_NativeActivity.h b/core/jni/include/android_runtime/android_app_NativeActivity.h
new file mode 100644
index 0000000..e096e91
--- /dev/null
+++ b/core/jni/include/android_runtime/android_app_NativeActivity.h
@@ -0,0 +1,45 @@
+/*
+ * 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.
+ */
+
+#ifndef _ANDROID_APP_NATIVEACTIVITY_H
+#define _ANDROID_APP_NATIVEACTIVITY_H
+
+#include <utils/Looper.h>
+
+#include <android/native_activity.h>
+
+#include "jni.h"
+
+namespace android {
+
+extern void android_NativeActivity_finish(
+ ANativeActivity* activity);
+
+extern void android_NativeActivity_setWindowFormat(
+ ANativeActivity* activity, int32_t format);
+
+extern void android_NativeActivity_setWindowFlags(
+ ANativeActivity* activity, int32_t values, int32_t mask);
+
+extern void android_NativeActivity_showSoftInput(
+ ANativeActivity* activity, int32_t flags);
+
+extern void android_NativeActivity_hideSoftInput(
+ ANativeActivity* activity, int32_t flags);
+
+} // namespace android
+
+#endif // _ANDROID_APP_NATIVEACTIVITY_H
diff --git a/core/jni/include/android_runtime/android_content_res_Configuration.h b/core/jni/include/android_runtime/android_content_res_Configuration.h
new file mode 100644
index 0000000..34c4439
--- /dev/null
+++ b/core/jni/include/android_runtime/android_content_res_Configuration.h
@@ -0,0 +1,36 @@
+/*
+ * 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.
+ */
+
+#ifndef _ANDROID_CONTENT_RES_CONFIGURATION_H
+#define _ANDROID_CONTENT_RES_CONFIGURATION_H
+
+#include <androidfw/ResourceTypes.h>
+#include <android/configuration.h>
+
+#include "jni.h"
+
+struct AConfiguration : android::ResTable_config {
+};
+
+namespace android {
+
+extern void android_Configuration_getFromJava(
+ JNIEnv* env, jobject clazz, struct AConfiguration* out);
+
+} // namespace android
+
+
+#endif // _ANDROID_CONTENT_RES_CONFIGURATION_H
diff --git a/core/jni/include/android_runtime/android_graphics_SurfaceTexture.h b/core/jni/include/android_runtime/android_graphics_SurfaceTexture.h
new file mode 100644
index 0000000..c534d4b
--- /dev/null
+++ b/core/jni/include/android_runtime/android_graphics_SurfaceTexture.h
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2011 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.
+ */
+
+#ifndef _ANDROID_GRAPHICS_SURFACETEXTURE_H
+#define _ANDROID_GRAPHICS_SURFACETEXTURE_H
+
+#include <android/native_window.h>
+
+#include "jni.h"
+
+namespace android {
+
+class GLConsumer;
+class IGraphicBufferProducer;
+
+extern sp<ANativeWindow> android_SurfaceTexture_getNativeWindow(JNIEnv* env, jobject thiz);
+extern bool android_SurfaceTexture_isInstanceOf(JNIEnv* env, jobject thiz);
+
+/* Gets the underlying GLConsumer from a SurfaceTexture Java object. */
+extern sp<GLConsumer> SurfaceTexture_getSurfaceTexture(JNIEnv* env, jobject thiz);
+
+/* gets the producer end of the SurfaceTexture */
+extern sp<IGraphicBufferProducer> SurfaceTexture_getProducer(JNIEnv* env, jobject thiz);
+
+} // namespace android
+
+#endif // _ANDROID_GRAPHICS_SURFACETEXTURE_H
diff --git a/core/jni/include/android_runtime/android_hardware_camera2_CameraMetadata.h b/core/jni/include/android_runtime/android_hardware_camera2_CameraMetadata.h
new file mode 100644
index 0000000..3c76ca5
--- /dev/null
+++ b/core/jni/include/android_runtime/android_hardware_camera2_CameraMetadata.h
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2014 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.
+ */
+
+#ifndef ANDROID_HARDWARE_CAMERA2_CAMERAMETADATA_JNI_H
+#define ANDROID_HARDWARE_CAMERA2_CAMERAMETADATA_JNI_H
+
+#include <camera/CameraMetadata.h>
+
+#include "jni.h"
+
+namespace android {
+
+/**
+ * Copies the native metadata for this java object into the given output CameraMetadata object.
+ */
+status_t CameraMetadata_getNativeMetadata(JNIEnv* env, jobject thiz,
+ /*out*/CameraMetadata* metadata);
+
+} /*namespace android*/
+
+#endif /*ANDROID_HARDWARE_CAMERA2_CAMERAMETADATA_JNI_H*/
diff --git a/core/jni/include/android_runtime/android_util_AssetManager.h b/core/jni/include/android_runtime/android_util_AssetManager.h
new file mode 100644
index 0000000..8dd9337
--- /dev/null
+++ b/core/jni/include/android_runtime/android_util_AssetManager.h
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2008 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.
+ */
+
+#ifndef android_util_AssetManager_H
+#define android_util_AssetManager_H
+
+#include <androidfw/AssetManager.h>
+
+#include "jni.h"
+
+namespace android {
+
+extern AssetManager* assetManagerForJavaObject(JNIEnv* env, jobject assetMgr);
+
+}
+
+#endif
diff --git a/core/jni/include/android_runtime/android_view_InputQueue.h b/core/jni/include/android_runtime/android_view_InputQueue.h
new file mode 100644
index 0000000..ed37b0a
--- /dev/null
+++ b/core/jni/include/android_runtime/android_view_InputQueue.h
@@ -0,0 +1,85 @@
+/*
+ * Copyright (C) 2013 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.
+ */
+
+#ifndef _ANDROID_VIEW_INPUTQUEUE_H
+#define _ANDROID_VIEW_INPUTQUEUE_H
+
+#include <input/Input.h>
+#include <utils/Looper.h>
+#include <utils/TypeHelpers.h>
+#include <utils/Vector.h>
+
+#include "JNIHelp.h"
+
+/*
+ * Declare a concrete type for the NDK's AInputQueue forward declaration
+ */
+struct AInputQueue{
+};
+
+namespace android {
+
+class InputQueue : public AInputQueue, public MessageHandler {
+public:
+ virtual ~InputQueue();
+
+ void attachLooper(Looper* looper, int ident, ALooper_callbackFunc callback, void* data);
+
+ void detachLooper();
+
+ bool hasEvents();
+
+ status_t getEvent(InputEvent** outEvent);
+
+ bool preDispatchEvent(InputEvent* event);
+
+ void finishEvent(InputEvent* event, bool handled);
+
+ KeyEvent* createKeyEvent();
+
+ MotionEvent* createMotionEvent();
+
+ void recycleInputEvent(InputEvent* event);
+
+ void enqueueEvent(InputEvent* event);
+
+ static InputQueue* createQueue(jobject inputQueueObj, const sp<Looper>& looper);
+
+protected:
+ virtual void handleMessage(const Message& message);
+
+private:
+ InputQueue(jobject inputQueueObj, const sp<Looper>& looper,
+ int readDispatchFd, int writeDispatchFd);
+
+ void detachLooperLocked();
+
+ jobject mInputQueueWeakGlobal;
+ int mDispatchReadFd;
+ int mDispatchWriteFd;
+ Vector<Looper*> mAppLoopers;
+ sp<Looper> mDispatchLooper;
+ sp<WeakMessageHandler> mHandler;
+ PooledInputEventFactory mPooledInputEventFactory;
+ // Guards the pending and finished event vectors
+ mutable Mutex mLock;
+ Vector<InputEvent*> mPendingEvents;
+ Vector<key_value_pair_t<InputEvent*, bool> > mFinishedEvents;
+};
+
+} // namespace android
+
+#endif
diff --git a/core/jni/include/android_runtime/android_view_Surface.h b/core/jni/include/android_runtime/android_view_Surface.h
new file mode 100644
index 0000000..b1e552a
--- /dev/null
+++ b/core/jni/include/android_runtime/android_view_Surface.h
@@ -0,0 +1,90 @@
+/*
+ * 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.
+ */
+
+#ifndef _ANDROID_VIEW_SURFACE_H
+#define _ANDROID_VIEW_SURFACE_H
+
+#include <android/native_window.h>
+
+#include "jni.h"
+
+namespace android {
+
+class Surface;
+class IGraphicBufferProducer;
+
+/**
+ * Enum mirroring the public API definitions for image and pixel formats.
+ * Some of these are hidden in the public API
+ *
+ * Keep up to date with android.graphics.ImageFormat and
+ * android.graphics.PixelFormat
+ */
+enum class PublicFormat {
+ UNKNOWN = 0x0,
+ RGBA_8888 = 0x1,
+ RGBX_8888 = 0x2,
+ RGB_888 = 0x3,
+ RGB_565 = 0x4,
+ NV16 = 0x10,
+ NV21 = 0x11,
+ YUY2 = 0x14,
+ RAW_SENSOR = 0x20,
+ PRIVATE = 0x22,
+ YUV_420_888 = 0x23,
+ RAW_PRIVATE = 0x24,
+ RAW10 = 0x25,
+ RAW12 = 0x26,
+ JPEG = 0x100,
+ DEPTH_POINT_CLOUD = 0x101,
+ YV12 = 0x32315659,
+ Y8 = 0x20203859, // @hide
+ Y16 = 0x20363159, // @hide
+ DEPTH16 = 0x44363159
+};
+
+/* Gets the underlying ANativeWindow for a Surface. */
+extern sp<ANativeWindow> android_view_Surface_getNativeWindow(
+ JNIEnv* env, jobject surfaceObj);
+
+/* Returns true if the object is an instance of Surface. */
+extern bool android_view_Surface_isInstanceOf(JNIEnv* env, jobject obj);
+
+/* Gets the underlying Surface from a Surface Java object. */
+extern sp<Surface> android_view_Surface_getSurface(JNIEnv* env, jobject surfaceObj);
+
+/* Creates a Surface from an IGraphicBufferProducer. */
+extern jobject android_view_Surface_createFromIGraphicBufferProducer(JNIEnv* env,
+ const sp<IGraphicBufferProducer>& bufferProducer);
+
+/* Convert from android.graphics.ImageFormat/PixelFormat enums to graphics.h HAL
+ * format */
+extern int android_view_Surface_mapPublicFormatToHalFormat(PublicFormat f);
+
+/* Convert from android.graphics.ImageFormat/PixelFormat enums to graphics.h HAL
+ * dataspace */
+extern android_dataspace android_view_Surface_mapPublicFormatToHalDataspace(
+ PublicFormat f);
+
+/* Convert from HAL format, dataspace pair to
+ * android.graphics.ImageFormat/PixelFormat.
+ * For unknown/unspecified pairs, returns PublicFormat::UNKNOWN */
+extern PublicFormat android_view_Surface_mapHalFormatDataspaceToPublicFormat(
+ int format, android_dataspace dataSpace);
+
+} // namespace android
+
+#endif // _ANDROID_VIEW_SURFACE_H
diff --git a/core/jni/include/android_runtime/android_view_SurfaceSession.h b/core/jni/include/android_runtime/android_view_SurfaceSession.h
new file mode 100644
index 0000000..3748f6c
--- /dev/null
+++ b/core/jni/include/android_runtime/android_view_SurfaceSession.h
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2012 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.
+ */
+
+#ifndef _ANDROID_VIEW_SURFACE_SESSION_H
+#define _ANDROID_VIEW_SURFACE_SESSION_H
+
+#include "jni.h"
+
+namespace android {
+
+class SurfaceComposerClient;
+
+/* Gets the underlying SurfaceComposerClient for a SurfaceSession. */
+extern sp<SurfaceComposerClient> android_view_SurfaceSession_getClient(
+ JNIEnv* env, jobject surfaceSessionObj);
+
+} // namespace android
+
+#endif // _ANDROID_VIEW_SURFACE_SESSION_H