├── ic_launcher-web.png ├── jni ├── android │ ├── lib │ │ ├── libbinder.so │ │ └── libutils.so │ └── include │ │ ├── frameworks │ │ └── native │ │ │ └── include │ │ │ ├── media │ │ │ ├── openmax │ │ │ │ └── OMX_Other.h │ │ │ └── hardware │ │ │ │ └── OMXPluginBase.h │ │ │ ├── input │ │ │ └── KeycodeLabels.h │ │ │ ├── cpustats │ │ │ ├── README.txt │ │ │ └── CentralTendencyStatistics.h │ │ │ ├── utils │ │ │ ├── Atomic.h │ │ │ ├── Functor.h │ │ │ ├── SystemClock.h │ │ │ ├── Endian.h │ │ │ ├── threads.h │ │ │ ├── ashmem.h │ │ │ ├── JenkinsHash.h │ │ │ ├── Trace.h │ │ │ ├── StopWatch.h │ │ │ ├── misc.h │ │ │ ├── ZipFileCRO.h │ │ │ ├── Compat.h │ │ │ ├── LinearTransform.h │ │ │ ├── BufferedTextOutput.h │ │ │ ├── StringArray.h │ │ │ ├── ZipUtils.h │ │ │ ├── Log.h │ │ │ ├── CallStack.h │ │ │ ├── Debug.h │ │ │ ├── ByteOrder.h │ │ │ ├── Singleton.h │ │ │ └── Errors.h │ │ │ ├── diskusage │ │ │ └── dirsize.h │ │ │ ├── ui │ │ │ ├── UiConfig.h │ │ │ ├── DisplayInfo.h │ │ │ ├── GraphicBufferMapper.h │ │ │ └── Point.h │ │ │ ├── gui │ │ │ ├── GuiConfig.h │ │ │ ├── GraphicBufferAlloc.h │ │ │ ├── DummyConsumer.h │ │ │ ├── ISensorServer.h │ │ │ ├── ISensorEventConnection.h │ │ │ ├── IGraphicBufferAlloc.h │ │ │ ├── BitTube.h │ │ │ ├── SensorManager.h │ │ │ ├── IDisplayEventConnection.h │ │ │ ├── ISurfaceComposerClient.h │ │ │ └── SensorEventQueue.h │ │ │ ├── powermanager │ │ │ ├── PowerManager.h │ │ │ └── IPowerManager.h │ │ │ ├── private │ │ │ ├── binder │ │ │ │ ├── binder_module.h │ │ │ │ └── Static.h │ │ │ ├── utils │ │ │ │ └── Static.h │ │ │ └── gui │ │ │ │ ├── SyncFeatures.h │ │ │ │ └── ComposerService.h │ │ │ ├── android │ │ │ ├── rect.h │ │ │ ├── native_window_jni.h │ │ │ ├── asset_manager_jni.h │ │ │ ├── obb.h │ │ │ ├── window.h │ │ │ └── bitmap.h │ │ │ └── binder │ │ │ ├── MemoryBase.h │ │ │ ├── IAppOpsCallback.h │ │ │ ├── MemoryDealer.h │ │ │ ├── IPermissionController.h │ │ │ ├── BinderService.h │ │ │ └── PermissionCache.h │ │ └── system │ │ └── core │ │ └── include │ │ ├── sysutils │ │ ├── FrameworkClient.h │ │ ├── ServiceManager.h │ │ ├── FrameworkCommand.h │ │ ├── FrameworkListener.h │ │ ├── NetlinkListener.h │ │ ├── NetlinkEvent.h │ │ └── SocketListener.h │ │ ├── cutils │ │ ├── tztime.h │ │ ├── partition_utils.h │ │ ├── zygote.h │ │ ├── dir_hash.h │ │ ├── open_memstream.h │ │ ├── cpu_info.h │ │ ├── uevent.h │ │ ├── android_reboot.h │ │ ├── iosched_policy.h │ │ ├── process_name.h │ │ ├── multiuser.h │ │ ├── ashmem.h │ │ ├── qsort_r_compat.h │ │ ├── record_stream.h │ │ ├── uio.h │ │ ├── memory.h │ │ ├── klog.h │ │ ├── jstring.h │ │ ├── event_tag_map.h │ │ ├── logd.h │ │ ├── compiler.h │ │ ├── aref.h │ │ ├── misc.h │ │ ├── list.h │ │ ├── debugger.h │ │ ├── str_parms.h │ │ ├── config_utils.h │ │ ├── fs.h │ │ ├── qtaguid.h │ │ ├── array.h │ │ ├── native_handle.h │ │ ├── atomic-inline.h │ │ ├── sched_policy.h │ │ └── properties.h │ │ ├── sync │ │ ├── sw_sync.h │ │ └── sync.h │ │ ├── corkscrew │ │ ├── demangle.h │ │ ├── symbol_table.h │ │ └── map_info.h │ │ ├── ion │ │ └── ion.h │ │ ├── netutils │ │ └── dhcp.h │ │ ├── zipfile │ │ └── zipfile.h │ │ ├── ctest │ │ └── ctest.h │ │ └── mincrypt │ │ ├── sha.h │ │ └── rsa.h ├── Application.mk └── Android.mk ├── libs └── android-support-v4.jar ├── res ├── drawable-hdpi │ └── ic_launcher.png ├── drawable-mdpi │ └── ic_launcher.png ├── drawable-xhdpi │ └── ic_launcher.png ├── drawable-xxhdpi │ └── ic_launcher.png ├── values-sw600dp │ └── dimens.xml ├── values │ ├── dimens.xml │ ├── strings.xml │ └── styles.xml ├── menu │ └── main.xml ├── values-sw720dp-land │ └── dimens.xml ├── values-v11 │ └── styles.xml ├── values-v14 │ └── styles.xml └── layout │ └── activity_main.xml ├── .syntastic_cpp_config ├── .settings └── org.eclipse.jdt.core.prefs ├── src └── io │ └── vec │ └── demo │ └── android │ └── ipc │ ├── IPC.java │ └── MainActivity.java ├── README.md ├── .gitignore ├── project.properties ├── proguard-project.txt ├── AndroidManifest.xml └── LICENSE /ic_launcher-web.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cedricfung/AndroidIPC/HEAD/ic_launcher-web.png -------------------------------------------------------------------------------- /jni/android/lib/libbinder.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cedricfung/AndroidIPC/HEAD/jni/android/lib/libbinder.so -------------------------------------------------------------------------------- /jni/android/lib/libutils.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cedricfung/AndroidIPC/HEAD/jni/android/lib/libutils.so -------------------------------------------------------------------------------- /libs/android-support-v4.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cedricfung/AndroidIPC/HEAD/libs/android-support-v4.jar -------------------------------------------------------------------------------- /res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cedricfung/AndroidIPC/HEAD/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cedricfung/AndroidIPC/HEAD/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /res/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cedricfung/AndroidIPC/HEAD/res/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /res/drawable-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cedricfung/AndroidIPC/HEAD/res/drawable-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /.syntastic_cpp_config: -------------------------------------------------------------------------------- 1 | -Ijni 2 | -Ijni/android/include/system/core/include 3 | -Ijni/android/include/frameworks/native/include 4 | -------------------------------------------------------------------------------- /jni/android/include/frameworks/native/include/media/openmax/OMX_Other.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cedricfung/AndroidIPC/HEAD/jni/android/include/frameworks/native/include/media/openmax/OMX_Other.h -------------------------------------------------------------------------------- /.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 3 | org.eclipse.jdt.core.compiler.compliance=1.6 4 | org.eclipse.jdt.core.compiler.source=1.6 5 | -------------------------------------------------------------------------------- /jni/Application.mk: -------------------------------------------------------------------------------- 1 | NDK_TOOLCHAIN_VERSION=4.8 2 | 3 | APP_ABI := armeabi-v7a 4 | APP_PLATFORM := android-18 5 | 6 | APP_STL := stlport_static 7 | APP_CPPFLAGS += -fno-rtti -Wno-psabi -Wno-switch 8 | STLPORT_FORCE_REBUILD := false 9 | -------------------------------------------------------------------------------- /jni/android/include/frameworks/native/include/input/KeycodeLabels.h: -------------------------------------------------------------------------------- 1 | #ifndef _LIBINPUT_KEYCODE_LABELS_H 2 | #define _LIBINPUT_KEYCODE_LABELS_H 3 | 4 | #include 5 | 6 | #endif // _LIBINPUT_KEYCODE_LABELS_H 7 | -------------------------------------------------------------------------------- /res/values-sw600dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 16dp 5 | 16dp 6 | 7 | 8 | -------------------------------------------------------------------------------- /res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | AndroidIPC 5 | Settings 6 | Hello world! 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/io/vec/demo/android/ipc/IPC.java: -------------------------------------------------------------------------------- 1 | package io.vec.demo.android.ipc; 2 | 3 | import android.os.MemoryFile; 4 | 5 | public class IPC { 6 | public static native boolean setMemoryFile(MemoryFile mfs); 7 | 8 | static { 9 | System.loadLibrary("ipc_shared"); 10 | } 11 | } -------------------------------------------------------------------------------- /res/menu/main.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /res/values-sw720dp-land/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 128dp 8 | 9 | 10 | -------------------------------------------------------------------------------- /jni/android/include/frameworks/native/include/cpustats/README.txt: -------------------------------------------------------------------------------- 1 | This is a static library of CPU usage statistics, originally written 2 | for audio but most are not actually specific to audio. 3 | 4 | Requirements to be here: 5 | * should be related to CPU usage statistics 6 | * should be portable to host; avoid Android OS dependencies without a conditional 7 | -------------------------------------------------------------------------------- /res/values-v11/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /res/values-v14/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | AndroidIPC 2 | ========== 3 | 4 | Samples for various Android IPC mechanisms 5 | 6 | 7 | Build and run 8 | ------------- 9 | 10 | You need ROOT permission from the adb 11 | 12 | $ ndk-build 13 | $ adb push libs/armeabi-v7a/ipc /data/local/ 14 | $ adb shell /data/local/ipc # start the service 15 | $ adb shell service list | grep binder_shm # check the service running 16 | 17 | Then just use your Eclipse in the regular way. 18 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # built application files 2 | *.apk 3 | *.ap_ 4 | 5 | # files for the dex VM 6 | *.dex 7 | 8 | # Java class files 9 | *.class 10 | 11 | # generated files 12 | bin/ 13 | gen/ 14 | obj/ 15 | 16 | # Local configuration file (sdk path, etc) 17 | local.properties 18 | 19 | # Eclipse project files 20 | .classpath 21 | .project 22 | libs/armeabi* 23 | 24 | # Intellij project files 25 | out/ 26 | build/ 27 | */src/main/libs/armeabi* 28 | .idea/ 29 | .gradle/ 30 | *.iml 31 | *.ipr 32 | *.iws 33 | -------------------------------------------------------------------------------- /jni/android/include/system/core/include/sysutils/FrameworkClient.h: -------------------------------------------------------------------------------- 1 | #ifndef _FRAMEWORK_CLIENT_H 2 | #define _FRAMEWORK_CLIENT_H 3 | 4 | #include "List.h" 5 | 6 | #include 7 | 8 | class FrameworkClient { 9 | int mSocket; 10 | pthread_mutex_t mWriteMutex; 11 | 12 | public: 13 | FrameworkClient(int sock); 14 | virtual ~FrameworkClient() {} 15 | 16 | int sendMsg(const char *msg); 17 | int sendMsg(const char *msg, const char *data); 18 | }; 19 | 20 | typedef android::sysutils::List FrameworkClientCollection; 21 | #endif 22 | -------------------------------------------------------------------------------- /project.properties: -------------------------------------------------------------------------------- 1 | # This file is automatically generated by Android Tools. 2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 3 | # 4 | # This file must be checked in Version Control Systems. 5 | # 6 | # To customize properties used by the Ant build system edit 7 | # "ant.properties", and override values to adapt the script to your 8 | # project structure. 9 | # 10 | # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home): 11 | #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt 12 | 13 | # Project target. 14 | target=android-18 15 | -------------------------------------------------------------------------------- /res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 10 | 11 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 14 | 15 | 16 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /proguard-project.txt: -------------------------------------------------------------------------------- 1 | # To enable ProGuard in your project, edit project.properties 2 | # to define the proguard.config property as described in that file. 3 | # 4 | # Add project specific ProGuard rules here. 5 | # By default, the flags in this file are appended to flags specified 6 | # in ${sdk.dir}/tools/proguard/proguard-android.txt 7 | # You can edit the include path and order by changing the ProGuard 8 | # include property in project.properties. 9 | # 10 | # For more details, see 11 | # http://developer.android.com/guide/developing/tools/proguard.html 12 | 13 | # Add any project specific keep options here: 14 | 15 | # If your project uses WebView with JS, uncomment the following 16 | # and specify the fully qualified class name to the JavaScript interface 17 | # class: 18 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 19 | # public *; 20 | #} 21 | -------------------------------------------------------------------------------- /jni/android/include/frameworks/native/include/utils/Atomic.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef ANDROID_UTILS_ATOMIC_H 18 | #define ANDROID_UTILS_ATOMIC_H 19 | 20 | #include 21 | 22 | #endif // ANDROID_UTILS_ATOMIC_H 23 | -------------------------------------------------------------------------------- /jni/android/include/system/core/include/cutils/tztime.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef _CUTILS_TZTIME_H 18 | #define _CUTILS_TZTIME_H 19 | 20 | // TODO: fix both callers to just include themselves. 21 | #include 22 | 23 | #endif /* __CUTILS_TZTIME_H */ 24 | 25 | -------------------------------------------------------------------------------- /src/io/vec/demo/android/ipc/MainActivity.java: -------------------------------------------------------------------------------- 1 | package io.vec.demo.android.ipc; 2 | 3 | import java.io.IOException; 4 | 5 | import android.app.Activity; 6 | import android.os.Bundle; 7 | import android.os.MemoryFile; 8 | import android.util.Log; 9 | import android.view.Menu; 10 | 11 | public class MainActivity extends Activity { 12 | 13 | @Override 14 | protected void onCreate(Bundle savedInstanceState) { 15 | super.onCreate(savedInstanceState); 16 | setContentView(R.layout.activity_main); 17 | try { 18 | MemoryFile mf = new MemoryFile("shm-demo", 1024); 19 | boolean ipcStatus = IPC.setMemoryFile(mf); 20 | Log.i("AndroidIPC::SHM", "IPC.setMemoryFile " + ipcStatus); 21 | mf.close(); 22 | } catch (IOException e) { 23 | e.printStackTrace(); 24 | } 25 | } 26 | 27 | @Override 28 | public boolean onCreateOptionsMenu(Menu menu) { 29 | getMenuInflater().inflate(R.menu.main, menu); 30 | return true; 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 10 | 11 | 16 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /jni/android/include/system/core/include/cutils/partition_utils.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011, The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef __CUTILS_PARTITION_WIPED_H__ 18 | #define __CUTILS_PARTITION_WIPED_H__ 19 | 20 | __BEGIN_DECLS 21 | 22 | int partition_wiped(char *source); 23 | void erase_footer(const char *dev_path, long long size); 24 | 25 | __END_DECLS 26 | 27 | #endif /* __CUTILS_PARTITION_WIPED_H__ */ 28 | -------------------------------------------------------------------------------- /jni/android/include/frameworks/native/include/diskusage/dirsize.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright (C) 2010 The Android Open Source Project 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | #ifndef __LIBDISKUSAGE_DIRSIZE_H 19 | #define __LIBDISKUSAGE_DIRSIZE_H 20 | 21 | #include 22 | 23 | __BEGIN_DECLS 24 | 25 | int64_t stat_size(struct stat *s); 26 | int64_t calculate_dir_size(int dfd); 27 | 28 | __END_DECLS 29 | 30 | #endif /* __LIBDISKUSAGE_DIRSIZE_H */ 31 | -------------------------------------------------------------------------------- /jni/android/include/frameworks/native/include/ui/UiConfig.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef ANDROID_UI_CONFIG_H 18 | #define ANDROID_UI_CONFIG_H 19 | 20 | #include 21 | 22 | namespace android { 23 | 24 | // Append the libui configuration details to configStr. 25 | void appendUiConfigString(String8& configStr); 26 | 27 | }; // namespace android 28 | 29 | #endif /*ANDROID_UI_CONFIG_H*/ 30 | -------------------------------------------------------------------------------- /jni/android/include/system/core/include/sysutils/ServiceManager.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef _SERVICE_MANAGER_H 18 | #define _SERVICE_MANAGER_H 19 | 20 | class ServiceManager { 21 | public: 22 | ServiceManager(); 23 | virtual ~ServiceManager() {} 24 | 25 | int start(const char *name); 26 | int stop(const char *name); 27 | bool isRunning(const char *name); 28 | }; 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /jni/android/include/frameworks/native/include/gui/GuiConfig.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef ANDROID_GUI_CONFIG_H 18 | #define ANDROID_GUI_CONFIG_H 19 | 20 | #include 21 | 22 | namespace android { 23 | 24 | // Append the libgui configuration details to configStr. 25 | void appendGuiConfigString(String8& configStr); 26 | 27 | }; // namespace android 28 | 29 | #endif /*ANDROID_GUI_CONFIG_H*/ 30 | -------------------------------------------------------------------------------- /jni/android/include/system/core/include/cutils/zygote.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2007 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef __CUTILS_ZYGOTE_H 18 | #define __CUTILS_ZYGOTE_H 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | int zygote_run_oneshot(int sendStdio, int argc, const char **argv); 25 | int zygote_run(int argc, const char **argv); 26 | 27 | #ifdef __cplusplus 28 | } 29 | #endif 30 | 31 | #endif /* __CUTILS_ZYGOTE_H */ 32 | -------------------------------------------------------------------------------- /jni/android/include/frameworks/native/include/powermanager/PowerManager.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef ANDROID_POWERMANAGER_H 18 | #define ANDROID_POWERMANAGER_H 19 | 20 | namespace android { 21 | 22 | // must be kept in sync with definitions in PowerManager.java 23 | enum { 24 | POWERMANAGER_PARTIAL_WAKE_LOCK = 1, // equals PowerManager.PARTIAL_WAKE_LOCK constant 25 | }; 26 | 27 | }; // namespace android 28 | 29 | #endif // ANDROID_POWERMANAGER_H 30 | -------------------------------------------------------------------------------- /jni/android/include/frameworks/native/include/utils/Functor.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef ANDROID_FUNCTOR_H 18 | #define ANDROID_FUNCTOR_H 19 | 20 | #include 21 | 22 | namespace android { 23 | 24 | class Functor { 25 | public: 26 | Functor() {} 27 | virtual ~Functor() {} 28 | virtual status_t operator ()(int what, void* data) { return NO_ERROR; } 29 | }; 30 | 31 | }; // namespace android 32 | 33 | #endif // ANDROID_FUNCTOR_H 34 | -------------------------------------------------------------------------------- /jni/android/include/system/core/include/cutils/dir_hash.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2007 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | typedef enum { 18 | SHA_1, 19 | } HashAlgorithm; 20 | 21 | int get_file_hash(HashAlgorithm algorithm, const char *path, 22 | char *output_string, size_t max_output_string); 23 | 24 | int get_recursive_hash_manifest(HashAlgorithm algorithm, 25 | const char *directory_path, 26 | char **output_string); 27 | -------------------------------------------------------------------------------- /jni/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | 3 | 4 | include $(CLEAR_VARS) 5 | 6 | ANDROID_INCLUDE := $(LOCAL_PATH)/android/include 7 | ANDROID_LIB := $(LOCAL_PATH)/android/lib 8 | 9 | LOCAL_CFLAGS += -DHAVE_PTHREADS -DHAVE_SYS_UIO_H 10 | 11 | LOCAL_C_INCLUDES += $(ANDROID_INCLUDE)/system/core/include 12 | LOCAL_C_INCLUDES += $(ANDROID_INCLUDE)/frameworks/native/include 13 | 14 | LOCAL_LDLIBS += -L$(ANDROID_LIB) 15 | LOCAL_LDLIBS += -llog -lutils -lbinder 16 | 17 | LOCAL_SRC_FILES := BinderSHM.cpp 18 | 19 | LOCAL_MODULE := ipc_shared 20 | include $(BUILD_SHARED_LIBRARY) 21 | 22 | 23 | 24 | 25 | include $(CLEAR_VARS) 26 | 27 | ANDROID_INCLUDE := $(LOCAL_PATH)/android/include 28 | ANDROID_LIB := $(LOCAL_PATH)/android/lib 29 | 30 | LOCAL_CFLAGS += -DHAVE_PTHREADS -DHAVE_SYS_UIO_H 31 | 32 | LOCAL_C_INCLUDES += $(ANDROID_INCLUDE)/system/core/include 33 | LOCAL_C_INCLUDES += $(ANDROID_INCLUDE)/frameworks/native/include 34 | 35 | LOCAL_LDLIBS += -L$(ANDROID_LIB) 36 | LOCAL_LDLIBS += -llog -lutils -lbinder 37 | 38 | LOCAL_SRC_FILES := BinderSHM.cpp 39 | 40 | LOCAL_MODULE := ipc 41 | include $(BUILD_EXECUTABLE) 42 | -------------------------------------------------------------------------------- /jni/android/include/frameworks/native/include/private/binder/binder_module.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef _BINDER_MODULE_H_ 18 | #define _BINDER_MODULE_H_ 19 | 20 | #ifdef __cplusplus 21 | namespace android { 22 | #endif 23 | 24 | /* obtain structures and constants from the kernel header */ 25 | 26 | #include 27 | #include 28 | 29 | #ifdef __cplusplus 30 | } // namespace android 31 | #endif 32 | 33 | #endif // _BINDER_MODULE_H_ 34 | -------------------------------------------------------------------------------- /jni/android/include/frameworks/native/include/utils/SystemClock.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef ANDROID_UTILS_SYSTEMCLOCK_H 18 | #define ANDROID_UTILS_SYSTEMCLOCK_H 19 | 20 | #include 21 | #include 22 | 23 | namespace android { 24 | 25 | int setCurrentTimeMillis(int64_t millis); 26 | int64_t uptimeMillis(); 27 | int64_t elapsedRealtime(); 28 | int64_t elapsedRealtimeNano(); 29 | 30 | }; // namespace android 31 | 32 | #endif // ANDROID_UTILS_SYSTEMCLOCK_H 33 | 34 | -------------------------------------------------------------------------------- /jni/android/include/system/core/include/cutils/open_memstream.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef __CUTILS_OPEN_MEMSTREAM_H__ 18 | #define __CUTILS_OPEN_MEMSTREAM_H__ 19 | 20 | #include 21 | 22 | #ifndef HAVE_OPEN_MEMSTREAM 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | FILE* open_memstream(char** bufp, size_t* sizep); 29 | 30 | #ifdef __cplusplus 31 | } 32 | #endif 33 | 34 | #endif /*!HAVE_OPEN_MEMSTREAM*/ 35 | 36 | #endif /*__CUTILS_OPEN_MEMSTREAM_H__*/ 37 | -------------------------------------------------------------------------------- /jni/android/include/frameworks/native/include/android/rect.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | 18 | #ifndef ANDROID_RECT_H 19 | #define ANDROID_RECT_H 20 | 21 | #include 22 | 23 | #ifdef __cplusplus 24 | extern "C" { 25 | #endif 26 | 27 | typedef struct ARect { 28 | #ifdef __cplusplus 29 | typedef int32_t value_type; 30 | #endif 31 | int32_t left; 32 | int32_t top; 33 | int32_t right; 34 | int32_t bottom; 35 | } ARect; 36 | 37 | #ifdef __cplusplus 38 | }; 39 | #endif 40 | 41 | #endif // ANDROID_RECT_H 42 | -------------------------------------------------------------------------------- /jni/android/include/system/core/include/cutils/cpu_info.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2007 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef __CUTILS_CPU_INFO_H 18 | #define __CUTILS_CPU_INFO_H 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | /* returns a string contiaining an ASCII representation of the CPU serial number, 25 | ** or NULL if cpu info not available. 26 | ** The string is a static variable, so don't call free() on it. 27 | */ 28 | extern const char* get_cpu_serial_number(void); 29 | 30 | #ifdef __cplusplus 31 | } 32 | #endif 33 | 34 | #endif /* __CUTILS_CPU_INFO_H */ 35 | -------------------------------------------------------------------------------- /jni/android/include/system/core/include/sync/sw_sync.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sw_sync.h 3 | * 4 | * Copyright 2013 Google, Inc 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | #ifndef __SYS_CORE_SW_SYNC_H 20 | #define __SYS_CORE_SW_SYNC_H 21 | 22 | #include "sync.h" 23 | 24 | __BEGIN_DECLS 25 | 26 | /* 27 | * sw_sync is mainly intended for testing and should not be compiled into 28 | * production kernels 29 | */ 30 | 31 | int sw_sync_timeline_create(void); 32 | int sw_sync_timeline_inc(int fd, unsigned count); 33 | int sw_sync_fence_create(int fd, const char *name, unsigned value); 34 | 35 | __END_DECLS 36 | 37 | #endif /* __SYS_CORE_SW_SYNC_H */ 38 | -------------------------------------------------------------------------------- /jni/android/include/system/core/include/cutils/uevent.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef __CUTILS_UEVENT_H 18 | #define __CUTILS_UEVENT_H 19 | 20 | #include 21 | #include 22 | 23 | #ifdef __cplusplus 24 | extern "C" { 25 | #endif 26 | 27 | int uevent_open_socket(int buf_sz, bool passcred); 28 | ssize_t uevent_kernel_multicast_recv(int socket, void *buffer, size_t length); 29 | ssize_t uevent_kernel_multicast_uid_recv(int socket, void *buffer, size_t length, uid_t *uid); 30 | 31 | #ifdef __cplusplus 32 | } 33 | #endif 34 | 35 | #endif /* __CUTILS_UEVENT_H */ 36 | -------------------------------------------------------------------------------- /jni/android/include/system/core/include/cutils/android_reboot.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011, The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef __CUTILS_ANDROID_REBOOT_H__ 18 | #define __CUTILS_ANDROID_REBOOT_H__ 19 | 20 | __BEGIN_DECLS 21 | 22 | /* Commands */ 23 | #define ANDROID_RB_RESTART 0xDEAD0001 24 | #define ANDROID_RB_POWEROFF 0xDEAD0002 25 | #define ANDROID_RB_RESTART2 0xDEAD0003 26 | 27 | /* Flags */ 28 | #define ANDROID_RB_FLAG_NO_SYNC 0x1 29 | #define ANDROID_RB_FLAG_NO_REMOUNT_RO 0x2 30 | 31 | int android_reboot(int cmd, int flags, char *arg); 32 | 33 | __END_DECLS 34 | 35 | #endif /* __CUTILS_ANDROID_REBOOT_H__ */ 36 | -------------------------------------------------------------------------------- /jni/android/include/frameworks/native/include/utils/Endian.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | // 18 | // Android endian-ness defines. 19 | // 20 | #ifndef _LIBS_UTILS_ENDIAN_H 21 | #define _LIBS_UTILS_ENDIAN_H 22 | 23 | #if defined(HAVE_ENDIAN_H) 24 | 25 | #include 26 | 27 | #else /*not HAVE_ENDIAN_H*/ 28 | 29 | #define __BIG_ENDIAN 0x1000 30 | #define __LITTLE_ENDIAN 0x0001 31 | 32 | #if defined(HAVE_LITTLE_ENDIAN) 33 | # define __BYTE_ORDER __LITTLE_ENDIAN 34 | #else 35 | # define __BYTE_ORDER __BIG_ENDIAN 36 | #endif 37 | 38 | #endif /*not HAVE_ENDIAN_H*/ 39 | 40 | #endif /*_LIBS_UTILS_ENDIAN_H*/ 41 | -------------------------------------------------------------------------------- /jni/android/include/frameworks/native/include/utils/threads.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2007 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef _LIBS_UTILS_THREADS_H 18 | #define _LIBS_UTILS_THREADS_H 19 | 20 | /* 21 | * Please, DO NOT USE! 22 | * 23 | * This file is here only for legacy reasons. Instead, include directly 24 | * the headers you need below. 25 | * 26 | */ 27 | 28 | #include 29 | 30 | #ifdef __cplusplus 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #endif 37 | 38 | #endif // _LIBS_UTILS_THREADS_H 39 | -------------------------------------------------------------------------------- /jni/android/include/frameworks/native/include/private/utils/Static.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | // All static variables go here, to control initialization and 18 | // destruction order in the library. 19 | 20 | #include 21 | #include 22 | 23 | namespace android { 24 | // For TextStream.cpp 25 | extern Vector gTextBuffers; 26 | 27 | // For String8.cpp 28 | extern void initialize_string8(); 29 | extern void terminate_string8(); 30 | 31 | // For String16.cpp 32 | extern void initialize_string16(); 33 | extern void terminate_string16(); 34 | 35 | } // namespace android 36 | -------------------------------------------------------------------------------- /jni/android/include/system/core/include/cutils/iosched_policy.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2007 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef __CUTILS_IOSCHED_POLICY_H 18 | #define __CUTILS_IOSCHED_POLICY_H 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | typedef enum { 25 | IoSchedClass_NONE, 26 | IoSchedClass_RT, 27 | IoSchedClass_BE, 28 | IoSchedClass_IDLE, 29 | } IoSchedClass; 30 | 31 | extern int android_set_ioprio(int pid, IoSchedClass clazz, int ioprio); 32 | extern int android_get_ioprio(int pid, IoSchedClass *clazz, int *ioprio); 33 | 34 | #ifdef __cplusplus 35 | } 36 | #endif 37 | 38 | #endif /* __CUTILS_IOSCHED_POLICY_H */ 39 | -------------------------------------------------------------------------------- /jni/android/include/system/core/include/cutils/process_name.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * Gives the current process a name. 19 | */ 20 | 21 | #ifndef __PROCESS_NAME_H 22 | #define __PROCESS_NAME_H 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | /** 29 | * Sets the current process name. 30 | * 31 | * Warning: This leaks a string every time you call it. Use judiciously! 32 | */ 33 | void set_process_name(const char* process_name); 34 | 35 | /** Gets the current process name. */ 36 | const char* get_process_name(void); 37 | 38 | #ifdef __cplusplus 39 | } 40 | #endif 41 | 42 | #endif /* __PROCESS_NAME_H */ 43 | -------------------------------------------------------------------------------- /jni/android/include/system/core/include/sysutils/FrameworkCommand.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | #ifndef __FRAMEWORK_CMD_HANDLER_H 17 | #define __FRAMEWORK_CMD_HANDLER_H 18 | 19 | #include "List.h" 20 | 21 | class SocketClient; 22 | 23 | class FrameworkCommand { 24 | private: 25 | const char *mCommand; 26 | 27 | public: 28 | 29 | FrameworkCommand(const char *cmd); 30 | virtual ~FrameworkCommand() { } 31 | 32 | virtual int runCommand(SocketClient *c, int argc, char **argv) = 0; 33 | 34 | const char *getCommand() { return mCommand; } 35 | }; 36 | 37 | typedef android::sysutils::List FrameworkCommandCollection; 38 | #endif 39 | -------------------------------------------------------------------------------- /jni/android/include/system/core/include/cutils/multiuser.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef __CUTILS_MULTIUSER_H 18 | #define __CUTILS_MULTIUSER_H 19 | 20 | #include 21 | 22 | #ifdef __cplusplus 23 | extern "C" { 24 | #endif 25 | 26 | // NOTE: keep in sync with android.os.UserId 27 | 28 | #define MULTIUSER_APP_PER_USER_RANGE 100000 29 | 30 | typedef uid_t userid_t; 31 | typedef uid_t appid_t; 32 | 33 | extern userid_t multiuser_get_user_id(uid_t uid); 34 | extern appid_t multiuser_get_app_id(uid_t uid); 35 | extern uid_t multiuser_get_uid(userid_t userId, appid_t appId); 36 | 37 | #ifdef __cplusplus 38 | } 39 | #endif 40 | 41 | #endif /* __CUTILS_MULTIUSER_H */ 42 | -------------------------------------------------------------------------------- /jni/android/include/system/core/include/cutils/ashmem.h: -------------------------------------------------------------------------------- 1 | /* cutils/ashmem.h 2 | ** 3 | ** Copyright 2008 The Android Open Source Project 4 | ** 5 | ** This file is dual licensed. It may be redistributed and/or modified 6 | ** under the terms of the Apache 2.0 License OR version 2 of the GNU 7 | ** General Public License. 8 | */ 9 | 10 | #ifndef _CUTILS_ASHMEM_H 11 | #define _CUTILS_ASHMEM_H 12 | 13 | #include 14 | 15 | #ifdef __cplusplus 16 | extern "C" { 17 | #endif 18 | 19 | int ashmem_create_region(const char *name, size_t size); 20 | int ashmem_set_prot_region(int fd, int prot); 21 | int ashmem_pin_region(int fd, size_t offset, size_t len); 22 | int ashmem_unpin_region(int fd, size_t offset, size_t len); 23 | int ashmem_get_size_region(int fd); 24 | 25 | #ifdef __cplusplus 26 | } 27 | #endif 28 | 29 | #ifndef __ASHMEMIOC /* in case someone included too */ 30 | 31 | #define ASHMEM_NAME_LEN 256 32 | 33 | #define ASHMEM_NAME_DEF "dev/ashmem" 34 | 35 | /* Return values from ASHMEM_PIN: Was the mapping purged while unpinned? */ 36 | #define ASHMEM_NOT_PURGED 0 37 | #define ASHMEM_WAS_PURGED 1 38 | 39 | /* Return values from ASHMEM_UNPIN: Is the mapping now pinned or unpinned? */ 40 | #define ASHMEM_IS_UNPINNED 0 41 | #define ASHMEM_IS_PINNED 1 42 | 43 | #endif /* ! __ASHMEMIOC */ 44 | 45 | #endif /* _CUTILS_ASHMEM_H */ 46 | -------------------------------------------------------------------------------- /jni/android/include/system/core/include/corkscrew/demangle.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /* C++ symbol name demangling. */ 18 | 19 | #ifndef _CORKSCREW_DEMANGLE_H 20 | #define _CORKSCREW_DEMANGLE_H 21 | 22 | #include 23 | #include 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | /* 30 | * Demangles a C++ symbol name. 31 | * If name is NULL or if the name cannot be demangled, returns NULL. 32 | * Otherwise, returns a newly allocated string that contains the demangled name. 33 | * 34 | * The caller must free the returned string using free(). 35 | */ 36 | char* demangle_symbol_name(const char* name); 37 | 38 | #ifdef __cplusplus 39 | } 40 | #endif 41 | 42 | #endif // _CORKSCREW_DEMANGLE_H 43 | -------------------------------------------------------------------------------- /jni/android/include/system/core/include/cutils/qsort_r_compat.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /* 18 | * Provides a portable version of qsort_r, called qsort_r_compat, which is a 19 | * reentrant variant of qsort that passes a user data pointer to its comparator. 20 | * This implementation follows the BSD parameter convention. 21 | */ 22 | 23 | #ifndef _LIBS_CUTILS_QSORT_R_COMPAT_H 24 | #define _LIBS_CUTILS_QSORT_R_COMPAT_H 25 | 26 | #include 27 | 28 | #ifdef __cplusplus 29 | extern "C" { 30 | #endif 31 | 32 | void qsort_r_compat(void* base, size_t nel, size_t width, void* thunk, 33 | int (*compar)(void*, const void* , const void* )); 34 | 35 | #ifdef __cplusplus 36 | } 37 | #endif 38 | 39 | #endif // _LIBS_CUTILS_QSORT_R_COMPAT_H 40 | -------------------------------------------------------------------------------- /jni/android/include/system/core/include/cutils/record_stream.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /* 18 | * A simple utility for reading fixed records out of a stream fd 19 | */ 20 | 21 | #ifndef _CUTILS_RECORD_STREAM_H 22 | #define _CUTILS_RECORD_STREAM_H 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | 29 | typedef struct RecordStream RecordStream; 30 | 31 | extern RecordStream *record_stream_new(int fd, size_t maxRecordLen); 32 | extern void record_stream_free(RecordStream *p_rs); 33 | 34 | extern int record_stream_get_next (RecordStream *p_rs, void ** p_outRecord, 35 | size_t *p_outRecordLen); 36 | 37 | #ifdef __cplusplus 38 | } 39 | #endif 40 | 41 | 42 | #endif /*_CUTILS_RECORD_STREAM_H*/ 43 | 44 | -------------------------------------------------------------------------------- /jni/android/include/system/core/include/cutils/uio.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2007 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | // 18 | // implementation of sys/uio.h for platforms that don't have it (Win32) 19 | // 20 | #ifndef _LIBS_CUTILS_UIO_H 21 | #define _LIBS_CUTILS_UIO_H 22 | 23 | #ifdef HAVE_SYS_UIO_H 24 | #include 25 | #else 26 | 27 | #ifdef __cplusplus 28 | extern "C" { 29 | #endif 30 | 31 | #include 32 | 33 | struct iovec { 34 | const void* iov_base; 35 | size_t iov_len; 36 | }; 37 | 38 | extern int readv( int fd, struct iovec* vecs, int count ); 39 | extern int writev( int fd, const struct iovec* vecs, int count ); 40 | 41 | #ifdef __cplusplus 42 | } 43 | #endif 44 | 45 | #endif /* !HAVE_SYS_UIO_H */ 46 | 47 | #endif /* _LIBS_UTILS_UIO_H */ 48 | 49 | -------------------------------------------------------------------------------- /jni/android/include/frameworks/native/include/android/native_window_jni.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef ANDROID_NATIVE_WINDOW_JNI_H 18 | #define ANDROID_NATIVE_WINDOW_JNI_H 19 | 20 | #include 21 | 22 | #include 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | /** 29 | * Return the ANativeWindow associated with a Java Surface object, 30 | * for interacting with it through native code. This acquires a reference 31 | * on the ANativeWindow that is returned; be sure to use ANativeWindow_release() 32 | * when done with it so that it doesn't leak. 33 | */ 34 | ANativeWindow* ANativeWindow_fromSurface(JNIEnv* env, jobject surface); 35 | 36 | #ifdef __cplusplus 37 | }; 38 | #endif 39 | 40 | #endif // ANDROID_NATIVE_WINDOW_H 41 | -------------------------------------------------------------------------------- /jni/android/include/frameworks/native/include/android/asset_manager_jni.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | 18 | #ifndef ANDROID_ASSET_MANAGER_JNI_H 19 | #define ANDROID_ASSET_MANAGER_JNI_H 20 | 21 | #include 22 | #include 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | /** 29 | * Given a Dalvik AssetManager object, obtain the corresponding native AAssetManager 30 | * object. Note that the caller is responsible for obtaining and holding a VM reference 31 | * to the jobject to prevent its being garbage collected while the native object is 32 | * in use. 33 | */ 34 | AAssetManager* AAssetManager_fromJava(JNIEnv* env, jobject assetManager); 35 | 36 | #ifdef __cplusplus 37 | }; 38 | #endif 39 | 40 | #endif // ANDROID_ASSET_MANAGER_JNI_H 41 | -------------------------------------------------------------------------------- /jni/android/include/frameworks/native/include/private/binder/Static.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | // All static variables go here, to control initialization and 18 | // destruction order in the library. 19 | 20 | #include 21 | 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | 28 | namespace android { 29 | 30 | // For ProcessState.cpp 31 | extern Mutex gProcessMutex; 32 | extern sp gProcess; 33 | 34 | // For ServiceManager.cpp 35 | extern Mutex gDefaultServiceManagerLock; 36 | extern sp gDefaultServiceManager; 37 | extern sp gPermissionController; 38 | 39 | } // namespace android 40 | -------------------------------------------------------------------------------- /jni/android/include/system/core/include/cutils/memory.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef ANDROID_CUTILS_MEMORY_H 18 | #define ANDROID_CUTILS_MEMORY_H 19 | 20 | #include 21 | #include 22 | 23 | #ifdef __cplusplus 24 | extern "C" { 25 | #endif 26 | 27 | /* size is given in bytes and must be multiple of 2 */ 28 | void android_memset16(uint16_t* dst, uint16_t value, size_t size); 29 | 30 | /* size is given in bytes and must be multiple of 4 */ 31 | void android_memset32(uint32_t* dst, uint32_t value, size_t size); 32 | 33 | #if !HAVE_STRLCPY 34 | /* Declaration of strlcpy() for platforms that don't already have it. */ 35 | size_t strlcpy(char *dst, const char *src, size_t size); 36 | #endif 37 | 38 | #ifdef __cplusplus 39 | } // extern "C" 40 | #endif 41 | 42 | #endif // ANDROID_CUTILS_MEMORY_H 43 | -------------------------------------------------------------------------------- /jni/android/include/system/core/include/cutils/klog.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef _CUTILS_KLOG_H_ 18 | #define _CUTILS_KLOG_H_ 19 | 20 | #include 21 | 22 | __BEGIN_DECLS 23 | 24 | void klog_init(void); 25 | void klog_set_level(int level); 26 | void klog_close(void); 27 | void klog_write(int level, const char *fmt, ...) 28 | __attribute__ ((format(printf, 2, 3))); 29 | 30 | __END_DECLS 31 | 32 | #define KLOG_ERROR(tag,x...) klog_write(3, "<3>" tag ": " x) 33 | #define KLOG_WARNING(tag,x...) klog_write(4, "<4>" tag ": " x) 34 | #define KLOG_NOTICE(tag,x...) klog_write(5, "<5>" tag ": " x) 35 | #define KLOG_INFO(tag,x...) klog_write(6, "<6>" tag ": " x) 36 | #define KLOG_DEBUG(tag,x...) klog_write(7, "<7>" tag ": " x) 37 | 38 | #define KLOG_DEFAULT_LEVEL 3 /* messages <= this level are logged */ 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /jni/android/include/frameworks/native/include/utils/ashmem.h: -------------------------------------------------------------------------------- 1 | /* utils/ashmem.h 2 | ** 3 | ** Copyright 2008 The Android Open Source Project 4 | ** 5 | ** This file is dual licensed. It may be redistributed and/or modified 6 | ** under the terms of the Apache 2.0 License OR version 2 of the GNU 7 | ** General Public License. 8 | */ 9 | 10 | #ifndef _UTILS_ASHMEM_H 11 | #define _UTILS_ASHMEM_H 12 | 13 | #include 14 | #include 15 | 16 | #define ASHMEM_NAME_LEN 256 17 | 18 | #define ASHMEM_NAME_DEF "dev/ashmem" 19 | 20 | /* Return values from ASHMEM_PIN: Was the mapping purged while unpinned? */ 21 | #define ASHMEM_NOT_REAPED 0 22 | #define ASHMEM_WAS_REAPED 1 23 | 24 | /* Return values from ASHMEM_UNPIN: Is the mapping now pinned or unpinned? */ 25 | #define ASHMEM_NOW_UNPINNED 0 26 | #define ASHMEM_NOW_PINNED 1 27 | 28 | #define __ASHMEMIOC 0x77 29 | 30 | #define ASHMEM_SET_NAME _IOW(__ASHMEMIOC, 1, char[ASHMEM_NAME_LEN]) 31 | #define ASHMEM_GET_NAME _IOR(__ASHMEMIOC, 2, char[ASHMEM_NAME_LEN]) 32 | #define ASHMEM_SET_SIZE _IOW(__ASHMEMIOC, 3, size_t) 33 | #define ASHMEM_GET_SIZE _IO(__ASHMEMIOC, 4) 34 | #define ASHMEM_SET_PROT_MASK _IOW(__ASHMEMIOC, 5, unsigned long) 35 | #define ASHMEM_GET_PROT_MASK _IO(__ASHMEMIOC, 6) 36 | #define ASHMEM_PIN _IO(__ASHMEMIOC, 7) 37 | #define ASHMEM_UNPIN _IO(__ASHMEMIOC, 8) 38 | #define ASHMEM_ISPINNED _IO(__ASHMEMIOC, 9) 39 | #define ASHMEM_PURGE_ALL_CACHES _IO(__ASHMEMIOC, 10) 40 | 41 | #endif /* _UTILS_ASHMEM_H */ 42 | -------------------------------------------------------------------------------- /jni/android/include/system/core/include/cutils/jstring.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef __CUTILS_STRING16_H 18 | #define __CUTILS_STRING16_H 19 | 20 | #include 21 | #include 22 | 23 | #ifdef __cplusplus 24 | extern "C" { 25 | #endif 26 | 27 | typedef uint16_t char16_t; 28 | 29 | extern char * strndup16to8 (const char16_t* s, size_t n); 30 | extern size_t strnlen16to8 (const char16_t* s, size_t n); 31 | extern char * strncpy16to8 (char *dest, const char16_t*s, size_t n); 32 | 33 | extern char16_t * strdup8to16 (const char* s, size_t *out_len); 34 | extern size_t strlen8to16 (const char* utf8Str); 35 | extern char16_t * strcpy8to16 (char16_t *dest, const char*s, size_t *out_len); 36 | extern char16_t * strcpylen8to16 (char16_t *dest, const char*s, int length, 37 | size_t *out_len); 38 | 39 | #ifdef __cplusplus 40 | } 41 | #endif 42 | 43 | #endif /* __CUTILS_STRING16_H */ 44 | -------------------------------------------------------------------------------- /jni/android/include/system/core/include/cutils/event_tag_map.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2007 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef _LIBS_CUTILS_EVENTTAGMAP_H 18 | #define _LIBS_CUTILS_EVENTTAGMAP_H 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | #define EVENT_TAG_MAP_FILE "/system/etc/event-log-tags" 25 | 26 | struct EventTagMap; 27 | typedef struct EventTagMap EventTagMap; 28 | 29 | /* 30 | * Open the specified file as an event log tag map. 31 | * 32 | * Returns NULL on failure. 33 | */ 34 | EventTagMap* android_openEventTagMap(const char* fileName); 35 | 36 | /* 37 | * Close the map. 38 | */ 39 | void android_closeEventTagMap(EventTagMap* map); 40 | 41 | /* 42 | * Look up a tag by index. Returns the tag string, or NULL if not found. 43 | */ 44 | const char* android_lookupEventTag(const EventTagMap* map, int tag); 45 | 46 | #ifdef __cplusplus 47 | } 48 | #endif 49 | 50 | #endif /*_LIBS_CUTILS_EVENTTAGMAP_H*/ 51 | -------------------------------------------------------------------------------- /jni/android/include/frameworks/native/include/powermanager/IPowerManager.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef ANDROID_IPOWERMANAGER_H 18 | #define ANDROID_IPOWERMANAGER_H 19 | 20 | #include 21 | #include 22 | 23 | namespace android { 24 | 25 | // ---------------------------------------------------------------------------- 26 | 27 | // must be kept in sync with interface defined in IPowerManager.aidl 28 | class IPowerManager : public IInterface 29 | { 30 | public: 31 | DECLARE_META_INTERFACE(PowerManager); 32 | 33 | virtual status_t acquireWakeLock(int flags, const sp& lock, const String16& tag) = 0; 34 | virtual status_t releaseWakeLock(const sp& lock, int flags) = 0; 35 | }; 36 | 37 | // ---------------------------------------------------------------------------- 38 | 39 | }; // namespace android 40 | 41 | #endif // ANDROID_IPOWERMANAGER_H 42 | -------------------------------------------------------------------------------- /jni/android/include/system/core/include/cutils/logd.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2009 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef _ANDROID_CUTILS_LOGD_H 18 | #define _ANDROID_CUTILS_LOGD_H 19 | 20 | /* the stable/frozen log-related definitions have been 21 | * moved to this header, which is exposed by the NDK 22 | */ 23 | #include 24 | 25 | /* the rest is only used internally by the system */ 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #ifdef HAVE_PTHREADS 32 | #include 33 | #endif 34 | #include 35 | #include 36 | 37 | #ifdef __cplusplus 38 | extern "C" { 39 | #endif 40 | 41 | int __android_log_bwrite(int32_t tag, const void *payload, size_t len); 42 | int __android_log_btwrite(int32_t tag, char type, const void *payload, 43 | size_t len); 44 | 45 | #ifdef __cplusplus 46 | } 47 | #endif 48 | 49 | #endif /* _LOGD_H */ 50 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013, Cedric Fung 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without modification, 5 | are permitted provided that the following conditions are met: 6 | 7 | Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | Redistributions in binary form must reproduce the above copyright notice, this 11 | list of conditions and the following disclaimer in the documentation and/or 12 | other materials provided with the distribution. 13 | 14 | Neither the name of the {organization} nor the names of its 15 | contributors may be used to endorse or promote products derived from 16 | this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 19 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 20 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR 22 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 25 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 27 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /jni/android/include/system/core/include/cutils/compiler.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2009 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef ANDROID_CUTILS_COMPILER_H 18 | #define ANDROID_CUTILS_COMPILER_H 19 | 20 | /* 21 | * helps the compiler's optimizer predicting branches 22 | */ 23 | 24 | #ifdef __cplusplus 25 | # define CC_LIKELY( exp ) (__builtin_expect( !!(exp), true )) 26 | # define CC_UNLIKELY( exp ) (__builtin_expect( !!(exp), false )) 27 | #else 28 | # define CC_LIKELY( exp ) (__builtin_expect( !!(exp), 1 )) 29 | # define CC_UNLIKELY( exp ) (__builtin_expect( !!(exp), 0 )) 30 | #endif 31 | 32 | /** 33 | * exports marked symbols 34 | * 35 | * if used on a C++ class declaration, this macro must be inserted 36 | * after the "class" keyword. For instance: 37 | * 38 | * template 39 | * class ANDROID_API Singleton { } 40 | */ 41 | 42 | #define ANDROID_API __attribute__((visibility("default"))) 43 | 44 | #endif // ANDROID_CUTILS_COMPILER_H 45 | -------------------------------------------------------------------------------- /jni/android/include/frameworks/native/include/private/gui/SyncFeatures.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef ANDROID_GUI_SYNC_FEATURES_H 18 | #define ANDROID_GUI_SYNC_FEATURES_H 19 | 20 | #include 21 | #include 22 | 23 | 24 | namespace android { 25 | // ---------------------------------------------------------------------------- 26 | 27 | class SyncFeatures : public Singleton { 28 | friend class Singleton; 29 | bool mHasNativeFenceSync; 30 | bool mHasFenceSync; 31 | bool mHasWaitSync; 32 | String8 mString; 33 | SyncFeatures(); 34 | 35 | public: 36 | bool useNativeFenceSync() const; 37 | bool useFenceSync() const; 38 | bool useWaitSync() const; 39 | String8 toString() const; 40 | }; 41 | 42 | // ---------------------------------------------------------------------------- 43 | }; // namespace android 44 | 45 | #endif // ANDROID_GUI_SYNC_FEATURES_H 46 | -------------------------------------------------------------------------------- /jni/android/include/frameworks/native/include/gui/GraphicBufferAlloc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef ANDROID_SF_GRAPHIC_BUFFER_ALLOC_H 18 | #define ANDROID_SF_GRAPHIC_BUFFER_ALLOC_H 19 | 20 | #include 21 | #include 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | namespace android { 28 | // --------------------------------------------------------------------------- 29 | 30 | class GraphicBuffer; 31 | 32 | class GraphicBufferAlloc : public BnGraphicBufferAlloc { 33 | public: 34 | GraphicBufferAlloc(); 35 | virtual ~GraphicBufferAlloc(); 36 | virtual sp createGraphicBuffer(uint32_t w, uint32_t h, 37 | PixelFormat format, uint32_t usage, status_t* error); 38 | }; 39 | 40 | 41 | // --------------------------------------------------------------------------- 42 | }; // namespace android 43 | 44 | #endif // ANDROID_SF_GRAPHIC_BUFFER_ALLOC_H 45 | -------------------------------------------------------------------------------- /jni/android/include/frameworks/native/include/ui/DisplayInfo.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2007 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef ANDROID_UI_DISPLAY_INFO_H 18 | #define ANDROID_UI_DISPLAY_INFO_H 19 | 20 | #include 21 | #include 22 | 23 | #include 24 | 25 | namespace android { 26 | 27 | struct DisplayInfo { 28 | uint32_t w; 29 | uint32_t h; 30 | float xdpi; 31 | float ydpi; 32 | float fps; 33 | float density; 34 | uint8_t orientation; 35 | bool secure; 36 | uint8_t reserved[2]; 37 | // TODO: this needs to go away (currently needed only by webkit) 38 | PixelFormatInfo pixelFormatInfo; 39 | }; 40 | 41 | /* Display orientations as defined in Surface.java and ISurfaceComposer.h. */ 42 | enum { 43 | DISPLAY_ORIENTATION_0 = 0, 44 | DISPLAY_ORIENTATION_90 = 1, 45 | DISPLAY_ORIENTATION_180 = 2, 46 | DISPLAY_ORIENTATION_270 = 3 47 | }; 48 | 49 | }; // namespace android 50 | 51 | #endif // ANDROID_COMPOSER_DISPLAY_INFO_H 52 | -------------------------------------------------------------------------------- /jni/android/include/system/core/include/ion/ion.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ion.c 3 | * 4 | * Memory Allocator functions for ion 5 | * 6 | * Copyright 2011 Google, Inc 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | #ifndef __SYS_CORE_ION_H 22 | #define __SYS_CORE_ION_H 23 | 24 | #include 25 | 26 | __BEGIN_DECLS 27 | 28 | int ion_open(); 29 | int ion_close(int fd); 30 | int ion_alloc(int fd, size_t len, size_t align, unsigned int heap_mask, 31 | unsigned int flags, struct ion_handle **handle); 32 | int ion_alloc_fd(int fd, size_t len, size_t align, unsigned int heap_mask, 33 | unsigned int flags, int *handle_fd); 34 | int ion_sync_fd(int fd, int handle_fd); 35 | int ion_free(int fd, struct ion_handle *handle); 36 | int ion_map(int fd, struct ion_handle *handle, size_t length, int prot, 37 | int flags, off_t offset, unsigned char **ptr, int *map_fd); 38 | int ion_share(int fd, struct ion_handle *handle, int *share_fd); 39 | int ion_import(int fd, int share_fd, struct ion_handle **handle); 40 | 41 | __END_DECLS 42 | 43 | #endif /* __SYS_CORE_ION_H */ 44 | -------------------------------------------------------------------------------- /jni/android/include/system/core/include/sysutils/FrameworkListener.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | #ifndef _FRAMEWORKSOCKETLISTENER_H 17 | #define _FRAMEWORKSOCKETLISTENER_H 18 | 19 | #include "SocketListener.h" 20 | #include "FrameworkCommand.h" 21 | 22 | class SocketClient; 23 | 24 | class FrameworkListener : public SocketListener { 25 | public: 26 | static const int CMD_ARGS_MAX = 26; 27 | 28 | /* 1 out of errorRate will be dropped */ 29 | int errorRate; 30 | 31 | private: 32 | int mCommandCount; 33 | bool mWithSeq; 34 | FrameworkCommandCollection *mCommands; 35 | 36 | public: 37 | FrameworkListener(const char *socketName); 38 | FrameworkListener(const char *socketName, bool withSeq); 39 | virtual ~FrameworkListener() {} 40 | 41 | protected: 42 | void registerCmd(FrameworkCommand *cmd); 43 | virtual bool onDataAvailable(SocketClient *c); 44 | 45 | private: 46 | void dispatchCommand(SocketClient *c, char *data); 47 | void init(const char *socketName, bool withSeq); 48 | }; 49 | #endif 50 | -------------------------------------------------------------------------------- /jni/android/include/system/core/include/corkscrew/symbol_table.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef _CORKSCREW_SYMBOL_TABLE_H 18 | #define _CORKSCREW_SYMBOL_TABLE_H 19 | 20 | #include 21 | #include 22 | 23 | #ifdef __cplusplus 24 | extern "C" { 25 | #endif 26 | 27 | typedef struct { 28 | uintptr_t start; 29 | uintptr_t end; 30 | char* name; 31 | } symbol_t; 32 | 33 | typedef struct { 34 | symbol_t* symbols; 35 | size_t num_symbols; 36 | } symbol_table_t; 37 | 38 | /* 39 | * Loads a symbol table from a given file. 40 | * Returns NULL on error. 41 | */ 42 | symbol_table_t* load_symbol_table(const char* filename); 43 | 44 | /* 45 | * Frees a symbol table. 46 | */ 47 | void free_symbol_table(symbol_table_t* table); 48 | 49 | /* 50 | * Finds a symbol associated with an address in the symbol table. 51 | * Returns NULL if not found. 52 | */ 53 | const symbol_t* find_symbol(const symbol_table_t* table, uintptr_t addr); 54 | 55 | #ifdef __cplusplus 56 | } 57 | #endif 58 | 59 | #endif // _CORKSCREW_SYMBOL_TABLE_H 60 | -------------------------------------------------------------------------------- /jni/android/include/system/core/include/cutils/aref.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef _CUTILS_AREF_H_ 18 | #define _CUTILS_AREF_H_ 19 | 20 | #include 21 | #include 22 | 23 | #ifdef ANDROID_SMP 24 | #include 25 | #else 26 | #include 27 | #endif 28 | 29 | __BEGIN_DECLS 30 | 31 | #define AREF_TO_ITEM(aref, container, member) \ 32 | (container *) (((char*) (aref)) - offsetof(container, member)) 33 | 34 | struct aref 35 | { 36 | volatile int32_t count; 37 | }; 38 | 39 | static inline void aref_init(struct aref *r) 40 | { 41 | r->count = 1; 42 | } 43 | 44 | static inline int32_t aref_count(struct aref *r) 45 | { 46 | return r->count; 47 | } 48 | 49 | static inline void aref_get(struct aref *r) 50 | { 51 | android_atomic_inc(&r->count); 52 | } 53 | 54 | static inline void aref_put(struct aref *r, void (*release)(struct aref *)) 55 | { 56 | if (android_atomic_dec(&r->count) == 1) 57 | release(r); 58 | } 59 | 60 | __END_DECLS 61 | 62 | #endif // _CUTILS_AREF_H_ 63 | -------------------------------------------------------------------------------- /jni/android/include/system/core/include/sysutils/NetlinkListener.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | #ifndef _NETLINKLISTENER_H 17 | #define _NETLINKLISTENER_H 18 | 19 | #include "SocketListener.h" 20 | 21 | class NetlinkEvent; 22 | 23 | class NetlinkListener : public SocketListener { 24 | char mBuffer[64 * 1024]; 25 | int mFormat; 26 | 27 | public: 28 | static const int NETLINK_FORMAT_ASCII = 0; 29 | static const int NETLINK_FORMAT_BINARY = 1; 30 | 31 | #if 1 32 | /* temporary version until we can get Motorola to update their 33 | * ril.so. Their prebuilt ril.so is using this private class 34 | * so changing the NetlinkListener() constructor breaks their ril. 35 | */ 36 | NetlinkListener(int socket); 37 | NetlinkListener(int socket, int format); 38 | #else 39 | NetlinkListener(int socket, int format = NETLINK_FORMAT_ASCII); 40 | #endif 41 | virtual ~NetlinkListener() {} 42 | 43 | protected: 44 | virtual bool onDataAvailable(SocketClient *cli); 45 | virtual void onEvent(NetlinkEvent *evt) = 0; 46 | }; 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /jni/android/include/system/core/include/cutils/misc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef __CUTILS_MISC_H 18 | #define __CUTILS_MISC_H 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | /* Load an entire file into a malloc'd chunk of memory 25 | * that is length_of_file + 1 (null terminator). If 26 | * sz is non-zero, return the size of the file via sz. 27 | * Returns 0 on failure. 28 | */ 29 | extern void *load_file(const char *fn, unsigned *sz); 30 | 31 | /* Connects your process to the system debugger daemon 32 | * so that on a crash it may be logged or interactively 33 | * debugged (depending on system settings). 34 | */ 35 | extern void debuggerd_connect(void); 36 | 37 | 38 | /* This is the range of UIDs (and GIDs) that are reserved 39 | * for assigning to applications. 40 | */ 41 | #define FIRST_APPLICATION_UID 10000 42 | #define LAST_APPLICATION_UID 99999 43 | 44 | #ifdef __cplusplus 45 | } 46 | #endif 47 | 48 | #endif /* __CUTILS_MISC_H */ 49 | -------------------------------------------------------------------------------- /jni/android/include/system/core/include/sync/sync.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sync.h 3 | * 4 | * Copyright 2012 Google, Inc 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | #ifndef __SYS_CORE_SYNC_H 20 | #define __SYS_CORE_SYNC_H 21 | 22 | #include 23 | #include 24 | 25 | __BEGIN_DECLS 26 | 27 | // XXX: These structs are copied from the header "linux/sync.h". 28 | struct sync_fence_info_data { 29 | uint32_t len; 30 | char name[32]; 31 | int32_t status; 32 | uint8_t pt_info[0]; 33 | }; 34 | 35 | struct sync_pt_info { 36 | uint32_t len; 37 | char obj_name[32]; 38 | char driver_name[32]; 39 | int32_t status; 40 | uint64_t timestamp_ns; 41 | uint8_t driver_data[0]; 42 | }; 43 | 44 | /* timeout in msecs */ 45 | int sync_wait(int fd, int timeout); 46 | int sync_merge(const char *name, int fd1, int fd2); 47 | struct sync_fence_info_data *sync_fence_info(int fd); 48 | struct sync_pt_info *sync_pt_info(struct sync_fence_info_data *info, 49 | struct sync_pt_info *itr); 50 | void sync_fence_info_free(struct sync_fence_info_data *info); 51 | 52 | __END_DECLS 53 | 54 | #endif /* __SYS_CORE_SYNC_H */ 55 | -------------------------------------------------------------------------------- /jni/android/include/frameworks/native/include/android/obb.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | 18 | #ifndef ANDROID_OBB_H 19 | #define ANDROID_OBB_H 20 | 21 | #include 22 | 23 | #ifdef __cplusplus 24 | extern "C" { 25 | #endif 26 | 27 | struct AObbInfo; 28 | typedef struct AObbInfo AObbInfo; 29 | 30 | enum { 31 | AOBBINFO_OVERLAY = 0x0001, 32 | }; 33 | 34 | /** 35 | * Scan an OBB and get information about it. 36 | */ 37 | AObbInfo* AObbScanner_getObbInfo(const char* filename); 38 | 39 | /** 40 | * Destroy the AObbInfo object. You must call this when finished with the object. 41 | */ 42 | void AObbInfo_delete(AObbInfo* obbInfo); 43 | 44 | /** 45 | * Get the package name for the OBB. 46 | */ 47 | const char* AObbInfo_getPackageName(AObbInfo* obbInfo); 48 | 49 | /** 50 | * Get the version of an OBB file. 51 | */ 52 | int32_t AObbInfo_getVersion(AObbInfo* obbInfo); 53 | 54 | /** 55 | * Get the flags of an OBB file. 56 | */ 57 | int32_t AObbInfo_getFlags(AObbInfo* obbInfo); 58 | 59 | #ifdef __cplusplus 60 | }; 61 | #endif 62 | 63 | #endif // ANDROID_OBB_H 64 | -------------------------------------------------------------------------------- /jni/android/include/frameworks/native/include/utils/JenkinsHash.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /* Implementation of Jenkins one-at-a-time hash function. These choices are 18 | * optimized for code size and portability, rather than raw speed. But speed 19 | * should still be quite good. 20 | **/ 21 | 22 | #ifndef ANDROID_JENKINS_HASH_H 23 | #define ANDROID_JENKINS_HASH_H 24 | 25 | #include 26 | 27 | namespace android { 28 | 29 | /* The Jenkins hash of a sequence of 32 bit words A, B, C is: 30 | * Whiten(Mix(Mix(Mix(0, A), B), C)) */ 31 | 32 | inline uint32_t JenkinsHashMix(uint32_t hash, uint32_t data) { 33 | hash += data; 34 | hash += (hash << 10); 35 | hash ^= (hash >> 6); 36 | return hash; 37 | } 38 | 39 | hash_t JenkinsHashWhiten(uint32_t hash); 40 | 41 | /* Helpful utility functions for hashing data in 32 bit chunks */ 42 | uint32_t JenkinsHashMixBytes(uint32_t hash, const uint8_t* bytes, size_t size); 43 | 44 | uint32_t JenkinsHashMixShorts(uint32_t hash, const uint16_t* shorts, size_t size); 45 | 46 | } 47 | 48 | #endif // ANDROID_JENKINS_HASH_H 49 | -------------------------------------------------------------------------------- /jni/android/include/frameworks/native/include/binder/MemoryBase.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef ANDROID_MEMORY_BASE_H 18 | #define ANDROID_MEMORY_BASE_H 19 | 20 | #include 21 | #include 22 | 23 | #include 24 | 25 | 26 | namespace android { 27 | 28 | // --------------------------------------------------------------------------- 29 | 30 | class MemoryBase : public BnMemory 31 | { 32 | public: 33 | MemoryBase(const sp& heap, ssize_t offset, size_t size); 34 | virtual ~MemoryBase(); 35 | virtual sp getMemory(ssize_t* offset, size_t* size) const; 36 | 37 | protected: 38 | size_t getSize() const { return mSize; } 39 | ssize_t getOffset() const { return mOffset; } 40 | const sp& getHeap() const { return mHeap; } 41 | 42 | private: 43 | size_t mSize; 44 | ssize_t mOffset; 45 | sp mHeap; 46 | }; 47 | 48 | // --------------------------------------------------------------------------- 49 | }; // namespace android 50 | 51 | #endif // ANDROID_MEMORY_BASE_H 52 | -------------------------------------------------------------------------------- /jni/android/include/frameworks/native/include/gui/DummyConsumer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef ANDROID_GUI_DUMMYCONSUMER_H 18 | #define ANDROID_GUI_DUMMYCONSUMER_H 19 | 20 | #include 21 | 22 | namespace android { 23 | // ---------------------------------------------------------------------------- 24 | 25 | 26 | // The DummyConsumer does not keep a reference to BufferQueue 27 | // unlike GLConsumer. This prevents a circular reference from 28 | // forming without having to use a ProxyConsumerListener 29 | class DummyConsumer : public BufferQueue::ConsumerListener { 30 | public: 31 | DummyConsumer(); 32 | virtual ~DummyConsumer(); 33 | protected: 34 | 35 | // Implementation of the BufferQueue::ConsumerListener interface. These 36 | // calls are used to notify the GLConsumer of asynchronous events in the 37 | // BufferQueue. 38 | virtual void onFrameAvailable(); 39 | virtual void onBuffersReleased(); 40 | 41 | }; 42 | 43 | // ---------------------------------------------------------------------------- 44 | }; // namespace android 45 | 46 | #endif // ANDROID_GUI_DUMMYCONSUMER_H 47 | -------------------------------------------------------------------------------- /jni/android/include/system/core/include/sysutils/NetlinkEvent.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | #ifndef _NETLINKEVENT_H 17 | #define _NETLINKEVENT_H 18 | 19 | #include 20 | 21 | #define NL_PARAMS_MAX 32 22 | 23 | class NetlinkEvent { 24 | int mSeq; 25 | char *mPath; 26 | int mAction; 27 | char *mSubsystem; 28 | char *mParams[NL_PARAMS_MAX]; 29 | 30 | public: 31 | const static int NlActionUnknown; 32 | const static int NlActionAdd; 33 | const static int NlActionRemove; 34 | const static int NlActionChange; 35 | const static int NlActionLinkDown; 36 | const static int NlActionLinkUp; 37 | 38 | NetlinkEvent(); 39 | virtual ~NetlinkEvent(); 40 | 41 | bool decode(char *buffer, int size, int format = NetlinkListener::NETLINK_FORMAT_ASCII); 42 | const char *findParam(const char *paramName); 43 | 44 | const char *getSubsystem() { return mSubsystem; } 45 | int getAction() { return mAction; } 46 | 47 | void dump(); 48 | 49 | protected: 50 | bool parseBinaryNetlinkMessage(char *buffer, int size); 51 | bool parseAsciiNetlinkMessage(char *buffer, int size); 52 | }; 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /jni/android/include/frameworks/native/include/binder/IAppOpsCallback.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | // 18 | #ifndef ANDROID_IAPP_OPS_CALLBACK_H 19 | #define ANDROID_IAPP_OPS_CALLBACK_H 20 | 21 | #include 22 | 23 | namespace android { 24 | 25 | // ---------------------------------------------------------------------- 26 | 27 | class IAppOpsCallback : public IInterface 28 | { 29 | public: 30 | DECLARE_META_INTERFACE(AppOpsCallback); 31 | 32 | virtual void opChanged(int32_t op, const String16& packageName) = 0; 33 | 34 | enum { 35 | OP_CHANGED_TRANSACTION = IBinder::FIRST_CALL_TRANSACTION 36 | }; 37 | }; 38 | 39 | // ---------------------------------------------------------------------- 40 | 41 | class BnAppOpsCallback : public BnInterface 42 | { 43 | public: 44 | virtual status_t onTransact( uint32_t code, 45 | const Parcel& data, 46 | Parcel* reply, 47 | uint32_t flags = 0); 48 | }; 49 | 50 | // ---------------------------------------------------------------------- 51 | 52 | }; // namespace android 53 | 54 | #endif // ANDROID_IAPP_OPS_CALLBACK_H 55 | 56 | -------------------------------------------------------------------------------- /jni/android/include/frameworks/native/include/utils/Trace.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef ANDROID_TRACE_H 18 | #define ANDROID_TRACE_H 19 | 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | 28 | #include 29 | #include 30 | #include 31 | 32 | // See for more ATRACE_* macros. 33 | 34 | // ATRACE_NAME traces the beginning and end of the current scope. To trace 35 | // the correct start and end times this macro should be declared first in the 36 | // scope body. 37 | #define ATRACE_NAME(name) android::ScopedTrace ___tracer(ATRACE_TAG, name) 38 | // ATRACE_CALL is an ATRACE_NAME that uses the current function name. 39 | #define ATRACE_CALL() ATRACE_NAME(__FUNCTION__) 40 | 41 | namespace android { 42 | 43 | class ScopedTrace { 44 | public: 45 | inline ScopedTrace(uint64_t tag, const char* name) 46 | : mTag(tag) { 47 | atrace_begin(mTag,name); 48 | } 49 | 50 | inline ~ScopedTrace() { 51 | atrace_end(mTag); 52 | } 53 | 54 | private: 55 | uint64_t mTag; 56 | }; 57 | 58 | }; // namespace android 59 | 60 | #endif // ANDROID_TRACE_H 61 | -------------------------------------------------------------------------------- /jni/android/include/system/core/include/cutils/list.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef _CUTILS_LIST_H_ 18 | #define _CUTILS_LIST_H_ 19 | 20 | #include 21 | 22 | #ifdef __cplusplus 23 | extern "C" { 24 | #endif /* __cplusplus */ 25 | 26 | struct listnode 27 | { 28 | struct listnode *next; 29 | struct listnode *prev; 30 | }; 31 | 32 | #define node_to_item(node, container, member) \ 33 | (container *) (((char*) (node)) - offsetof(container, member)) 34 | 35 | #define list_declare(name) \ 36 | struct listnode name = { \ 37 | .next = &name, \ 38 | .prev = &name, \ 39 | } 40 | 41 | #define list_for_each(node, list) \ 42 | for (node = (list)->next; node != (list); node = node->next) 43 | 44 | #define list_for_each_reverse(node, list) \ 45 | for (node = (list)->prev; node != (list); node = node->prev) 46 | 47 | void list_init(struct listnode *list); 48 | void list_add_tail(struct listnode *list, struct listnode *item); 49 | void list_remove(struct listnode *item); 50 | 51 | #define list_empty(list) ((list) == (list)->next) 52 | #define list_head(list) ((list)->next) 53 | #define list_tail(list) ((list)->prev) 54 | 55 | #ifdef __cplusplus 56 | }; 57 | #endif /* __cplusplus */ 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /jni/android/include/system/core/include/cutils/debugger.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef __CUTILS_DEBUGGER_H 18 | #define __CUTILS_DEBUGGER_H 19 | 20 | #include 21 | 22 | #ifdef __cplusplus 23 | extern "C" { 24 | #endif 25 | 26 | #define DEBUGGER_SOCKET_NAME "android:debuggerd" 27 | 28 | typedef enum { 29 | // dump a crash 30 | DEBUGGER_ACTION_CRASH, 31 | // dump a tombstone file 32 | DEBUGGER_ACTION_DUMP_TOMBSTONE, 33 | // dump a backtrace only back to the socket 34 | DEBUGGER_ACTION_DUMP_BACKTRACE, 35 | } debugger_action_t; 36 | 37 | typedef struct { 38 | debugger_action_t action; 39 | pid_t tid; 40 | uintptr_t abort_msg_address; 41 | } debugger_msg_t; 42 | 43 | /* Dumps a process backtrace, registers, and stack to a tombstone file (requires root). 44 | * Stores the tombstone path in the provided buffer. 45 | * Returns 0 on success, -1 on error. 46 | */ 47 | int dump_tombstone(pid_t tid, char* pathbuf, size_t pathlen); 48 | 49 | /* Dumps a process backtrace only to the specified file (requires root). 50 | * Returns 0 on success, -1 on error. 51 | */ 52 | int dump_backtrace_to_file(pid_t tid, int fd); 53 | 54 | #ifdef __cplusplus 55 | } 56 | #endif 57 | 58 | #endif /* __CUTILS_DEBUGGER_H */ 59 | -------------------------------------------------------------------------------- /jni/android/include/system/core/include/sysutils/SocketListener.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | #ifndef _SOCKETLISTENER_H 17 | #define _SOCKETLISTENER_H 18 | 19 | #include 20 | 21 | #include 22 | 23 | class SocketListener { 24 | bool mListen; 25 | const char *mSocketName; 26 | int mSock; 27 | SocketClientCollection *mClients; 28 | pthread_mutex_t mClientsLock; 29 | int mCtrlPipe[2]; 30 | pthread_t mThread; 31 | bool mUseCmdNum; 32 | 33 | public: 34 | SocketListener(const char *socketName, bool listen); 35 | SocketListener(const char *socketName, bool listen, bool useCmdNum); 36 | SocketListener(int socketFd, bool listen); 37 | 38 | virtual ~SocketListener(); 39 | int startListener(); 40 | int stopListener(); 41 | 42 | void sendBroadcast(int code, const char *msg, bool addErrno); 43 | 44 | protected: 45 | virtual bool onDataAvailable(SocketClient *c) = 0; 46 | 47 | private: 48 | static void *threadStart(void *obj); 49 | void runListener(); 50 | void init(const char *socketName, int socketFd, bool listen, bool useCmdNum); 51 | }; 52 | #endif 53 | -------------------------------------------------------------------------------- /jni/android/include/frameworks/native/include/media/hardware/OMXPluginBase.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2009 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef OMX_PLUGIN_BASE_H_ 18 | 19 | #define OMX_PLUGIN_BASE_H_ 20 | 21 | #include 22 | 23 | #include 24 | 25 | #include 26 | #include 27 | 28 | namespace android { 29 | 30 | struct OMXPluginBase { 31 | OMXPluginBase() {} 32 | virtual ~OMXPluginBase() {} 33 | 34 | virtual OMX_ERRORTYPE makeComponentInstance( 35 | const char *name, 36 | const OMX_CALLBACKTYPE *callbacks, 37 | OMX_PTR appData, 38 | OMX_COMPONENTTYPE **component) = 0; 39 | 40 | virtual OMX_ERRORTYPE destroyComponentInstance( 41 | OMX_COMPONENTTYPE *component) = 0; 42 | 43 | virtual OMX_ERRORTYPE enumerateComponents( 44 | OMX_STRING name, 45 | size_t size, 46 | OMX_U32 index) = 0; 47 | 48 | virtual OMX_ERRORTYPE getRolesOfComponent( 49 | const char *name, 50 | Vector *roles) = 0; 51 | 52 | private: 53 | OMXPluginBase(const OMXPluginBase &); 54 | OMXPluginBase &operator=(const OMXPluginBase &); 55 | }; 56 | 57 | } // namespace android 58 | 59 | #endif // OMX_PLUGIN_BASE_H_ 60 | -------------------------------------------------------------------------------- /jni/android/include/system/core/include/netutils/dhcp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010, The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef _NETUTILS_DHCP_H_ 18 | #define _NETUTILS_DHCP_H_ 19 | 20 | #include 21 | #include 22 | 23 | __BEGIN_DECLS 24 | 25 | extern int do_dhcp(char *iname); 26 | extern int dhcp_do_request(const char *ifname, 27 | char *ipaddr, 28 | char *gateway, 29 | uint32_t *prefixLength, 30 | char *dns[], 31 | char *server, 32 | uint32_t *lease, 33 | char *vendorInfo); 34 | extern int dhcp_do_request_renew(const char *ifname, 35 | char *ipaddr, 36 | char *gateway, 37 | uint32_t *prefixLength, 38 | char *dns[], 39 | char *server, 40 | uint32_t *lease, 41 | char *vendorInfo); 42 | extern int dhcp_stop(const char *ifname); 43 | extern int dhcp_release_lease(const char *ifname); 44 | extern char *dhcp_get_errmsg(); 45 | 46 | __END_DECLS 47 | 48 | #endif /* _NETUTILS_DHCP_H_ */ 49 | -------------------------------------------------------------------------------- /jni/android/include/frameworks/native/include/utils/StopWatch.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef ANDROID_STOPWATCH_H 18 | #define ANDROID_STOPWATCH_H 19 | 20 | #include 21 | #include 22 | 23 | #include 24 | 25 | // --------------------------------------------------------------------------- 26 | 27 | namespace android { 28 | 29 | class StopWatch 30 | { 31 | public: 32 | StopWatch( const char *name, 33 | int clock = SYSTEM_TIME_MONOTONIC, 34 | uint32_t flags = 0); 35 | ~StopWatch(); 36 | 37 | const char* name() const; 38 | nsecs_t lap(); 39 | nsecs_t elapsedTime() const; 40 | 41 | void reset(); 42 | 43 | private: 44 | const char* mName; 45 | int mClock; 46 | uint32_t mFlags; 47 | 48 | struct lap_t { 49 | nsecs_t soFar; 50 | nsecs_t thisLap; 51 | }; 52 | 53 | nsecs_t mStartTime; 54 | lap_t mLaps[8]; 55 | int mNumLaps; 56 | }; 57 | 58 | 59 | }; // namespace android 60 | 61 | 62 | // --------------------------------------------------------------------------- 63 | 64 | #endif // ANDROID_STOPWATCH_H 65 | -------------------------------------------------------------------------------- /jni/android/include/system/core/include/cutils/str_parms.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef __CUTILS_STR_PARMS_H 18 | #define __CUTILS_STR_PARMS_H 19 | 20 | #include 21 | 22 | struct str_parms; 23 | 24 | struct str_parms *str_parms_create(void); 25 | struct str_parms *str_parms_create_str(const char *_string); 26 | void str_parms_destroy(struct str_parms *str_parms); 27 | 28 | void str_parms_del(struct str_parms *str_parms, const char *key); 29 | 30 | int str_parms_add_str(struct str_parms *str_parms, const char *key, 31 | const char *value); 32 | int str_parms_add_int(struct str_parms *str_parms, const char *key, int value); 33 | 34 | int str_parms_add_float(struct str_parms *str_parms, const char *key, 35 | float value); 36 | 37 | int str_parms_get_str(struct str_parms *str_parms, const char *key, 38 | char *out_val, int len); 39 | int str_parms_get_int(struct str_parms *str_parms, const char *key, 40 | int *out_val); 41 | int str_parms_get_float(struct str_parms *str_parms, const char *key, 42 | float *out_val); 43 | 44 | char *str_parms_to_str(struct str_parms *str_parms); 45 | 46 | /* debug */ 47 | void str_parms_dump(struct str_parms *str_parms); 48 | 49 | #endif /* __CUTILS_STR_PARMS_H */ 50 | -------------------------------------------------------------------------------- /jni/android/include/frameworks/native/include/gui/ISensorServer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef ANDROID_GUI_ISENSORSERVER_H 18 | #define ANDROID_GUI_ISENSORSERVER_H 19 | 20 | #include 21 | #include 22 | 23 | #include 24 | #include 25 | 26 | #include 27 | 28 | namespace android { 29 | // ---------------------------------------------------------------------------- 30 | 31 | class Sensor; 32 | class ISensorEventConnection; 33 | 34 | class ISensorServer : public IInterface 35 | { 36 | public: 37 | DECLARE_META_INTERFACE(SensorServer); 38 | 39 | virtual Vector getSensorList() = 0; 40 | virtual sp createSensorEventConnection() = 0; 41 | }; 42 | 43 | // ---------------------------------------------------------------------------- 44 | 45 | class BnSensorServer : public BnInterface 46 | { 47 | public: 48 | virtual status_t onTransact( uint32_t code, 49 | const Parcel& data, 50 | Parcel* reply, 51 | uint32_t flags = 0); 52 | }; 53 | 54 | // ---------------------------------------------------------------------------- 55 | }; // namespace android 56 | 57 | #endif // ANDROID_GUI_ISENSORSERVER_H 58 | -------------------------------------------------------------------------------- /jni/android/include/frameworks/native/include/utils/misc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | // 18 | // Handy utility functions and portability code. 19 | // 20 | #ifndef _LIBS_UTILS_MISC_H 21 | #define _LIBS_UTILS_MISC_H 22 | 23 | #include 24 | #include 25 | 26 | /* get #of elements in a static array */ 27 | #ifndef NELEM 28 | # define NELEM(x) ((int) (sizeof(x) / sizeof((x)[0]))) 29 | #endif 30 | 31 | namespace android { 32 | 33 | /* 34 | * Some utility functions for working with files. These could be made 35 | * part of a "File" class. 36 | */ 37 | typedef enum FileType { 38 | kFileTypeUnknown = 0, 39 | kFileTypeNonexistent, // i.e. ENOENT 40 | kFileTypeRegular, 41 | kFileTypeDirectory, 42 | kFileTypeCharDev, 43 | kFileTypeBlockDev, 44 | kFileTypeFifo, 45 | kFileTypeSymlink, 46 | kFileTypeSocket, 47 | } FileType; 48 | /* get the file's type; follows symlinks */ 49 | FileType getFileType(const char* fileName); 50 | /* get the file's modification date; returns -1 w/errno set on failure */ 51 | time_t getFileModDate(const char* fileName); 52 | 53 | typedef void (*sysprop_change_callback)(void); 54 | void add_sysprop_change_callback(sysprop_change_callback cb, int priority); 55 | void report_sysprop_change(); 56 | 57 | }; // namespace android 58 | 59 | #endif // _LIBS_UTILS_MISC_H 60 | -------------------------------------------------------------------------------- /jni/android/include/frameworks/native/include/binder/MemoryDealer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2007 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef ANDROID_MEMORY_DEALER_H 18 | #define ANDROID_MEMORY_DEALER_H 19 | 20 | 21 | #include 22 | #include 23 | 24 | #include 25 | #include 26 | 27 | namespace android { 28 | // ---------------------------------------------------------------------------- 29 | 30 | class SimpleBestFitAllocator; 31 | 32 | // ---------------------------------------------------------------------------- 33 | 34 | class MemoryDealer : public RefBase 35 | { 36 | public: 37 | MemoryDealer(size_t size, const char* name = 0); 38 | 39 | virtual sp allocate(size_t size); 40 | virtual void deallocate(size_t offset); 41 | virtual void dump(const char* what) const; 42 | 43 | sp getMemoryHeap() const { return heap(); } 44 | 45 | protected: 46 | virtual ~MemoryDealer(); 47 | 48 | private: 49 | const sp& heap() const; 50 | SimpleBestFitAllocator* allocator() const; 51 | 52 | sp mHeap; 53 | SimpleBestFitAllocator* mAllocator; 54 | }; 55 | 56 | 57 | // ---------------------------------------------------------------------------- 58 | }; // namespace android 59 | 60 | #endif // ANDROID_MEMORY_DEALER_H 61 | -------------------------------------------------------------------------------- /jni/android/include/frameworks/native/include/utils/ZipFileCRO.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | // 18 | // C API for ead-only access to Zip archives, with minimal heap allocation. 19 | // 20 | #ifndef __LIBS_ZIPFILECRO_H 21 | #define __LIBS_ZIPFILECRO_H 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | #include 28 | 29 | #ifdef __cplusplus 30 | extern "C" { 31 | #endif 32 | 33 | /* 34 | * Trivial typedef to ensure that ZipFileCRO is not treated as a simple integer. 35 | */ 36 | typedef void* ZipFileCRO; 37 | 38 | /* 39 | * Trivial typedef to ensure that ZipEntryCRO is not treated as a simple 40 | * integer. We use NULL to indicate an invalid value. 41 | */ 42 | typedef void* ZipEntryCRO; 43 | 44 | extern ZipFileCRO ZipFileXRO_open(const char* path); 45 | 46 | extern void ZipFileCRO_destroy(ZipFileCRO zip); 47 | 48 | extern ZipEntryCRO ZipFileCRO_findEntryByName(ZipFileCRO zip, 49 | const char* fileName); 50 | 51 | extern bool ZipFileCRO_getEntryInfo(ZipFileCRO zip, ZipEntryCRO entry, 52 | int* pMethod, size_t* pUncompLen, 53 | size_t* pCompLen, off64_t* pOffset, long* pModWhen, long* pCrc32); 54 | 55 | extern bool ZipFileCRO_uncompressEntry(ZipFileCRO zip, ZipEntryCRO entry, int fd); 56 | 57 | #ifdef __cplusplus 58 | } 59 | #endif 60 | 61 | #endif /*__LIBS_ZIPFILECRO_H*/ 62 | -------------------------------------------------------------------------------- /jni/android/include/frameworks/native/include/binder/IPermissionController.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | // 18 | #ifndef ANDROID_IPERMISSION_CONTROLLER_H 19 | #define ANDROID_IPERMISSION_CONTROLLER_H 20 | 21 | #include 22 | 23 | namespace android { 24 | 25 | // ---------------------------------------------------------------------- 26 | 27 | class IPermissionController : public IInterface 28 | { 29 | public: 30 | DECLARE_META_INTERFACE(PermissionController); 31 | 32 | virtual bool checkPermission(const String16& permission, 33 | int32_t pid, int32_t uid) = 0; 34 | 35 | enum { 36 | CHECK_PERMISSION_TRANSACTION = IBinder::FIRST_CALL_TRANSACTION 37 | }; 38 | }; 39 | 40 | // ---------------------------------------------------------------------- 41 | 42 | class BnPermissionController : public BnInterface 43 | { 44 | public: 45 | virtual status_t onTransact( uint32_t code, 46 | const Parcel& data, 47 | Parcel* reply, 48 | uint32_t flags = 0); 49 | }; 50 | 51 | // ---------------------------------------------------------------------- 52 | 53 | }; // namespace android 54 | 55 | #endif // ANDROID_IPERMISSION_CONTROLLER_H 56 | 57 | -------------------------------------------------------------------------------- /jni/android/include/system/core/include/cutils/config_utils.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef __CUTILS_CONFIG_UTILS_H 18 | #define __CUTILS_CONFIG_UTILS_H 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | typedef struct cnode cnode; 25 | 26 | 27 | struct cnode 28 | { 29 | cnode *next; 30 | cnode *first_child; 31 | cnode *last_child; 32 | const char *name; 33 | const char *value; 34 | }; 35 | 36 | /* parse a text string into a config node tree */ 37 | void config_load(cnode *root, char *data); 38 | 39 | /* parse a file into a config node tree */ 40 | void config_load_file(cnode *root, const char *fn); 41 | 42 | /* create a single config node */ 43 | cnode* config_node(const char *name, const char *value); 44 | 45 | /* locate a named child of a config node */ 46 | cnode* config_find(cnode *root, const char *name); 47 | 48 | /* look up a child by name and return the boolean value */ 49 | int config_bool(cnode *root, const char *name, int _default); 50 | 51 | /* look up a child by name and return the string value */ 52 | const char* config_str(cnode *root, const char *name, const char *_default); 53 | 54 | /* add a named child to a config node (or modify it if it already exists) */ 55 | void config_set(cnode *root, const char *name, const char *value); 56 | 57 | /* free a config node tree */ 58 | void config_free(cnode *root); 59 | 60 | #ifdef __cplusplus 61 | } 62 | #endif 63 | 64 | #endif 65 | -------------------------------------------------------------------------------- /jni/android/include/frameworks/native/include/gui/ISensorEventConnection.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef ANDROID_GUI_ISENSOR_EVENT_CONNECTION_H 18 | #define ANDROID_GUI_ISENSOR_EVENT_CONNECTION_H 19 | 20 | #include 21 | #include 22 | 23 | #include 24 | #include 25 | 26 | #include 27 | 28 | namespace android { 29 | // ---------------------------------------------------------------------------- 30 | 31 | class BitTube; 32 | 33 | class ISensorEventConnection : public IInterface 34 | { 35 | public: 36 | DECLARE_META_INTERFACE(SensorEventConnection); 37 | 38 | virtual sp getSensorChannel() const = 0; 39 | virtual status_t enableDisable(int handle, bool enabled) = 0; 40 | virtual status_t setEventRate(int handle, nsecs_t ns) = 0; 41 | }; 42 | 43 | // ---------------------------------------------------------------------------- 44 | 45 | class BnSensorEventConnection : public BnInterface 46 | { 47 | public: 48 | virtual status_t onTransact( uint32_t code, 49 | const Parcel& data, 50 | Parcel* reply, 51 | uint32_t flags = 0); 52 | }; 53 | 54 | // ---------------------------------------------------------------------------- 55 | }; // namespace android 56 | 57 | #endif // ANDROID_GUI_ISENSOR_EVENT_CONNECTION_H 58 | -------------------------------------------------------------------------------- /jni/android/include/system/core/include/cutils/fs.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef __CUTILS_FS_H 18 | #define __CUTILS_FS_H 19 | 20 | #include 21 | 22 | /* 23 | * TEMP_FAILURE_RETRY is defined by some, but not all, versions of 24 | * . (Alas, it is not as standard as we'd hoped!) So, if it's 25 | * not already defined, then define it here. 26 | */ 27 | #ifndef TEMP_FAILURE_RETRY 28 | /* Used to retry syscalls that can return EINTR. */ 29 | #define TEMP_FAILURE_RETRY(exp) ({ \ 30 | typeof (exp) _rc; \ 31 | do { \ 32 | _rc = (exp); \ 33 | } while (_rc == -1 && errno == EINTR); \ 34 | _rc; }) 35 | #endif 36 | 37 | #ifdef __cplusplus 38 | extern "C" { 39 | #endif 40 | 41 | /* 42 | * Ensure that directory exists with given mode and owners. 43 | */ 44 | extern int fs_prepare_dir(const char* path, mode_t mode, uid_t uid, gid_t gid); 45 | 46 | /* 47 | * Read single plaintext integer from given file, correctly handling files 48 | * partially written with fs_write_atomic_int(). 49 | */ 50 | extern int fs_read_atomic_int(const char* path, int* value); 51 | 52 | /* 53 | * Write single plaintext integer to given file, creating backup while 54 | * in progress. 55 | */ 56 | extern int fs_write_atomic_int(const char* path, int value); 57 | 58 | #ifdef __cplusplus 59 | } 60 | #endif 61 | 62 | #endif /* __CUTILS_FS_H */ 63 | -------------------------------------------------------------------------------- /jni/android/include/system/core/include/zipfile/zipfile.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef _ZIPFILE_ZIPFILE_H 18 | #define _ZIPFILE_ZIPFILE_H 19 | 20 | #include 21 | 22 | #ifdef __cplusplus 23 | extern "C" { 24 | #endif 25 | 26 | typedef void* zipfile_t; 27 | typedef void* zipentry_t; 28 | 29 | // Provide a buffer. Returns NULL on failure. 30 | zipfile_t init_zipfile(const void* data, size_t size); 31 | 32 | // Release the zipfile resources. 33 | void release_zipfile(zipfile_t file); 34 | 35 | // Get a named entry object. Returns NULL if it doesn't exist 36 | // or if we won't be able to decompress it. The zipentry_t is 37 | // freed by release_zipfile() 38 | zipentry_t lookup_zipentry(zipfile_t file, const char* entryName); 39 | 40 | // Return the size of the entry. 41 | size_t get_zipentry_size(zipentry_t entry); 42 | 43 | // return the filename of this entry, you own the memory returned 44 | char* get_zipentry_name(zipentry_t entry); 45 | 46 | // The buffer must be 1.001 times the buffer size returned 47 | // by get_zipentry_size. Returns nonzero on failure. 48 | int decompress_zipentry(zipentry_t entry, void* buf, int bufsize); 49 | 50 | // iterate through the entries in the zip file. pass a pointer to 51 | // a void* initialized to NULL to start. Returns NULL when done 52 | zipentry_t iterate_zipfile(zipfile_t file, void** cookie); 53 | 54 | #ifdef __cplusplus 55 | } // extern "C" 56 | #endif 57 | 58 | #endif // _ZIPFILE_ZIPFILE_H 59 | -------------------------------------------------------------------------------- /jni/android/include/frameworks/native/include/gui/IGraphicBufferAlloc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef ANDROID_GUI_IGRAPHIC_BUFFER_ALLOC_H 18 | #define ANDROID_GUI_IGRAPHIC_BUFFER_ALLOC_H 19 | 20 | #include 21 | #include 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | namespace android { 28 | // ---------------------------------------------------------------------------- 29 | 30 | class GraphicBuffer; 31 | 32 | class IGraphicBufferAlloc : public IInterface 33 | { 34 | public: 35 | DECLARE_META_INTERFACE(GraphicBufferAlloc); 36 | 37 | /* Create a new GraphicBuffer for the client to use. 38 | */ 39 | virtual sp createGraphicBuffer(uint32_t w, uint32_t h, 40 | PixelFormat format, uint32_t usage, status_t* error) = 0; 41 | }; 42 | 43 | // ---------------------------------------------------------------------------- 44 | 45 | class BnGraphicBufferAlloc : public BnInterface 46 | { 47 | public: 48 | virtual status_t onTransact( uint32_t code, 49 | const Parcel& data, 50 | Parcel* reply, 51 | uint32_t flags = 0); 52 | }; 53 | 54 | // ---------------------------------------------------------------------------- 55 | 56 | }; // namespace android 57 | 58 | #endif // ANDROID_GUI_IGRAPHIC_BUFFER_ALLOC_H 59 | -------------------------------------------------------------------------------- /jni/android/include/system/core/include/cutils/qtaguid.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef __CUTILS_QTAGUID_H 18 | #define __CUTILS_QTAGUID_H 19 | 20 | #include 21 | #include 22 | #include 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | /* 29 | * Set tags (and owning UIDs) for network sockets. 30 | */ 31 | extern int qtaguid_tagSocket(int sockfd, int tag, uid_t uid); 32 | 33 | /* 34 | * Untag a network socket before closing. 35 | */ 36 | extern int qtaguid_untagSocket(int sockfd); 37 | 38 | /* 39 | * For the given uid, switch counter sets. 40 | * The kernel only keeps a limited number of sets. 41 | * 2 for now. 42 | */ 43 | extern int qtaguid_setCounterSet(int counterSetNum, uid_t uid); 44 | 45 | /* 46 | * Delete all tag info that relates to the given tag an uid. 47 | * If the tag is 0, then ALL info about the uid is freeded. 48 | * The delete data also affects active tagged socketd, which are 49 | * then untagged. 50 | * The calling process can only operate on its own tags. 51 | * Unless it is part of the happy AID_NET_BW_ACCT group. 52 | * In which case it can clobber everything. 53 | */ 54 | extern int qtaguid_deleteTagData(int tag, uid_t uid); 55 | 56 | /* 57 | * Enable/disable qtaguid functionnality at a lower level. 58 | * When pacified, the kernel will accept commands but do nothing. 59 | */ 60 | extern int qtaguid_setPacifier(int on); 61 | 62 | #ifdef __cplusplus 63 | } 64 | #endif 65 | 66 | #endif /* __CUTILS_QTAG_UID_H */ 67 | -------------------------------------------------------------------------------- /jni/android/include/frameworks/native/include/ui/GraphicBufferMapper.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2007 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef ANDROID_UI_BUFFER_MAPPER_H 18 | #define ANDROID_UI_BUFFER_MAPPER_H 19 | 20 | #include 21 | #include 22 | 23 | #include 24 | 25 | #include 26 | 27 | 28 | struct gralloc_module_t; 29 | 30 | namespace android { 31 | 32 | // --------------------------------------------------------------------------- 33 | 34 | class Rect; 35 | 36 | class GraphicBufferMapper : public Singleton 37 | { 38 | public: 39 | static inline GraphicBufferMapper& get() { return getInstance(); } 40 | 41 | status_t registerBuffer(buffer_handle_t handle); 42 | 43 | status_t unregisterBuffer(buffer_handle_t handle); 44 | 45 | status_t lock(buffer_handle_t handle, 46 | int usage, const Rect& bounds, void** vaddr); 47 | 48 | status_t lockYCbCr(buffer_handle_t handle, 49 | int usage, const Rect& bounds, android_ycbcr *ycbcr); 50 | 51 | status_t unlock(buffer_handle_t handle); 52 | 53 | // dumps information about the mapping of this handle 54 | void dump(buffer_handle_t handle); 55 | 56 | private: 57 | friend class Singleton; 58 | GraphicBufferMapper(); 59 | gralloc_module_t const *mAllocMod; 60 | }; 61 | 62 | // --------------------------------------------------------------------------- 63 | 64 | }; // namespace android 65 | 66 | #endif // ANDROID_UI_BUFFER_MAPPER_H 67 | 68 | -------------------------------------------------------------------------------- /jni/android/include/system/core/include/cutils/array.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2007 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * A pointer array which intelligently expands its capacity ad needed. 19 | */ 20 | 21 | #ifndef __ARRAY_H 22 | #define __ARRAY_H 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | #include 29 | 30 | /** An array. */ 31 | typedef struct Array Array; 32 | 33 | /** Constructs a new array. Returns NULL if we ran out of memory. */ 34 | Array* arrayCreate(); 35 | 36 | /** Frees an array. Does not free elements themselves. */ 37 | void arrayFree(Array* array); 38 | 39 | /** Adds a pointer. Returns 0 is successful, < 0 otherwise. */ 40 | int arrayAdd(Array* array, void* pointer); 41 | 42 | /** Gets the pointer at the specified index. */ 43 | void* arrayGet(Array* array, int index); 44 | 45 | /** Removes the pointer at the given index and returns it. */ 46 | void* arrayRemove(Array* array, int index); 47 | 48 | /** Sets pointer at the given index. Returns old pointer. */ 49 | void* arraySet(Array* array, int index, void* pointer); 50 | 51 | /** Sets the array size. Sets new pointers to NULL. Returns 0 if successful, < 0 otherwise . */ 52 | int arraySetSize(Array* array, int size); 53 | 54 | /** Returns the size of the given array. */ 55 | int arraySize(Array* array); 56 | 57 | /** 58 | * Returns a pointer to a C-style array which will be valid until this array 59 | * changes. 60 | */ 61 | const void** arrayUnwrap(Array* array); 62 | 63 | #ifdef __cplusplus 64 | } 65 | #endif 66 | 67 | #endif /* __ARRAY_H */ 68 | -------------------------------------------------------------------------------- /jni/android/include/system/core/include/cutils/native_handle.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2009 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef NATIVE_HANDLE_H_ 18 | #define NATIVE_HANDLE_H_ 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | typedef struct native_handle 25 | { 26 | int version; /* sizeof(native_handle_t) */ 27 | int numFds; /* number of file-descriptors at &data[0] */ 28 | int numInts; /* number of ints at &data[numFds] */ 29 | int data[0]; /* numFds + numInts ints */ 30 | } native_handle_t; 31 | 32 | /* 33 | * native_handle_close 34 | * 35 | * closes the file descriptors contained in this native_handle_t 36 | * 37 | * return 0 on success, or a negative error code on failure 38 | * 39 | */ 40 | int native_handle_close(const native_handle_t* h); 41 | 42 | 43 | /* 44 | * native_handle_create 45 | * 46 | * creates a native_handle_t and initializes it. must be destroyed with 47 | * native_handle_delete(). 48 | * 49 | */ 50 | native_handle_t* native_handle_create(int numFds, int numInts); 51 | 52 | /* 53 | * native_handle_delete 54 | * 55 | * frees a native_handle_t allocated with native_handle_create(). 56 | * This ONLY frees the memory allocated for the native_handle_t, but doesn't 57 | * close the file descriptors; which can be achieved with native_handle_close(). 58 | * 59 | * return 0 on success, or a negative error code on failure 60 | * 61 | */ 62 | int native_handle_delete(native_handle_t* h); 63 | 64 | 65 | #ifdef __cplusplus 66 | } 67 | #endif 68 | 69 | #endif /* NATIVE_HANDLE_H_ */ 70 | -------------------------------------------------------------------------------- /jni/android/include/frameworks/native/include/utils/Compat.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef __LIB_UTILS_COMPAT_H 18 | #define __LIB_UTILS_COMPAT_H 19 | 20 | #include 21 | 22 | /* Compatibility definitions for non-Linux (i.e., BSD-based) hosts. */ 23 | #ifndef HAVE_OFF64_T 24 | #if _FILE_OFFSET_BITS < 64 25 | #error "_FILE_OFFSET_BITS < 64; large files are not supported on this platform" 26 | #endif /* _FILE_OFFSET_BITS < 64 */ 27 | 28 | typedef off_t off64_t; 29 | 30 | static inline off64_t lseek64(int fd, off64_t offset, int whence) { 31 | return lseek(fd, offset, whence); 32 | } 33 | 34 | #ifdef HAVE_PREAD 35 | static inline ssize_t pread64(int fd, void* buf, size_t nbytes, off64_t offset) { 36 | return pread(fd, buf, nbytes, offset); 37 | } 38 | #endif 39 | 40 | #endif /* !HAVE_OFF64_T */ 41 | 42 | #if HAVE_PRINTF_ZD 43 | # define ZD "%zd" 44 | # define ZD_TYPE ssize_t 45 | #else 46 | # define ZD "%ld" 47 | # define ZD_TYPE long 48 | #endif 49 | 50 | /* 51 | * TEMP_FAILURE_RETRY is defined by some, but not all, versions of 52 | * . (Alas, it is not as standard as we'd hoped!) So, if it's 53 | * not already defined, then define it here. 54 | */ 55 | #ifndef TEMP_FAILURE_RETRY 56 | /* Used to retry syscalls that can return EINTR. */ 57 | #define TEMP_FAILURE_RETRY(exp) ({ \ 58 | typeof (exp) _rc; \ 59 | do { \ 60 | _rc = (exp); \ 61 | } while (_rc == -1 && errno == EINTR); \ 62 | _rc; }) 63 | #endif 64 | 65 | #endif /* __LIB_UTILS_COMPAT_H */ 66 | -------------------------------------------------------------------------------- /jni/android/include/frameworks/native/include/utils/LinearTransform.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef _LIBS_UTILS_LINEAR_TRANSFORM_H 18 | #define _LIBS_UTILS_LINEAR_TRANSFORM_H 19 | 20 | #include 21 | 22 | namespace android { 23 | 24 | // LinearTransform defines a structure which hold the definition of a 25 | // transformation from single dimensional coordinate system A into coordinate 26 | // system B (and back again). Values in A and in B are 64 bit, the linear 27 | // scale factor is expressed as a rational number using two 32 bit values. 28 | // 29 | // Specifically, let 30 | // f(a) = b 31 | // F(b) = f^-1(b) = a 32 | // then 33 | // 34 | // f(a) = (((a - a_zero) * a_to_b_numer) / a_to_b_denom) + b_zero; 35 | // 36 | // and 37 | // 38 | // F(b) = (((b - b_zero) * a_to_b_denom) / a_to_b_numer) + a_zero; 39 | // 40 | struct LinearTransform { 41 | int64_t a_zero; 42 | int64_t b_zero; 43 | int32_t a_to_b_numer; 44 | uint32_t a_to_b_denom; 45 | 46 | // Transform from A->B 47 | // Returns true on success, or false in the case of a singularity or an 48 | // overflow. 49 | bool doForwardTransform(int64_t a_in, int64_t* b_out) const; 50 | 51 | // Transform from B->A 52 | // Returns true on success, or false in the case of a singularity or an 53 | // overflow. 54 | bool doReverseTransform(int64_t b_in, int64_t* a_out) const; 55 | 56 | // Helpers which will reduce the fraction N/D using Euclid's method. 57 | template static void reduce(T* N, T* D); 58 | static void reduce(int32_t* N, uint32_t* D); 59 | }; 60 | 61 | 62 | } 63 | 64 | #endif // _LIBS_UTILS_LINEAR_TRANSFORM_H 65 | -------------------------------------------------------------------------------- /jni/android/include/frameworks/native/include/utils/BufferedTextOutput.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef ANDROID_BUFFEREDTEXTOUTPUT_H 18 | #define ANDROID_BUFFEREDTEXTOUTPUT_H 19 | 20 | #include 21 | #include 22 | #include 23 | 24 | // --------------------------------------------------------------------------- 25 | namespace android { 26 | 27 | class BufferedTextOutput : public TextOutput 28 | { 29 | public: 30 | //** Flags for constructor */ 31 | enum { 32 | MULTITHREADED = 0x0001 33 | }; 34 | 35 | BufferedTextOutput(uint32_t flags = 0); 36 | virtual ~BufferedTextOutput(); 37 | 38 | virtual status_t print(const char* txt, size_t len); 39 | virtual void moveIndent(int delta); 40 | 41 | virtual void pushBundle(); 42 | virtual void popBundle(); 43 | 44 | protected: 45 | virtual status_t writeLines(const struct iovec& vec, size_t N) = 0; 46 | 47 | private: 48 | struct BufferState; 49 | struct ThreadState; 50 | 51 | static ThreadState*getThreadState(); 52 | static void threadDestructor(void *st); 53 | 54 | BufferState*getBuffer() const; 55 | 56 | uint32_t mFlags; 57 | const int32_t mSeq; 58 | const int32_t mIndex; 59 | 60 | Mutex mLock; 61 | BufferState* mGlobalState; 62 | }; 63 | 64 | // --------------------------------------------------------------------------- 65 | }; // namespace android 66 | 67 | #endif // ANDROID_BUFFEREDTEXTOUTPUT_H 68 | -------------------------------------------------------------------------------- /jni/android/include/system/core/include/ctest/ctest.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2007 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * Very simple unit testing framework. 19 | */ 20 | 21 | #ifndef __CUTILS_TEST_H 22 | #define __CUTILS_TEST_H 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | /** 29 | * Adds a test to the test suite. 30 | */ 31 | #define addTest(test) addNamedTest(#test, &test) 32 | 33 | /** 34 | * Asserts that a condition is true. The test fails if it isn't. 35 | */ 36 | #define assertTrue(value, message) assertTrueWithSource(value, __FILE__, __LINE__, message); 37 | 38 | /** 39 | * Asserts that a condition is false. The test fails if the value is true. 40 | */ 41 | #define assertFalse(value, message) assertTrueWithSource(!value, __FILE__, __LINE__, message); 42 | 43 | /** Fails a test with the given message. */ 44 | #define fail(message) assertTrueWithSource(0, __FILE__, __LINE__, message); 45 | 46 | /** 47 | * Asserts that two values are ==. 48 | */ 49 | #define assertSame(a, b) assertTrueWithSource(a == b, __FILE__, __LINE__, "Expected same value."); 50 | 51 | /** 52 | * Asserts that two values are !=. 53 | */ 54 | #define assertNotSame(a, b) assertTrueWithSource(a != b, __FILE__, __LINE__,\ 55 | "Expected different values"); 56 | 57 | /** 58 | * Runs a test suite. 59 | */ 60 | void runTests(void); 61 | 62 | // Do not call these functions directly. Use macros above instead. 63 | void addNamedTest(const char* name, void (*test)(void)); 64 | void assertTrueWithSource(int value, const char* file, int line, char* message); 65 | 66 | #ifdef __cplusplus 67 | } 68 | #endif 69 | 70 | #endif /* __CUTILS_TEST_H */ 71 | -------------------------------------------------------------------------------- /jni/android/include/frameworks/native/include/binder/BinderService.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef ANDROID_BINDER_SERVICE_H 18 | #define ANDROID_BINDER_SERVICE_H 19 | 20 | #include 21 | 22 | #include 23 | #include 24 | 25 | #include 26 | #include 27 | #include 28 | #include 29 | 30 | // --------------------------------------------------------------------------- 31 | namespace android { 32 | 33 | template 34 | class BinderService 35 | { 36 | public: 37 | static status_t publish(bool allowIsolated = false) { 38 | sp sm(defaultServiceManager()); 39 | return sm->addService( 40 | String16(SERVICE::getServiceName()), 41 | new SERVICE(), allowIsolated); 42 | } 43 | 44 | static void publishAndJoinThreadPool(bool allowIsolated = false) { 45 | sp sm(defaultServiceManager()); 46 | sm->addService( 47 | String16(SERVICE::getServiceName()), 48 | new SERVICE(), allowIsolated); 49 | ProcessState::self()->startThreadPool(); 50 | ProcessState::self()->giveThreadPoolName(); 51 | IPCThreadState::self()->joinThreadPool(); 52 | } 53 | 54 | static void instantiate() { publish(); } 55 | 56 | static status_t shutdown() { 57 | return NO_ERROR; 58 | } 59 | }; 60 | 61 | 62 | }; // namespace android 63 | // --------------------------------------------------------------------------- 64 | #endif // ANDROID_BINDER_SERVICE_H 65 | -------------------------------------------------------------------------------- /jni/android/include/frameworks/native/include/private/gui/ComposerService.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef ANDROID_PRIVATE_GUI_COMPOSER_SERVICE_H 18 | #define ANDROID_PRIVATE_GUI_COMPOSER_SERVICE_H 19 | 20 | #include 21 | #include 22 | 23 | #include 24 | #include 25 | 26 | 27 | namespace android { 28 | 29 | // --------------------------------------------------------------------------- 30 | 31 | class IMemoryHeap; 32 | class ISurfaceComposer; 33 | 34 | // --------------------------------------------------------------------------- 35 | 36 | // This holds our connection to the composer service (i.e. SurfaceFlinger). 37 | // If the remote side goes away, we will re-establish the connection. 38 | // Users of this class should not retain the value from 39 | // getComposerService() for an extended period. 40 | // 41 | // (It's not clear that using Singleton is useful here anymore.) 42 | class ComposerService : public Singleton 43 | { 44 | sp mComposerService; 45 | sp mDeathObserver; 46 | Mutex mLock; 47 | 48 | ComposerService(); 49 | void connectLocked(); 50 | void composerServiceDied(); 51 | friend class Singleton; 52 | public: 53 | 54 | // Get a connection to the Composer Service. This will block until 55 | // a connection is established. 56 | static sp getComposerService(); 57 | }; 58 | 59 | // --------------------------------------------------------------------------- 60 | }; // namespace android 61 | 62 | #endif // ANDROID_PRIVATE_GUI_COMPOSER_SERVICE_H 63 | -------------------------------------------------------------------------------- /jni/android/include/frameworks/native/include/utils/StringArray.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2009 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | // 18 | // Sortable array of strings. STL-ish, but STL-free. 19 | // 20 | #ifndef _LIBS_UTILS_STRING_ARRAY_H 21 | #define _LIBS_UTILS_STRING_ARRAY_H 22 | 23 | #include 24 | #include 25 | 26 | namespace android { 27 | 28 | // 29 | // An expanding array of strings. Add, get, sort, delete. 30 | // 31 | class StringArray { 32 | public: 33 | StringArray(); 34 | virtual ~StringArray(); 35 | 36 | // 37 | // Add a string. A copy of the string is made. 38 | // 39 | bool push_back(const char* str); 40 | 41 | // 42 | // Delete an entry. 43 | // 44 | void erase(int idx); 45 | 46 | // 47 | // Sort the array. 48 | // 49 | void sort(int (*compare)(const void*, const void*)); 50 | 51 | // 52 | // Pass this to the sort routine to do an ascending alphabetical sort. 53 | // 54 | static int cmpAscendingAlpha(const void* pstr1, const void* pstr2); 55 | 56 | // 57 | // Get the #of items in the array. 58 | // 59 | inline int size(void) const { return mCurrent; } 60 | 61 | // 62 | // Return entry N. 63 | // [should use operator[] here] 64 | // 65 | const char* getEntry(int idx) const { 66 | return (unsigned(idx) >= unsigned(mCurrent)) ? NULL : mArray[idx]; 67 | } 68 | 69 | // 70 | // Set entry N to specified string. 71 | // [should use operator[] here] 72 | // 73 | void setEntry(int idx, const char* str); 74 | 75 | private: 76 | int mMax; 77 | int mCurrent; 78 | char** mArray; 79 | }; 80 | 81 | }; // namespace android 82 | 83 | #endif // _LIBS_UTILS_STRING_ARRAY_H 84 | -------------------------------------------------------------------------------- /jni/android/include/system/core/include/cutils/atomic-inline.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef ANDROID_CUTILS_ATOMIC_INLINE_H 18 | #define ANDROID_CUTILS_ATOMIC_INLINE_H 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | /* 25 | * Inline declarations and macros for some special-purpose atomic 26 | * operations. These are intended for rare circumstances where a 27 | * memory barrier needs to be issued inline rather than as a function 28 | * call. 29 | * 30 | * Most code should not use these. 31 | * 32 | * Anything that does include this file must set ANDROID_SMP to either 33 | * 0 or 1, indicating compilation for UP or SMP, respectively. 34 | * 35 | * Macros defined in this header: 36 | * 37 | * void ANDROID_MEMBAR_FULL(void) 38 | * Full memory barrier. Provides a compiler reordering barrier, and 39 | * on SMP systems emits an appropriate instruction. 40 | */ 41 | 42 | #if !defined(ANDROID_SMP) 43 | # error "Must define ANDROID_SMP before including atomic-inline.h" 44 | #endif 45 | 46 | #if defined(__arm__) 47 | #include 48 | #elif defined(__i386__) || defined(__x86_64__) 49 | #include 50 | #elif defined(__mips__) 51 | #include 52 | #else 53 | #error atomic operations are unsupported 54 | #endif 55 | 56 | #if ANDROID_SMP == 0 57 | #define ANDROID_MEMBAR_FULL android_compiler_barrier 58 | #else 59 | #define ANDROID_MEMBAR_FULL android_memory_barrier 60 | #endif 61 | 62 | #if ANDROID_SMP == 0 63 | #define ANDROID_MEMBAR_STORE android_compiler_barrier 64 | #else 65 | #define ANDROID_MEMBAR_STORE android_memory_store_barrier 66 | #endif 67 | 68 | #ifdef __cplusplus 69 | } 70 | #endif 71 | 72 | #endif /* ANDROID_CUTILS_ATOMIC_INLINE_H */ 73 | -------------------------------------------------------------------------------- /jni/android/include/system/core/include/cutils/sched_policy.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2007 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef __CUTILS_SCHED_POLICY_H 18 | #define __CUTILS_SCHED_POLICY_H 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | /* Keep in sync with THREAD_GROUP_* in frameworks/base/core/java/android/os/Process.java */ 25 | typedef enum { 26 | SP_DEFAULT = -1, 27 | SP_BACKGROUND = 0, 28 | SP_FOREGROUND = 1, 29 | SP_SYSTEM = 2, // can't be used with set_sched_policy() 30 | SP_AUDIO_APP = 3, 31 | SP_AUDIO_SYS = 4, 32 | SP_CNT, 33 | SP_MAX = SP_CNT - 1, 34 | SP_SYSTEM_DEFAULT = SP_FOREGROUND, 35 | } SchedPolicy; 36 | 37 | /* Assign thread tid to the cgroup associated with the specified policy. 38 | * If the thread is a thread group leader, that is it's gettid() == getpid(), 39 | * then the other threads in the same thread group are _not_ affected. 40 | * On platforms which support gettid(), zero tid means current thread. 41 | * Return value: 0 for success, or -errno for error. 42 | */ 43 | extern int set_sched_policy(int tid, SchedPolicy policy); 44 | 45 | /* Return the policy associated with the cgroup of thread tid via policy pointer. 46 | * On platforms which support gettid(), zero tid means current thread. 47 | * Return value: 0 for success, or -1 for error and set errno. 48 | */ 49 | extern int get_sched_policy(int tid, SchedPolicy *policy); 50 | 51 | /* Return a displayable string corresponding to policy. 52 | * Return value: non-NULL NUL-terminated name of unspecified length; 53 | * the caller is responsible for displaying the useful part of the string. 54 | */ 55 | extern const char *get_sched_policy_name(SchedPolicy policy); 56 | 57 | #ifdef __cplusplus 58 | } 59 | #endif 60 | 61 | #endif /* __CUTILS_SCHED_POLICY_H */ 62 | -------------------------------------------------------------------------------- /jni/android/include/frameworks/native/include/gui/BitTube.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef ANDROID_GUI_SENSOR_CHANNEL_H 18 | #define ANDROID_GUI_SENSOR_CHANNEL_H 19 | 20 | #include 21 | #include 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | 28 | namespace android { 29 | // ---------------------------------------------------------------------------- 30 | class Parcel; 31 | 32 | class BitTube : public RefBase 33 | { 34 | public: 35 | 36 | BitTube(); 37 | BitTube(const Parcel& data); 38 | virtual ~BitTube(); 39 | 40 | status_t initCheck() const; 41 | int getFd() const; 42 | ssize_t write(void const* vaddr, size_t size); 43 | ssize_t read(void* vaddr, size_t size); 44 | 45 | status_t writeToParcel(Parcel* reply) const; 46 | 47 | template 48 | static ssize_t sendObjects(const sp& tube, 49 | T const* events, size_t count) { 50 | return sendObjects(tube, events, count, sizeof(T)); 51 | } 52 | 53 | template 54 | static ssize_t recvObjects(const sp& tube, 55 | T* events, size_t count) { 56 | return recvObjects(tube, events, count, sizeof(T)); 57 | } 58 | 59 | private: 60 | int mSendFd; 61 | mutable int mReceiveFd; 62 | 63 | static ssize_t sendObjects(const sp& tube, 64 | void const* events, size_t count, size_t objSize); 65 | 66 | static ssize_t recvObjects(const sp& tube, 67 | void* events, size_t count, size_t objSize); 68 | }; 69 | 70 | // ---------------------------------------------------------------------------- 71 | }; // namespace android 72 | 73 | #endif // ANDROID_GUI_SENSOR_CHANNEL_H 74 | -------------------------------------------------------------------------------- /jni/android/include/system/core/include/cutils/properties.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef __CUTILS_PROPERTIES_H 18 | #define __CUTILS_PROPERTIES_H 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | /* System properties are *small* name value pairs managed by the 25 | ** property service. If your data doesn't fit in the provided 26 | ** space it is not appropriate for a system property. 27 | ** 28 | ** WARNING: system/bionic/include/sys/system_properties.h also defines 29 | ** these, but with different names. (TODO: fix that) 30 | */ 31 | #define PROPERTY_KEY_MAX 32 32 | #define PROPERTY_VALUE_MAX 92 33 | 34 | /* property_get: returns the length of the value which will never be 35 | ** greater than PROPERTY_VALUE_MAX - 1 and will always be zero terminated. 36 | ** (the length does not include the terminating zero). 37 | ** 38 | ** If the property read fails or returns an empty value, the default 39 | ** value is used (if nonnull). 40 | */ 41 | int property_get(const char *key, char *value, const char *default_value); 42 | 43 | /* property_set: returns 0 on success, < 0 on failure 44 | */ 45 | int property_set(const char *key, const char *value); 46 | 47 | int property_list(void (*propfn)(const char *key, const char *value, void *cookie), void *cookie); 48 | 49 | 50 | #ifdef HAVE_SYSTEM_PROPERTY_SERVER 51 | /* 52 | * We have an external property server instead of built-in libc support. 53 | * Used by the simulator. 54 | */ 55 | #define SYSTEM_PROPERTY_PIPE_NAME "/tmp/android-sysprop" 56 | 57 | enum { 58 | kSystemPropertyUnknown = 0, 59 | kSystemPropertyGet, 60 | kSystemPropertySet, 61 | kSystemPropertyList 62 | }; 63 | #endif /*HAVE_SYSTEM_PROPERTY_SERVER*/ 64 | 65 | 66 | #ifdef __cplusplus 67 | } 68 | #endif 69 | 70 | #endif 71 | -------------------------------------------------------------------------------- /jni/android/include/frameworks/native/include/utils/ZipUtils.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2007 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | // 18 | // Miscellaneous zip/gzip utility functions. 19 | // 20 | #ifndef __LIBS_ZIPUTILS_H 21 | #define __LIBS_ZIPUTILS_H 22 | 23 | #include 24 | 25 | namespace android { 26 | 27 | /* 28 | * Container class for utility functions, primarily for namespace reasons. 29 | */ 30 | class ZipUtils { 31 | public: 32 | /* 33 | * General utility function for uncompressing "deflate" data from a file 34 | * to a buffer. 35 | */ 36 | static bool inflateToBuffer(int fd, void* buf, long uncompressedLen, 37 | long compressedLen); 38 | static bool inflateToBuffer(FILE* fp, void* buf, long uncompressedLen, 39 | long compressedLen); 40 | 41 | /* 42 | * Someday we might want to make this generic and handle bzip2 ".bz2" 43 | * files too. 44 | * 45 | * We could declare gzip to be a sub-class of zip that has exactly 46 | * one always-compressed entry, but we currently want to treat Zip 47 | * and gzip as distinct, so there's no value. 48 | * 49 | * The zlib library has some gzip utilities, but it has no interface 50 | * for extracting the uncompressed length of the file (you do *not* 51 | * want to gzseek to the end). 52 | * 53 | * Pass in a seeked file pointer for the gzip file. If this is a gzip 54 | * file, we set our return values appropriately and return "true" with 55 | * the file seeked to the start of the compressed data. 56 | */ 57 | static bool examineGzip(FILE* fp, int* pCompressionMethod, 58 | long* pUncompressedLen, long* pCompressedLen, unsigned long* pCRC32); 59 | 60 | private: 61 | ZipUtils() {} 62 | ~ZipUtils() {} 63 | }; 64 | 65 | }; // namespace android 66 | 67 | #endif /*__LIBS_ZIPUTILS_H*/ 68 | -------------------------------------------------------------------------------- /jni/android/include/frameworks/native/include/utils/Log.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | // 18 | // C/C++ logging functions. See the logging documentation for API details. 19 | // 20 | // We'd like these to be available from C code (in case we import some from 21 | // somewhere), so this has a C interface. 22 | // 23 | // The output will be correct when the log file is shared between multiple 24 | // threads and/or multiple processes so long as the operating system 25 | // supports O_APPEND. These calls have mutex-protected data structures 26 | // and so are NOT reentrant. Do not use LOG in a signal handler. 27 | // 28 | #ifndef _LIBS_UTILS_LOG_H 29 | #define _LIBS_UTILS_LOG_H 30 | 31 | #include 32 | #include 33 | 34 | #ifdef __cplusplus 35 | 36 | namespace android { 37 | 38 | /* 39 | * A very simple utility that yells in the log when an operation takes too long. 40 | */ 41 | class LogIfSlow { 42 | public: 43 | LogIfSlow(const char* tag, android_LogPriority priority, 44 | int timeoutMillis, const char* message); 45 | ~LogIfSlow(); 46 | 47 | private: 48 | const char* const mTag; 49 | const android_LogPriority mPriority; 50 | const int mTimeoutMillis; 51 | const char* const mMessage; 52 | const int64_t mStart; 53 | }; 54 | 55 | /* 56 | * Writes the specified debug log message if this block takes longer than the 57 | * specified number of milliseconds to run. Includes the time actually taken. 58 | * 59 | * { 60 | * ALOGD_IF_SLOW(50, "Excessive delay doing something."); 61 | * doSomething(); 62 | * } 63 | */ 64 | #define ALOGD_IF_SLOW(timeoutMillis, message) \ 65 | android::LogIfSlow _logIfSlow(LOG_TAG, ANDROID_LOG_DEBUG, timeoutMillis, message); 66 | 67 | } // namespace android 68 | 69 | #endif // __cplusplus 70 | 71 | #endif // _LIBS_UTILS_LOG_H 72 | -------------------------------------------------------------------------------- /jni/android/include/frameworks/native/include/android/window.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | 18 | #ifndef ANDROID_WINDOW_H 19 | #define ANDROID_WINDOW_H 20 | 21 | #ifdef __cplusplus 22 | extern "C" { 23 | #endif 24 | 25 | /** 26 | * Window flags, as per the Java API at android.view.WindowManager.LayoutParams. 27 | */ 28 | enum { 29 | AWINDOW_FLAG_ALLOW_LOCK_WHILE_SCREEN_ON = 0x00000001, 30 | AWINDOW_FLAG_DIM_BEHIND = 0x00000002, 31 | AWINDOW_FLAG_BLUR_BEHIND = 0x00000004, 32 | AWINDOW_FLAG_NOT_FOCUSABLE = 0x00000008, 33 | AWINDOW_FLAG_NOT_TOUCHABLE = 0x00000010, 34 | AWINDOW_FLAG_NOT_TOUCH_MODAL = 0x00000020, 35 | AWINDOW_FLAG_TOUCHABLE_WHEN_WAKING = 0x00000040, 36 | AWINDOW_FLAG_KEEP_SCREEN_ON = 0x00000080, 37 | AWINDOW_FLAG_LAYOUT_IN_SCREEN = 0x00000100, 38 | AWINDOW_FLAG_LAYOUT_NO_LIMITS = 0x00000200, 39 | AWINDOW_FLAG_FULLSCREEN = 0x00000400, 40 | AWINDOW_FLAG_FORCE_NOT_FULLSCREEN = 0x00000800, 41 | AWINDOW_FLAG_DITHER = 0x00001000, 42 | AWINDOW_FLAG_SECURE = 0x00002000, 43 | AWINDOW_FLAG_SCALED = 0x00004000, 44 | AWINDOW_FLAG_IGNORE_CHEEK_PRESSES = 0x00008000, 45 | AWINDOW_FLAG_LAYOUT_INSET_DECOR = 0x00010000, 46 | AWINDOW_FLAG_ALT_FOCUSABLE_IM = 0x00020000, 47 | AWINDOW_FLAG_WATCH_OUTSIDE_TOUCH = 0x00040000, 48 | AWINDOW_FLAG_SHOW_WHEN_LOCKED = 0x00080000, 49 | AWINDOW_FLAG_SHOW_WALLPAPER = 0x00100000, 50 | AWINDOW_FLAG_TURN_SCREEN_ON = 0x00200000, 51 | AWINDOW_FLAG_DISMISS_KEYGUARD = 0x00400000, 52 | }; 53 | 54 | #ifdef __cplusplus 55 | }; 56 | #endif 57 | 58 | #endif // ANDROID_WINDOW_H 59 | -------------------------------------------------------------------------------- /jni/android/include/system/core/include/mincrypt/sha.h: -------------------------------------------------------------------------------- 1 | /* sha.h 2 | ** 3 | ** Copyright 2008, The Android Open Source Project 4 | ** 5 | ** Redistribution and use in source and binary forms, with or without 6 | ** modification, are permitted provided that the following conditions are met: 7 | ** * Redistributions of source code must retain the above copyright 8 | ** notice, this list of conditions and the following disclaimer. 9 | ** * Redistributions in binary form must reproduce the above copyright 10 | ** notice, this list of conditions and the following disclaimer in the 11 | ** documentation and/or other materials provided with the distribution. 12 | ** * Neither the name of Google Inc. nor the names of its contributors may 13 | ** be used to endorse or promote products derived from this software 14 | ** without specific prior written permission. 15 | ** 16 | ** THIS SOFTWARE IS PROVIDED BY Google Inc. ``AS IS'' AND ANY EXPRESS OR 17 | ** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | ** MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO 19 | ** EVENT SHALL Google Inc. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 21 | ** PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 22 | ** OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 23 | ** WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 24 | ** OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 25 | ** ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef _EMBEDDED_SHA_H_ 29 | #define _EMBEDDED_SHA_H_ 30 | 31 | #include 32 | 33 | #ifdef __cplusplus 34 | extern "C" { 35 | #endif 36 | 37 | typedef struct SHA_CTX { 38 | uint64_t count; 39 | uint32_t state[5]; 40 | #if defined(HAVE_ENDIAN_H) && defined(HAVE_LITTLE_ENDIAN) 41 | union { 42 | uint8_t b[64]; 43 | uint32_t w[16]; 44 | } buf; 45 | #else 46 | uint8_t buf[64]; 47 | #endif 48 | } SHA_CTX; 49 | 50 | void SHA_init(SHA_CTX* ctx); 51 | void SHA_update(SHA_CTX* ctx, const void* data, int len); 52 | const uint8_t* SHA_final(SHA_CTX* ctx); 53 | 54 | /* Convenience method. Returns digest parameter value. */ 55 | const uint8_t* SHA(const void* data, int len, uint8_t* digest); 56 | 57 | #define SHA_DIGEST_SIZE 20 58 | 59 | #ifdef __cplusplus 60 | } 61 | #endif 62 | 63 | #endif 64 | -------------------------------------------------------------------------------- /jni/android/include/frameworks/native/include/gui/SensorManager.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef ANDROID_GUI_SENSOR_MANAGER_H 18 | #define ANDROID_GUI_SENSOR_MANAGER_H 19 | 20 | #include 21 | #include 22 | 23 | #include 24 | 25 | #include 26 | #include 27 | #include 28 | #include 29 | 30 | #include 31 | 32 | // ---------------------------------------------------------------------------- 33 | // Concrete types for the NDK 34 | struct ASensorManager { }; 35 | 36 | // ---------------------------------------------------------------------------- 37 | namespace android { 38 | // ---------------------------------------------------------------------------- 39 | 40 | class ISensorServer; 41 | class Sensor; 42 | class SensorEventQueue; 43 | 44 | // ---------------------------------------------------------------------------- 45 | 46 | class SensorManager : 47 | public ASensorManager, 48 | public Singleton 49 | { 50 | public: 51 | SensorManager(); 52 | ~SensorManager(); 53 | 54 | ssize_t getSensorList(Sensor const* const** list) const; 55 | Sensor const* getDefaultSensor(int type); 56 | sp createEventQueue(); 57 | 58 | private: 59 | // DeathRecipient interface 60 | void sensorManagerDied(); 61 | 62 | status_t assertStateLocked() const; 63 | 64 | private: 65 | mutable Mutex mLock; 66 | mutable sp mSensorServer; 67 | mutable Sensor const** mSensorList; 68 | mutable Vector mSensors; 69 | mutable sp mDeathObserver; 70 | }; 71 | 72 | // ---------------------------------------------------------------------------- 73 | }; // namespace android 74 | 75 | #endif // ANDROID_GUI_SENSOR_MANAGER_H 76 | -------------------------------------------------------------------------------- /jni/android/include/frameworks/native/include/utils/CallStack.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2007 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef ANDROID_CALLSTACK_H 18 | #define ANDROID_CALLSTACK_H 19 | 20 | #include 21 | #include 22 | 23 | #include 24 | #include 25 | 26 | // --------------------------------------------------------------------------- 27 | 28 | namespace android { 29 | 30 | class CallStack 31 | { 32 | public: 33 | enum { 34 | MAX_DEPTH = 31 35 | }; 36 | 37 | CallStack(); 38 | CallStack(const char* logtag, int32_t ignoreDepth=1, 39 | int32_t maxDepth=MAX_DEPTH); 40 | CallStack(const CallStack& rhs); 41 | ~CallStack(); 42 | 43 | CallStack& operator = (const CallStack& rhs); 44 | 45 | bool operator == (const CallStack& rhs) const; 46 | bool operator != (const CallStack& rhs) const; 47 | bool operator < (const CallStack& rhs) const; 48 | bool operator >= (const CallStack& rhs) const; 49 | bool operator > (const CallStack& rhs) const; 50 | bool operator <= (const CallStack& rhs) const; 51 | 52 | const void* operator [] (int index) const; 53 | 54 | void clear(); 55 | 56 | void update(int32_t ignoreDepth=1, int32_t maxDepth=MAX_DEPTH); 57 | 58 | // Dump a stack trace to the log using the supplied logtag 59 | void dump(const char* logtag, const char* prefix = 0) const; 60 | 61 | // Return a string (possibly very long) containing the complete stack trace 62 | String8 toString(const char* prefix = 0) const; 63 | 64 | size_t size() const { return mCount; } 65 | 66 | private: 67 | size_t mCount; 68 | backtrace_frame_t mStack[MAX_DEPTH]; 69 | }; 70 | 71 | }; // namespace android 72 | 73 | 74 | // --------------------------------------------------------------------------- 75 | 76 | #endif // ANDROID_CALLSTACK_H 77 | -------------------------------------------------------------------------------- /jni/android/include/frameworks/native/include/utils/Debug.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef ANDROID_DEBUG_H 18 | #define ANDROID_DEBUG_H 19 | 20 | #include 21 | #include 22 | 23 | namespace android { 24 | // --------------------------------------------------------------------------- 25 | 26 | #ifdef __cplusplus 27 | template struct CompileTimeAssert; 28 | template<> struct CompileTimeAssert {}; 29 | #define COMPILE_TIME_ASSERT(_exp) \ 30 | template class CompileTimeAssert< (_exp) >; 31 | #endif 32 | #define COMPILE_TIME_ASSERT_FUNCTION_SCOPE(_exp) \ 33 | CompileTimeAssert<( _exp )>(); 34 | 35 | // --------------------------------------------------------------------------- 36 | 37 | #ifdef __cplusplus 38 | template struct CompileTimeIfElse; 39 | template 40 | struct CompileTimeIfElse { typedef LHS TYPE; }; 41 | template 42 | struct CompileTimeIfElse { typedef RHS TYPE; }; 43 | #endif 44 | 45 | // --------------------------------------------------------------------------- 46 | 47 | #ifdef __cplusplus 48 | extern "C" { 49 | #endif 50 | 51 | const char* stringForIndent(int32_t indentLevel); 52 | 53 | typedef void (*debugPrintFunc)(void* cookie, const char* txt); 54 | 55 | void printTypeCode(uint32_t typeCode, 56 | debugPrintFunc func = 0, void* cookie = 0); 57 | 58 | void printHexData(int32_t indent, const void *buf, size_t length, 59 | size_t bytesPerLine=16, int32_t singleLineBytesCutoff=16, 60 | size_t alignment=0, bool cArrayStyle=false, 61 | debugPrintFunc func = 0, void* cookie = 0); 62 | 63 | #ifdef __cplusplus 64 | } 65 | #endif 66 | 67 | // --------------------------------------------------------------------------- 68 | }; // namespace android 69 | 70 | #endif // ANDROID_DEBUG_H 71 | -------------------------------------------------------------------------------- /jni/android/include/frameworks/native/include/cpustats/CentralTendencyStatistics.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef _CENTRAL_TENDENCY_STATISTICS_H 18 | #define _CENTRAL_TENDENCY_STATISTICS_H 19 | 20 | #include 21 | 22 | // Not multithread safe 23 | class CentralTendencyStatistics { 24 | 25 | public: 26 | 27 | CentralTendencyStatistics() : 28 | mMean(NAN), mMedian(NAN), mMinimum(INFINITY), mMaximum(-INFINITY), mN(0), mM2(0), 29 | mVariance(NAN), mVarianceKnownForN(0), mStddev(NAN), mStddevKnownForN(0) { } 30 | 31 | ~CentralTendencyStatistics() { } 32 | 33 | // add x to the set of samples 34 | void sample(double x); 35 | 36 | // return the arithmetic mean of all samples so far 37 | double mean() const { return mMean; } 38 | 39 | // return the minimum of all samples so far 40 | double minimum() const { return mMinimum; } 41 | 42 | // return the maximum of all samples so far 43 | double maximum() const { return mMaximum; } 44 | 45 | // return the variance of all samples so far 46 | double variance() const; 47 | 48 | // return the standard deviation of all samples so far 49 | double stddev() const; 50 | 51 | // return the number of samples added so far 52 | unsigned n() const { return mN; } 53 | 54 | // reset the set of samples to be empty 55 | void reset(); 56 | 57 | private: 58 | double mMean; 59 | double mMedian; 60 | double mMinimum; 61 | double mMaximum; 62 | unsigned mN; // number of samples so far 63 | double mM2; 64 | 65 | // cached variance, and n at time of caching 66 | mutable double mVariance; 67 | mutable unsigned mVarianceKnownForN; 68 | 69 | // cached standard deviation, and n at time of caching 70 | mutable double mStddev; 71 | mutable unsigned mStddevKnownForN; 72 | 73 | }; 74 | 75 | #endif // _CENTRAL_TENDENCY_STATISTICS_H 76 | -------------------------------------------------------------------------------- /jni/android/include/frameworks/native/include/utils/ByteOrder.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | // 18 | 19 | #ifndef _LIBS_UTILS_BYTE_ORDER_H 20 | #define _LIBS_UTILS_BYTE_ORDER_H 21 | 22 | #include 23 | #include 24 | #ifdef HAVE_WINSOCK 25 | #include 26 | #else 27 | #include 28 | #endif 29 | 30 | /* 31 | * These macros are like the hton/ntoh byte swapping macros, 32 | * except they allow you to swap to and from the "device" byte 33 | * order. The device byte order is the endianness of the target 34 | * device -- for the ARM CPUs we use today, this is little endian. 35 | * 36 | * Note that the byte swapping functions have not been optimized 37 | * much; performance is currently not an issue for them since the 38 | * intent is to allow us to avoid byte swapping on the device. 39 | */ 40 | 41 | static inline uint32_t android_swap_long(uint32_t v) 42 | { 43 | return (v<<24) | ((v<<8)&0x00FF0000) | ((v>>8)&0x0000FF00) | (v>>24); 44 | } 45 | 46 | static inline uint16_t android_swap_short(uint16_t v) 47 | { 48 | return (v<<8) | (v>>8); 49 | } 50 | 51 | #define DEVICE_BYTE_ORDER LITTLE_ENDIAN 52 | 53 | #if BYTE_ORDER == DEVICE_BYTE_ORDER 54 | 55 | #define dtohl(x) (x) 56 | #define dtohs(x) (x) 57 | #define htodl(x) (x) 58 | #define htods(x) (x) 59 | 60 | #else 61 | 62 | #define dtohl(x) (android_swap_long(x)) 63 | #define dtohs(x) (android_swap_short(x)) 64 | #define htodl(x) (android_swap_long(x)) 65 | #define htods(x) (android_swap_short(x)) 66 | 67 | #endif 68 | 69 | #if BYTE_ORDER == LITTLE_ENDIAN 70 | #define fromlel(x) (x) 71 | #define fromles(x) (x) 72 | #define tolel(x) (x) 73 | #define toles(x) (x) 74 | #else 75 | #define fromlel(x) (android_swap_long(x)) 76 | #define fromles(x) (android_swap_short(x)) 77 | #define tolel(x) (android_swap_long(x)) 78 | #define toles(x) (android_swap_short(x)) 79 | #endif 80 | 81 | #endif // _LIBS_UTILS_BYTE_ORDER_H 82 | -------------------------------------------------------------------------------- /jni/android/include/system/core/include/mincrypt/rsa.h: -------------------------------------------------------------------------------- 1 | /* rsa.h 2 | ** 3 | ** Copyright 2008, The Android Open Source Project 4 | ** 5 | ** Redistribution and use in source and binary forms, with or without 6 | ** modification, are permitted provided that the following conditions are met: 7 | ** * Redistributions of source code must retain the above copyright 8 | ** notice, this list of conditions and the following disclaimer. 9 | ** * Redistributions in binary form must reproduce the above copyright 10 | ** notice, this list of conditions and the following disclaimer in the 11 | ** documentation and/or other materials provided with the distribution. 12 | ** * Neither the name of Google Inc. nor the names of its contributors may 13 | ** be used to endorse or promote products derived from this software 14 | ** without specific prior written permission. 15 | ** 16 | ** THIS SOFTWARE IS PROVIDED BY Google Inc. ``AS IS'' AND ANY EXPRESS OR 17 | ** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | ** MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO 19 | ** EVENT SHALL Google Inc. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 21 | ** PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 22 | ** OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 23 | ** WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 24 | ** OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 25 | ** ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef _EMBEDDED_RSA_H_ 29 | #define _EMBEDDED_RSA_H_ 30 | 31 | #include 32 | 33 | #ifdef __cplusplus 34 | extern "C" { 35 | #endif 36 | 37 | #define RSANUMBYTES 256 /* 2048 bit key length */ 38 | #define RSANUMWORDS (RSANUMBYTES / sizeof(uint32_t)) 39 | 40 | typedef struct RSAPublicKey { 41 | int len; /* Length of n[] in number of uint32_t */ 42 | uint32_t n0inv; /* -1 / n[0] mod 2^32 */ 43 | uint32_t n[RSANUMWORDS]; /* modulus as little endian array */ 44 | uint32_t rr[RSANUMWORDS]; /* R^2 as little endian array */ 45 | int exponent; /* 3 or 65537 */ 46 | } RSAPublicKey; 47 | 48 | int RSA_verify(const RSAPublicKey *key, 49 | const uint8_t* signature, 50 | const int len, 51 | const uint8_t* sha); 52 | 53 | #ifdef __cplusplus 54 | } 55 | #endif 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /jni/android/include/frameworks/native/include/gui/IDisplayEventConnection.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef ANDROID_GUI_IDISPLAY_EVENT_CONNECTION_H 18 | #define ANDROID_GUI_IDISPLAY_EVENT_CONNECTION_H 19 | 20 | #include 21 | #include 22 | 23 | #include 24 | #include 25 | 26 | #include 27 | 28 | namespace android { 29 | // ---------------------------------------------------------------------------- 30 | 31 | class BitTube; 32 | 33 | class IDisplayEventConnection : public IInterface 34 | { 35 | public: 36 | 37 | DECLARE_META_INTERFACE(DisplayEventConnection); 38 | 39 | /* 40 | * getDataChannel() returns a BitTube where to receive the events from 41 | */ 42 | virtual sp getDataChannel() const = 0; 43 | 44 | /* 45 | * setVsyncRate() sets the vsync event delivery rate. A value of 46 | * 1 returns every vsync events. A value of 2 returns every other events, 47 | * etc... a value of 0 returns no event unless requestNextVsync() has 48 | * been called. 49 | */ 50 | virtual void setVsyncRate(uint32_t count) = 0; 51 | 52 | /* 53 | * requestNextVsync() schedules the next vsync event. It has no effect 54 | * if the vsync rate is > 0. 55 | */ 56 | virtual void requestNextVsync() = 0; // asynchronous 57 | }; 58 | 59 | // ---------------------------------------------------------------------------- 60 | 61 | class BnDisplayEventConnection : public BnInterface 62 | { 63 | public: 64 | virtual status_t onTransact( uint32_t code, 65 | const Parcel& data, 66 | Parcel* reply, 67 | uint32_t flags = 0); 68 | }; 69 | 70 | // ---------------------------------------------------------------------------- 71 | }; // namespace android 72 | 73 | #endif // ANDROID_GUI_IDISPLAY_EVENT_CONNECTION_H 74 | -------------------------------------------------------------------------------- /jni/android/include/frameworks/native/include/utils/Singleton.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2007 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef ANDROID_UTILS_SINGLETON_H 18 | #define ANDROID_UTILS_SINGLETON_H 19 | 20 | #include 21 | #include 22 | #include 23 | #include 24 | 25 | namespace android { 26 | // --------------------------------------------------------------------------- 27 | 28 | template 29 | class ANDROID_API Singleton 30 | { 31 | public: 32 | static TYPE& getInstance() { 33 | Mutex::Autolock _l(sLock); 34 | TYPE* instance = sInstance; 35 | if (instance == 0) { 36 | instance = new TYPE(); 37 | sInstance = instance; 38 | } 39 | return *instance; 40 | } 41 | 42 | static bool hasInstance() { 43 | Mutex::Autolock _l(sLock); 44 | return sInstance != 0; 45 | } 46 | 47 | protected: 48 | ~Singleton() { }; 49 | Singleton() { }; 50 | 51 | private: 52 | Singleton(const Singleton&); 53 | Singleton& operator = (const Singleton&); 54 | static Mutex sLock; 55 | static TYPE* sInstance; 56 | }; 57 | 58 | /* 59 | * use ANDROID_SINGLETON_STATIC_INSTANCE(TYPE) in your implementation file 60 | * (eg: .cpp) to create the static instance of Singleton<>'s attributes, 61 | * and avoid to have a copy of them in each compilation units Singleton 62 | * is used. 63 | * NOTE: we use a version of Mutex ctor that takes a parameter, because 64 | * for some unknown reason using the default ctor doesn't emit the variable! 65 | */ 66 | 67 | #define ANDROID_SINGLETON_STATIC_INSTANCE(TYPE) \ 68 | template<> Mutex Singleton< TYPE >::sLock(Mutex::PRIVATE); \ 69 | template<> TYPE* Singleton< TYPE >::sInstance(0); \ 70 | template class Singleton< TYPE >; 71 | 72 | 73 | // --------------------------------------------------------------------------- 74 | }; // namespace android 75 | 76 | #endif // ANDROID_UTILS_SINGLETON_H 77 | 78 | -------------------------------------------------------------------------------- /jni/android/include/frameworks/native/include/ui/Point.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef ANDROID_UI_POINT 18 | #define ANDROID_UI_POINT 19 | 20 | #include 21 | #include 22 | 23 | namespace android { 24 | 25 | class Point : public LightFlattenablePod 26 | { 27 | public: 28 | int x; 29 | int y; 30 | 31 | // we don't provide copy-ctor and operator= on purpose 32 | // because we want the compiler generated versions 33 | 34 | // Default constructor doesn't initialize the Point 35 | inline Point() { 36 | } 37 | inline Point(int x, int y) : x(x), y(y) { 38 | } 39 | 40 | inline bool operator == (const Point& rhs) const { 41 | return (x == rhs.x) && (y == rhs.y); 42 | } 43 | inline bool operator != (const Point& rhs) const { 44 | return !operator == (rhs); 45 | } 46 | 47 | inline bool isOrigin() const { 48 | return !(x|y); 49 | } 50 | 51 | // operator < defines an order which allows to use points in sorted 52 | // vectors. 53 | bool operator < (const Point& rhs) const { 54 | return y 23 | #include 24 | #include 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | typedef struct map_info { 31 | struct map_info* next; 32 | uintptr_t start; 33 | uintptr_t end; 34 | bool is_readable; 35 | bool is_writable; 36 | bool is_executable; 37 | void* data; // arbitrary data associated with the map by the user, initially NULL 38 | char name[]; 39 | } map_info_t; 40 | 41 | /* Loads memory map from /proc//maps. */ 42 | map_info_t* load_map_info_list(pid_t tid); 43 | 44 | /* Frees memory map. */ 45 | void free_map_info_list(map_info_t* milist); 46 | 47 | /* Finds the memory map that contains the specified address. */ 48 | const map_info_t* find_map_info(const map_info_t* milist, uintptr_t addr); 49 | 50 | /* Returns true if the addr is in a readable map. */ 51 | bool is_readable_map(const map_info_t* milist, uintptr_t addr); 52 | /* Returns true if the addr is in a writable map. */ 53 | bool is_writable_map(const map_info_t* milist, uintptr_t addr); 54 | /* Returns true if the addr is in an executable map. */ 55 | bool is_executable_map(const map_info_t* milist, uintptr_t addr); 56 | 57 | /* Acquires a reference to the memory map for this process. 58 | * The result is cached and refreshed automatically. 59 | * Make sure to release the map info when done. */ 60 | map_info_t* acquire_my_map_info_list(); 61 | 62 | /* Releases a reference to the map info for this process that was 63 | * previous acquired using acquire_my_map_info_list(). */ 64 | void release_my_map_info_list(map_info_t* milist); 65 | 66 | /* Flushes the cached memory map so the next call to 67 | * acquire_my_map_info_list() gets fresh data. */ 68 | void flush_my_map_info_list(); 69 | 70 | #ifdef __cplusplus 71 | } 72 | #endif 73 | 74 | #endif // _CORKSCREW_MAP_INFO_H 75 | -------------------------------------------------------------------------------- /jni/android/include/frameworks/native/include/gui/ISurfaceComposerClient.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2007 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef ANDROID_GUI_ISURFACE_COMPOSER_CLIENT_H 18 | #define ANDROID_GUI_ISURFACE_COMPOSER_CLIENT_H 19 | 20 | #include 21 | #include 22 | 23 | #include 24 | #include 25 | 26 | #include 27 | 28 | #include 29 | 30 | namespace android { 31 | // ---------------------------------------------------------------------------- 32 | 33 | class IGraphicBufferProducer; 34 | 35 | class ISurfaceComposerClient : public IInterface 36 | { 37 | public: 38 | DECLARE_META_INTERFACE(SurfaceComposerClient); 39 | 40 | // flags for createSurface() 41 | enum { // (keep in sync with Surface.java) 42 | eHidden = 0x00000004, 43 | eDestroyBackbuffer = 0x00000020, 44 | eSecure = 0x00000080, 45 | eNonPremultiplied = 0x00000100, 46 | eOpaque = 0x00000400, 47 | eProtectedByApp = 0x00000800, 48 | eProtectedByDRM = 0x00001000, 49 | 50 | eFXSurfaceNormal = 0x00000000, 51 | eFXSurfaceDim = 0x00020000, 52 | eFXSurfaceMask = 0x000F0000, 53 | }; 54 | 55 | /* 56 | * Requires ACCESS_SURFACE_FLINGER permission 57 | */ 58 | virtual status_t createSurface( 59 | const String8& name, uint32_t w, uint32_t h, 60 | PixelFormat format, uint32_t flags, 61 | sp* handle, 62 | sp* gbp) = 0; 63 | 64 | /* 65 | * Requires ACCESS_SURFACE_FLINGER permission 66 | */ 67 | virtual status_t destroySurface(const sp& handle) = 0; 68 | }; 69 | 70 | // ---------------------------------------------------------------------------- 71 | 72 | class BnSurfaceComposerClient: public BnInterface { 73 | public: 74 | virtual status_t onTransact(uint32_t code, const Parcel& data, 75 | Parcel* reply, uint32_t flags = 0); 76 | }; 77 | 78 | // ---------------------------------------------------------------------------- 79 | 80 | }; // namespace android 81 | 82 | #endif // ANDROID_GUI_ISURFACE_COMPOSER_CLIENT_H 83 | -------------------------------------------------------------------------------- /jni/android/include/frameworks/native/include/utils/Errors.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2007 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef ANDROID_ERRORS_H 18 | #define ANDROID_ERRORS_H 19 | 20 | #include 21 | #include 22 | 23 | namespace android { 24 | 25 | // use this type to return error codes 26 | #ifdef HAVE_MS_C_RUNTIME 27 | typedef int status_t; 28 | #else 29 | typedef int32_t status_t; 30 | #endif 31 | 32 | /* the MS C runtime lacks a few error codes */ 33 | 34 | /* 35 | * Error codes. 36 | * All error codes are negative values. 37 | */ 38 | 39 | // Win32 #defines NO_ERROR as well. It has the same value, so there's no 40 | // real conflict, though it's a bit awkward. 41 | #ifdef _WIN32 42 | # undef NO_ERROR 43 | #endif 44 | 45 | enum { 46 | OK = 0, // Everything's swell. 47 | NO_ERROR = 0, // No errors. 48 | 49 | UNKNOWN_ERROR = 0x80000000, 50 | 51 | NO_MEMORY = -ENOMEM, 52 | INVALID_OPERATION = -ENOSYS, 53 | BAD_VALUE = -EINVAL, 54 | BAD_TYPE = 0x80000001, 55 | NAME_NOT_FOUND = -ENOENT, 56 | PERMISSION_DENIED = -EPERM, 57 | NO_INIT = -ENODEV, 58 | ALREADY_EXISTS = -EEXIST, 59 | DEAD_OBJECT = -EPIPE, 60 | FAILED_TRANSACTION = 0x80000002, 61 | JPARKS_BROKE_IT = -EPIPE, 62 | #if !defined(HAVE_MS_C_RUNTIME) 63 | BAD_INDEX = -EOVERFLOW, 64 | NOT_ENOUGH_DATA = -ENODATA, 65 | WOULD_BLOCK = -EWOULDBLOCK, 66 | TIMED_OUT = -ETIMEDOUT, 67 | UNKNOWN_TRANSACTION = -EBADMSG, 68 | #else 69 | BAD_INDEX = -E2BIG, 70 | NOT_ENOUGH_DATA = 0x80000003, 71 | WOULD_BLOCK = 0x80000004, 72 | TIMED_OUT = 0x80000005, 73 | UNKNOWN_TRANSACTION = 0x80000006, 74 | #endif 75 | FDS_NOT_ALLOWED = 0x80000007, 76 | }; 77 | 78 | // Restore define; enumeration is in "android" namespace, so the value defined 79 | // there won't work for Win32 code in a different namespace. 80 | #ifdef _WIN32 81 | # define NO_ERROR 0L 82 | #endif 83 | 84 | }; // namespace android 85 | 86 | // --------------------------------------------------------------------------- 87 | 88 | #endif // ANDROID_ERRORS_H 89 | -------------------------------------------------------------------------------- /jni/android/include/frameworks/native/include/binder/PermissionCache.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2009 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef BINDER_PERMISSION_H 18 | #define BINDER_PERMISSION_H 19 | 20 | #include 21 | #include 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | namespace android { 28 | // --------------------------------------------------------------------------- 29 | 30 | /* 31 | * PermissionCache caches permission checks for a given uid. 32 | * 33 | * Currently the cache is not updated when there is a permission change, 34 | * for instance when an application is uninstalled. 35 | * 36 | * IMPORTANT: for the reason stated above, only system permissions are safe 37 | * to cache. This restriction may be lifted at a later time. 38 | * 39 | */ 40 | 41 | class PermissionCache : Singleton { 42 | struct Entry { 43 | String16 name; 44 | uid_t uid; 45 | bool granted; 46 | inline bool operator < (const Entry& e) const { 47 | return (uid == e.uid) ? (name < e.name) : (uid < e.uid); 48 | } 49 | }; 50 | mutable Mutex mLock; 51 | // we pool all the permission names we see, as many permissions checks 52 | // will have identical names 53 | SortedVector< String16 > mPermissionNamesPool; 54 | // this is our cache per say. it stores pooled names. 55 | SortedVector< Entry > mCache; 56 | 57 | // free the whole cache, but keep the permission name pool 58 | void purge(); 59 | 60 | status_t check(bool* granted, 61 | const String16& permission, uid_t uid) const; 62 | 63 | void cache(const String16& permission, uid_t uid, bool granted); 64 | 65 | public: 66 | PermissionCache(); 67 | 68 | static bool checkCallingPermission(const String16& permission); 69 | 70 | static bool checkCallingPermission(const String16& permission, 71 | int32_t* outPid, int32_t* outUid); 72 | 73 | static bool checkPermission(const String16& permission, 74 | pid_t pid, uid_t uid); 75 | }; 76 | 77 | // --------------------------------------------------------------------------- 78 | }; // namespace android 79 | 80 | #endif /* BINDER_PERMISSION_H */ 81 | -------------------------------------------------------------------------------- /jni/android/include/frameworks/native/include/android/bitmap.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2009 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef ANDROID_BITMAP_H 18 | #define ANDROID_BITMAP_H 19 | 20 | #include 21 | #include 22 | 23 | #ifdef __cplusplus 24 | extern "C" { 25 | #endif 26 | 27 | #define ANDROID_BITMAP_RESULT_SUCCESS 0 28 | #define ANDROID_BITMAP_RESULT_BAD_PARAMETER -1 29 | #define ANDROID_BITMAP_RESULT_JNI_EXCEPTION -2 30 | #define ANDROID_BITMAP_RESULT_ALLOCATION_FAILED -3 31 | 32 | /* Backward compatibility: this macro used to be misspelled. */ 33 | #define ANDROID_BITMAP_RESUT_SUCCESS ANDROID_BITMAP_RESULT_SUCCESS 34 | 35 | enum AndroidBitmapFormat { 36 | ANDROID_BITMAP_FORMAT_NONE = 0, 37 | ANDROID_BITMAP_FORMAT_RGBA_8888 = 1, 38 | ANDROID_BITMAP_FORMAT_RGB_565 = 4, 39 | ANDROID_BITMAP_FORMAT_RGBA_4444 = 7, 40 | ANDROID_BITMAP_FORMAT_A_8 = 8, 41 | }; 42 | 43 | typedef struct { 44 | uint32_t width; 45 | uint32_t height; 46 | uint32_t stride; 47 | int32_t format; 48 | uint32_t flags; // 0 for now 49 | } AndroidBitmapInfo; 50 | 51 | /** 52 | * Given a java bitmap object, fill out the AndroidBitmap struct for it. 53 | * If the call fails, the info parameter will be ignored 54 | */ 55 | int AndroidBitmap_getInfo(JNIEnv* env, jobject jbitmap, 56 | AndroidBitmapInfo* info); 57 | 58 | /** 59 | * Given a java bitmap object, attempt to lock the pixel address. 60 | * Locking will ensure that the memory for the pixels will not move 61 | * until the unlockPixels call, and ensure that, if the pixels had been 62 | * previously purged, they will have been restored. 63 | * 64 | * If this call succeeds, it must be balanced by a call to 65 | * AndroidBitmap_unlockPixels, after which time the address of the pixels should 66 | * no longer be used. 67 | * 68 | * If this succeeds, *addrPtr will be set to the pixel address. If the call 69 | * fails, addrPtr will be ignored. 70 | */ 71 | int AndroidBitmap_lockPixels(JNIEnv* env, jobject jbitmap, void** addrPtr); 72 | 73 | /** 74 | * Call this to balanace a successful call to AndroidBitmap_lockPixels 75 | */ 76 | int AndroidBitmap_unlockPixels(JNIEnv* env, jobject jbitmap); 77 | 78 | #ifdef __cplusplus 79 | } 80 | #endif 81 | 82 | #endif 83 | -------------------------------------------------------------------------------- /jni/android/include/frameworks/native/include/gui/SensorEventQueue.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef ANDROID_SENSOR_EVENT_QUEUE_H 18 | #define ANDROID_SENSOR_EVENT_QUEUE_H 19 | 20 | #include 21 | #include 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | #include 28 | 29 | // ---------------------------------------------------------------------------- 30 | 31 | struct ALooper; 32 | struct ASensorEvent; 33 | 34 | // Concrete types for the NDK 35 | struct ASensorEventQueue { 36 | ALooper* looper; 37 | }; 38 | 39 | // ---------------------------------------------------------------------------- 40 | namespace android { 41 | // ---------------------------------------------------------------------------- 42 | 43 | class ISensorEventConnection; 44 | class Sensor; 45 | class Looper; 46 | 47 | // ---------------------------------------------------------------------------- 48 | 49 | class SensorEventQueue : public ASensorEventQueue, public RefBase 50 | { 51 | public: 52 | SensorEventQueue(const sp& connection); 53 | virtual ~SensorEventQueue(); 54 | virtual void onFirstRef(); 55 | 56 | int getFd() const; 57 | 58 | static ssize_t write(const sp& tube, 59 | ASensorEvent const* events, size_t numEvents); 60 | 61 | ssize_t read(ASensorEvent* events, size_t numEvents); 62 | 63 | status_t waitForEvent() const; 64 | status_t wake() const; 65 | 66 | status_t enableSensor(Sensor const* sensor) const; 67 | status_t disableSensor(Sensor const* sensor) const; 68 | status_t setEventRate(Sensor const* sensor, nsecs_t ns) const; 69 | 70 | // these are here only to support SensorManager.java 71 | status_t enableSensor(int32_t handle, int32_t us) const; 72 | status_t disableSensor(int32_t handle) const; 73 | 74 | private: 75 | sp getLooper() const; 76 | sp mSensorEventConnection; 77 | sp mSensorChannel; 78 | mutable Mutex mLock; 79 | mutable sp mLooper; 80 | }; 81 | 82 | // ---------------------------------------------------------------------------- 83 | }; // namespace android 84 | 85 | #endif // ANDROID_SENSOR_EVENT_QUEUE_H 86 | --------------------------------------------------------------------------------