├── AndroidManifest.xml ├── README.md ├── bin ├── classes │ └── com │ │ ├── alibaba │ │ └── laiwang │ │ │ └── android │ │ │ ├── MemoryService.class │ │ │ └── MemoryShare.class │ │ └── example │ │ └── android_memoryshare │ │ ├── BuildConfig.class │ │ ├── MainActivity.class │ │ ├── R$attr.class │ │ ├── R$dimen.class │ │ ├── R$drawable.class │ │ ├── R$id.class │ │ ├── R$layout.class │ │ ├── R$menu.class │ │ ├── R$string.class │ │ ├── R$style.class │ │ ├── R.class │ │ └── TestActivity.class ├── dexedLibs │ └── android-support-v4-a5c7a72e65aa5c9e4421c026cd1a9438.jar └── res │ └── crunch │ ├── drawable-hdpi │ └── ic_launcher.png │ ├── drawable-mdpi │ └── ic_launcher.png │ ├── drawable-xhdpi │ └── ic_launcher.png │ └── drawable-xxhdpi │ └── ic_launcher.png ├── gen └── com │ └── example │ └── android_memoryshare │ ├── BuildConfig.java │ └── R.java ├── ic_launcher-web.png ├── jni ├── Android.mk ├── Android │ ├── include │ │ ├── AudioHardware.h │ │ ├── cutils │ │ │ ├── adb_networking.h │ │ │ ├── array.h │ │ │ ├── ashmem.h │ │ │ ├── atomic.h │ │ │ ├── config_utils.h │ │ │ ├── cpu_info.h │ │ │ ├── dir_hash.h │ │ │ ├── event_tag_map.h │ │ │ ├── fdevent.h │ │ │ ├── hashmap.h │ │ │ ├── jstring.h │ │ │ ├── log.h │ │ │ ├── logd.h │ │ │ ├── logger.h │ │ │ ├── logprint.h │ │ │ ├── memory.h │ │ │ ├── misc.h │ │ │ ├── mq.h │ │ │ ├── mspace.h │ │ │ ├── native_handle.h │ │ │ ├── process_name.h │ │ │ ├── properties.h │ │ │ ├── record_stream.h │ │ │ ├── selector.h │ │ │ ├── sockets.h │ │ │ ├── threads.h │ │ │ ├── tztime.h │ │ │ ├── uio.h │ │ │ └── zygote.h │ │ ├── hardware_legacy │ │ │ ├── AudioHardwareBase.h │ │ │ ├── AudioHardwareInterface.h │ │ │ ├── IMountService.h │ │ │ ├── flashlight.h │ │ │ ├── gps.h │ │ │ ├── power.h │ │ │ ├── qemu_tracing.h │ │ │ ├── uevent.h │ │ │ ├── vibrator.h │ │ │ └── wifi.h │ │ ├── media │ │ │ ├── AudioRecord.h │ │ │ ├── AudioSystem.h │ │ │ ├── AudioTrack.h │ │ │ ├── AudioTrack9.h │ │ │ ├── IAudioFlinger.h │ │ │ ├── IAudioFlingerClient.h │ │ │ ├── IAudioRecord.h │ │ │ ├── IAudioTrack.h │ │ │ ├── IMediaMetadataRetriever.h │ │ │ ├── IMediaPlayer.h │ │ │ ├── IMediaPlayerClient.h │ │ │ ├── IMediaPlayerService.h │ │ │ ├── IMediaRecorder.h │ │ │ ├── JetPlayer.h │ │ │ ├── MediaMetadataRetrieverInterface.h │ │ │ ├── MediaPlayerInterface.h │ │ │ ├── PVMediaRecorder.h │ │ │ ├── PVMetadataRetriever.h │ │ │ ├── PVPlayer.h │ │ │ ├── ToneGenerator.h │ │ │ ├── mediametadataretriever.h │ │ │ ├── mediaplayer.h │ │ │ ├── mediarecorder.h │ │ │ ├── mediascanner.h │ │ │ └── thread_init.h │ │ └── utils │ │ │ ├── AndroidUnicode.h │ │ │ ├── Asset.h │ │ │ ├── AssetDir.h │ │ │ ├── AssetManager.h │ │ │ ├── Atomic.h │ │ │ ├── BackupHelpers.h │ │ │ ├── Binder.h │ │ │ ├── BpBinder.h │ │ │ ├── Buffer.h │ │ │ ├── BufferedTextOutput.h │ │ │ ├── ByteOrder.h │ │ │ ├── CallStack.h │ │ │ ├── Debug.h │ │ │ ├── Endian.h │ │ │ ├── Errors.h │ │ │ ├── FileMap.h │ │ │ ├── IBinder.h │ │ │ ├── IInterface.h │ │ │ ├── IMemory.h │ │ │ ├── IPCThreadState.h │ │ │ ├── IPermissionController.h │ │ │ ├── IServiceManager.h │ │ │ ├── KeyedVector.h │ │ │ ├── List.h │ │ │ ├── Log.h │ │ │ ├── LogSocket.h │ │ │ ├── MemoryBase.h │ │ │ ├── MemoryDealer.h │ │ │ ├── MemoryHeapBase.h │ │ │ ├── MemoryHeapPmem.h │ │ │ ├── Parcel.h │ │ │ ├── Pipe.h │ │ │ ├── ProcessState.h │ │ │ ├── RefBase.h │ │ │ ├── ResourceTypes.h │ │ │ ├── SharedBuffer.h │ │ │ ├── Socket.h │ │ │ ├── SortedVector.h │ │ │ ├── StopWatch.h │ │ │ ├── String16.h │ │ │ ├── String8.h │ │ │ ├── SystemClock.h │ │ │ ├── TextOutput.h │ │ │ ├── TimerProbe.h │ │ │ ├── Timers.h │ │ │ ├── TypeHelpers.h │ │ │ ├── Vector.h │ │ │ ├── VectorImpl.h │ │ │ ├── ZipEntry.h │ │ │ ├── ZipFile.h │ │ │ ├── ZipFileCRO.h │ │ │ ├── ZipFileRO.h │ │ │ ├── ZipUtils.h │ │ │ ├── ashmem.h │ │ │ ├── executablepath.h │ │ │ ├── inet_address.h │ │ │ ├── misc.h │ │ │ ├── ported.h │ │ │ ├── string_array.h │ │ │ └── threads.h │ ├── include_jb │ │ ├── binder │ │ │ ├── Binder.h │ │ │ ├── BinderService.h │ │ │ ├── BpBinder.h │ │ │ ├── IBinder.h │ │ │ ├── IInterface.h │ │ │ ├── IMemory.h │ │ │ ├── IPCThreadState.h │ │ │ ├── IPermissionController.h │ │ │ ├── IServiceManager.h │ │ │ ├── MemoryBase.h │ │ │ ├── MemoryDealer.h │ │ │ ├── MemoryHeapBase.h │ │ │ ├── Parcel.h │ │ │ ├── PermissionCache.h │ │ │ └── ProcessState.h │ │ ├── cutils │ │ │ ├── abort_socket.h │ │ │ ├── android_reboot.h │ │ │ ├── array.h │ │ │ ├── ashmem.h │ │ │ ├── atomic-arm.h │ │ │ ├── atomic-inline.h │ │ │ ├── atomic-x86.h │ │ │ ├── atomic.h │ │ │ ├── bitops.h │ │ │ ├── compiler.h │ │ │ ├── config_utils.h │ │ │ ├── cpu_info.h │ │ │ ├── debugger.h │ │ │ ├── dir_hash.h │ │ │ ├── event_tag_map.h │ │ │ ├── hashmap.h │ │ │ ├── iosched_policy.h │ │ │ ├── jstring.h │ │ │ ├── klog.h │ │ │ ├── list.h │ │ │ ├── log.h │ │ │ ├── logd.h │ │ │ ├── logger.h │ │ │ ├── logprint.h │ │ │ ├── memory.h │ │ │ ├── misc.h │ │ │ ├── mq.h │ │ │ ├── mspace.h │ │ │ ├── native_handle.h │ │ │ ├── open_memstream.h │ │ │ ├── partition_utils.h │ │ │ ├── process_name.h │ │ │ ├── properties.h │ │ │ ├── qsort_r_compat.h │ │ │ ├── qtaguid.h │ │ │ ├── record_stream.h │ │ │ ├── sched_policy.h │ │ │ ├── selector.h │ │ │ ├── sockets.h │ │ │ ├── str_parms.h │ │ │ ├── threads.h │ │ │ ├── tztime.h │ │ │ ├── uevent.h │ │ │ ├── uio.h │ │ │ └── zygote.h │ │ ├── hardware │ │ │ ├── audio.h │ │ │ ├── audio_effect.h │ │ │ ├── audio_policy.h │ │ │ ├── camera.h │ │ │ ├── camera2.h │ │ │ ├── camera_common.h │ │ │ ├── fb.h │ │ │ ├── gps.h │ │ │ ├── gralloc.h │ │ │ ├── hardware.h │ │ │ ├── hwcomposer.h │ │ │ ├── hwcomposer_defs.h │ │ │ ├── keymaster.h │ │ │ ├── lights.h │ │ │ ├── local_time_hal.h │ │ │ ├── nfc.h │ │ │ ├── power.h │ │ │ ├── qemu_pipe.h │ │ │ ├── qemud.h │ │ │ └── sensors.h │ │ ├── hardware_legacy │ │ │ ├── AudioHardwareBase.h │ │ │ ├── AudioHardwareInterface.h │ │ │ ├── AudioPolicyInterface.h │ │ │ ├── AudioPolicyManagerBase.h │ │ │ ├── AudioSystemLegacy.h │ │ │ ├── IMountService.h │ │ │ ├── audio_policy_conf.h │ │ │ ├── power.h │ │ │ ├── qemu_tracing.h │ │ │ ├── uevent.h │ │ │ ├── vibrator.h │ │ │ └── wifi.h │ │ ├── media │ │ │ ├── AudioEffect.h │ │ │ ├── AudioParameter.h │ │ │ ├── AudioRecord.h │ │ │ ├── AudioSystem.h │ │ │ ├── AudioTrack.h │ │ │ ├── EffectsFactoryApi.h │ │ │ ├── IAudioFlinger.h │ │ │ ├── IAudioFlingerClient.h │ │ │ ├── IAudioPolicyService.h │ │ │ ├── IAudioRecord.h │ │ │ ├── IAudioTrack.h │ │ │ ├── ICrypto.h │ │ │ ├── IEffect.h │ │ │ ├── IEffectClient.h │ │ │ ├── IMediaDeathNotifier.h │ │ │ ├── IMediaMetadataRetriever.h │ │ │ ├── IMediaPlayer.h │ │ │ ├── IMediaPlayerClient.h │ │ │ ├── IMediaPlayerService.h │ │ │ ├── IMediaRecorder.h │ │ │ ├── IMediaRecorderClient.h │ │ │ ├── IOMX.h │ │ │ ├── IStreamSource.h │ │ │ ├── JetPlayer.h │ │ │ ├── MediaMetadataRetrieverInterface.h │ │ │ ├── MediaPlayerInterface.h │ │ │ ├── MediaProfiles.h │ │ │ ├── MediaRecorderBase.h │ │ │ ├── MemoryLeakTrackUtil.h │ │ │ ├── Metadata.h │ │ │ ├── SoundPool.h │ │ │ ├── ToneGenerator.h │ │ │ ├── Visualizer.h │ │ │ ├── mediametadataretriever.h │ │ │ ├── mediaplayer.h │ │ │ ├── mediarecorder.h │ │ │ ├── mediascanner.h │ │ │ └── stagefright │ │ │ │ ├── AACWriter.h │ │ │ │ ├── ACodec.h │ │ │ │ ├── AMRWriter.h │ │ │ │ ├── AudioPlayer.h │ │ │ │ ├── AudioSource.h │ │ │ │ ├── CameraSource.h │ │ │ │ ├── CameraSourceTimeLapse.h │ │ │ │ ├── ColorConverter.h │ │ │ │ ├── DataSource.h │ │ │ │ ├── FileSource.h │ │ │ │ ├── JPEGSource.h │ │ │ │ ├── MPEG2TSWriter.h │ │ │ │ ├── MPEG4Writer.h │ │ │ │ ├── MediaBuffer.h │ │ │ │ ├── MediaBufferGroup.h │ │ │ │ ├── MediaCodec.h │ │ │ │ ├── MediaCodecList.h │ │ │ │ ├── MediaDefs.h │ │ │ │ ├── MediaErrors.h │ │ │ │ ├── MediaExtractor.h │ │ │ │ ├── MediaSource.h │ │ │ │ ├── MediaWriter.h │ │ │ │ ├── MetaData.h │ │ │ │ ├── NativeWindowWrapper.h │ │ │ │ ├── NuMediaExtractor.h │ │ │ │ ├── OMXClient.h │ │ │ │ ├── OMXCodec.h │ │ │ │ ├── SkipCutBuffer.h │ │ │ │ ├── StagefrightMediaScanner.h │ │ │ │ ├── SurfaceMediaSource.h │ │ │ │ ├── TimeSource.h │ │ │ │ ├── Utils.h │ │ │ │ ├── YUVCanvas.h │ │ │ │ ├── YUVImage.h │ │ │ │ ├── foundation │ │ │ │ ├── AAtomizer.h │ │ │ │ ├── ABase.h │ │ │ │ ├── ABitReader.h │ │ │ │ ├── ABuffer.h │ │ │ │ ├── ADebug.h │ │ │ │ ├── AHandler.h │ │ │ │ ├── AHandlerReflector.h │ │ │ │ ├── AHierarchicalStateMachine.h │ │ │ │ ├── ALooper.h │ │ │ │ ├── ALooperRoster.h │ │ │ │ ├── AMessage.h │ │ │ │ ├── AString.h │ │ │ │ ├── base64.h │ │ │ │ └── hexdump.h │ │ │ │ └── timedtext │ │ │ │ └── TimedTextDriver.h │ │ ├── system │ │ │ ├── audio.h │ │ │ ├── audio_policy.h │ │ │ ├── camera.h │ │ │ ├── graphics.h │ │ │ └── window.h │ │ └── utils │ │ │ ├── AndroidThreads.h │ │ │ ├── Atomic.h │ │ │ ├── BasicHashtable.h │ │ │ ├── BitSet.h │ │ │ ├── BlobCache.h │ │ │ ├── BufferedTextOutput.h │ │ │ ├── ByteOrder.h │ │ │ ├── CallStack.h │ │ │ ├── Compat.h │ │ │ ├── Condition.h │ │ │ ├── Debug.h │ │ │ ├── Endian.h │ │ │ ├── Errors.h │ │ │ ├── FileMap.h │ │ │ ├── Flattenable.h │ │ │ ├── Functor.h │ │ │ ├── GenerationCache.h │ │ │ ├── KeyedVector.h │ │ │ ├── LinearTransform.h │ │ │ ├── List.h │ │ │ ├── Log.h │ │ │ ├── Looper.h │ │ │ ├── Mutex.h │ │ │ ├── PropertyMap.h │ │ │ ├── RWLock.h │ │ │ ├── RefBase.h │ │ │ ├── SharedBuffer.h │ │ │ ├── Singleton.h │ │ │ ├── SortedVector.h │ │ │ ├── StopWatch.h │ │ │ ├── String16.h │ │ │ ├── String8.h │ │ │ ├── StringArray.h │ │ │ ├── StrongPointer.h │ │ │ ├── SystemClock.h │ │ │ ├── TextOutput.h │ │ │ ├── Thread.h │ │ │ ├── ThreadDefs.h │ │ │ ├── Timers.h │ │ │ ├── Tokenizer.h │ │ │ ├── Trace.h │ │ │ ├── TypeHelpers.h │ │ │ ├── Unicode.h │ │ │ ├── UniquePtr.h │ │ │ ├── Vector.h │ │ │ ├── VectorImpl.h │ │ │ ├── WorkQueue.h │ │ │ ├── ZipFileCRO.h │ │ │ ├── ZipFileRO.h │ │ │ ├── ZipUtils.h │ │ │ ├── ashmem.h │ │ │ ├── misc.h │ │ │ └── threads.h │ ├── include_jb4_2 │ │ ├── binder │ │ │ ├── Binder.h │ │ │ ├── BinderService.h │ │ │ ├── BpBinder.h │ │ │ ├── IBinder.h │ │ │ ├── IInterface.h │ │ │ ├── IMemory.h │ │ │ ├── IPCThreadState.h │ │ │ ├── IPermissionController.h │ │ │ ├── IServiceManager.h │ │ │ ├── MemoryBase.h │ │ │ ├── MemoryDealer.h │ │ │ ├── MemoryHeapBase.h │ │ │ ├── Parcel.h │ │ │ ├── PermissionCache.h │ │ │ └── ProcessState.h │ │ ├── cutils │ │ │ ├── abort_socket.h │ │ │ ├── android_reboot.h │ │ │ ├── array.h │ │ │ ├── ashmem.h │ │ │ ├── atomic-arm.h │ │ │ ├── atomic-inline.h │ │ │ ├── atomic-mips.h │ │ │ ├── atomic-x86.h │ │ │ ├── atomic.h │ │ │ ├── bitops.h │ │ │ ├── compiler.h │ │ │ ├── config_utils.h │ │ │ ├── cpu_info.h │ │ │ ├── debugger.h │ │ │ ├── dir_hash.h │ │ │ ├── event_tag_map.h │ │ │ ├── fs.h │ │ │ ├── hashmap.h │ │ │ ├── iosched_policy.h │ │ │ ├── jstring.h │ │ │ ├── klog.h │ │ │ ├── list.h │ │ │ ├── log.h │ │ │ ├── logd.h │ │ │ ├── logger.h │ │ │ ├── logprint.h │ │ │ ├── memory.h │ │ │ ├── misc.h │ │ │ ├── mq.h │ │ │ ├── multiuser.h │ │ │ ├── native_handle.h │ │ │ ├── open_memstream.h │ │ │ ├── partition_utils.h │ │ │ ├── process_name.h │ │ │ ├── properties.h │ │ │ ├── qsort_r_compat.h │ │ │ ├── qtaguid.h │ │ │ ├── record_stream.h │ │ │ ├── sched_policy.h │ │ │ ├── selector.h │ │ │ ├── sockets.h │ │ │ ├── str_parms.h │ │ │ ├── threads.h │ │ │ ├── tztime.h │ │ │ ├── uevent.h │ │ │ ├── uio.h │ │ │ └── zygote.h │ │ ├── hardware │ │ │ ├── audio.h │ │ │ ├── audio_effect.h │ │ │ ├── audio_policy.h │ │ │ ├── bluetooth.h │ │ │ ├── bt_av.h │ │ │ ├── bt_hf.h │ │ │ ├── bt_hh.h │ │ │ ├── bt_hl.h │ │ │ ├── bt_pan.h │ │ │ ├── bt_sock.h │ │ │ ├── camera.h │ │ │ ├── camera2.h │ │ │ ├── camera_common.h │ │ │ ├── fb.h │ │ │ ├── gps.h │ │ │ ├── gralloc.h │ │ │ ├── hardware.h │ │ │ ├── hwcomposer.h │ │ │ ├── hwcomposer_defs.h │ │ │ ├── keymaster.h │ │ │ ├── lights.h │ │ │ ├── local_time_hal.h │ │ │ ├── nfc.h │ │ │ ├── power.h │ │ │ ├── qemu_pipe.h │ │ │ ├── qemud.h │ │ │ └── sensors.h │ │ ├── hardware_legacy │ │ │ ├── AudioHardwareBase.h │ │ │ ├── AudioHardwareInterface.h │ │ │ ├── AudioPolicyInterface.h │ │ │ ├── AudioPolicyManagerBase.h │ │ │ ├── AudioSystemLegacy.h │ │ │ ├── IMountService.h │ │ │ ├── audio_policy_conf.h │ │ │ ├── power.h │ │ │ ├── qemu_tracing.h │ │ │ ├── uevent.h │ │ │ ├── vibrator.h │ │ │ └── wifi.h │ │ ├── media │ │ │ ├── AudioBufferProvider.h │ │ │ ├── AudioEffect.h │ │ │ ├── AudioParameter.h │ │ │ ├── AudioRecord.h │ │ │ ├── AudioSystem.h │ │ │ ├── AudioTrack.h │ │ │ ├── EffectsFactoryApi.h │ │ │ ├── ExtendedAudioBufferProvider.h │ │ │ ├── IAudioFlinger.h │ │ │ ├── IAudioFlingerClient.h │ │ │ ├── IAudioPolicyService.h │ │ │ ├── IAudioRecord.h │ │ │ ├── IAudioTrack.h │ │ │ ├── ICrypto.h │ │ │ ├── IEffect.h │ │ │ ├── IEffectClient.h │ │ │ ├── IHDCP.h │ │ │ ├── IMediaDeathNotifier.h │ │ │ ├── IMediaMetadataRetriever.h │ │ │ ├── IMediaPlayer.h │ │ │ ├── IMediaPlayerClient.h │ │ │ ├── IMediaPlayerService.h │ │ │ ├── IMediaRecorder.h │ │ │ ├── IMediaRecorderClient.h │ │ │ ├── IOMX.h │ │ │ ├── IRemoteDisplay.h │ │ │ ├── IRemoteDisplayClient.h │ │ │ ├── IStreamSource.h │ │ │ ├── JetPlayer.h │ │ │ ├── MediaMetadataRetrieverInterface.h │ │ │ ├── MediaPlayerInterface.h │ │ │ ├── MediaProfiles.h │ │ │ ├── MediaRecorderBase.h │ │ │ ├── MemoryLeakTrackUtil.h │ │ │ ├── Metadata.h │ │ │ ├── SoundPool.h │ │ │ ├── ToneGenerator.h │ │ │ ├── Visualizer.h │ │ │ ├── mediametadataretriever.h │ │ │ ├── mediaplayer.h │ │ │ ├── mediarecorder.h │ │ │ ├── mediascanner.h │ │ │ ├── nbaio │ │ │ │ ├── AudioBufferProviderSource.h │ │ │ │ ├── AudioStreamInSource.h │ │ │ │ ├── AudioStreamOutSink.h │ │ │ │ ├── LibsndfileSink.h │ │ │ │ ├── LibsndfileSource.h │ │ │ │ ├── MonoPipe.h │ │ │ │ ├── MonoPipeReader.h │ │ │ │ ├── NBAIO.h │ │ │ │ ├── Pipe.h │ │ │ │ ├── PipeReader.h │ │ │ │ ├── SourceAudioBufferProvider.h │ │ │ │ └── roundup.h │ │ │ └── stagefright │ │ │ │ ├── AACWriter.h │ │ │ │ ├── ACodec.h │ │ │ │ ├── AMRWriter.h │ │ │ │ ├── AudioPlayer.h │ │ │ │ ├── AudioSource.h │ │ │ │ ├── CameraSource.h │ │ │ │ ├── CameraSourceTimeLapse.h │ │ │ │ ├── ColorConverter.h │ │ │ │ ├── DataSource.h │ │ │ │ ├── FileSource.h │ │ │ │ ├── JPEGSource.h │ │ │ │ ├── MPEG2TSWriter.h │ │ │ │ ├── MPEG4Writer.h │ │ │ │ ├── MediaBuffer.h │ │ │ │ ├── MediaBufferGroup.h │ │ │ │ ├── MediaCodec.h │ │ │ │ ├── MediaCodecList.h │ │ │ │ ├── MediaDefs.h │ │ │ │ ├── MediaErrors.h │ │ │ │ ├── MediaExtractor.h │ │ │ │ ├── MediaSource.h │ │ │ │ ├── MediaWriter.h │ │ │ │ ├── MetaData.h │ │ │ │ ├── NativeWindowWrapper.h │ │ │ │ ├── NuMediaExtractor.h │ │ │ │ ├── OMXClient.h │ │ │ │ ├── OMXCodec.h │ │ │ │ ├── SkipCutBuffer.h │ │ │ │ ├── StagefrightMediaScanner.h │ │ │ │ ├── SurfaceMediaSource.h │ │ │ │ ├── TimeSource.h │ │ │ │ ├── Utils.h │ │ │ │ ├── YUVCanvas.h │ │ │ │ ├── YUVImage.h │ │ │ │ ├── foundation │ │ │ │ ├── AAtomizer.h │ │ │ │ ├── ABase.h │ │ │ │ ├── ABitReader.h │ │ │ │ ├── ABuffer.h │ │ │ │ ├── ADebug.h │ │ │ │ ├── AHandler.h │ │ │ │ ├── AHandlerReflector.h │ │ │ │ ├── AHierarchicalStateMachine.h │ │ │ │ ├── ALooper.h │ │ │ │ ├── ALooperRoster.h │ │ │ │ ├── AMessage.h │ │ │ │ ├── AString.h │ │ │ │ ├── base64.h │ │ │ │ └── hexdump.h │ │ │ │ └── timedtext │ │ │ │ └── TimedTextDriver.h │ │ ├── system │ │ │ ├── audio.h │ │ │ ├── audio_policy.h │ │ │ ├── camera.h │ │ │ ├── graphics.h │ │ │ └── window.h │ │ └── utils │ │ │ ├── AndroidThreads.h │ │ │ ├── Atomic.h │ │ │ ├── BasicHashtable.h │ │ │ ├── BitSet.h │ │ │ ├── BlobCache.h │ │ │ ├── BufferedTextOutput.h │ │ │ ├── ByteOrder.h │ │ │ ├── CallStack.h │ │ │ ├── Compat.h │ │ │ ├── Condition.h │ │ │ ├── Debug.h │ │ │ ├── Endian.h │ │ │ ├── Errors.h │ │ │ ├── FileMap.h │ │ │ ├── Flattenable.h │ │ │ ├── Functor.h │ │ │ ├── GenerationCache.h │ │ │ ├── KeyedVector.h │ │ │ ├── LinearTransform.h │ │ │ ├── List.h │ │ │ ├── Log.h │ │ │ ├── Looper.h │ │ │ ├── Mutex.h │ │ │ ├── PropertyMap.h │ │ │ ├── RWLock.h │ │ │ ├── RefBase.h │ │ │ ├── SharedBuffer.h │ │ │ ├── Singleton.h │ │ │ ├── SortedVector.h │ │ │ ├── StopWatch.h │ │ │ ├── String16.h │ │ │ ├── String8.h │ │ │ ├── StringArray.h │ │ │ ├── StrongPointer.h │ │ │ ├── SystemClock.h │ │ │ ├── TextOutput.h │ │ │ ├── Thread.h │ │ │ ├── ThreadDefs.h │ │ │ ├── Timers.h │ │ │ ├── Tokenizer.h │ │ │ ├── Trace.h │ │ │ ├── TypeHelpers.h │ │ │ ├── Unicode.h │ │ │ ├── UniquePtr.h │ │ │ ├── Vector.h │ │ │ ├── VectorImpl.h │ │ │ ├── WorkQueue.h │ │ │ ├── ZipFileCRO.h │ │ │ ├── ZipFileRO.h │ │ │ ├── ZipUtils.h │ │ │ ├── ashmem.h │ │ │ ├── misc.h │ │ │ └── threads.h │ └── lib │ │ ├── gingerbread │ │ ├── libmedia.so │ │ └── libutils.so │ │ ├── jb4_2 │ │ ├── libmedia.so │ │ └── libutils.so │ │ ├── jellybean │ │ ├── libcutils.so │ │ ├── libmedia.so │ │ └── libutils.so │ │ ├── libmedia.so │ │ └── libutils.so ├── Memoryshare.cpp ├── Memoryshare.h ├── README ├── com_alibaba_laiwang_android_MemoryShare.cpp ├── com_alibaba_laiwang_android_MemoryShare.h ├── memory_base.cpp └── memory_base.h ├── libs ├── android-support-v4.jar └── armeabi │ ├── libatrack16.so │ └── liblwhelper.so ├── obj └── local │ └── armeabi │ ├── libalac.a │ ├── libape.a │ ├── libatrack16.so │ ├── libflac.a │ ├── liblossless.so │ ├── liblwcore.so │ ├── liblwhelper.so │ ├── libmpc.a │ ├── libstdc++.a │ ├── libwav.a │ ├── libwv.a │ └── objs │ ├── alac │ ├── alac_decoder.o │ ├── alac_decoder.o.d │ ├── demux.o │ ├── demux.o.d │ ├── m4a.o │ ├── m4a.o.d │ ├── main.o │ └── main.o.d │ ├── ape │ ├── ape_decoder.o │ ├── ape_decoder.o.d │ ├── crc.o │ ├── crc.o.d │ ├── entropy.o │ ├── entropy.o.d │ ├── filter_1280_15.o │ ├── filter_1280_15.o.d │ ├── filter_16_11.o │ ├── filter_16_11.o.d │ ├── filter_256_13.o │ ├── filter_256_13.o.d │ ├── filter_32_10.o │ ├── filter_32_10.o.d │ ├── filter_64_11.o │ ├── filter_64_11.o.d │ ├── main.o │ ├── main.o.d │ ├── parser.o │ ├── parser.o.d │ ├── predictor-arm.o │ ├── predictor-arm.o.d │ ├── predictor.o │ └── predictor.o.d │ ├── atrack16 │ ├── Memoryshare.o │ ├── Memoryshare.o.d │ ├── memory_base.o │ ├── memory_base.o.d │ ├── std_audio.o │ └── std_audio.o.d │ ├── flac │ ├── arm.o │ ├── arm.o.d │ ├── bitstream.o │ ├── bitstream.o.d │ ├── flac_decoder.o │ ├── flac_decoder.o.d │ ├── main.o │ ├── main.o.d │ ├── tables.o │ └── tables.o.d │ ├── lossless │ ├── com_alibaba_laiwang_android_MemoryShare.o │ ├── com_alibaba_laiwang_android_MemoryShare.o.d │ ├── main.o │ └── main.o.d │ ├── lwcore │ ├── com_alibaba_laiwang_android_MemoryShare.o │ └── com_alibaba_laiwang_android_MemoryShare.o.d │ ├── lwhelper │ ├── Memoryshare.o │ ├── Memoryshare.o.d │ ├── com_alibaba_laiwang_android_MemoryShare.o │ └── com_alibaba_laiwang_android_MemoryShare.o.d │ ├── mpc │ ├── huffsv46.o │ ├── huffsv46.o.d │ ├── huffsv7.o │ ├── huffsv7.o.d │ ├── idtag.o │ ├── idtag.o.d │ ├── main.o │ ├── main.o.d │ ├── mpc_decoder.o │ ├── mpc_decoder.o.d │ ├── requant.o │ ├── requant.o.d │ ├── streaminfo.o │ ├── streaminfo.o.d │ ├── synth_filter.o │ └── synth_filter.o.d │ ├── wav │ ├── main.o │ └── main.o.d │ └── wv │ ├── arm.o │ ├── arm.o.d │ ├── arml.o │ ├── arml.o.d │ ├── float.o │ ├── float.o.d │ ├── main.o │ ├── main.o.d │ ├── metadata.o │ ├── metadata.o.d │ ├── pack.o │ ├── pack.o.d │ ├── unpack.o │ ├── unpack.o.d │ ├── words.o │ ├── words.o.d │ ├── wputils.o │ └── wputils.o.d ├── proguard-project.txt ├── project.properties ├── res ├── drawable-hdpi │ └── ic_launcher.png ├── drawable-mdpi │ └── ic_launcher.png ├── drawable-xhdpi │ └── ic_launcher.png ├── drawable-xxhdpi │ └── ic_launcher.png ├── layout │ └── activity_main.xml ├── menu │ └── main.xml ├── values-sw600dp │ └── dimens.xml ├── values-sw720dp-land │ └── dimens.xml ├── values-v11 │ └── styles.xml ├── values-v14 │ └── styles.xml └── values │ ├── dimens.xml │ ├── strings.xml │ └── styles.xml └── src └── com ├── alibaba └── laiwang │ └── android │ ├── IMemoryShare.aidl │ ├── MemoryClient.java │ ├── MemoryService.java │ └── MemoryShare.java └── example └── android_memoryshare ├── MainActivity.java └── TestActivity.java /AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 10 | 11 | 16 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 28 | 29 | 30 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Android-MemorySahre 2 | =================== 3 | 4 | use ashmem ipc in native. 5 | 6 | this plan will be used to transcate large buffer data between two proceess. 7 | 8 | process A: 9 | 10 | 1.ashmeme_create_region 11 | 12 | 2.mmap 13 | 14 | 3.read or write share memory. 15 | 16 | 4.close. 17 | 18 | 19 | 20 | process B: 21 | 22 | 1.transacte fd between two process by binder's ParcelFileDescriptor. 23 | 24 | because struct file is global for linux kernal. so binder driver can get file by fget, and map file to anthoer process with 25 | new fd. API target_fd_install. 26 | 27 | 2.mmap 28 | 29 | 3.read or write share memory 30 | 31 | 4.close 32 | 33 | -------------------------------------------------------------------------------- /bin/classes/com/alibaba/laiwang/android/MemoryService.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Android/Android-MemorySahre/3f7061b76bcecab984c835b2411400233092c7b3/bin/classes/com/alibaba/laiwang/android/MemoryService.class -------------------------------------------------------------------------------- /bin/classes/com/alibaba/laiwang/android/MemoryShare.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Android/Android-MemorySahre/3f7061b76bcecab984c835b2411400233092c7b3/bin/classes/com/alibaba/laiwang/android/MemoryShare.class -------------------------------------------------------------------------------- /bin/classes/com/example/android_memoryshare/BuildConfig.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Android/Android-MemorySahre/3f7061b76bcecab984c835b2411400233092c7b3/bin/classes/com/example/android_memoryshare/BuildConfig.class -------------------------------------------------------------------------------- /bin/classes/com/example/android_memoryshare/MainActivity.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Android/Android-MemorySahre/3f7061b76bcecab984c835b2411400233092c7b3/bin/classes/com/example/android_memoryshare/MainActivity.class -------------------------------------------------------------------------------- /bin/classes/com/example/android_memoryshare/R$attr.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Android/Android-MemorySahre/3f7061b76bcecab984c835b2411400233092c7b3/bin/classes/com/example/android_memoryshare/R$attr.class -------------------------------------------------------------------------------- /bin/classes/com/example/android_memoryshare/R$dimen.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Android/Android-MemorySahre/3f7061b76bcecab984c835b2411400233092c7b3/bin/classes/com/example/android_memoryshare/R$dimen.class -------------------------------------------------------------------------------- /bin/classes/com/example/android_memoryshare/R$drawable.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Android/Android-MemorySahre/3f7061b76bcecab984c835b2411400233092c7b3/bin/classes/com/example/android_memoryshare/R$drawable.class -------------------------------------------------------------------------------- /bin/classes/com/example/android_memoryshare/R$id.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Android/Android-MemorySahre/3f7061b76bcecab984c835b2411400233092c7b3/bin/classes/com/example/android_memoryshare/R$id.class -------------------------------------------------------------------------------- /bin/classes/com/example/android_memoryshare/R$layout.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Android/Android-MemorySahre/3f7061b76bcecab984c835b2411400233092c7b3/bin/classes/com/example/android_memoryshare/R$layout.class -------------------------------------------------------------------------------- /bin/classes/com/example/android_memoryshare/R$menu.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Android/Android-MemorySahre/3f7061b76bcecab984c835b2411400233092c7b3/bin/classes/com/example/android_memoryshare/R$menu.class -------------------------------------------------------------------------------- /bin/classes/com/example/android_memoryshare/R$string.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Android/Android-MemorySahre/3f7061b76bcecab984c835b2411400233092c7b3/bin/classes/com/example/android_memoryshare/R$string.class -------------------------------------------------------------------------------- /bin/classes/com/example/android_memoryshare/R$style.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Android/Android-MemorySahre/3f7061b76bcecab984c835b2411400233092c7b3/bin/classes/com/example/android_memoryshare/R$style.class -------------------------------------------------------------------------------- /bin/classes/com/example/android_memoryshare/R.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Android/Android-MemorySahre/3f7061b76bcecab984c835b2411400233092c7b3/bin/classes/com/example/android_memoryshare/R.class -------------------------------------------------------------------------------- /bin/classes/com/example/android_memoryshare/TestActivity.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Android/Android-MemorySahre/3f7061b76bcecab984c835b2411400233092c7b3/bin/classes/com/example/android_memoryshare/TestActivity.class -------------------------------------------------------------------------------- /bin/dexedLibs/android-support-v4-a5c7a72e65aa5c9e4421c026cd1a9438.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Android/Android-MemorySahre/3f7061b76bcecab984c835b2411400233092c7b3/bin/dexedLibs/android-support-v4-a5c7a72e65aa5c9e4421c026cd1a9438.jar -------------------------------------------------------------------------------- /bin/res/crunch/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Android/Android-MemorySahre/3f7061b76bcecab984c835b2411400233092c7b3/bin/res/crunch/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /bin/res/crunch/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Android/Android-MemorySahre/3f7061b76bcecab984c835b2411400233092c7b3/bin/res/crunch/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /bin/res/crunch/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Android/Android-MemorySahre/3f7061b76bcecab984c835b2411400233092c7b3/bin/res/crunch/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /bin/res/crunch/drawable-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Android/Android-MemorySahre/3f7061b76bcecab984c835b2411400233092c7b3/bin/res/crunch/drawable-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /gen/com/example/android_memoryshare/BuildConfig.java: -------------------------------------------------------------------------------- 1 | /** Automatically generated file. DO NOT MODIFY */ 2 | package com.example.android_memoryshare; 3 | 4 | public final class BuildConfig { 5 | public final static boolean DEBUG = true; 6 | } -------------------------------------------------------------------------------- /ic_launcher-web.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Android/Android-MemorySahre/3f7061b76bcecab984c835b2411400233092c7b3/ic_launcher-web.png -------------------------------------------------------------------------------- /jni/Android.mk: -------------------------------------------------------------------------------- 1 | 2 | LOCAL_PATH := $(call my-dir) 3 | 4 | # library for Android api = 16 5 | include $(CLEAR_VARS) 6 | LOCAL_MODULE := atrack16 7 | LOCAL_CFLAGS += -O2 -Wall -export-dynamic -DBUILD_STANDALONE -DCPU_ARM -DAVSREMOTE -finline-functions -fPIC -D__ARM_EABI__=1 -DOLD_LOGDH -fpermissive 8 | LOCAL_CFLAGS += -DBUILD_JB 9 | LOCAL_C_INCLUDES += $(LOCAL_PATH)/Android/include_jb 10 | LOCAL_SRC_FILES := memory_base.cpp 11 | LOCAL_ARM_MODE := arm 12 | LOCAL_LDLIBS := -llog \ 13 | $(LOCAL_PATH)/Android/lib/jellybean/libcutils.so $(LOCAL_PATH)/Android/lib/jellybean/libutils.so $(LOCAL_PATH)/Android/lib/jellybean/libmedia.so 14 | include $(BUILD_SHARED_LIBRARY) 15 | 16 | 17 | # common codecs & startup library 18 | include $(CLEAR_VARS) 19 | LOCAL_MODULE := lwhelper 20 | LOCAL_CFLAGS += -O2 -Wall -DBUILD_STANDALONE -DCPU_ARM -DAVSREMOTE -finline-functions -fPIC -D__ARM_EABI__=1 -DOLD_LOGDH -fpermissive 21 | LOCAL_SRC_FILES := Memoryshare.cpp com_alibaba_laiwang_android_MemoryShare.cpp 22 | LOCAL_ARM_MODE := arm 23 | LOCAL_LDLIBS := -llog -ldl 24 | LOCAL_SHARED_LIBRARIES := atrack16 25 | include $(BUILD_SHARED_LIBRARY) 26 | 27 | #CODECS := alac ape flac wav wv mpc 28 | #codec-makefiles = $(patsubst %,$(LOCAL_PATH)/%/Android.mk,$(CODECS)) 29 | #include $(call codec-makefiles) 30 | 31 | -------------------------------------------------------------------------------- /jni/Android/include/cutils/adb_networking.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 _ADB_NETWORKING_H 18 | #define _ADB_NETWORKING_H 1 19 | #include 20 | #include 21 | #include 22 | 23 | #ifdef __cplusplus 24 | extern "C" { 25 | #endif 26 | 27 | extern int adb_networking_connect_fd(int fd, struct sockaddr_in *p_address); 28 | extern int adb_networking_gethostbyname(const char *name, struct in_addr *p_out_addr); 29 | 30 | #ifdef __cplusplus 31 | } 32 | #endif 33 | 34 | #endif /*_ADB_NETWORKING_H*/ 35 | 36 | -------------------------------------------------------------------------------- /jni/Android/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 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | int ashmem_create_region(const char *name, size_t size); 18 | int ashmem_set_prot_region(int fd, int prot); 19 | int ashmem_pin_region(int fd, size_t offset, size_t len); 20 | int ashmem_unpin_region(int fd, size_t offset, size_t len); 21 | 22 | #ifdef __cplusplus 23 | } 24 | #endif 25 | 26 | #ifndef __ASHMEMIOC /* in case someone included too */ 27 | 28 | #define ASHMEM_NAME_LEN 256 29 | 30 | #define ASHMEM_NAME_DEF "dev/ashmem" 31 | 32 | /* Return values from ASHMEM_PIN: Was the mapping purged while unpinned? */ 33 | #define ASHMEM_NOT_PURGED 0 34 | #define ASHMEM_WAS_PURGED 1 35 | 36 | /* Return values from ASHMEM_UNPIN: Is the mapping now pinned or unpinned? */ 37 | #define ASHMEM_IS_UNPINNED 0 38 | #define ASHMEM_IS_PINNED 1 39 | 40 | #endif /* ! __ASHMEMIOC */ 41 | 42 | #endif /* _CUTILS_ASHMEM_H */ 43 | -------------------------------------------------------------------------------- /jni/Android/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/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/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/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/cutils/logger.h: -------------------------------------------------------------------------------- 1 | /* utils/logger.h 2 | ** 3 | ** Copyright 2007, 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_LOGGER_H 11 | #define _UTILS_LOGGER_H 12 | 13 | #include 14 | 15 | struct logger_entry { 16 | uint16_t len; /* length of the payload */ 17 | uint16_t __pad; /* no matter what, we get 2 bytes of padding */ 18 | int32_t pid; /* generating process's pid */ 19 | int32_t tid; /* generating process's tid */ 20 | int32_t sec; /* seconds since Epoch */ 21 | int32_t nsec; /* nanoseconds */ 22 | char msg[0]; /* the entry's payload */ 23 | }; 24 | 25 | #define LOGGER_LOG_MAIN "log/main" 26 | #define LOGGER_LOG_RADIO "log/radio" 27 | #define LOGGER_LOG_EVENTS "log/events" 28 | 29 | #define LOGGER_ENTRY_MAX_LEN (4*1024) 30 | #define LOGGER_ENTRY_MAX_PAYLOAD \ 31 | (LOGGER_ENTRY_MAX_LEN - sizeof(struct logger_entry)) 32 | 33 | #ifdef HAVE_IOCTL 34 | 35 | #include 36 | 37 | #define __LOGGERIO 0xAE 38 | 39 | #define LOGGER_GET_LOG_BUF_SIZE _IO(__LOGGERIO, 1) /* size of log */ 40 | #define LOGGER_GET_LOG_LEN _IO(__LOGGERIO, 2) /* used log len */ 41 | #define LOGGER_GET_NEXT_ENTRY_LEN _IO(__LOGGERIO, 3) /* next entry len */ 42 | #define LOGGER_FLUSH_LOG _IO(__LOGGERIO, 4) /* flush log */ 43 | 44 | #endif // HAVE_IOCTL 45 | 46 | #endif /* _UTILS_LOGGER_H */ 47 | -------------------------------------------------------------------------------- /jni/Android/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/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/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 | typedef struct 21 | { 22 | int version; /* sizeof(native_handle) */ 23 | int numFds; /* number of file-descriptors at &data[0] */ 24 | int numInts; /* number of ints at &data[numFds] */ 25 | int data[0]; /* numFds + numInts ints */ 26 | } native_handle; 27 | 28 | #endif /* NATIVE_HANDLE_H_ */ 29 | -------------------------------------------------------------------------------- /jni/Android/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/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/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 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | time_t mktime_tz(struct tm * const tmp, char const * tz); 25 | void localtime_tz(const time_t * const timep, struct tm * tmp, const char* tz); 26 | 27 | struct strftime_locale { 28 | const char *mon[12]; /* short names */ 29 | const char *month[12]; /* long names */ 30 | const char *wday[7]; /* short names */ 31 | const char *weekday[7]; /* long names */ 32 | const char *X_fmt; 33 | const char *x_fmt; 34 | const char *c_fmt; 35 | const char *am; 36 | const char *pm; 37 | const char *date_fmt; 38 | }; 39 | 40 | size_t strftime_tz(char *s, size_t max, const char *format, const struct tm *tm, const struct strftime_locale *locale); 41 | 42 | #ifdef __cplusplus 43 | } 44 | #endif 45 | 46 | #endif /* __CUTILS_TZTIME_H */ 47 | 48 | -------------------------------------------------------------------------------- /jni/Android/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/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 | int zygote_run_wait(int argc, const char **argv, void (*post_run_func)(int)); 27 | 28 | #ifdef __cplusplus 29 | } 30 | #endif 31 | 32 | #endif /* __CUTILS_ZYGOTE_H */ 33 | -------------------------------------------------------------------------------- /jni/Android/include/hardware_legacy/flashlight.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 _HARDWARE_FLASHLIGHT_H 18 | #define _HARDWARE_FLASHLIGHT_H 19 | 20 | #if __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | int get_flashlight_enabled(); 25 | int set_flashlight_enabled(int on); 26 | int enable_camera_flash(int milliseconds); 27 | 28 | #if __cplusplus 29 | } // extern "C" 30 | #endif 31 | 32 | #endif // _HARDWARE_FLASHLIGHT_H 33 | -------------------------------------------------------------------------------- /jni/Android/include/hardware_legacy/power.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 _HARDWARE_POWER_H 18 | #define _HARDWARE_POWER_H 19 | 20 | #include 21 | 22 | #if __cplusplus 23 | extern "C" { 24 | #endif 25 | 26 | enum { 27 | PARTIAL_WAKE_LOCK = 1, // the cpu stays on, but the screen is off 28 | FULL_WAKE_LOCK = 2 // the screen is also on 29 | }; 30 | 31 | // while you have a lock held, the device will stay on at least at the 32 | // level you request. 33 | int acquire_wake_lock(int lock, const char* id); 34 | int release_wake_lock(const char* id); 35 | 36 | // true if you want the screen on, false if you want it off 37 | int set_screen_state(int on); 38 | 39 | // set how long to stay awake after the last user activity in seconds 40 | int set_last_user_activity_timeout(int64_t delay); 41 | 42 | 43 | #if __cplusplus 44 | } // extern "C" 45 | #endif 46 | 47 | #endif // _HARDWARE_POWER_H 48 | -------------------------------------------------------------------------------- /jni/Android/include/hardware_legacy/qemu_tracing.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 _HARDWARE_QEMU_TRACING_H 18 | #define _HARDWARE_QEMU_TRACING_H 19 | 20 | #if __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | int qemu_start_tracing(); 25 | int qemu_stop_tracing(); 26 | int qemu_add_mapping(unsigned int addr, const char *name); 27 | int qemu_remove_mapping(unsigned int addr); 28 | 29 | #if __cplusplus 30 | } // extern "C" 31 | #endif 32 | 33 | #endif // _HARDWARE_QEMU_TRACING_H 34 | -------------------------------------------------------------------------------- /jni/Android/include/hardware_legacy/uevent.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 _HARDWARE_UEVENT_H 18 | #define _HARDWARE_UEVENT_H 19 | 20 | #if __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | int uevent_init(); 25 | int uevent_next_event(char* buffer, int buffer_length); 26 | 27 | #if __cplusplus 28 | } // extern "C" 29 | #endif 30 | 31 | #endif // _HARDWARE_UEVENT_H 32 | -------------------------------------------------------------------------------- /jni/Android/include/hardware_legacy/vibrator.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 _HARDWARE_VIBRATOR_H 18 | #define _HARDWARE_VIBRATOR_H 19 | 20 | #if __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | /** 25 | * Turn on vibrator 26 | * 27 | * @param timeout_ms number of milliseconds to vibrate 28 | * 29 | * @return 0 if successful, -1 if error 30 | */ 31 | int vibrator_on(int timeout_ms); 32 | 33 | /** 34 | * Turn off vibrator 35 | * 36 | * @return 0 if successful, -1 if error 37 | */ 38 | int vibrator_off(); 39 | 40 | #if __cplusplus 41 | } // extern "C" 42 | #endif 43 | 44 | #endif // _HARDWARE_VIBRATOR_H 45 | -------------------------------------------------------------------------------- /jni/Android/include/media/IMediaPlayerClient.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_IMEDIAPLAYERCLIENT_H 18 | #define ANDROID_IMEDIAPLAYERCLIENT_H 19 | 20 | #include 21 | #include 22 | #include 23 | 24 | namespace android { 25 | 26 | class IMediaPlayerClient: public IInterface 27 | { 28 | public: 29 | DECLARE_META_INTERFACE(MediaPlayerClient); 30 | 31 | virtual void notify(int msg, int ext1, int ext2) = 0; 32 | }; 33 | 34 | // ---------------------------------------------------------------------------- 35 | 36 | class BnMediaPlayerClient: public BnInterface 37 | { 38 | public: 39 | virtual status_t onTransact( uint32_t code, 40 | const Parcel& data, 41 | Parcel* reply, 42 | uint32_t flags = 0); 43 | }; 44 | 45 | }; // namespace android 46 | 47 | #endif // ANDROID_IMEDIAPLAYERCLIENT_H 48 | 49 | -------------------------------------------------------------------------------- /jni/Android/include/media/thread_init.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 THREAD_INIT_H 18 | #define THREAD_INIT_H 19 | 20 | bool InitializeForThread(); 21 | void UninitializeForThread(); 22 | 23 | #endif /* THREAD_INIT_H*/ 24 | 25 | -------------------------------------------------------------------------------- /jni/Android/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/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 | // 18 | // Debugging tools. These should be able to be stripped 19 | // in release builds. 20 | // 21 | #ifndef ANDROID_DEBUG_H 22 | #define ANDROID_DEBUG_H 23 | 24 | #include 25 | #include 26 | 27 | namespace android { 28 | 29 | template struct CompileTimeAssert; 30 | template<> struct CompileTimeAssert {}; 31 | 32 | const char* stringForIndent(int32_t indentLevel); 33 | 34 | typedef void (*debugPrintFunc)(void* cookie, const char* txt); 35 | 36 | void printTypeCode(uint32_t typeCode, 37 | debugPrintFunc func = 0, void* cookie = 0); 38 | void printHexData(int32_t indent, const void *buf, size_t length, 39 | size_t bytesPerLine=16, int32_t singleLineBytesCutoff=16, 40 | size_t alignment=0, bool cArrayStyle=false, 41 | debugPrintFunc func = 0, void* cookie = 0); 42 | 43 | }; // namespace android 44 | 45 | #endif // ANDROID_DEBUG_H 46 | -------------------------------------------------------------------------------- /jni/Android/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/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 | 33 | #endif // _LIBS_UTILS_LOG_H 34 | -------------------------------------------------------------------------------- /jni/Android/include/utils/LogSocket.h: -------------------------------------------------------------------------------- 1 | /* utils/LogSocket.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_LOGSOCKET_H 11 | #define _UTILS_LOGSOCKET_H 12 | 13 | #define SOCKET_CLOSE_LOCAL 0 14 | 15 | void add_send_stats(int fd, int send); 16 | void add_recv_stats(int fd, int recv); 17 | void log_socket_close(int fd, short reason); 18 | void log_socket_connect(int fd, unsigned int ip, unsigned short port); 19 | 20 | #endif /* _UTILS_LOGSOCKET_H */ 21 | -------------------------------------------------------------------------------- /jni/Android/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 | 29 | }; // namespace android 30 | 31 | #endif // ANDROID_UTILS_SYSTEMCLOCK_H 32 | 33 | -------------------------------------------------------------------------------- /jni/Android/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/utils/executablepath.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 _UTILS_EXECUTABLEPATH_H 18 | #define _UTILS_EXECUTABLEPATH_H 19 | 20 | #include 21 | 22 | // returns the path to this executable 23 | #if __cplusplus 24 | extern "C" 25 | #endif 26 | void executablepath(char s[PATH_MAX]); 27 | 28 | #endif // _UTILS_EXECUTABLEPATH_H 29 | -------------------------------------------------------------------------------- /jni/Android/include/utils/ported.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 | // Standard functions ported to the current platform. Note these are NOT 19 | // in the "android" namespace. 20 | // 21 | #ifndef _LIBS_UTILS_PORTED_H 22 | #define _LIBS_UTILS_PORTED_H 23 | 24 | #include // for timeval 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | /* library replacement functions */ 31 | #if defined(NEED_GETTIMEOFDAY) 32 | int gettimeofday(struct timeval* tv, struct timezone* tz); 33 | #endif 34 | #if defined(NEED_USLEEP) 35 | void usleep(unsigned long usec); 36 | #endif 37 | #if defined(NEED_PIPE) 38 | int pipe(int filedes[2]); 39 | #endif 40 | #if defined(NEED_SETENV) 41 | int setenv(const char* name, const char* value, int overwrite); 42 | void unsetenv(const char* name); 43 | char* getenv(const char* name); 44 | #endif 45 | 46 | #ifdef __cplusplus 47 | } 48 | #endif 49 | 50 | #endif // _LIBS_UTILS_PORTED_H 51 | -------------------------------------------------------------------------------- /jni/Android/include_jb/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_jb/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_jb/cutils/bitops.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_BITOPS_H 18 | #define __CUTILS_BITOPS_H 19 | 20 | #include 21 | 22 | __BEGIN_DECLS 23 | 24 | static inline int popcount(unsigned int x) 25 | { 26 | return __builtin_popcount(x); 27 | } 28 | 29 | static inline int popcountl(unsigned long x) 30 | { 31 | return __builtin_popcountl(x); 32 | } 33 | 34 | static inline int popcountll(unsigned long long x) 35 | { 36 | return __builtin_popcountll(x); 37 | } 38 | 39 | __END_DECLS 40 | 41 | #endif /* __CUTILS_BITOPS_H */ 42 | -------------------------------------------------------------------------------- /jni/Android/include_jb/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_jb/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_jb/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/include_jb/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_jb/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_jb/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_jb/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 | void klog_init(void); 21 | void klog_set_level(int level); 22 | void klog_close(void); 23 | void klog_write(int level, const char *fmt, ...) 24 | __attribute__ ((format(printf, 2, 3))); 25 | 26 | #define KLOG_ERROR(tag,x...) klog_write(3, "<3>" tag ": " x) 27 | #define KLOG_WARNING(tag,x...) klog_write(4, "<4>" tag ": " x) 28 | #define KLOG_NOTICE(tag,x...) klog_write(5, "<5>" tag ": " x) 29 | #define KLOG_INFO(tag,x...) klog_write(6, "<6>" tag ": " x) 30 | #define KLOG_DEBUG(tag,x...) klog_write(7, "<7>" tag ": " x) 31 | 32 | #define KLOG_DEFAULT_LEVEL 3 /* messages <= this level are logged */ 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /jni/Android/include_jb/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 | -------------------------------------------------------------------------------- /jni/Android/include_jb/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_jb/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_jb/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_jb/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_jb/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_jb/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_jb/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_jb/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_jb/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 | int zygote_run_wait(int argc, const char **argv, void (*post_run_func)(int)); 27 | 28 | #ifdef __cplusplus 29 | } 30 | #endif 31 | 32 | #endif /* __CUTILS_ZYGOTE_H */ 33 | -------------------------------------------------------------------------------- /jni/Android/include_jb/hardware_legacy/power.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 _HARDWARE_POWER_H 18 | #define _HARDWARE_POWER_H 19 | 20 | #include 21 | 22 | #if __cplusplus 23 | extern "C" { 24 | #endif 25 | 26 | enum { 27 | PARTIAL_WAKE_LOCK = 1, // the cpu stays on, but the screen is off 28 | FULL_WAKE_LOCK = 2 // the screen is also on 29 | }; 30 | 31 | // while you have a lock held, the device will stay on at least at the 32 | // level you request. 33 | int acquire_wake_lock(int lock, const char* id); 34 | int release_wake_lock(const char* id); 35 | 36 | 37 | #if __cplusplus 38 | } // extern "C" 39 | #endif 40 | 41 | #endif // _HARDWARE_POWER_H 42 | -------------------------------------------------------------------------------- /jni/Android/include_jb/hardware_legacy/qemu_tracing.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 _HARDWARE_QEMU_TRACING_H 18 | #define _HARDWARE_QEMU_TRACING_H 19 | 20 | #if __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | int qemu_start_tracing(); 25 | int qemu_stop_tracing(); 26 | int qemu_add_mapping(unsigned int addr, const char *name); 27 | int qemu_remove_mapping(unsigned int addr); 28 | 29 | #if __cplusplus 30 | } // extern "C" 31 | #endif 32 | 33 | #endif // _HARDWARE_QEMU_TRACING_H 34 | -------------------------------------------------------------------------------- /jni/Android/include_jb/hardware_legacy/uevent.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 _HARDWARE_UEVENT_H 18 | #define _HARDWARE_UEVENT_H 19 | 20 | #if __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | int uevent_init(); 25 | int uevent_get_fd(); 26 | int uevent_next_event(char* buffer, int buffer_length); 27 | int uevent_add_native_handler(void (*handler)(void *data, const char *msg, int msg_len), 28 | void *handler_data); 29 | int uevent_remove_native_handler(void (*handler)(void *data, const char *msg, int msg_len)); 30 | 31 | #if __cplusplus 32 | } // extern "C" 33 | #endif 34 | 35 | #endif // _HARDWARE_UEVENT_H 36 | -------------------------------------------------------------------------------- /jni/Android/include_jb/hardware_legacy/vibrator.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 _HARDWARE_VIBRATOR_H 18 | #define _HARDWARE_VIBRATOR_H 19 | 20 | #if __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | /** 25 | * Return whether the device has a vibrator. 26 | * 27 | * @return 1 if a vibrator exists, 0 if it doesn't. 28 | */ 29 | int vibrator_exists(); 30 | 31 | /** 32 | * Turn on vibrator 33 | * 34 | * @param timeout_ms number of milliseconds to vibrate 35 | * 36 | * @return 0 if successful, -1 if error 37 | */ 38 | int vibrator_on(int timeout_ms); 39 | 40 | /** 41 | * Turn off vibrator 42 | * 43 | * @return 0 if successful, -1 if error 44 | */ 45 | int vibrator_off(); 46 | 47 | #if __cplusplus 48 | } // extern "C" 49 | #endif 50 | 51 | #endif // _HARDWARE_VIBRATOR_H 52 | -------------------------------------------------------------------------------- /jni/Android/include_jb/media/IMediaPlayerClient.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_IMEDIAPLAYERCLIENT_H 18 | #define ANDROID_IMEDIAPLAYERCLIENT_H 19 | 20 | #include 21 | #include 22 | #include 23 | 24 | namespace android { 25 | 26 | class IMediaPlayerClient: public IInterface 27 | { 28 | public: 29 | DECLARE_META_INTERFACE(MediaPlayerClient); 30 | 31 | virtual void notify(int msg, int ext1, int ext2, const Parcel *obj) = 0; 32 | }; 33 | 34 | // ---------------------------------------------------------------------------- 35 | 36 | class BnMediaPlayerClient: public BnInterface 37 | { 38 | public: 39 | virtual status_t onTransact( uint32_t code, 40 | const Parcel& data, 41 | Parcel* reply, 42 | uint32_t flags = 0); 43 | }; 44 | 45 | }; // namespace android 46 | 47 | #endif // ANDROID_IMEDIAPLAYERCLIENT_H 48 | -------------------------------------------------------------------------------- /jni/Android/include_jb/media/IMediaRecorderClient.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_IMEDIARECORDERCLIENT_H 18 | #define ANDROID_IMEDIARECORDERCLIENT_H 19 | 20 | #include 21 | #include 22 | #include 23 | 24 | namespace android { 25 | 26 | class IMediaRecorderClient: public IInterface 27 | { 28 | public: 29 | DECLARE_META_INTERFACE(MediaRecorderClient); 30 | 31 | virtual void notify(int msg, int ext1, int ext2) = 0; 32 | }; 33 | 34 | // ---------------------------------------------------------------------------- 35 | 36 | class BnMediaRecorderClient: public BnInterface 37 | { 38 | public: 39 | virtual status_t onTransact( uint32_t code, 40 | const Parcel& data, 41 | Parcel* reply, 42 | uint32_t flags = 0); 43 | }; 44 | 45 | }; // namespace android 46 | 47 | #endif // ANDROID_IMEDIARECORDERCLIENT_H 48 | -------------------------------------------------------------------------------- /jni/Android/include_jb/media/MemoryLeakTrackUtil.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 | #ifndef MEMORY_LEAK_TRACK_UTIL_H 17 | #define MEMORY_LEAK_TRACK_UTIL_H 18 | 19 | namespace android { 20 | /* 21 | * Dump the memory address of the calling process to the given fd. 22 | */ 23 | extern void dumpMemoryAddresses(int fd); 24 | 25 | }; 26 | 27 | #endif // MEMORY_LEAK_TRACK_UTIL_H 28 | -------------------------------------------------------------------------------- /jni/Android/include_jb/media/stagefright/OMXClient.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_CLIENT_H_ 18 | 19 | #define OMX_CLIENT_H_ 20 | 21 | #include 22 | 23 | namespace android { 24 | 25 | class OMXClient { 26 | public: 27 | OMXClient(); 28 | 29 | status_t connect(); 30 | void disconnect(); 31 | 32 | sp interface() { 33 | return mOMX; 34 | } 35 | 36 | private: 37 | sp mOMX; 38 | 39 | OMXClient(const OMXClient &); 40 | OMXClient &operator=(const OMXClient &); 41 | }; 42 | 43 | } // namespace android 44 | 45 | #endif // OMX_CLIENT_H_ 46 | -------------------------------------------------------------------------------- /jni/Android/include_jb/media/stagefright/StagefrightMediaScanner.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 STAGEFRIGHT_MEDIA_SCANNER_H_ 18 | 19 | #define STAGEFRIGHT_MEDIA_SCANNER_H_ 20 | 21 | #include 22 | 23 | namespace android { 24 | 25 | struct StagefrightMediaScanner : public MediaScanner { 26 | StagefrightMediaScanner(); 27 | virtual ~StagefrightMediaScanner(); 28 | 29 | virtual MediaScanResult processFile( 30 | const char *path, const char *mimeType, 31 | MediaScannerClient &client); 32 | 33 | virtual char *extractAlbumArt(int fd); 34 | 35 | private: 36 | StagefrightMediaScanner(const StagefrightMediaScanner &); 37 | StagefrightMediaScanner &operator=(const StagefrightMediaScanner &); 38 | 39 | MediaScanResult processFileInternal( 40 | const char *path, const char *mimeType, 41 | MediaScannerClient &client); 42 | }; 43 | 44 | } // namespace android 45 | 46 | #endif // STAGEFRIGHT_MEDIA_SCANNER_H_ 47 | -------------------------------------------------------------------------------- /jni/Android/include_jb/media/stagefright/TimeSource.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 TIME_SOURCE_H_ 18 | 19 | #define TIME_SOURCE_H_ 20 | 21 | #include 22 | 23 | namespace android { 24 | 25 | class TimeSource { 26 | public: 27 | TimeSource() {} 28 | virtual ~TimeSource() {} 29 | 30 | virtual int64_t getRealTimeUs() = 0; 31 | 32 | private: 33 | TimeSource(const TimeSource &); 34 | TimeSource &operator=(const TimeSource &); 35 | }; 36 | 37 | class SystemTimeSource : public TimeSource { 38 | public: 39 | SystemTimeSource(); 40 | 41 | virtual int64_t getRealTimeUs(); 42 | 43 | private: 44 | static int64_t GetSystemTimeUs(); 45 | 46 | int64_t mStartTimeUs; 47 | }; 48 | 49 | } // namespace android 50 | 51 | #endif // TIME_SOURCE_H_ 52 | -------------------------------------------------------------------------------- /jni/Android/include_jb/media/stagefright/Utils.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 UTILS_H_ 18 | 19 | #define UTILS_H_ 20 | 21 | #include 22 | #include 23 | #include 24 | 25 | namespace android { 26 | 27 | #define FOURCC(c1, c2, c3, c4) \ 28 | (c1 << 24 | c2 << 16 | c3 << 8 | c4) 29 | 30 | uint16_t U16_AT(const uint8_t *ptr); 31 | uint32_t U32_AT(const uint8_t *ptr); 32 | uint64_t U64_AT(const uint8_t *ptr); 33 | 34 | uint16_t U16LE_AT(const uint8_t *ptr); 35 | uint32_t U32LE_AT(const uint8_t *ptr); 36 | uint64_t U64LE_AT(const uint8_t *ptr); 37 | 38 | uint64_t ntoh64(uint64_t x); 39 | uint64_t hton64(uint64_t x); 40 | 41 | struct MetaData; 42 | struct AMessage; 43 | status_t convertMetaDataToMessage( 44 | const sp &meta, sp *format); 45 | 46 | } // namespace android 47 | 48 | #endif // UTILS_H_ 49 | -------------------------------------------------------------------------------- /jni/Android/include_jb/media/stagefright/foundation/AAtomizer.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 A_ATOMIZER_H_ 18 | 19 | #define A_ATOMIZER_H_ 20 | 21 | #include 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | 29 | namespace android { 30 | 31 | struct AAtomizer { 32 | static const char *Atomize(const char *name); 33 | 34 | private: 35 | static AAtomizer gAtomizer; 36 | 37 | Mutex mLock; 38 | Vector > mAtoms; 39 | 40 | AAtomizer(); 41 | 42 | const char *atomize(const char *name); 43 | 44 | static uint32_t Hash(const char *s); 45 | 46 | DISALLOW_EVIL_CONSTRUCTORS(AAtomizer); 47 | }; 48 | 49 | } // namespace android 50 | 51 | #endif // A_ATOMIZER_H_ 52 | -------------------------------------------------------------------------------- /jni/Android/include_jb/media/stagefright/foundation/ABase.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 A_BASE_H_ 18 | 19 | #define A_BASE_H_ 20 | 21 | #define DISALLOW_EVIL_CONSTRUCTORS(name) \ 22 | name(const name &); \ 23 | name &operator=(const name &) 24 | 25 | #endif // A_BASE_H_ 26 | -------------------------------------------------------------------------------- /jni/Android/include_jb/media/stagefright/foundation/ABitReader.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 A_BIT_READER_H_ 18 | 19 | #define A_BIT_READER_H_ 20 | 21 | #include 22 | 23 | #include 24 | #include 25 | 26 | namespace android { 27 | 28 | struct ABitReader { 29 | ABitReader(const uint8_t *data, size_t size); 30 | 31 | uint32_t getBits(size_t n); 32 | void skipBits(size_t n); 33 | 34 | void putBits(uint32_t x, size_t n); 35 | 36 | size_t numBitsLeft() const; 37 | 38 | const uint8_t *data() const; 39 | 40 | private: 41 | const uint8_t *mData; 42 | size_t mSize; 43 | 44 | uint32_t mReservoir; // left-aligned bits 45 | size_t mNumBitsLeft; 46 | 47 | void fillReservoir(); 48 | 49 | DISALLOW_EVIL_CONSTRUCTORS(ABitReader); 50 | }; 51 | 52 | } // namespace android 53 | 54 | #endif // A_BIT_READER_H_ 55 | -------------------------------------------------------------------------------- /jni/Android/include_jb/media/stagefright/foundation/AHandler.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 A_HANDLER_H_ 18 | 19 | #define A_HANDLER_H_ 20 | 21 | #include 22 | #include 23 | 24 | namespace android { 25 | 26 | struct AMessage; 27 | 28 | struct AHandler : public RefBase { 29 | AHandler() 30 | : mID(0) { 31 | } 32 | 33 | ALooper::handler_id id() const { 34 | return mID; 35 | } 36 | 37 | sp looper(); 38 | 39 | protected: 40 | virtual void onMessageReceived(const sp &msg) = 0; 41 | 42 | private: 43 | friend struct ALooperRoster; 44 | 45 | ALooper::handler_id mID; 46 | 47 | void setID(ALooper::handler_id id) { 48 | mID = id; 49 | } 50 | 51 | DISALLOW_EVIL_CONSTRUCTORS(AHandler); 52 | }; 53 | 54 | } // namespace android 55 | 56 | #endif // A_HANDLER_H_ 57 | -------------------------------------------------------------------------------- /jni/Android/include_jb/media/stagefright/foundation/AHandlerReflector.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 A_HANDLER_REFLECTOR_H_ 18 | 19 | #define A_HANDLER_REFLECTOR_H_ 20 | 21 | #include 22 | 23 | namespace android { 24 | 25 | template 26 | struct AHandlerReflector : public AHandler { 27 | AHandlerReflector(T *target) 28 | : mTarget(target) { 29 | } 30 | 31 | protected: 32 | virtual void onMessageReceived(const sp &msg) { 33 | sp target = mTarget.promote(); 34 | if (target != NULL) { 35 | target->onMessageReceived(msg); 36 | } 37 | } 38 | 39 | private: 40 | wp mTarget; 41 | 42 | AHandlerReflector(const AHandlerReflector &); 43 | AHandlerReflector &operator=(const AHandlerReflector &); 44 | }; 45 | 46 | } // namespace android 47 | 48 | #endif // A_HANDLER_REFLECTOR_H_ 49 | -------------------------------------------------------------------------------- /jni/Android/include_jb/media/stagefright/foundation/base64.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 BASE_64_H_ 18 | 19 | #define BASE_64_H_ 20 | 21 | #include 22 | 23 | namespace android { 24 | 25 | struct ABuffer; 26 | struct AString; 27 | 28 | sp decodeBase64(const AString &s); 29 | void encodeBase64(const void *data, size_t size, AString *out); 30 | 31 | } // namespace android 32 | 33 | #endif // BASE_64_H_ 34 | -------------------------------------------------------------------------------- /jni/Android/include_jb/media/stagefright/foundation/hexdump.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 HEXDUMP_H_ 18 | 19 | #define HEXDUMP_H_ 20 | 21 | #include 22 | 23 | namespace android { 24 | 25 | void hexdump(const void *_data, size_t size); 26 | 27 | } // namespace android 28 | 29 | #endif // HEXDUMP_H_ 30 | -------------------------------------------------------------------------------- /jni/Android/include_jb/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_jb/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 | #endif /* __LIB_UTILS_COMPAT_H */ 43 | -------------------------------------------------------------------------------- /jni/Android/include_jb/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_jb/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_jb/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 | 33 | #endif // _LIBS_UTILS_LOG_H 34 | -------------------------------------------------------------------------------- /jni/Android/include_jb/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 | 29 | }; // namespace android 30 | 31 | #endif // ANDROID_UTILS_SYSTEMCLOCK_H 32 | 33 | -------------------------------------------------------------------------------- /jni/Android/include_jb/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_jb/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_jb4_2/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_jb4_2/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_jb4_2/cutils/bitops.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_BITOPS_H 18 | #define __CUTILS_BITOPS_H 19 | 20 | #include 21 | 22 | __BEGIN_DECLS 23 | 24 | static inline int popcount(unsigned int x) 25 | { 26 | return __builtin_popcount(x); 27 | } 28 | 29 | static inline int popcountl(unsigned long x) 30 | { 31 | return __builtin_popcountl(x); 32 | } 33 | 34 | static inline int popcountll(unsigned long long x) 35 | { 36 | return __builtin_popcountll(x); 37 | } 38 | 39 | __END_DECLS 40 | 41 | #endif /* __CUTILS_BITOPS_H */ 42 | -------------------------------------------------------------------------------- /jni/Android/include_jb4_2/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_jb4_2/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_jb4_2/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/include_jb4_2/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_jb4_2/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_jb4_2/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_jb4_2/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 | void klog_init(void); 21 | void klog_set_level(int level); 22 | void klog_close(void); 23 | void klog_write(int level, const char *fmt, ...) 24 | __attribute__ ((format(printf, 2, 3))); 25 | 26 | #define KLOG_ERROR(tag,x...) klog_write(3, "<3>" tag ": " x) 27 | #define KLOG_WARNING(tag,x...) klog_write(4, "<4>" tag ": " x) 28 | #define KLOG_NOTICE(tag,x...) klog_write(5, "<5>" tag ": " x) 29 | #define KLOG_INFO(tag,x...) klog_write(6, "<6>" tag ": " x) 30 | #define KLOG_DEBUG(tag,x...) klog_write(7, "<7>" tag ": " x) 31 | 32 | #define KLOG_DEFAULT_LEVEL 3 /* messages <= this level are logged */ 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /jni/Android/include_jb4_2/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 | -------------------------------------------------------------------------------- /jni/Android/include_jb4_2/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_jb4_2/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_jb4_2/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_jb4_2/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_jb4_2/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_jb4_2/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_jb4_2/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_jb4_2/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 | -------------------------------------------------------------------------------- /jni/Android/include_jb4_2/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_jb4_2/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_jb4_2/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 | int zygote_run_wait(int argc, const char **argv, void (*post_run_func)(int)); 27 | 28 | #ifdef __cplusplus 29 | } 30 | #endif 31 | 32 | #endif /* __CUTILS_ZYGOTE_H */ 33 | -------------------------------------------------------------------------------- /jni/Android/include_jb4_2/hardware_legacy/power.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 _HARDWARE_POWER_H 18 | #define _HARDWARE_POWER_H 19 | 20 | #include 21 | 22 | #if __cplusplus 23 | extern "C" { 24 | #endif 25 | 26 | enum { 27 | PARTIAL_WAKE_LOCK = 1, // the cpu stays on, but the screen is off 28 | FULL_WAKE_LOCK = 2 // the screen is also on 29 | }; 30 | 31 | // while you have a lock held, the device will stay on at least at the 32 | // level you request. 33 | int acquire_wake_lock(int lock, const char* id); 34 | int release_wake_lock(const char* id); 35 | 36 | 37 | #if __cplusplus 38 | } // extern "C" 39 | #endif 40 | 41 | #endif // _HARDWARE_POWER_H 42 | -------------------------------------------------------------------------------- /jni/Android/include_jb4_2/hardware_legacy/qemu_tracing.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 _HARDWARE_QEMU_TRACING_H 18 | #define _HARDWARE_QEMU_TRACING_H 19 | 20 | #if __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | int qemu_start_tracing(); 25 | int qemu_stop_tracing(); 26 | int qemu_add_mapping(unsigned int addr, const char *name); 27 | int qemu_remove_mapping(unsigned int addr); 28 | 29 | #if __cplusplus 30 | } // extern "C" 31 | #endif 32 | 33 | #endif // _HARDWARE_QEMU_TRACING_H 34 | -------------------------------------------------------------------------------- /jni/Android/include_jb4_2/hardware_legacy/uevent.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 _HARDWARE_UEVENT_H 18 | #define _HARDWARE_UEVENT_H 19 | 20 | #if __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | int uevent_init(); 25 | int uevent_get_fd(); 26 | int uevent_next_event(char* buffer, int buffer_length); 27 | int uevent_add_native_handler(void (*handler)(void *data, const char *msg, int msg_len), 28 | void *handler_data); 29 | int uevent_remove_native_handler(void (*handler)(void *data, const char *msg, int msg_len)); 30 | 31 | #if __cplusplus 32 | } // extern "C" 33 | #endif 34 | 35 | #endif // _HARDWARE_UEVENT_H 36 | -------------------------------------------------------------------------------- /jni/Android/include_jb4_2/hardware_legacy/vibrator.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 _HARDWARE_VIBRATOR_H 18 | #define _HARDWARE_VIBRATOR_H 19 | 20 | #if __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | /** 25 | * Return whether the device has a vibrator. 26 | * 27 | * @return 1 if a vibrator exists, 0 if it doesn't. 28 | */ 29 | int vibrator_exists(); 30 | 31 | /** 32 | * Turn on vibrator 33 | * 34 | * @param timeout_ms number of milliseconds to vibrate 35 | * 36 | * @return 0 if successful, -1 if error 37 | */ 38 | int vibrator_on(int timeout_ms); 39 | 40 | /** 41 | * Turn off vibrator 42 | * 43 | * @return 0 if successful, -1 if error 44 | */ 45 | int vibrator_off(); 46 | 47 | #if __cplusplus 48 | } // extern "C" 49 | #endif 50 | 51 | #endif // _HARDWARE_VIBRATOR_H 52 | -------------------------------------------------------------------------------- /jni/Android/include_jb4_2/media/ExtendedAudioBufferProvider.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_EXTENDED_AUDIO_BUFFER_PROVIDER_H 18 | #define ANDROID_EXTENDED_AUDIO_BUFFER_PROVIDER_H 19 | 20 | #include 21 | 22 | namespace android { 23 | 24 | class ExtendedAudioBufferProvider : public AudioBufferProvider { 25 | public: 26 | virtual size_t framesReady() const = 0; // see description at AudioFlinger.h 27 | }; 28 | 29 | } // namespace android 30 | 31 | #endif // ANDROID_EXTENDED_AUDIO_BUFFER_PROVIDER_H 32 | -------------------------------------------------------------------------------- /jni/Android/include_jb4_2/media/IMediaPlayerClient.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_IMEDIAPLAYERCLIENT_H 18 | #define ANDROID_IMEDIAPLAYERCLIENT_H 19 | 20 | #include 21 | #include 22 | #include 23 | 24 | namespace android { 25 | 26 | class IMediaPlayerClient: public IInterface 27 | { 28 | public: 29 | DECLARE_META_INTERFACE(MediaPlayerClient); 30 | 31 | virtual void notify(int msg, int ext1, int ext2, const Parcel *obj) = 0; 32 | }; 33 | 34 | // ---------------------------------------------------------------------------- 35 | 36 | class BnMediaPlayerClient: public BnInterface 37 | { 38 | public: 39 | virtual status_t onTransact( uint32_t code, 40 | const Parcel& data, 41 | Parcel* reply, 42 | uint32_t flags = 0); 43 | }; 44 | 45 | }; // namespace android 46 | 47 | #endif // ANDROID_IMEDIAPLAYERCLIENT_H 48 | -------------------------------------------------------------------------------- /jni/Android/include_jb4_2/media/IMediaRecorderClient.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_IMEDIARECORDERCLIENT_H 18 | #define ANDROID_IMEDIARECORDERCLIENT_H 19 | 20 | #include 21 | #include 22 | #include 23 | 24 | namespace android { 25 | 26 | class IMediaRecorderClient: public IInterface 27 | { 28 | public: 29 | DECLARE_META_INTERFACE(MediaRecorderClient); 30 | 31 | virtual void notify(int msg, int ext1, int ext2) = 0; 32 | }; 33 | 34 | // ---------------------------------------------------------------------------- 35 | 36 | class BnMediaRecorderClient: public BnInterface 37 | { 38 | public: 39 | virtual status_t onTransact( uint32_t code, 40 | const Parcel& data, 41 | Parcel* reply, 42 | uint32_t flags = 0); 43 | }; 44 | 45 | }; // namespace android 46 | 47 | #endif // ANDROID_IMEDIARECORDERCLIENT_H 48 | -------------------------------------------------------------------------------- /jni/Android/include_jb4_2/media/MemoryLeakTrackUtil.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 | #ifndef MEMORY_LEAK_TRACK_UTIL_H 17 | #define MEMORY_LEAK_TRACK_UTIL_H 18 | 19 | namespace android { 20 | /* 21 | * Dump the memory address of the calling process to the given fd. 22 | */ 23 | extern void dumpMemoryAddresses(int fd); 24 | 25 | }; 26 | 27 | #endif // MEMORY_LEAK_TRACK_UTIL_H 28 | -------------------------------------------------------------------------------- /jni/Android/include_jb4_2/media/nbaio/roundup.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 ROUNDUP_H 18 | #define ROUNDUP_H 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | // Round up to the next highest power of 2 25 | unsigned roundup(unsigned v); 26 | 27 | #ifdef __cplusplus 28 | } 29 | #endif 30 | 31 | #endif // ROUNDUP_H 32 | -------------------------------------------------------------------------------- /jni/Android/include_jb4_2/media/stagefright/OMXClient.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_CLIENT_H_ 18 | 19 | #define OMX_CLIENT_H_ 20 | 21 | #include 22 | 23 | namespace android { 24 | 25 | class OMXClient { 26 | public: 27 | OMXClient(); 28 | 29 | status_t connect(); 30 | void disconnect(); 31 | 32 | sp interface() { 33 | return mOMX; 34 | } 35 | 36 | private: 37 | sp mOMX; 38 | 39 | OMXClient(const OMXClient &); 40 | OMXClient &operator=(const OMXClient &); 41 | }; 42 | 43 | } // namespace android 44 | 45 | #endif // OMX_CLIENT_H_ 46 | -------------------------------------------------------------------------------- /jni/Android/include_jb4_2/media/stagefright/StagefrightMediaScanner.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 STAGEFRIGHT_MEDIA_SCANNER_H_ 18 | 19 | #define STAGEFRIGHT_MEDIA_SCANNER_H_ 20 | 21 | #include 22 | 23 | namespace android { 24 | 25 | struct StagefrightMediaScanner : public MediaScanner { 26 | StagefrightMediaScanner(); 27 | virtual ~StagefrightMediaScanner(); 28 | 29 | virtual MediaScanResult processFile( 30 | const char *path, const char *mimeType, 31 | MediaScannerClient &client); 32 | 33 | virtual char *extractAlbumArt(int fd); 34 | 35 | private: 36 | StagefrightMediaScanner(const StagefrightMediaScanner &); 37 | StagefrightMediaScanner &operator=(const StagefrightMediaScanner &); 38 | 39 | MediaScanResult processFileInternal( 40 | const char *path, const char *mimeType, 41 | MediaScannerClient &client); 42 | }; 43 | 44 | } // namespace android 45 | 46 | #endif // STAGEFRIGHT_MEDIA_SCANNER_H_ 47 | -------------------------------------------------------------------------------- /jni/Android/include_jb4_2/media/stagefright/TimeSource.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 TIME_SOURCE_H_ 18 | 19 | #define TIME_SOURCE_H_ 20 | 21 | #include 22 | 23 | namespace android { 24 | 25 | class TimeSource { 26 | public: 27 | TimeSource() {} 28 | virtual ~TimeSource() {} 29 | 30 | virtual int64_t getRealTimeUs() = 0; 31 | 32 | private: 33 | TimeSource(const TimeSource &); 34 | TimeSource &operator=(const TimeSource &); 35 | }; 36 | 37 | class SystemTimeSource : public TimeSource { 38 | public: 39 | SystemTimeSource(); 40 | 41 | virtual int64_t getRealTimeUs(); 42 | 43 | private: 44 | int64_t mStartTimeUs; 45 | }; 46 | 47 | } // namespace android 48 | 49 | #endif // TIME_SOURCE_H_ 50 | -------------------------------------------------------------------------------- /jni/Android/include_jb4_2/media/stagefright/Utils.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 UTILS_H_ 18 | 19 | #define UTILS_H_ 20 | 21 | #include 22 | #include 23 | #include 24 | 25 | namespace android { 26 | 27 | #define FOURCC(c1, c2, c3, c4) \ 28 | (c1 << 24 | c2 << 16 | c3 << 8 | c4) 29 | 30 | uint16_t U16_AT(const uint8_t *ptr); 31 | uint32_t U32_AT(const uint8_t *ptr); 32 | uint64_t U64_AT(const uint8_t *ptr); 33 | 34 | uint16_t U16LE_AT(const uint8_t *ptr); 35 | uint32_t U32LE_AT(const uint8_t *ptr); 36 | uint64_t U64LE_AT(const uint8_t *ptr); 37 | 38 | uint64_t ntoh64(uint64_t x); 39 | uint64_t hton64(uint64_t x); 40 | 41 | struct MetaData; 42 | struct AMessage; 43 | status_t convertMetaDataToMessage( 44 | const sp &meta, sp *format); 45 | void convertMessageToMetaData( 46 | const sp &format, sp &meta); 47 | 48 | } // namespace android 49 | 50 | #endif // UTILS_H_ 51 | -------------------------------------------------------------------------------- /jni/Android/include_jb4_2/media/stagefright/foundation/AAtomizer.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 A_ATOMIZER_H_ 18 | 19 | #define A_ATOMIZER_H_ 20 | 21 | #include 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | 29 | namespace android { 30 | 31 | struct AAtomizer { 32 | static const char *Atomize(const char *name); 33 | 34 | private: 35 | static AAtomizer gAtomizer; 36 | 37 | Mutex mLock; 38 | Vector > mAtoms; 39 | 40 | AAtomizer(); 41 | 42 | const char *atomize(const char *name); 43 | 44 | static uint32_t Hash(const char *s); 45 | 46 | DISALLOW_EVIL_CONSTRUCTORS(AAtomizer); 47 | }; 48 | 49 | } // namespace android 50 | 51 | #endif // A_ATOMIZER_H_ 52 | -------------------------------------------------------------------------------- /jni/Android/include_jb4_2/media/stagefright/foundation/ABase.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 A_BASE_H_ 18 | 19 | #define A_BASE_H_ 20 | 21 | #define DISALLOW_EVIL_CONSTRUCTORS(name) \ 22 | name(const name &); \ 23 | name &operator=(const name &) 24 | 25 | #endif // A_BASE_H_ 26 | -------------------------------------------------------------------------------- /jni/Android/include_jb4_2/media/stagefright/foundation/ABitReader.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 A_BIT_READER_H_ 18 | 19 | #define A_BIT_READER_H_ 20 | 21 | #include 22 | 23 | #include 24 | #include 25 | 26 | namespace android { 27 | 28 | struct ABitReader { 29 | ABitReader(const uint8_t *data, size_t size); 30 | 31 | uint32_t getBits(size_t n); 32 | void skipBits(size_t n); 33 | 34 | void putBits(uint32_t x, size_t n); 35 | 36 | size_t numBitsLeft() const; 37 | 38 | const uint8_t *data() const; 39 | 40 | private: 41 | const uint8_t *mData; 42 | size_t mSize; 43 | 44 | uint32_t mReservoir; // left-aligned bits 45 | size_t mNumBitsLeft; 46 | 47 | void fillReservoir(); 48 | 49 | DISALLOW_EVIL_CONSTRUCTORS(ABitReader); 50 | }; 51 | 52 | } // namespace android 53 | 54 | #endif // A_BIT_READER_H_ 55 | -------------------------------------------------------------------------------- /jni/Android/include_jb4_2/media/stagefright/foundation/AHandler.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 A_HANDLER_H_ 18 | 19 | #define A_HANDLER_H_ 20 | 21 | #include 22 | #include 23 | 24 | namespace android { 25 | 26 | struct AMessage; 27 | 28 | struct AHandler : public RefBase { 29 | AHandler() 30 | : mID(0) { 31 | } 32 | 33 | ALooper::handler_id id() const { 34 | return mID; 35 | } 36 | 37 | sp looper(); 38 | 39 | protected: 40 | virtual void onMessageReceived(const sp &msg) = 0; 41 | 42 | private: 43 | friend struct ALooperRoster; 44 | 45 | ALooper::handler_id mID; 46 | 47 | void setID(ALooper::handler_id id) { 48 | mID = id; 49 | } 50 | 51 | DISALLOW_EVIL_CONSTRUCTORS(AHandler); 52 | }; 53 | 54 | } // namespace android 55 | 56 | #endif // A_HANDLER_H_ 57 | -------------------------------------------------------------------------------- /jni/Android/include_jb4_2/media/stagefright/foundation/AHandlerReflector.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 A_HANDLER_REFLECTOR_H_ 18 | 19 | #define A_HANDLER_REFLECTOR_H_ 20 | 21 | #include 22 | 23 | namespace android { 24 | 25 | template 26 | struct AHandlerReflector : public AHandler { 27 | AHandlerReflector(T *target) 28 | : mTarget(target) { 29 | } 30 | 31 | protected: 32 | virtual void onMessageReceived(const sp &msg) { 33 | sp target = mTarget.promote(); 34 | if (target != NULL) { 35 | target->onMessageReceived(msg); 36 | } 37 | } 38 | 39 | private: 40 | wp mTarget; 41 | 42 | AHandlerReflector(const AHandlerReflector &); 43 | AHandlerReflector &operator=(const AHandlerReflector &); 44 | }; 45 | 46 | } // namespace android 47 | 48 | #endif // A_HANDLER_REFLECTOR_H_ 49 | -------------------------------------------------------------------------------- /jni/Android/include_jb4_2/media/stagefright/foundation/base64.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 BASE_64_H_ 18 | 19 | #define BASE_64_H_ 20 | 21 | #include 22 | 23 | namespace android { 24 | 25 | struct ABuffer; 26 | struct AString; 27 | 28 | sp decodeBase64(const AString &s); 29 | void encodeBase64(const void *data, size_t size, AString *out); 30 | 31 | } // namespace android 32 | 33 | #endif // BASE_64_H_ 34 | -------------------------------------------------------------------------------- /jni/Android/include_jb4_2/media/stagefright/foundation/hexdump.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 HEXDUMP_H_ 18 | 19 | #define HEXDUMP_H_ 20 | 21 | #include 22 | 23 | namespace android { 24 | 25 | struct AString; 26 | 27 | void hexdump( 28 | const void *_data, size_t size, 29 | size_t indent = 0, AString *appendTo = NULL); 30 | 31 | } // namespace android 32 | 33 | #endif // HEXDUMP_H_ 34 | -------------------------------------------------------------------------------- /jni/Android/include_jb4_2/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_jb4_2/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_jb4_2/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_jb4_2/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_jb4_2/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_jb4_2/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/lib/gingerbread/libmedia.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Android/Android-MemorySahre/3f7061b76bcecab984c835b2411400233092c7b3/jni/Android/lib/gingerbread/libmedia.so -------------------------------------------------------------------------------- /jni/Android/lib/gingerbread/libutils.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Android/Android-MemorySahre/3f7061b76bcecab984c835b2411400233092c7b3/jni/Android/lib/gingerbread/libutils.so -------------------------------------------------------------------------------- /jni/Android/lib/jb4_2/libmedia.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Android/Android-MemorySahre/3f7061b76bcecab984c835b2411400233092c7b3/jni/Android/lib/jb4_2/libmedia.so -------------------------------------------------------------------------------- /jni/Android/lib/jb4_2/libutils.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Android/Android-MemorySahre/3f7061b76bcecab984c835b2411400233092c7b3/jni/Android/lib/jb4_2/libutils.so -------------------------------------------------------------------------------- /jni/Android/lib/jellybean/libcutils.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Android/Android-MemorySahre/3f7061b76bcecab984c835b2411400233092c7b3/jni/Android/lib/jellybean/libcutils.so -------------------------------------------------------------------------------- /jni/Android/lib/jellybean/libmedia.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Android/Android-MemorySahre/3f7061b76bcecab984c835b2411400233092c7b3/jni/Android/lib/jellybean/libmedia.so -------------------------------------------------------------------------------- /jni/Android/lib/jellybean/libutils.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Android/Android-MemorySahre/3f7061b76bcecab984c835b2411400233092c7b3/jni/Android/lib/jellybean/libutils.so -------------------------------------------------------------------------------- /jni/Android/lib/libmedia.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Android/Android-MemorySahre/3f7061b76bcecab984c835b2411400233092c7b3/jni/Android/lib/libmedia.so -------------------------------------------------------------------------------- /jni/Android/lib/libutils.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Android/Android-MemorySahre/3f7061b76bcecab984c835b2411400233092c7b3/jni/Android/lib/libutils.so -------------------------------------------------------------------------------- /jni/Memoryshare.cpp: -------------------------------------------------------------------------------- 1 | #include "Memoryshare.h" 2 | #include "memory_base.h" 3 | #include 4 | #include 5 | #include 6 | 7 | #define MEME_SIZE 100 8 | 9 | int MemoryShare::openMemoryShare() { 10 | 11 | mFD = liblwmm_ashmem_create("my_laiwang_ashmem", MEME_SIZE); 12 | __android_log_print(ANDROID_LOG_INFO,"libatrack", "ashmem create:%d", mFD); 13 | if(mFD < 0) 14 | return -1; 15 | 16 | return 0; 17 | } 18 | 19 | int MemoryShare::mmapMemoryShare(int fd) { 20 | 21 | if (fd!=0) { 22 | mFD = fd; 23 | } 24 | __android_log_print(ANDROID_LOG_INFO,"libatrack", "ashmem fd:%d", mFD); 25 | 26 | this->mPSHM = liblwmm_ashmem_mmap(mFD, MEME_SIZE); 27 | if (mPSHM == -1) { 28 | __android_log_print(ANDROID_LOG_INFO,"libatrack", "ashmem map faile"); 29 | return -1; 30 | } 31 | 32 | __android_log_print(ANDROID_LOG_INFO,"libatrack", "ashmem addr:%x", mPSHM); 33 | 34 | return 0; 35 | } 36 | 37 | int MemoryShare::closeMemoryShare() { 38 | 39 | liblwmm_ashmem_close(mFD); 40 | return 0; 41 | } 42 | 43 | int MemoryShare::writeMemoryShare(void* src, int count) { 44 | 45 | // todo: memory copy 46 | memcpy(this->mPSHM, src, count); 47 | liblwmm_ashmem_msync(this->mPSHM, MEME_SIZE); 48 | return count; 49 | } 50 | 51 | int MemoryShare::readMemoryShare(void* buff, int count) { 52 | 53 | // todo: memory copy 54 | // memcpy(buff, this->mPSHM, count); 55 | liblwmm_ashmem_read(mFD, this->mPSHM, buff, count); 56 | 57 | return 0; 58 | } 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /jni/Memoryshare.h: -------------------------------------------------------------------------------- 1 | #ifndef __MEMORY_SHARE_H__ 2 | #define __MEMORY_SHARE_H__ 3 | 4 | class MemoryShare { 5 | 6 | 7 | public: 8 | 9 | int openMemoryShare(); 10 | int mmapMemoryShare(int fd); 11 | int closeMemoryShare(); 12 | int readMemoryShare(void* buff, int count); 13 | int writeMemoryShare(void* src, int count); 14 | 15 | public: 16 | int mFD; 17 | int mOffset; 18 | void* mPSHM; 19 | 20 | }; 21 | 22 | 23 | #endif // __MEMORY_SHARE_H__ 24 | -------------------------------------------------------------------------------- /jni/README: -------------------------------------------------------------------------------- 1 | To setup the JNI sources, you'll need to do the following: 2 | 3 | (1) Go to your NDK root directory 4 | 5 | (2) mkdir apps/lossless 6 | 7 | (3) Create the file "apps/lossless/Application.mk" containing two lines: 8 | 9 | APP_PROJECT_PATH := $(call my-dir)/project 10 | APP_MODULES := ape flac wav wv mpc lossless 11 | 12 | (4) In apps/lossless, make a link called "project" pointing to the unzipped andLess directory (full path!). 13 | (check that from NDK root you can open the file you're reading now as apps/lossless/project/jni/README) 14 | 15 | (5) Change the following line in build-binary.mk (NDK build file): 16 | 17 | diff -r android-ndk-1.6_r1.orig/build/core/build-binary.mk android-ndk-1.6_r1/build/core/build-binary.mk 18 | 166c166 19 | < $(LOCAL_BUILT_MODULE): PRIVATE_STATIC_LIBRARIES := $(static_libraries) 20 | --- 21 | > $(LOCAL_BUILT_MODULE): PRIVATE_WHOLE_STATIC_LIBRARIES := $(static_libraries) 22 | 23 | I don't know how to get around this NDK "feature" gracefully, but the app won't link otherwise. 24 | If you do know, please inform me. 25 | 26 | (6) Now you just go to the ndk root dir and "make APP=lossless" to get "liblossless.so" in its proper place, 27 | so that it'll get added to the .apk when you build the java code. 28 | 29 | 30 | -------------------------------------------------------------------------------- /jni/memory_base.h: -------------------------------------------------------------------------------- 1 | #ifndef __MEMORY_BASE_H__ 2 | #define __MEMORY_BASE_H__ 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | int liblwmm_ashmem_create(const char* name, int size); 9 | int liblwmm_ashmem_mmap(int fd, int size); 10 | int liblwmm_ashmem_msync(void* addr, int len); 11 | int liblwmm_ashmem_close(int fd); 12 | int liblwmm_ashmem_read(int fd, void* vpm, void* buff, int count); 13 | 14 | #ifdef __cplusplus 15 | } 16 | #endif 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /libs/android-support-v4.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Android/Android-MemorySahre/3f7061b76bcecab984c835b2411400233092c7b3/libs/android-support-v4.jar -------------------------------------------------------------------------------- /libs/armeabi/libatrack16.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Android/Android-MemorySahre/3f7061b76bcecab984c835b2411400233092c7b3/libs/armeabi/libatrack16.so -------------------------------------------------------------------------------- /libs/armeabi/liblwhelper.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Android/Android-MemorySahre/3f7061b76bcecab984c835b2411400233092c7b3/libs/armeabi/liblwhelper.so -------------------------------------------------------------------------------- /obj/local/armeabi/libalac.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Android/Android-MemorySahre/3f7061b76bcecab984c835b2411400233092c7b3/obj/local/armeabi/libalac.a -------------------------------------------------------------------------------- /obj/local/armeabi/libape.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Android/Android-MemorySahre/3f7061b76bcecab984c835b2411400233092c7b3/obj/local/armeabi/libape.a -------------------------------------------------------------------------------- /obj/local/armeabi/libatrack16.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Android/Android-MemorySahre/3f7061b76bcecab984c835b2411400233092c7b3/obj/local/armeabi/libatrack16.so -------------------------------------------------------------------------------- /obj/local/armeabi/libflac.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Android/Android-MemorySahre/3f7061b76bcecab984c835b2411400233092c7b3/obj/local/armeabi/libflac.a -------------------------------------------------------------------------------- /obj/local/armeabi/liblossless.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Android/Android-MemorySahre/3f7061b76bcecab984c835b2411400233092c7b3/obj/local/armeabi/liblossless.so -------------------------------------------------------------------------------- /obj/local/armeabi/liblwcore.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Android/Android-MemorySahre/3f7061b76bcecab984c835b2411400233092c7b3/obj/local/armeabi/liblwcore.so -------------------------------------------------------------------------------- /obj/local/armeabi/liblwhelper.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Android/Android-MemorySahre/3f7061b76bcecab984c835b2411400233092c7b3/obj/local/armeabi/liblwhelper.so -------------------------------------------------------------------------------- /obj/local/armeabi/libmpc.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Android/Android-MemorySahre/3f7061b76bcecab984c835b2411400233092c7b3/obj/local/armeabi/libmpc.a -------------------------------------------------------------------------------- /obj/local/armeabi/libstdc++.a: -------------------------------------------------------------------------------- 1 | ! 2 | -------------------------------------------------------------------------------- /obj/local/armeabi/libwav.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Android/Android-MemorySahre/3f7061b76bcecab984c835b2411400233092c7b3/obj/local/armeabi/libwav.a -------------------------------------------------------------------------------- /obj/local/armeabi/libwv.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Android/Android-MemorySahre/3f7061b76bcecab984c835b2411400233092c7b3/obj/local/armeabi/libwv.a -------------------------------------------------------------------------------- /obj/local/armeabi/objs/alac/alac_decoder.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Android/Android-MemorySahre/3f7061b76bcecab984c835b2411400233092c7b3/obj/local/armeabi/objs/alac/alac_decoder.o -------------------------------------------------------------------------------- /obj/local/armeabi/objs/alac/demux.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Android/Android-MemorySahre/3f7061b76bcecab984c835b2411400233092c7b3/obj/local/armeabi/objs/alac/demux.o -------------------------------------------------------------------------------- /obj/local/armeabi/objs/alac/m4a.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Android/Android-MemorySahre/3f7061b76bcecab984c835b2411400233092c7b3/obj/local/armeabi/objs/alac/m4a.o -------------------------------------------------------------------------------- /obj/local/armeabi/objs/alac/main.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Android/Android-MemorySahre/3f7061b76bcecab984c835b2411400233092c7b3/obj/local/armeabi/objs/alac/main.o -------------------------------------------------------------------------------- /obj/local/armeabi/objs/ape/ape_decoder.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Android/Android-MemorySahre/3f7061b76bcecab984c835b2411400233092c7b3/obj/local/armeabi/objs/ape/ape_decoder.o -------------------------------------------------------------------------------- /obj/local/armeabi/objs/ape/crc.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Android/Android-MemorySahre/3f7061b76bcecab984c835b2411400233092c7b3/obj/local/armeabi/objs/ape/crc.o -------------------------------------------------------------------------------- /obj/local/armeabi/objs/ape/entropy.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Android/Android-MemorySahre/3f7061b76bcecab984c835b2411400233092c7b3/obj/local/armeabi/objs/ape/entropy.o -------------------------------------------------------------------------------- /obj/local/armeabi/objs/ape/filter_1280_15.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Android/Android-MemorySahre/3f7061b76bcecab984c835b2411400233092c7b3/obj/local/armeabi/objs/ape/filter_1280_15.o -------------------------------------------------------------------------------- /obj/local/armeabi/objs/ape/filter_16_11.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Android/Android-MemorySahre/3f7061b76bcecab984c835b2411400233092c7b3/obj/local/armeabi/objs/ape/filter_16_11.o -------------------------------------------------------------------------------- /obj/local/armeabi/objs/ape/filter_256_13.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Android/Android-MemorySahre/3f7061b76bcecab984c835b2411400233092c7b3/obj/local/armeabi/objs/ape/filter_256_13.o -------------------------------------------------------------------------------- /obj/local/armeabi/objs/ape/filter_32_10.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Android/Android-MemorySahre/3f7061b76bcecab984c835b2411400233092c7b3/obj/local/armeabi/objs/ape/filter_32_10.o -------------------------------------------------------------------------------- /obj/local/armeabi/objs/ape/filter_64_11.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Android/Android-MemorySahre/3f7061b76bcecab984c835b2411400233092c7b3/obj/local/armeabi/objs/ape/filter_64_11.o -------------------------------------------------------------------------------- /obj/local/armeabi/objs/ape/main.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Android/Android-MemorySahre/3f7061b76bcecab984c835b2411400233092c7b3/obj/local/armeabi/objs/ape/main.o -------------------------------------------------------------------------------- /obj/local/armeabi/objs/ape/parser.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Android/Android-MemorySahre/3f7061b76bcecab984c835b2411400233092c7b3/obj/local/armeabi/objs/ape/parser.o -------------------------------------------------------------------------------- /obj/local/armeabi/objs/ape/predictor-arm.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Android/Android-MemorySahre/3f7061b76bcecab984c835b2411400233092c7b3/obj/local/armeabi/objs/ape/predictor-arm.o -------------------------------------------------------------------------------- /obj/local/armeabi/objs/ape/predictor-arm.o.d: -------------------------------------------------------------------------------- 1 | obj/local/armeabi/objs/ape/predictor-arm.o: jni/ape/predictor-arm.S \ 2 | jni/ape/demac_config.h 3 | 4 | jni/ape/demac_config.h: 5 | -------------------------------------------------------------------------------- /obj/local/armeabi/objs/ape/predictor.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Android/Android-MemorySahre/3f7061b76bcecab984c835b2411400233092c7b3/obj/local/armeabi/objs/ape/predictor.o -------------------------------------------------------------------------------- /obj/local/armeabi/objs/atrack16/Memoryshare.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Android/Android-MemorySahre/3f7061b76bcecab984c835b2411400233092c7b3/obj/local/armeabi/objs/atrack16/Memoryshare.o -------------------------------------------------------------------------------- /obj/local/armeabi/objs/atrack16/memory_base.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Android/Android-MemorySahre/3f7061b76bcecab984c835b2411400233092c7b3/obj/local/armeabi/objs/atrack16/memory_base.o -------------------------------------------------------------------------------- /obj/local/armeabi/objs/atrack16/std_audio.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Android/Android-MemorySahre/3f7061b76bcecab984c835b2411400233092c7b3/obj/local/armeabi/objs/atrack16/std_audio.o -------------------------------------------------------------------------------- /obj/local/armeabi/objs/flac/arm.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Android/Android-MemorySahre/3f7061b76bcecab984c835b2411400233092c7b3/obj/local/armeabi/objs/flac/arm.o -------------------------------------------------------------------------------- /obj/local/armeabi/objs/flac/arm.o.d: -------------------------------------------------------------------------------- 1 | obj/local/armeabi/objs/flac/arm.o: jni/flac/arm.S 2 | -------------------------------------------------------------------------------- /obj/local/armeabi/objs/flac/bitstream.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Android/Android-MemorySahre/3f7061b76bcecab984c835b2411400233092c7b3/obj/local/armeabi/objs/flac/bitstream.o -------------------------------------------------------------------------------- /obj/local/armeabi/objs/flac/flac_decoder.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Android/Android-MemorySahre/3f7061b76bcecab984c835b2411400233092c7b3/obj/local/armeabi/objs/flac/flac_decoder.o -------------------------------------------------------------------------------- /obj/local/armeabi/objs/flac/main.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Android/Android-MemorySahre/3f7061b76bcecab984c835b2411400233092c7b3/obj/local/armeabi/objs/flac/main.o -------------------------------------------------------------------------------- /obj/local/armeabi/objs/flac/tables.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Android/Android-MemorySahre/3f7061b76bcecab984c835b2411400233092c7b3/obj/local/armeabi/objs/flac/tables.o -------------------------------------------------------------------------------- /obj/local/armeabi/objs/lossless/com_alibaba_laiwang_android_MemoryShare.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Android/Android-MemorySahre/3f7061b76bcecab984c835b2411400233092c7b3/obj/local/armeabi/objs/lossless/com_alibaba_laiwang_android_MemoryShare.o -------------------------------------------------------------------------------- /obj/local/armeabi/objs/lossless/com_alibaba_laiwang_android_MemoryShare.o.d: -------------------------------------------------------------------------------- 1 | obj/local/armeabi/objs/lossless/com_alibaba_laiwang_android_MemoryShare.o: \ 2 | jni/com_alibaba_laiwang_android_MemoryShare.cpp \ 3 | jni/com_alibaba_laiwang_android_MemoryShare.h \ 4 | /Users/i-mac/i-jdan/MySDK/android-ndk-r9b/platforms/android-19/arch-arm/usr/include/jni.h \ 5 | /Users/i-mac/i-jdan/MySDK/android-ndk-r9b/platforms/android-19/arch-arm/usr/include/sys/cdefs.h \ 6 | /Users/i-mac/i-jdan/MySDK/android-ndk-r9b/platforms/android-19/arch-arm/usr/include/sys/cdefs_elf.h \ 7 | /Users/i-mac/i-jdan/MySDK/android-ndk-r9b/platforms/android-19/arch-arm/usr/include/android/api-level.h \ 8 | jni/Memoryshare.h 9 | 10 | jni/com_alibaba_laiwang_android_MemoryShare.h: 11 | 12 | /Users/i-mac/i-jdan/MySDK/android-ndk-r9b/platforms/android-19/arch-arm/usr/include/jni.h: 13 | 14 | /Users/i-mac/i-jdan/MySDK/android-ndk-r9b/platforms/android-19/arch-arm/usr/include/sys/cdefs.h: 15 | 16 | /Users/i-mac/i-jdan/MySDK/android-ndk-r9b/platforms/android-19/arch-arm/usr/include/sys/cdefs_elf.h: 17 | 18 | /Users/i-mac/i-jdan/MySDK/android-ndk-r9b/platforms/android-19/arch-arm/usr/include/android/api-level.h: 19 | 20 | jni/Memoryshare.h: 21 | -------------------------------------------------------------------------------- /obj/local/armeabi/objs/lossless/main.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Android/Android-MemorySahre/3f7061b76bcecab984c835b2411400233092c7b3/obj/local/armeabi/objs/lossless/main.o -------------------------------------------------------------------------------- /obj/local/armeabi/objs/lwcore/com_alibaba_laiwang_android_MemoryShare.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Android/Android-MemorySahre/3f7061b76bcecab984c835b2411400233092c7b3/obj/local/armeabi/objs/lwcore/com_alibaba_laiwang_android_MemoryShare.o -------------------------------------------------------------------------------- /obj/local/armeabi/objs/lwcore/com_alibaba_laiwang_android_MemoryShare.o.d: -------------------------------------------------------------------------------- 1 | obj/local/armeabi/objs/lwcore/com_alibaba_laiwang_android_MemoryShare.o: \ 2 | jni/com_alibaba_laiwang_android_MemoryShare.cpp \ 3 | jni/com_alibaba_laiwang_android_MemoryShare.h \ 4 | /Users/i-mac/i-jdan/MySDK/android-ndk-r9b/platforms/android-19/arch-arm/usr/include/jni.h \ 5 | /Users/i-mac/i-jdan/MySDK/android-ndk-r9b/platforms/android-19/arch-arm/usr/include/sys/cdefs.h \ 6 | /Users/i-mac/i-jdan/MySDK/android-ndk-r9b/platforms/android-19/arch-arm/usr/include/sys/cdefs_elf.h \ 7 | /Users/i-mac/i-jdan/MySDK/android-ndk-r9b/platforms/android-19/arch-arm/usr/include/android/api-level.h \ 8 | jni/Memoryshare.h 9 | 10 | jni/com_alibaba_laiwang_android_MemoryShare.h: 11 | 12 | /Users/i-mac/i-jdan/MySDK/android-ndk-r9b/platforms/android-19/arch-arm/usr/include/jni.h: 13 | 14 | /Users/i-mac/i-jdan/MySDK/android-ndk-r9b/platforms/android-19/arch-arm/usr/include/sys/cdefs.h: 15 | 16 | /Users/i-mac/i-jdan/MySDK/android-ndk-r9b/platforms/android-19/arch-arm/usr/include/sys/cdefs_elf.h: 17 | 18 | /Users/i-mac/i-jdan/MySDK/android-ndk-r9b/platforms/android-19/arch-arm/usr/include/android/api-level.h: 19 | 20 | jni/Memoryshare.h: 21 | -------------------------------------------------------------------------------- /obj/local/armeabi/objs/lwhelper/Memoryshare.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Android/Android-MemorySahre/3f7061b76bcecab984c835b2411400233092c7b3/obj/local/armeabi/objs/lwhelper/Memoryshare.o -------------------------------------------------------------------------------- /obj/local/armeabi/objs/lwhelper/com_alibaba_laiwang_android_MemoryShare.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Android/Android-MemorySahre/3f7061b76bcecab984c835b2411400233092c7b3/obj/local/armeabi/objs/lwhelper/com_alibaba_laiwang_android_MemoryShare.o -------------------------------------------------------------------------------- /obj/local/armeabi/objs/mpc/huffsv46.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Android/Android-MemorySahre/3f7061b76bcecab984c835b2411400233092c7b3/obj/local/armeabi/objs/mpc/huffsv46.o -------------------------------------------------------------------------------- /obj/local/armeabi/objs/mpc/huffsv7.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Android/Android-MemorySahre/3f7061b76bcecab984c835b2411400233092c7b3/obj/local/armeabi/objs/mpc/huffsv7.o -------------------------------------------------------------------------------- /obj/local/armeabi/objs/mpc/idtag.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Android/Android-MemorySahre/3f7061b76bcecab984c835b2411400233092c7b3/obj/local/armeabi/objs/mpc/idtag.o -------------------------------------------------------------------------------- /obj/local/armeabi/objs/mpc/main.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Android/Android-MemorySahre/3f7061b76bcecab984c835b2411400233092c7b3/obj/local/armeabi/objs/mpc/main.o -------------------------------------------------------------------------------- /obj/local/armeabi/objs/mpc/mpc_decoder.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Android/Android-MemorySahre/3f7061b76bcecab984c835b2411400233092c7b3/obj/local/armeabi/objs/mpc/mpc_decoder.o -------------------------------------------------------------------------------- /obj/local/armeabi/objs/mpc/requant.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Android/Android-MemorySahre/3f7061b76bcecab984c835b2411400233092c7b3/obj/local/armeabi/objs/mpc/requant.o -------------------------------------------------------------------------------- /obj/local/armeabi/objs/mpc/streaminfo.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Android/Android-MemorySahre/3f7061b76bcecab984c835b2411400233092c7b3/obj/local/armeabi/objs/mpc/streaminfo.o -------------------------------------------------------------------------------- /obj/local/armeabi/objs/mpc/synth_filter.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Android/Android-MemorySahre/3f7061b76bcecab984c835b2411400233092c7b3/obj/local/armeabi/objs/mpc/synth_filter.o -------------------------------------------------------------------------------- /obj/local/armeabi/objs/wav/main.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Android/Android-MemorySahre/3f7061b76bcecab984c835b2411400233092c7b3/obj/local/armeabi/objs/wav/main.o -------------------------------------------------------------------------------- /obj/local/armeabi/objs/wv/arm.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Android/Android-MemorySahre/3f7061b76bcecab984c835b2411400233092c7b3/obj/local/armeabi/objs/wv/arm.o -------------------------------------------------------------------------------- /obj/local/armeabi/objs/wv/arm.o.d: -------------------------------------------------------------------------------- 1 | obj/local/armeabi/objs/wv/arm.o: jni/wv/arm.S 2 | -------------------------------------------------------------------------------- /obj/local/armeabi/objs/wv/arml.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Android/Android-MemorySahre/3f7061b76bcecab984c835b2411400233092c7b3/obj/local/armeabi/objs/wv/arml.o -------------------------------------------------------------------------------- /obj/local/armeabi/objs/wv/arml.o.d: -------------------------------------------------------------------------------- 1 | obj/local/armeabi/objs/wv/arml.o: jni/wv/arml.S 2 | -------------------------------------------------------------------------------- /obj/local/armeabi/objs/wv/float.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Android/Android-MemorySahre/3f7061b76bcecab984c835b2411400233092c7b3/obj/local/armeabi/objs/wv/float.o -------------------------------------------------------------------------------- /obj/local/armeabi/objs/wv/main.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Android/Android-MemorySahre/3f7061b76bcecab984c835b2411400233092c7b3/obj/local/armeabi/objs/wv/main.o -------------------------------------------------------------------------------- /obj/local/armeabi/objs/wv/metadata.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Android/Android-MemorySahre/3f7061b76bcecab984c835b2411400233092c7b3/obj/local/armeabi/objs/wv/metadata.o -------------------------------------------------------------------------------- /obj/local/armeabi/objs/wv/pack.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Android/Android-MemorySahre/3f7061b76bcecab984c835b2411400233092c7b3/obj/local/armeabi/objs/wv/pack.o -------------------------------------------------------------------------------- /obj/local/armeabi/objs/wv/unpack.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Android/Android-MemorySahre/3f7061b76bcecab984c835b2411400233092c7b3/obj/local/armeabi/objs/wv/unpack.o -------------------------------------------------------------------------------- /obj/local/armeabi/objs/wv/words.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Android/Android-MemorySahre/3f7061b76bcecab984c835b2411400233092c7b3/obj/local/armeabi/objs/wv/words.o -------------------------------------------------------------------------------- /obj/local/armeabi/objs/wv/wputils.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Android/Android-MemorySahre/3f7061b76bcecab984c835b2411400233092c7b3/obj/local/armeabi/objs/wv/wputils.o -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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-19 15 | -------------------------------------------------------------------------------- /res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Android/Android-MemorySahre/3f7061b76bcecab984c835b2411400233092c7b3/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Android/Android-MemorySahre/3f7061b76bcecab984c835b2411400233092c7b3/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /res/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Android/Android-MemorySahre/3f7061b76bcecab984c835b2411400233092c7b3/res/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /res/drawable-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-Android/Android-MemorySahre/3f7061b76bcecab984c835b2411400233092c7b3/res/drawable-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 10 | 11 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /res/menu/main.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /res/values-sw600dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /res/values-sw720dp-land/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 128dp 8 | 9 | 10 | -------------------------------------------------------------------------------- /res/values-v11/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /res/values-v14/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 16dp 5 | 16dp 6 | 7 | 8 | -------------------------------------------------------------------------------- /res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Android-MemoryShare 5 | Settings 6 | Hello world! 7 | 8 | 9 | -------------------------------------------------------------------------------- /res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 14 | 15 | 16 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /src/com/alibaba/laiwang/android/IMemoryShare.aidl: -------------------------------------------------------------------------------- 1 | package com.alibaba.laiwang.android; 2 | import android.os.ParcelFileDescriptor; 3 | 4 | interface IMemoryShare { 5 | ParcelFileDescriptor getShmFD(); 6 | } -------------------------------------------------------------------------------- /src/com/alibaba/laiwang/android/MemoryService.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.laiwang.android; 2 | 3 | import java.io.IOException; 4 | 5 | import android.annotation.SuppressLint; 6 | import android.app.Service; 7 | import android.content.Intent; 8 | import android.os.IBinder; 9 | import android.os.ParcelFileDescriptor; 10 | import android.os.RemoteException; 11 | import android.util.Log; 12 | 13 | public class MemoryService extends Service{ 14 | 15 | private static final String TAG = "libSHM"; 16 | private MemoryShare mMemoryShare; 17 | private MemoryImpl mMemoryImpl; 18 | 19 | @Override 20 | public void onCreate() { 21 | 22 | Log.e(TAG, "service onCreate"); 23 | 24 | mMemoryImpl = new MemoryImpl(); 25 | mMemoryShare = new MemoryShare(); 26 | mMemoryShare.init(); 27 | mMemoryShare.open(); 28 | mMemoryShare.mmap(0); 29 | mMemoryShare.write(); 30 | mMemoryShare.read(); 31 | 32 | super.onCreate(); 33 | } 34 | 35 | @Override 36 | public IBinder onBind(Intent intent) { 37 | return mMemoryImpl; 38 | } 39 | 40 | protected void onHandleIntent(Intent intent) { 41 | Log.e(TAG, "intent"); 42 | } 43 | 44 | @Override 45 | public void onDestroy() { 46 | mMemoryShare.close(); 47 | super.onDestroy(); 48 | } 49 | 50 | class MemoryImpl extends IMemoryShare.Stub { 51 | 52 | @SuppressLint("NewApi") 53 | @Override 54 | public ParcelFileDescriptor getShmFD() throws RemoteException { 55 | try { 56 | return ParcelFileDescriptor.fromFd(mMemoryShare.mFD); 57 | } catch (IOException e) { 58 | e.printStackTrace(); 59 | } 60 | return null; 61 | } 62 | 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /src/com/alibaba/laiwang/android/MemoryShare.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.laiwang.android; 2 | 3 | import android.os.Build; 4 | import android.os.Build.VERSION_CODES; 5 | 6 | 7 | 8 | public class MemoryShare { 9 | 10 | static { 11 | if (VERSION_CODES.JELLY_BEAN == Integer.parseInt(Build.VERSION.SDK)) { 12 | System.loadLibrary("atrack16"); 13 | } 14 | 15 | System.loadLibrary("lwhelper"); 16 | } 17 | 18 | public int init() { 19 | 20 | this.mHandler = native_init(); 21 | return 0; 22 | } 23 | 24 | public int open() { 25 | native_open(this.mHandler); 26 | return 0; 27 | } 28 | 29 | public int mmap(int fd) { 30 | this.mFD = native_mmap(this.mHandler, fd); 31 | return 0; 32 | } 33 | 34 | public int close() { 35 | native_close(this.mHandler); 36 | return 0; 37 | } 38 | 39 | 40 | public int write() { 41 | native_write(this.mHandler); 42 | return 0; 43 | } 44 | 45 | public int read() { 46 | native_read(this.mHandler); 47 | return 0; 48 | } 49 | 50 | private native int native_init(); 51 | private native int native_open(int handler); 52 | private native int native_mmap(int handler, int fd); 53 | private native int native_close(int handler); 54 | private native int native_read(int handler); 55 | private native int native_write(int handler); 56 | private native int native_unmmap(); 57 | 58 | 59 | private int mHandler; 60 | 61 | public int mFD; 62 | 63 | } 64 | -------------------------------------------------------------------------------- /src/com/example/android_memoryshare/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.example.android_memoryshare; 2 | 3 | import android.annotation.SuppressLint; 4 | import android.app.Activity; 5 | import android.os.Bundle; 6 | import android.view.Menu; 7 | import android.view.View; 8 | import android.view.View.OnClickListener; 9 | 10 | import com.alibaba.laiwang.android.MemoryClient; 11 | 12 | public class MainActivity extends Activity { 13 | 14 | private MemoryClient mMemoryClient; 15 | 16 | @SuppressLint("NewApi") 17 | @Override 18 | protected void onCreate(Bundle savedInstanceState) { 19 | super.onCreate(savedInstanceState); 20 | setContentView(R.layout.activity_main); 21 | 22 | mMemoryClient = new MemoryClient(); 23 | 24 | mMemoryClient.startService(this); 25 | 26 | this.findViewById(R.id.btnShare).setOnClickListener(new OnClickListener() { 27 | 28 | @Override 29 | public void onClick(View v) { 30 | mMemoryClient.readSHM(); 31 | } 32 | }); 33 | } 34 | 35 | @Override 36 | public boolean onCreateOptionsMenu(Menu menu) { 37 | getMenuInflater().inflate(R.menu.main, menu); 38 | return true; 39 | } 40 | 41 | @Override 42 | protected void onResume() { 43 | super.onResume(); 44 | } 45 | 46 | @Override 47 | protected void onDestroy() { 48 | super.onDestroy(); 49 | } 50 | 51 | } 52 | --------------------------------------------------------------------------------