├── .clang-format ├── .github └── ISSUE_TEMPLATE.md ├── .gitignore ├── .travis.yml ├── AUTHORS ├── Android.mk ├── CMakeLists.txt ├── COPYING.GPL ├── README.md ├── android ├── CMakeLists.txt ├── anbox-touch.idc ├── anboxd.rc ├── appmgr │ ├── Android.mk │ ├── AndroidManifest.xml │ ├── res │ │ ├── layout │ │ │ ├── app_view.xml │ │ │ └── list_item_icon_text.xml │ │ └── values │ │ │ ├── dimens.xml │ │ │ └── strings.xml │ └── src │ │ └── org │ │ └── anbox │ │ └── appmgr │ │ ├── AppListAdapter.java │ │ ├── AppListFragment.java │ │ ├── AppModel.java │ │ ├── AppViewActivity.java │ │ ├── AppsGridFragment.java │ │ ├── AppsLoader.java │ │ ├── GridFragment.java │ │ ├── LauncherActivity.java │ │ ├── LauncherService.java │ │ ├── MainApplication.java │ │ ├── PackageEventReceiver.java │ │ ├── PackageIntentReceiver.java │ │ └── PlatformService.java ├── audio │ ├── MODULE_LICENSE_APACHE2 │ ├── NOTICE │ └── audio_hw.cpp ├── camera │ ├── Android.mk │ ├── CallbackNotifier.cpp │ ├── CallbackNotifier.h │ ├── Converters.cpp │ ├── Converters.h │ ├── EmulatedBaseCamera.cpp │ ├── EmulatedBaseCamera.h │ ├── EmulatedCamera.cpp │ ├── EmulatedCamera.h │ ├── EmulatedCamera2.cpp │ ├── EmulatedCamera2.h │ ├── EmulatedCamera3.cpp │ ├── EmulatedCamera3.h │ ├── EmulatedCameraCommon.h │ ├── EmulatedCameraDevice.cpp │ ├── EmulatedCameraDevice.h │ ├── EmulatedCameraFactory.cpp │ ├── EmulatedCameraFactory.h │ ├── EmulatedCameraHal.cpp │ ├── EmulatedCameraHotplugThread.cpp │ ├── EmulatedCameraHotplugThread.h │ ├── EmulatedFakeCamera.cpp │ ├── EmulatedFakeCamera.h │ ├── EmulatedFakeCamera2.cpp │ ├── EmulatedFakeCamera2.h │ ├── EmulatedFakeCamera3.cpp │ ├── EmulatedFakeCamera3.h │ ├── EmulatedFakeCameraDevice.cpp │ ├── EmulatedFakeCameraDevice.h │ ├── EmulatedQemuCamera.cpp │ ├── EmulatedQemuCamera.h │ ├── EmulatedQemuCamera2.cpp │ ├── EmulatedQemuCamera2.h │ ├── EmulatedQemuCameraDevice.cpp │ ├── EmulatedQemuCameraDevice.h │ ├── JpegCompressor.cpp │ ├── JpegCompressor.h │ ├── JpegStub.cpp │ ├── JpegStub.h │ ├── PreviewWindow.cpp │ ├── PreviewWindow.h │ ├── QemuClient.cpp │ ├── QemuClient.h │ ├── fake-pipeline2 │ │ ├── Base.h │ │ ├── JpegCompressor.cpp │ │ ├── JpegCompressor.h │ │ ├── Scene.cpp │ │ ├── Scene.h │ │ ├── Sensor.cpp │ │ └── Sensor.h │ ├── media_codecs.xml │ └── media_profiles.xml ├── data │ └── etc │ │ └── apns-conf.xml ├── fingerprint │ ├── Android.mk │ └── fingerprint.c ├── fstab.goldfish ├── gps │ ├── Android.mk │ └── gps_qemu.c ├── hwcomposer │ └── hwcomposer.cpp ├── init.goldfish.rc ├── init.goldfish.sh ├── lights │ ├── Android.mk │ └── lights_qemu.c ├── opengl │ ├── Android.mk │ ├── README │ ├── common.mk │ ├── host │ │ └── include │ │ │ └── libOpenglRender │ │ │ └── IOStream.h │ ├── shared │ │ └── OpenglCodecCommon │ │ │ ├── Android.mk │ │ │ ├── ChecksumCalculator.cpp │ │ │ ├── ChecksumCalculator.h │ │ │ ├── ErrorLog.h │ │ │ ├── FixedBuffer.h │ │ │ ├── GLClientState.cpp │ │ │ ├── GLClientState.h │ │ │ ├── GLSharedGroup.cpp │ │ │ ├── GLSharedGroup.h │ │ │ ├── Makefile │ │ │ ├── SmartPtr.h │ │ │ ├── SocketStream.cpp │ │ │ ├── SocketStream.h │ │ │ ├── TcpStream.cpp │ │ │ ├── TcpStream.h │ │ │ ├── codec_defs.h │ │ │ ├── glUtils.cpp │ │ │ ├── glUtils.h │ │ │ └── gl_base_types.h │ ├── system │ │ ├── GLESv1 │ │ │ ├── Android.mk │ │ │ └── gl.cpp │ │ ├── GLESv1_enc │ │ │ ├── Android.mk │ │ │ ├── GLEncoder.cpp │ │ │ ├── GLEncoder.h │ │ │ ├── GLEncoderUtils.cpp │ │ │ ├── GLEncoderUtils.h │ │ │ ├── gl_client_context.cpp │ │ │ ├── gl_client_context.h │ │ │ ├── gl_client_proc.h │ │ │ ├── gl_enc.cpp │ │ │ ├── gl_enc.h │ │ │ ├── gl_entry.cpp │ │ │ ├── gl_ftable.h │ │ │ ├── gl_opcodes.h │ │ │ └── gl_types.h │ │ ├── GLESv2 │ │ │ ├── Android.mk │ │ │ └── gl2.cpp │ │ ├── GLESv2_enc │ │ │ ├── Android.mk │ │ │ ├── GL2Encoder.cpp │ │ │ ├── GL2Encoder.h │ │ │ ├── GL2EncoderUtils.cpp │ │ │ ├── GL2EncoderUtils.h │ │ │ ├── gl2_client_context.cpp │ │ │ ├── gl2_client_context.h │ │ │ ├── gl2_client_proc.h │ │ │ ├── gl2_enc.cpp │ │ │ ├── gl2_enc.h │ │ │ ├── gl2_entry.cpp │ │ │ ├── gl2_ftable.h │ │ │ ├── gl2_opcodes.h │ │ │ └── gl2_types.h │ │ ├── OpenglSystemCommon │ │ │ ├── Android.mk │ │ │ ├── EGLClientIface.h │ │ │ ├── EGLImage.h │ │ │ ├── HostConnection.cpp │ │ │ ├── HostConnection.h │ │ │ ├── QemuPipeStream.cpp │ │ │ ├── QemuPipeStream.h │ │ │ ├── ThreadInfo.cpp │ │ │ ├── ThreadInfo.h │ │ │ └── gralloc_cb.h │ │ ├── egl │ │ │ ├── Android.mk │ │ │ ├── ClientAPIExts.cpp │ │ │ ├── ClientAPIExts.h │ │ │ ├── ClientAPIExts.in │ │ │ ├── egl.cfg │ │ │ ├── egl.cpp │ │ │ ├── eglContext.h │ │ │ ├── eglDisplay.cpp │ │ │ ├── eglDisplay.h │ │ │ └── egl_ftable.h │ │ ├── gralloc │ │ │ ├── Android.mk │ │ │ └── gralloc.cpp │ │ └── renderControl_enc │ │ │ ├── Android.mk │ │ │ ├── README │ │ │ ├── renderControl.attrib │ │ │ ├── renderControl.in │ │ │ ├── renderControl.types │ │ │ ├── renderControl_client_base.h │ │ │ ├── renderControl_client_context.cpp │ │ │ ├── renderControl_client_context.h │ │ │ ├── renderControl_client_proc.h │ │ │ ├── renderControl_enc.cpp │ │ │ ├── renderControl_enc.h │ │ │ ├── renderControl_entry.cpp │ │ │ ├── renderControl_ftable.h │ │ │ ├── renderControl_opcodes.h │ │ │ └── renderControl_types.h │ └── tests │ │ ├── gles_android_wrapper │ │ ├── Android.mk │ │ ├── ApiInitializer.h │ │ ├── CleanSpec.mk │ │ ├── ServerConnection.cpp │ │ ├── ServerConnection.h │ │ ├── ThreadInfo.cpp │ │ ├── ThreadInfo.h │ │ ├── egl.cfg │ │ ├── egl.cpp │ │ ├── egl_dispatch.cpp │ │ ├── egl_dispatch.h │ │ ├── egl_ftable.h │ │ ├── egl_proc.h │ │ ├── gles.cpp │ │ ├── gles_dispatch.cpp │ │ ├── gles_dispatch.h │ │ ├── gles_emul.cfg │ │ ├── gles_ftable.h │ │ ├── gles_proc.h │ │ ├── glesv1_emul_ifc.cpp │ │ └── glesv2_emul_ifc.cpp │ │ └── ut_rendercontrol_enc │ │ ├── Android.mk │ │ ├── ut_rendercontrol.attrib │ │ ├── ut_rendercontrol.in │ │ ├── ut_rendercontrol.types │ │ └── ut_rendercontrol_types.h ├── power │ ├── Android.mk │ └── power_qemu.c ├── qemu-props │ ├── Android.mk │ └── qemu-props.c ├── qemud │ ├── Android.mk │ └── qemud.c ├── sensors │ ├── Android.mk │ └── sensors_qemu.c ├── service │ ├── activity_manager_interface.cpp │ ├── activity_manager_interface.h │ ├── android_api_skeleton.cpp │ ├── android_api_skeleton.h │ ├── daemon.cpp │ ├── daemon.h │ ├── host_connector.cpp │ ├── host_connector.h │ ├── local_socket_connection.cpp │ ├── local_socket_connection.h │ ├── main.cpp │ ├── message_processor.cpp │ ├── message_processor.h │ ├── platform_api_stub.cpp │ ├── platform_api_stub.h │ ├── platform_server_proxy.cpp │ ├── platform_server_proxy.h │ ├── platform_service.cpp │ ├── platform_service.h │ ├── platform_service_interface.cpp │ └── platform_service_interface.h ├── ueventd.goldfish.rc └── vibrator │ ├── Android.mk │ └── vibrator_qemu.c ├── cmake ├── FindEGL.cmake ├── FindGLESv2.cmake ├── FindGMock.cmake └── LinuxCrossCompile.cmake ├── cmake_uninstall.cmake.in ├── cross-compile-chroot.sh ├── data ├── anbox.desktop ├── apparmor.json ├── manifest.json ├── ui │ └── loading-screen.png └── xsession.conf ├── debian ├── README.Debian ├── anbox-common.install ├── anbox-modules-dkms.install ├── anbox-modules-dkms.postinst ├── anbox-modules-dkms.prerm ├── changelog ├── compat ├── control ├── copyright ├── dirs ├── rules └── source │ ├── format │ └── options ├── docs ├── architecture.png ├── build-android.md ├── generate-emugl-source.md └── runtime-setup.md ├── external ├── CMakeLists.txt ├── android-emugl │ ├── CMakeLists.txt │ ├── DESIGN │ ├── README │ ├── README.anbox │ ├── common.mk │ ├── googletest.mk │ ├── host │ │ ├── CMakeLists.txt │ │ ├── include │ │ │ ├── ETC1 │ │ │ │ └── etc1.h │ │ │ ├── GLES │ │ │ │ ├── gl.h │ │ │ │ ├── glext.h │ │ │ │ └── glplatform.h │ │ │ ├── OpenGLESDispatch │ │ │ │ ├── EGLDispatch.h │ │ │ │ ├── GLESv1Dispatch.h │ │ │ │ ├── GLESv2Dispatch.h │ │ │ │ ├── gldefs.h │ │ │ │ └── gles_functions.h │ │ │ └── libOpenglRender │ │ │ │ └── IOStream.h │ │ ├── libs │ │ │ ├── CMakeLists.txt │ │ │ ├── GLESv1_dec │ │ │ │ ├── CMakeLists.txt │ │ │ │ ├── GLESv1Decoder.cpp │ │ │ │ ├── GLESv1Decoder.h │ │ │ │ ├── gles1.addon │ │ │ │ ├── gles1.attrib │ │ │ │ ├── gles1.in │ │ │ │ ├── gles1.types │ │ │ │ └── gles1_types.h │ │ │ ├── GLESv2_dec │ │ │ │ ├── CMakeLists.txt │ │ │ │ ├── GLESv2Decoder.cpp │ │ │ │ ├── GLESv2Decoder.h │ │ │ │ ├── gles2.attrib │ │ │ │ ├── gles2.in │ │ │ │ ├── gles2.types │ │ │ │ └── gles2_types.h │ │ │ ├── Translator │ │ │ │ ├── CMakeLists.txt │ │ │ │ ├── EGL │ │ │ │ │ ├── Android.mk │ │ │ │ │ ├── CMakeLists.txt │ │ │ │ │ ├── ClientAPIExts.cpp │ │ │ │ │ ├── ClientAPIExts.h │ │ │ │ │ ├── ClientAPIExts.in │ │ │ │ │ ├── EglConfig.cpp │ │ │ │ │ ├── EglConfig.h │ │ │ │ │ ├── EglContext.cpp │ │ │ │ │ ├── EglContext.h │ │ │ │ │ ├── EglDisplay.cpp │ │ │ │ │ ├── EglDisplay.h │ │ │ │ │ ├── EglGlobalInfo.cpp │ │ │ │ │ ├── EglGlobalInfo.h │ │ │ │ │ ├── EglImp.cpp │ │ │ │ │ ├── EglOsApi.h │ │ │ │ │ ├── EglOsApi_darwin.cpp │ │ │ │ │ ├── EglOsApi_glx.cpp │ │ │ │ │ ├── EglOsApi_mir.cpp │ │ │ │ │ ├── EglOsApi_null.cpp │ │ │ │ │ ├── EglOsApi_wgl.cpp │ │ │ │ │ ├── EglPbufferSurface.cpp │ │ │ │ │ ├── EglPbufferSurface.h │ │ │ │ │ ├── EglSurface.cpp │ │ │ │ │ ├── EglSurface.h │ │ │ │ │ ├── EglThreadInfo.cpp │ │ │ │ │ ├── EglThreadInfo.h │ │ │ │ │ ├── EglValidate.cpp │ │ │ │ │ ├── EglValidate.h │ │ │ │ │ ├── EglWindowSurface.cpp │ │ │ │ │ ├── EglWindowSurface.h │ │ │ │ │ ├── MacNative.h │ │ │ │ │ ├── MacNative.m │ │ │ │ │ ├── MacPixelFormatsAttribs.h │ │ │ │ │ ├── MacPixelFormatsAttribs.m │ │ │ │ │ ├── ThreadInfo.cpp │ │ │ │ │ └── ThreadInfo.h │ │ │ │ ├── GLES_CM │ │ │ │ │ ├── Android.mk │ │ │ │ │ ├── CMakeLists.txt │ │ │ │ │ ├── GLEScmContext.cpp │ │ │ │ │ ├── GLEScmContext.h │ │ │ │ │ ├── GLEScmImp.cpp │ │ │ │ │ ├── GLEScmUtils.cpp │ │ │ │ │ ├── GLEScmUtils.h │ │ │ │ │ ├── GLEScmValidate.cpp │ │ │ │ │ └── GLEScmValidate.h │ │ │ │ ├── GLES_V2 │ │ │ │ │ ├── .GLESv2Imp.cpp.swp │ │ │ │ │ ├── Android.mk │ │ │ │ │ ├── CMakeLists.txt │ │ │ │ │ ├── GLESv2Context.cpp │ │ │ │ │ ├── GLESv2Context.h │ │ │ │ │ ├── GLESv2Imp.cpp │ │ │ │ │ ├── GLESv2Validate.cpp │ │ │ │ │ ├── GLESv2Validate.h │ │ │ │ │ ├── ProgramData.cpp │ │ │ │ │ ├── ProgramData.h │ │ │ │ │ ├── ShaderParser.cpp │ │ │ │ │ └── ShaderParser.h │ │ │ │ ├── GLcommon │ │ │ │ │ ├── Android.mk │ │ │ │ │ ├── CMakeLists.txt │ │ │ │ │ ├── FramebufferData.cpp │ │ │ │ │ ├── GLDispatch.cpp │ │ │ │ │ ├── GLESbuffer.cpp │ │ │ │ │ ├── GLEScontext.cpp │ │ │ │ │ ├── GLESpointer.cpp │ │ │ │ │ ├── GLESvalidate.cpp │ │ │ │ │ ├── GLutils.cpp │ │ │ │ │ ├── PaletteTexture.cpp │ │ │ │ │ ├── RangeManip.cpp │ │ │ │ │ ├── TextureUtils.cpp │ │ │ │ │ ├── etc1.cpp │ │ │ │ │ └── objectNameManager.cpp │ │ │ │ └── include │ │ │ │ │ └── GLcommon │ │ │ │ │ ├── FramebufferData.h │ │ │ │ │ ├── GLDispatch.h │ │ │ │ │ ├── GLESbuffer.h │ │ │ │ │ ├── GLEScontext.h │ │ │ │ │ ├── GLESmacros.h │ │ │ │ │ ├── GLESpointer.h │ │ │ │ │ ├── GLESvalidate.h │ │ │ │ │ ├── GLLibrary.h │ │ │ │ │ ├── GLconversion_macros.h │ │ │ │ │ ├── GLutils.h │ │ │ │ │ ├── PaletteTexture.h │ │ │ │ │ ├── RangeManip.h │ │ │ │ │ ├── TextureUtils.h │ │ │ │ │ ├── TranslatorIfaces.h │ │ │ │ │ ├── etc1.h │ │ │ │ │ └── objectNameManager.h │ │ │ ├── libOpenGLESDispatch │ │ │ │ ├── CMakeLists.txt │ │ │ │ ├── EGLDispatch.cpp │ │ │ │ ├── GLESv1Dispatch.cpp │ │ │ │ ├── GLESv2Dispatch.cpp │ │ │ │ ├── gles1_extensions.entries │ │ │ │ ├── gles1_only.entries │ │ │ │ ├── gles2_extensions.entries │ │ │ │ ├── gles2_only.entries │ │ │ │ ├── gles3_only.entries │ │ │ │ ├── gles_common.entries │ │ │ │ ├── gles_extensions.entries │ │ │ │ ├── render_egl.entries │ │ │ │ └── render_egl_extensions.entries │ │ │ └── renderControl_dec │ │ │ │ ├── CMakeLists.txt │ │ │ │ ├── renderControl.attrib │ │ │ │ ├── renderControl.in │ │ │ │ ├── renderControl.types │ │ │ │ └── renderControl_types.h │ │ └── tools │ │ │ ├── CMakeLists.txt │ │ │ └── emugen │ │ │ ├── ApiGen.cpp │ │ │ ├── ApiGen.h │ │ │ ├── CMakeLists.txt │ │ │ ├── EntryPoint.cpp │ │ │ ├── EntryPoint.h │ │ │ ├── Parser.cpp │ │ │ ├── Parser.h │ │ │ ├── Parser_unittest.cpp │ │ │ ├── README │ │ │ ├── TypeFactory.cpp │ │ │ ├── TypeFactory.h │ │ │ ├── Var.h │ │ │ ├── VarType.h │ │ │ ├── errors.h │ │ │ ├── getopt.c │ │ │ ├── getopt.h │ │ │ ├── main.cpp │ │ │ ├── strUtils.cpp │ │ │ ├── strUtils.h │ │ │ └── tests │ │ │ ├── run-tests.sh │ │ │ └── t.001 │ │ │ ├── expected │ │ │ ├── decoder │ │ │ │ ├── foo_dec.cpp │ │ │ │ ├── foo_dec.h │ │ │ │ ├── foo_opcodes.h │ │ │ │ ├── foo_server_context.cpp │ │ │ │ ├── foo_server_context.h │ │ │ │ └── foo_server_proc.h │ │ │ ├── encoder │ │ │ │ ├── foo_client_context.cpp │ │ │ │ ├── foo_client_context.h │ │ │ │ ├── foo_client_proc.h │ │ │ │ ├── foo_enc.cpp │ │ │ │ ├── foo_enc.h │ │ │ │ ├── foo_entry.cpp │ │ │ │ ├── foo_ftable.h │ │ │ │ └── foo_opcodes.h │ │ │ └── wrapper │ │ │ │ ├── foo_wrapper_context.cpp │ │ │ │ ├── foo_wrapper_context.h │ │ │ │ ├── foo_wrapper_entry.cpp │ │ │ │ └── foo_wrapper_proc.h │ │ │ └── input │ │ │ ├── foo.attrib │ │ │ ├── foo.in │ │ │ └── foo.types │ ├── scripts │ │ └── gen-headers.sh │ └── shared │ │ ├── CMakeLists.txt │ │ ├── OpenglCodecCommon │ │ ├── CMakeLists.txt │ │ ├── ChecksumCalculator.cpp │ │ ├── ChecksumCalculator.h │ │ ├── ChecksumCalculatorThreadInfo.cpp │ │ ├── ChecksumCalculatorThreadInfo.h │ │ ├── ErrorLog.h │ │ ├── GLDecoderContextData.h │ │ ├── Makefile │ │ ├── ProtocolUtils.h │ │ ├── glUtils.cpp │ │ ├── glUtils.h │ │ └── gl_base_types.h │ │ └── emugl │ │ ├── CMakeLists.txt │ │ └── common │ │ ├── CMakeLists.txt │ │ ├── condition_variable.h │ │ ├── condition_variable_unittest.cpp │ │ ├── condition_variable_win32.cpp │ │ ├── crash_reporter.cpp │ │ ├── crash_reporter.h │ │ ├── id_to_object_map.cpp │ │ ├── id_to_object_map.h │ │ ├── id_to_object_map_unittest.cpp │ │ ├── lazy_instance.cpp │ │ ├── lazy_instance.h │ │ ├── lazy_instance_unittest.cpp │ │ ├── logging.cpp │ │ ├── logging.h │ │ ├── message_channel.cpp │ │ ├── message_channel.h │ │ ├── message_channel_unittest.cpp │ │ ├── mutex.h │ │ ├── mutex_unittest.cpp │ │ ├── pod_vector.cpp │ │ ├── pod_vector.h │ │ ├── pod_vector_unittest.cpp │ │ ├── scoped_pointer_vector.h │ │ ├── shared_library.cpp │ │ ├── shared_library.h │ │ ├── shared_library_unittest.cpp │ │ ├── smart_ptr.cpp │ │ ├── smart_ptr.h │ │ ├── smart_ptr_unittest.cpp │ │ ├── sockets.cpp │ │ ├── sockets.h │ │ ├── testing │ │ ├── test_shared_library.cpp │ │ └── test_thread.h │ │ ├── thread.h │ │ ├── thread_pthread.cpp │ │ ├── thread_store.cpp │ │ ├── thread_store.h │ │ ├── thread_store_unittest.cpp │ │ ├── thread_unittest.cpp │ │ ├── thread_win32.cpp │ │ ├── unique_integer_map.h │ │ └── unique_integer_map_unittest.cpp ├── nsexec │ └── uidmapshift.c ├── process-cpp-minimal │ ├── CMakeLists.txt │ ├── COPYING │ ├── README.md │ ├── include │ │ └── core │ │ │ ├── connection.h │ │ │ ├── posix │ │ │ ├── child_process.h │ │ │ ├── exec.h │ │ │ ├── exit.h │ │ │ ├── fork.h │ │ │ ├── linux │ │ │ │ └── proc │ │ │ │ │ └── process │ │ │ │ │ ├── oom_adj.h │ │ │ │ │ ├── oom_score.h │ │ │ │ │ ├── oom_score_adj.h │ │ │ │ │ ├── stat.h │ │ │ │ │ └── state.h │ │ │ ├── process.h │ │ │ ├── process_group.h │ │ │ ├── signal.h │ │ │ ├── signalable.h │ │ │ ├── standard_stream.h │ │ │ ├── this_process.h │ │ │ ├── visibility.h │ │ │ └── wait.h │ │ │ ├── signal.h │ │ │ └── testing │ │ │ ├── cross_process_sync.h │ │ │ └── fork_and_run.h │ ├── src │ │ ├── CMakeLists.txt │ │ └── core │ │ │ ├── posix │ │ │ ├── CMakeLists.txt │ │ │ ├── backtrace.cpp │ │ │ ├── backtrace.h │ │ │ ├── child_process.cpp │ │ │ ├── exec.cpp │ │ │ ├── fork.cpp │ │ │ ├── linux │ │ │ │ ├── CMakeLists.txt │ │ │ │ └── proc │ │ │ │ │ └── process │ │ │ │ │ ├── oom_adj.cpp │ │ │ │ │ ├── oom_score.cpp │ │ │ │ │ ├── oom_score_adj.cpp │ │ │ │ │ ├── stat.cpp │ │ │ │ │ └── state.cpp │ │ │ ├── process.cpp │ │ │ ├── process_group.cpp │ │ │ ├── signal.cpp │ │ │ ├── signalable.cpp │ │ │ ├── standard_stream.cpp │ │ │ ├── this_process.cpp │ │ │ └── wait.cpp │ │ │ └── testing │ │ │ ├── cross_process_sync.cpp │ │ │ └── fork_and_run.cpp │ └── symbols.map └── xdg │ ├── CMakeLists.txt │ ├── LICENSE │ ├── xdg.cpp │ ├── xdg.h │ └── xdg_test.cpp ├── kernel ├── 99-anbox.rules ├── anbox.conf ├── ashmem │ ├── Makefile │ ├── ashmem.c │ ├── ashmem.h │ ├── deps.c │ ├── dkms.conf │ └── uapi │ │ └── ashmem.h ├── binder │ ├── Makefile │ ├── binder.c │ ├── binder.h │ ├── binder_trace.h │ ├── deps.c │ └── dkms.conf └── patches │ ├── 0001-ipc-namespace-a-generic-per-ipc-pointer-and-peripc_o.patch │ └── 0002-binder-implement-namepsace-support-for-Android-binde.patch ├── products ├── AndroidProducts.mk ├── anbox.mk ├── anbox.xml ├── anbox_arm64.mk ├── anbox_armv7a_neon.mk ├── anbox_x86_64.mk ├── arm64 │ ├── BoardConfig.mk │ └── device.mk ├── armv7-a-neon │ ├── BoardConfig.mk │ └── device.mk ├── overlay │ └── frameworks │ │ └── base │ │ └── packages │ │ ├── SettingsProvider │ │ └── res │ │ │ └── values │ │ │ └── defaults.xml │ │ └── SystemUI │ │ └── res │ │ └── values │ │ └── config.xml ├── vendorsetup.sh └── x86_64 │ ├── BoardConfig.mk │ └── device.mk ├── robox ├── robox.json ├── scripts ├── anbox-bridge.sh ├── anbox-init.sh ├── android-sync.sh ├── build-with-docker.sh ├── clean-build.sh ├── clean-format.sh ├── collect-bug-info.sh ├── container-manager.sh ├── create-package.sh ├── gen-emugl-entries.py ├── gen-emugl-headers.sh ├── load-kmods.sh ├── mount-android.sh ├── setup-partial-chroot.sh ├── snap-wrapper.sh ├── start-container.sh └── update-emugl-sources.sh ├── snap └── gui │ ├── anbox.desktop │ └── icon.png ├── snapcraft.yaml ├── src ├── CMakeLists.txt ├── anbox │ ├── android │ │ ├── intent.cpp │ │ ├── intent.h │ │ ├── ip_config_builder.cpp │ │ └── ip_config_builder.h │ ├── application │ │ ├── database.cpp │ │ ├── database.h │ │ ├── launcher_storage.cpp │ │ ├── launcher_storage.h │ │ └── manager.h │ ├── audio │ │ ├── client_info.h │ │ ├── server.cpp │ │ ├── server.h │ │ ├── sink.h │ │ └── source.h │ ├── bridge │ │ ├── android_api_stub.cpp │ │ ├── android_api_stub.h │ │ ├── platform_api_skeleton.cpp │ │ ├── platform_api_skeleton.h │ │ ├── platform_message_processor.cpp │ │ └── platform_message_processor.h │ ├── build │ │ └── config.h.in │ ├── cli.cpp │ ├── cli.h │ ├── cmds │ │ ├── container_manager.cpp │ │ ├── container_manager.h │ │ ├── generate_ip_config.cpp │ │ ├── generate_ip_config.h │ │ ├── install.cpp │ │ ├── install.h │ │ ├── launch.cpp │ │ ├── launch.h │ │ ├── session_manager.cpp │ │ ├── session_manager.h │ │ ├── system_info.cpp │ │ ├── system_info.h │ │ ├── version.cpp │ │ └── version.h │ ├── common │ │ ├── binary_writer.cpp │ │ ├── binary_writer.h │ │ ├── dispatcher.cpp │ │ ├── dispatcher.h │ │ ├── fd.cpp │ │ ├── fd.h │ │ ├── fd_sets.h │ │ ├── loop_device.cpp │ │ ├── loop_device.h │ │ ├── loop_device_allocator.cpp │ │ ├── loop_device_allocator.h │ │ ├── message_channel.cpp │ │ ├── message_channel.h │ │ ├── mount_entry.cpp │ │ ├── mount_entry.h │ │ ├── scope_ptr.h │ │ ├── small_vector.h │ │ ├── type_traits.h │ │ ├── variable_length_array.h │ │ ├── wait_handle.cpp │ │ └── wait_handle.h │ ├── container │ │ ├── client.cpp │ │ ├── client.h │ │ ├── configuration.h │ │ ├── container.cpp │ │ ├── container.h │ │ ├── lxc_container.cpp │ │ ├── lxc_container.h │ │ ├── management_api_message_processor.cpp │ │ ├── management_api_message_processor.h │ │ ├── management_api_skeleton.cpp │ │ ├── management_api_skeleton.h │ │ ├── management_api_stub.cpp │ │ ├── management_api_stub.h │ │ ├── service.cpp │ │ └── service.h │ ├── daemon.cpp │ ├── daemon.h │ ├── dbus │ │ ├── codecs.h │ │ ├── interface.h │ │ ├── skeleton │ │ │ ├── application_manager.cpp │ │ │ ├── application_manager.h │ │ │ ├── service.cpp │ │ │ └── service.h │ │ └── stub │ │ │ ├── application_manager.cpp │ │ │ └── application_manager.h │ ├── defer_action.h │ ├── do_not_copy_or_move.h │ ├── graphics │ │ ├── buffer_queue.cpp │ │ ├── buffer_queue.h │ │ ├── buffered_io_stream.cpp │ │ ├── buffered_io_stream.h │ │ ├── density.h │ │ ├── emugl │ │ │ ├── ColorBuffer.cpp │ │ │ ├── ColorBuffer.h │ │ │ ├── DispatchTables.h │ │ │ ├── DisplayManager.cpp │ │ │ ├── DisplayManager.h │ │ │ ├── ReadBuffer.cpp │ │ │ ├── ReadBuffer.h │ │ │ ├── RenderApi.cpp │ │ │ ├── RenderApi.h │ │ │ ├── RenderContext.cpp │ │ │ ├── RenderContext.h │ │ │ ├── RenderControl.cpp │ │ │ ├── RenderControl.h │ │ │ ├── RenderThread.cpp │ │ │ ├── RenderThread.h │ │ │ ├── RenderThreadInfo.cpp │ │ │ ├── RenderThreadInfo.h │ │ │ ├── Renderable.cpp │ │ │ ├── Renderable.h │ │ │ ├── Renderer.cpp │ │ │ ├── Renderer.h │ │ │ ├── RendererConfig.cpp │ │ │ ├── RendererConfig.h │ │ │ ├── TextureDraw.cpp │ │ │ ├── TextureDraw.h │ │ │ ├── TextureResize.cpp │ │ │ ├── TextureResize.h │ │ │ ├── TimeUtils.cpp │ │ │ ├── TimeUtils.h │ │ │ ├── WindowSurface.cpp │ │ │ └── WindowSurface.h │ │ ├── gl_extensions.h │ │ ├── gl_renderer_server.cpp │ │ ├── gl_renderer_server.h │ │ ├── layer_composer.cpp │ │ ├── layer_composer.h │ │ ├── multi_window_composer_strategy.cpp │ │ ├── multi_window_composer_strategy.h │ │ ├── opengles_message_processor.cpp │ │ ├── opengles_message_processor.h │ │ ├── primitives.h │ │ ├── program_family.cpp │ │ ├── program_family.h │ │ ├── rect.cpp │ │ ├── rect.h │ │ ├── renderer.h │ │ ├── single_window_composer_strategy.cpp │ │ └── single_window_composer_strategy.h │ ├── input │ │ ├── device.cpp │ │ ├── device.h │ │ ├── manager.cpp │ │ └── manager.h │ ├── logger.cpp │ ├── logger.h │ ├── network │ │ ├── base_socket_messenger.cpp │ │ ├── base_socket_messenger.h │ │ ├── connection_context.cpp │ │ ├── connection_context.h │ │ ├── connection_creator.cpp │ │ ├── connection_creator.h │ │ ├── connections.h │ │ ├── connector.h │ │ ├── credentials.cpp │ │ ├── credentials.h │ │ ├── delegate_connection_creator.h │ │ ├── delegate_message_processor.cpp │ │ ├── delegate_message_processor.h │ │ ├── fd_socket_transmission.cpp │ │ ├── fd_socket_transmission.h │ │ ├── local_socket_messenger.cpp │ │ ├── local_socket_messenger.h │ │ ├── message_processor.h │ │ ├── message_receiver.h │ │ ├── message_sender.h │ │ ├── published_socket_connector.cpp │ │ ├── published_socket_connector.h │ │ ├── socket_connection.cpp │ │ ├── socket_connection.h │ │ ├── socket_helper.cpp │ │ ├── socket_helper.h │ │ ├── socket_messenger.cpp │ │ ├── socket_messenger.h │ │ ├── stream_socket_transport.cpp │ │ ├── stream_socket_transport.h │ │ ├── tcp_socket_connector.cpp │ │ ├── tcp_socket_connector.h │ │ ├── tcp_socket_messenger.cpp │ │ └── tcp_socket_messenger.h │ ├── not_reachable.cpp │ ├── not_reachable.h │ ├── optional.h │ ├── platform │ │ ├── base_platform.cpp │ │ ├── base_platform.h │ │ ├── null │ │ │ ├── platform.cpp │ │ │ └── platform.h │ │ └── sdl │ │ │ ├── audio_sink.cpp │ │ │ ├── audio_sink.h │ │ │ ├── keycode_converter.cpp │ │ │ ├── keycode_converter.h │ │ │ ├── mir_display_connection.cpp │ │ │ ├── mir_display_connection.h │ │ │ ├── platform.cpp │ │ │ ├── platform.h │ │ │ ├── sdl_wrapper.h │ │ │ ├── window.cpp │ │ │ └── window.h │ ├── protobuf │ │ ├── anbox_bridge.proto │ │ ├── anbox_container.proto │ │ ├── anbox_rpc.proto │ │ └── google_protobuf_guard.cpp │ ├── qemu │ │ ├── adb_message_processor.cpp │ │ ├── adb_message_processor.h │ │ ├── at_parser.cpp │ │ ├── at_parser.h │ │ ├── boot_properties_message_processor.cpp │ │ ├── boot_properties_message_processor.h │ │ ├── bootanimation_message_processor.cpp │ │ ├── bootanimation_message_processor.h │ │ ├── camera_message_processor.cpp │ │ ├── camera_message_processor.h │ │ ├── fingerprint_message_processor.cpp │ │ ├── fingerprint_message_processor.h │ │ ├── gsm_message_processor.cpp │ │ ├── gsm_message_processor.h │ │ ├── hwcontrol_message_processor.cpp │ │ ├── hwcontrol_message_processor.h │ │ ├── null_message_processor.cpp │ │ ├── null_message_processor.h │ │ ├── pipe_connection_creator.cpp │ │ ├── pipe_connection_creator.h │ │ ├── qemud_message_processor.cpp │ │ ├── qemud_message_processor.h │ │ ├── telephony_manager.cpp │ │ └── telephony_manager.h │ ├── rotation_status.h │ ├── rpc │ │ ├── channel.cpp │ │ ├── channel.h │ │ ├── connection_creator.cpp │ │ ├── connection_creator.h │ │ ├── constants.h │ │ ├── make_protobuf_object.h │ │ ├── message_processor.cpp │ │ ├── message_processor.h │ │ ├── pending_call_cache.cpp │ │ ├── pending_call_cache.h │ │ └── template_message_processor.h │ ├── runtime.cpp │ ├── runtime.h │ ├── sensors │ │ ├── sensors_common.h │ │ ├── sensors_data.cpp │ │ ├── sensors_data.h │ │ ├── sensors_manager.cpp │ │ ├── sensors_manager.h │ │ ├── sensors_message_processor.cpp │ │ ├── sensors_message_processor.h │ │ ├── sensors_sensor.cpp │ │ ├── sensors_sensor.h │ │ └── simulated_sensor_data.h │ ├── system_configuration.cpp │ ├── system_configuration.h │ ├── testing │ │ └── gtest_utils.h │ ├── ui │ │ ├── splash_screen.cpp │ │ └── splash_screen.h │ ├── utils.cpp │ ├── utils.h │ ├── utils │ │ ├── environment_file.cpp │ │ └── environment_file.h │ └── wm │ │ ├── display.cpp │ │ ├── display.h │ │ ├── manager.cpp │ │ ├── manager.h │ │ ├── multi_window_manager.cpp │ │ ├── multi_window_manager.h │ │ ├── single_window_manager.cpp │ │ ├── single_window_manager.h │ │ ├── stack.cpp │ │ ├── stack.h │ │ ├── task.cpp │ │ ├── task.h │ │ ├── window.cpp │ │ ├── window.h │ │ ├── window_state.cpp │ │ └── window_state.h └── main.cpp └── tests ├── CMakeLists.txt ├── anbox ├── CMakeLists.txt ├── android │ ├── CMakeLists.txt │ └── intent_tests.cpp ├── application │ ├── CMakeLists.txt │ └── restricted_manager_tests.cpp ├── common │ ├── CMakeLists.txt │ ├── binary_writer_tests.cpp │ ├── message_channel_tests.cpp │ ├── scope_ptr_tests.cpp │ ├── small_vector_tests.cpp │ └── type_traits_tests.cpp ├── graphics │ ├── CMakeLists.txt │ ├── buffer_queue_tests.cpp │ ├── buffered_io_stream_tests.cpp │ ├── layer_composer_tests.cpp │ └── render_control_tests.cpp └── support │ ├── CMakeLists.txt │ └── at_parser_tests.cpp └── robox └── scalability.sh /.clang-format: -------------------------------------------------------------------------------- 1 | # Defines the Chromium style for automatic reformatting. 2 | # http://clang.llvm.org/docs/ClangFormatStyleOptions.html 3 | BasedOnStyle: Google 4 | # This defaults to 'Auto'. Explicitly set it for a while, so that 5 | # 'vector >' in existing files gets formatted to 6 | # 'vector>'. ('Auto' means that clang-format will only use 7 | # 'int>>' if the file already contains at least one such instance.) 8 | Standard: Cpp11 9 | ColumnLimit: 0 10 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | Make sure you are running the latest version of Anbox before reporting an issue. 2 | 3 | Please also check that no similar bug is already reported. Have a look on the list of open bugs at https://github.com/anbox/anbox/issues 4 | 5 | ** Please paste the result of `anbox system-info` below:** 6 | ``` 7 | [please paste printout of `anbox system-info` here] 8 | ``` 9 | 10 | **Please describe your problem:** 11 | 12 | 13 | **What were you expecting?:** 14 | 15 | 16 | **Additional info:** 17 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | build*/ 2 | parts/ 3 | stage/ 4 | prime/ 5 | snap/ 6 | android-images/ 7 | *.snap 8 | CMakeLists.txt.user 9 | *.o.cmd 10 | *.symvers 11 | *.o 12 | *.ko 13 | *.ko.cmd 14 | *.mod.c 15 | *.mod.o 16 | modules.order 17 | .tmp_versions 18 | .idea 19 | 20 | 21 | debian/anbox-modules-dkms.debhelper.log 22 | debian/anbox-modules-dkms.substvars 23 | debian/anbox-modules-dkms/ 24 | debian/debhelper-build-stamp 25 | debian/files 26 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: cpp 2 | os: linux 3 | sudo: required 4 | 5 | services: 6 | - docker 7 | 8 | script: 9 | - scripts/build-with-docker.sh 10 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | People contributed to Anbox in an alphabetical sorted list: 2 | 3 | Marius Gripsgard 4 | Ricardo Mendoza 5 | Simon Fels 6 | Thomas Voß 7 | -------------------------------------------------------------------------------- /android/anbox-touch.idc: -------------------------------------------------------------------------------- 1 | # Copyright 2017 The Android Open Source Project 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # 16 | # Input Device Calibration File for the Anbox. 17 | # 18 | 19 | device.internal = 1 20 | 21 | touch.deviceType = touchScreen 22 | touch.displayId = 0 23 | touch.orientationAware = 1 24 | 25 | touch.size.calibration = diameter 26 | touch.size.scale = 60.216953 27 | touch.size.bias = -60.108793 28 | touch.size.isSummed = 0 29 | 30 | touch.pressure.calibration = amplitude 31 | touch.pressure.scale = 0.0125 32 | 33 | touch.orientation.calibration = none 34 | -------------------------------------------------------------------------------- /android/anboxd.rc: -------------------------------------------------------------------------------- 1 | service anboxd /system/bin/anboxd 2 | class core 3 | 4 | service anbox-log-dumper /system/bin/logcat -f /data/system.log -r 2048 -n 4 5 | class core 6 | -------------------------------------------------------------------------------- /android/appmgr/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | 3 | include $(CLEAR_VARS) 4 | LOCAL_MODULE_TAGS := optional 5 | LOCAL_STATIC_JAVA_LIBRARIES := \ 6 | android-common \ 7 | android-support-v13 8 | LOCAL_SRC_FILES := $(call all-java-files-under, src) 9 | # LOCAL_SDK_VERSION := current 10 | LOCAL_PACKAGE_NAME := AnboxAppMgr 11 | LOCAL_CERTIFICATE := shared 12 | LOCAL_PRIVILEGED_MODULE := true 13 | LOCAL_OVERRIDES_PACKAGES := \ 14 | Home \ 15 | Launcher2 \ 16 | Launcher3 \ 17 | LatinIME \ 18 | QuickSearchBox 19 | include $(BUILD_PACKAGE) 20 | -------------------------------------------------------------------------------- /android/appmgr/res/layout/app_view.xml: -------------------------------------------------------------------------------- 1 | 10 | 11 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /android/appmgr/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16dp 4 | 16dp 5 | 6 | -------------------------------------------------------------------------------- /android/appmgr/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | Anbox Application Manager 3 | 4 | -------------------------------------------------------------------------------- /android/appmgr/src/org/anbox/appmgr/MainApplication.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Simon Fels 3 | * 4 | * This program is free software: you can redistribute it and/or modify it 5 | * under the terms of the GNU General Public License version 3, as published 6 | * by the Free Software Foundation. 7 | * 8 | * This program is distributed in the hope that it will be useful, but 9 | * WITHOUT ANY WARRANTY; without even the implied warranties of 10 | * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR 11 | * PURPOSE. See the GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License along 14 | * with this program. If not, see . 15 | * 16 | */ 17 | 18 | package org.anbox.appmgr; 19 | 20 | import android.app.Application; 21 | 22 | public final class MainApplication extends Application { 23 | } 24 | -------------------------------------------------------------------------------- /android/audio/MODULE_LICENSE_APACHE2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lag-linaro/robox/0bc0774c244d929f98e3c84c24183ac151403aa1/android/audio/MODULE_LICENSE_APACHE2 -------------------------------------------------------------------------------- /android/camera/JpegStub.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef JPEGSTUB_H_ 18 | #define JPEGSTUB_H_ 19 | 20 | extern "C" { 21 | 22 | struct JpegStub { 23 | void* mInternalEncoder; 24 | void* mInternalStream; 25 | }; 26 | 27 | void JpegStub_init(JpegStub* stub, int* strides); 28 | void JpegStub_cleanup(JpegStub* stub); 29 | int JpegStub_compress(JpegStub* stub, const void* image, 30 | int width, int height, int quality); 31 | void JpegStub_getCompressedImage(JpegStub* stub, void* buff); 32 | size_t JpegStub_getCompressedSize(JpegStub* stub); 33 | 34 | }; 35 | #endif // JPEGSTUB_H_ 36 | -------------------------------------------------------------------------------- /android/fingerprint/Android.mk: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2013 The Android Open Source Project 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | LOCAL_PATH := $(call my-dir) 16 | 17 | include $(CLEAR_VARS) 18 | 19 | LOCAL_MODULE := fingerprint.goldfish 20 | LOCAL_MODULE_RELATIVE_PATH := hw 21 | LOCAL_SRC_FILES := fingerprint.c 22 | LOCAL_SHARED_LIBRARIES := liblog 23 | 24 | include $(BUILD_SHARED_LIBRARY) 25 | 26 | include $(CLEAR_VARS) 27 | 28 | LOCAL_MODULE := fingerprint.ranchu 29 | LOCAL_MODULE_RELATIVE_PATH := hw 30 | LOCAL_SRC_FILES := fingerprint.c 31 | LOCAL_SHARED_LIBRARIES := liblog 32 | 33 | include $(BUILD_SHARED_LIBRARY) 34 | -------------------------------------------------------------------------------- /android/fstab.goldfish: -------------------------------------------------------------------------------- 1 | # Android fstab file. 2 | -------------------------------------------------------------------------------- /android/lights/Android.mk: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2011 The Android Open Source Project. 2 | # 3 | # Original code licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this software except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | LOCAL_PATH := $(call my-dir) 16 | 17 | # HAL module implemenation, not prelinked and stored in 18 | # hw/..so 19 | include $(CLEAR_VARS) 20 | LOCAL_MODULE_RELATIVE_PATH := hw 21 | LOCAL_SHARED_LIBRARIES := liblog libcutils 22 | LOCAL_SRC_FILES := lights_qemu.c 23 | LOCAL_MODULE := lights.goldfish 24 | LOCAL_CFLAGS += -DLIGHT_BACKLIGHT 25 | include $(BUILD_SHARED_LIBRARY) 26 | -------------------------------------------------------------------------------- /android/opengl/README: -------------------------------------------------------------------------------- 1 | This directory contains Android-side modules related to hardware OpenGL ES 2 | emulation. The host-side modules and documentation are in 3 | $ANDROID_BUILD_TOP/sdk/emulator/opengl. 4 | 5 | Note that this directory contains encoder sources that are auto-generated 6 | with the 'emugen' host tool (see sdk/emulator/opengl/host/tools/emugen). 7 | 8 | To regenerate them, run external/qemu/distrib/update-emugl-sources.sh, 9 | after building the emulator from sources, this will populate the content 10 | here with the appropriate updated source files. 11 | 12 | You should do this whenever you update one of the *.types, *.in and *.attrib 13 | files located under one of: 14 | 15 | $AOSP/sdk/emulator/opengl/libs/GLESv1_dec/ 16 | $AOSP/sdk/emulator/opengl/libs/GLESv2_dec/ 17 | $AOSP/sdk/emulator/opengl/libs/renderControl_dec/ 18 | 19 | or when the 'emugen' tool itself is modified. 20 | -------------------------------------------------------------------------------- /android/opengl/shared/OpenglCodecCommon/Android.mk: -------------------------------------------------------------------------------- 1 | # This build script corresponds to a library containing many definitions 2 | # common to both the guest and the host. They relate to 3 | # 4 | LOCAL_PATH := $(call my-dir) 5 | 6 | commonSources := \ 7 | GLClientState.cpp \ 8 | ChecksumCalculator.cpp \ 9 | GLSharedGroup.cpp \ 10 | glUtils.cpp \ 11 | SocketStream.cpp \ 12 | TcpStream.cpp \ 13 | 14 | ### CodecCommon guest ############################################## 15 | $(call emugl-begin-static-library,libOpenglCodecCommon) 16 | 17 | LOCAL_SRC_FILES := $(commonSources) 18 | 19 | LOCAL_CFLAGS += -DLOG_TAG=\"eglCodecCommon\" 20 | 21 | $(call emugl-export,SHARED_LIBRARIES,libcutils libutils liblog) 22 | $(call emugl-export,C_INCLUDES,$(LOCAL_PATH)) 23 | $(call emugl-end-module) 24 | -------------------------------------------------------------------------------- /android/opengl/shared/OpenglCodecCommon/ErrorLog.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 | #ifndef _ERROR_LOG_H_ 17 | #define _ERROR_LOG_H_ 18 | 19 | #if defined(__ANDROID__) 20 | # include 21 | # define ERR(...) ALOGE(__VA_ARGS__) 22 | # ifdef EMUGL_DEBUG 23 | # define DBG(...) ALOGD(__VA_ARGS__) 24 | # else 25 | # define DBG(...) ((void)0) 26 | # endif 27 | #else 28 | # include 29 | # define ERR(...) fprintf(stderr, __VA_ARGS__) 30 | # ifdef EMUGL_DEBUG 31 | # define DBG(...) fprintf(stderr, __VA_ARGS__) 32 | # else 33 | # define DBG(...) ((void)0) 34 | # endif 35 | #endif 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /android/opengl/shared/OpenglCodecCommon/Makefile: -------------------------------------------------------------------------------- 1 | 2 | ROOT=../.. 3 | 4 | include $(ROOT)/make/commondefs 5 | 6 | CXXFILES = TcpStream.cpp GLClientState.cpp glUtils.cpp 7 | CXXINCS += -I$(ROOT)/libs/GLESv1 -I$(ROOT)/include 8 | 9 | LIBRARY_NAME = libcodecCommon.a 10 | 11 | include $(COMMONRULES) 12 | 13 | 14 | -------------------------------------------------------------------------------- /android/opengl/shared/OpenglCodecCommon/TcpStream.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 | #ifndef __TCP_STREAM_H 17 | #define __TCP_STREAM_H 18 | 19 | #include "SocketStream.h" 20 | 21 | class TcpStream : public SocketStream { 22 | public: 23 | explicit TcpStream(size_t bufsize = 10000); 24 | virtual int listen(unsigned short port); 25 | virtual SocketStream *accept(); 26 | virtual int connect(unsigned short port); 27 | int connect(const char* hostname, unsigned short port); 28 | private: 29 | TcpStream(int sock, size_t bufSize); 30 | }; 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /android/opengl/shared/OpenglCodecCommon/codec_defs.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 | #ifndef _CODEC_DEFS_H 17 | #define _CODEC_DEFS_H 18 | 19 | #define CODEC_SERVER_PORT 22468 20 | 21 | #define CODEC_MAX_VERTEX_ATTRIBUTES 64 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /android/opengl/system/GLESv1/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | 3 | ### GLESv1 implementation ########################################### 4 | $(call emugl-begin-shared-library,libGLESv1_CM_emulation) 5 | $(call emugl-import,libOpenglSystemCommon libGLESv1_enc lib_renderControl_enc) 6 | 7 | LOCAL_CFLAGS += -DLOG_TAG=\"GLES_emulation\" -DGL_GLEXT_PROTOTYPES 8 | 9 | LOCAL_SRC_FILES := gl.cpp 10 | LOCAL_MODULE_RELATIVE_PATH := egl 11 | 12 | $(call emugl-end-module) 13 | -------------------------------------------------------------------------------- /android/opengl/system/GLESv1_enc/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | 3 | ### GLESv1_enc Encoder ########################################### 4 | $(call emugl-begin-shared-library,libGLESv1_enc) 5 | 6 | LOCAL_CFLAGS += -DLOG_TAG=\"emuglGLESv1_enc\" 7 | 8 | LOCAL_SRC_FILES := \ 9 | GLEncoder.cpp \ 10 | GLEncoderUtils.cpp \ 11 | gl_client_context.cpp \ 12 | gl_enc.cpp \ 13 | gl_entry.cpp 14 | 15 | $(call emugl-import,libOpenglCodecCommon) 16 | $(call emugl-export,C_INCLUDES,$(LOCAL_PATH)) 17 | $(call emugl-export,C_INCLUDES,$(intermediates)) 18 | 19 | $(call emugl-end-module) 20 | -------------------------------------------------------------------------------- /android/opengl/system/GLESv1_enc/GLEncoderUtils.cpp: -------------------------------------------------------------------------------- 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 | #include 17 | #include 18 | #include "GLEncoder.h" 19 | 20 | namespace glesv1_enc { 21 | 22 | size_t pixelDataSize(void *self, GLsizei width, GLsizei height, GLenum format, GLenum type, int pack) 23 | { 24 | GLEncoder *ctx = (GLEncoder *)self; 25 | return ctx->pixelDataSize(width, height, format, type, pack); 26 | } 27 | 28 | } // namespace glesv1_enc 29 | -------------------------------------------------------------------------------- /android/opengl/system/GLESv1_enc/GLEncoderUtils.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 | #ifndef GL_ENCODER_UTILS_H 17 | #define GL_ENCODER_UTILS_H 18 | 19 | namespace glesv1_enc { 20 | size_t pixelDataSize(void *self, GLsizei width, GLsizei height, GLenum format, GLenum type, int pack); 21 | }; 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /android/opengl/system/GLESv1_enc/gl_enc.h: -------------------------------------------------------------------------------- 1 | // Generated Code - DO NOT EDIT !! 2 | // generated by 'emugen' 3 | 4 | #ifndef GUARD_gl_encoder_context_t 5 | #define GUARD_gl_encoder_context_t 6 | 7 | #include "IOStream.h" 8 | #include "ChecksumCalculator.h" 9 | #include "gl_client_context.h" 10 | 11 | 12 | #include "glUtils.h" 13 | #include "GLEncoderUtils.h" 14 | 15 | struct gl_encoder_context_t : public gl_client_context_t { 16 | 17 | IOStream *m_stream; 18 | ChecksumCalculator *m_checksumCalculator; 19 | 20 | gl_encoder_context_t(IOStream *stream, ChecksumCalculator *checksumCalculator); 21 | }; 22 | 23 | #endif // GUARD_gl_encoder_context_t -------------------------------------------------------------------------------- /android/opengl/system/GLESv1_enc/gl_types.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 | #ifndef __GL_TYPES__H 17 | #define __GL_TYPES__H 18 | 19 | #include "gl_base_types.h" 20 | #endif 21 | -------------------------------------------------------------------------------- /android/opengl/system/GLESv2/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | 3 | ### GLESv2 implementation ########################################### 4 | $(call emugl-begin-shared-library,libGLESv2_emulation) 5 | $(call emugl-import,libOpenglSystemCommon libGLESv2_enc lib_renderControl_enc) 6 | 7 | LOCAL_CFLAGS += -DLOG_TAG=\"GLESv2_emulation\" -DGL_GLEXT_PROTOTYPES 8 | 9 | LOCAL_SRC_FILES := gl2.cpp 10 | LOCAL_MODULE_RELATIVE_PATH := egl 11 | 12 | $(call emugl-end-module) 13 | -------------------------------------------------------------------------------- /android/opengl/system/GLESv2_enc/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | 3 | ### GLESv2_enc Encoder ########################################### 4 | $(call emugl-begin-shared-library,libGLESv2_enc) 5 | 6 | LOCAL_SRC_FILES := \ 7 | GL2EncoderUtils.cpp \ 8 | GL2Encoder.cpp \ 9 | gl2_client_context.cpp \ 10 | gl2_enc.cpp \ 11 | gl2_entry.cpp 12 | 13 | LOCAL_CFLAGS += -DLOG_TAG=\"emuglGLESv2_enc\" 14 | 15 | $(call emugl-export,C_INCLUDES,$(LOCAL_PATH)) 16 | $(call emugl-import,libOpenglCodecCommon) 17 | 18 | $(call emugl-end-module) 19 | 20 | 21 | -------------------------------------------------------------------------------- /android/opengl/system/GLESv2_enc/GL2EncoderUtils.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 | #ifndef GL2_ENCODER_UTILS_H 17 | #define GL2_ENCODER_UTILS_H 18 | 19 | namespace glesv2_enc { 20 | 21 | size_t pixelDataSize(void *self, GLsizei width, GLsizei height, GLenum format, GLenum type, int pack); 22 | size_t pixelDataSize3D(void *self, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, int pack); 23 | GLenum uniformType(void * self, GLuint program, GLint location); 24 | 25 | } // namespace glesv2_enc 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /android/opengl/system/GLESv2_enc/gl2_enc.h: -------------------------------------------------------------------------------- 1 | // Generated Code - DO NOT EDIT !! 2 | // generated by 'emugen' 3 | 4 | #ifndef GUARD_gl2_encoder_context_t 5 | #define GUARD_gl2_encoder_context_t 6 | 7 | #include "IOStream.h" 8 | #include "ChecksumCalculator.h" 9 | #include "gl2_client_context.h" 10 | 11 | 12 | #include 13 | #include "glUtils.h" 14 | #include "GL2EncoderUtils.h" 15 | 16 | struct gl2_encoder_context_t : public gl2_client_context_t { 17 | 18 | IOStream *m_stream; 19 | ChecksumCalculator *m_checksumCalculator; 20 | 21 | gl2_encoder_context_t(IOStream *stream, ChecksumCalculator *checksumCalculator); 22 | }; 23 | 24 | #endif // GUARD_gl2_encoder_context_t -------------------------------------------------------------------------------- /android/opengl/system/GLESv2_enc/gl2_types.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 | #ifndef _GL_2_TYPES_H_ 17 | #define _GL_2_TYPES_H_ 18 | #include "gl_base_types.h" 19 | 20 | typedef void *GLvoidptr; 21 | #endif 22 | -------------------------------------------------------------------------------- /android/opengl/system/OpenglSystemCommon/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | 3 | $(call emugl-begin-shared-library,libOpenglSystemCommon) 4 | $(call emugl-import,libGLESv1_enc libGLESv2_enc lib_renderControl_enc) 5 | 6 | LOCAL_SRC_FILES := \ 7 | HostConnection.cpp \ 8 | QemuPipeStream.cpp \ 9 | ThreadInfo.cpp 10 | 11 | $(call emugl-export,C_INCLUDES,$(LOCAL_PATH) bionic/libc/private) 12 | 13 | $(call emugl-end-module) 14 | -------------------------------------------------------------------------------- /android/opengl/system/OpenglSystemCommon/EGLImage.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 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 __COMMON_EGL_IMAGE_H 17 | #define __COMMON_EGL_IMAGE_H 18 | 19 | #include 20 | #include 21 | #include 22 | #include 23 | 24 | struct EGLImage_t 25 | { 26 | EGLDisplay dpy; 27 | EGLenum target; 28 | 29 | union 30 | { 31 | android_native_buffer_t *native_buffer; 32 | uint32_t host_egl_image; 33 | }; 34 | }; 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /android/opengl/system/OpenglSystemCommon/ThreadInfo.cpp: -------------------------------------------------------------------------------- 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 | #include "ThreadInfo.h" 17 | #include "cutils/threads.h" 18 | 19 | thread_store_t s_tls = THREAD_STORE_INITIALIZER; 20 | 21 | static void tlsDestruct(void *ptr) 22 | { 23 | if (ptr) { 24 | EGLThreadInfo *ti = (EGLThreadInfo *)ptr; 25 | delete ti->hostConn; 26 | delete ti; 27 | ((void **)__get_tls())[TLS_SLOT_OPENGL] = NULL; 28 | } 29 | } 30 | 31 | EGLThreadInfo *slow_getEGLThreadInfo() 32 | { 33 | EGLThreadInfo *ti = (EGLThreadInfo *)thread_store_get(&s_tls); 34 | if (ti) return ti; 35 | 36 | ti = new EGLThreadInfo(); 37 | thread_store_set(&s_tls, ti, tlsDestruct); 38 | 39 | return ti; 40 | } 41 | -------------------------------------------------------------------------------- /android/opengl/system/egl/ClientAPIExts.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 | #ifndef _CLIENT_APIS_EXTS_H 17 | #define _CLIENT_APIS_EXTS_H 18 | 19 | #include "EGLClientIface.h" 20 | 21 | namespace ClientAPIExts 22 | { 23 | 24 | void initClientFuncs(const EGLClient_glesInterface *iface, int idx); 25 | void* getProcAddress(const char *fname); 26 | 27 | } // of namespace ClientAPIExts 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /android/opengl/system/egl/egl.cfg: -------------------------------------------------------------------------------- 1 | 0 0 emulation 2 | -------------------------------------------------------------------------------- /android/opengl/system/gralloc/Android.mk: -------------------------------------------------------------------------------- 1 | ifneq (false,$(BUILD_EMULATOR_OPENGL_DRIVER)) 2 | 3 | LOCAL_PATH := $(call my-dir) 4 | 5 | $(call emugl-begin-shared-library,gralloc.goldfish) 6 | $(call emugl-import,libGLESv1_enc lib_renderControl_enc libOpenglSystemCommon) 7 | $(call emugl-set-shared-library-subpath,hw) 8 | 9 | LOCAL_CFLAGS += -DLOG_TAG=\"gralloc_goldfish\" 10 | LOCAL_CFLAGS += -Wno-missing-field-initializers 11 | 12 | LOCAL_SRC_FILES := gralloc.cpp 13 | 14 | # Need to access the special OPENGL TLS Slot 15 | LOCAL_C_INCLUDES += bionic/libc/private 16 | LOCAL_SHARED_LIBRARIES += libdl 17 | 18 | $(call emugl-end-module) 19 | 20 | endif # BUILD_EMULATOR_OPENGL_DRIVER != false 21 | -------------------------------------------------------------------------------- /android/opengl/system/renderControl_enc/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | 3 | $(call emugl-begin-shared-library,lib_renderControl_enc) 4 | 5 | LOCAL_SRC_FILES := \ 6 | renderControl_client_context.cpp \ 7 | renderControl_enc.cpp \ 8 | renderControl_entry.cpp 9 | 10 | $(call emugl-export,C_INCLUDES,$(LOCAL_PATH)) 11 | $(call emugl-import,libOpenglCodecCommon) 12 | $(call emugl-end-module) 13 | -------------------------------------------------------------------------------- /android/opengl/system/renderControl_enc/renderControl.attrib: -------------------------------------------------------------------------------- 1 | GLOBAL 2 | base_opcode 10000 3 | encoder_headers "glUtils.h" 4 | 5 | rcGetEGLVersion 6 | dir major out 7 | len major sizeof(EGLint) 8 | dir minor out 9 | len minor sizeof(EGLint) 10 | 11 | rcQueryEGLString 12 | dir buffer out 13 | len buffer bufferSize 14 | 15 | rcGetGLString 16 | dir buffer out 17 | len buffer bufferSize 18 | 19 | rcGetNumConfigs 20 | dir numAttribs out 21 | len numAttribs sizeof(uint32_t) 22 | 23 | rcGetConfigs 24 | dir buffer out 25 | len buffer bufSize 26 | 27 | rcChooseConfig 28 | dir attribs in 29 | len attribs attribs_size 30 | dir configs out 31 | var_flag configs nullAllowed 32 | len configs configs_size*sizeof(uint32_t) 33 | 34 | rcReadColorBuffer 35 | dir pixels out 36 | len pixels (((glUtilsPixelBitSize(format, type) * width) >> 3) * height) 37 | 38 | rcUpdateColorBuffer 39 | dir pixels in 40 | len pixels (((glUtilsPixelBitSize(format, type) * width) >> 3) * height) 41 | var_flag pixels isLarge 42 | 43 | rcCloseColorBuffer 44 | flag flushOnEncode 45 | 46 | -------------------------------------------------------------------------------- /android/opengl/system/renderControl_enc/renderControl.types: -------------------------------------------------------------------------------- 1 | uint32_t 32 0x%08x false 2 | EGLint 32 0x%08x false 3 | GLint 32 0x%08x false 4 | GLuint 32 0x%08x false 5 | GLenum 32 0x%08x false 6 | EGLenum 32 0x%08x false 7 | uint32_t* 32 0x%08x true 8 | EGLint* 32 0x%08x true 9 | GLint* 32 0x%08x true 10 | GLuint* 32 0x%08x true 11 | void* 32 0x%08x true 12 | -------------------------------------------------------------------------------- /android/opengl/system/renderControl_enc/renderControl_enc.h: -------------------------------------------------------------------------------- 1 | // Generated Code - DO NOT EDIT !! 2 | // generated by 'emugen' 3 | 4 | #ifndef GUARD_renderControl_encoder_context_t 5 | #define GUARD_renderControl_encoder_context_t 6 | 7 | #include "IOStream.h" 8 | #include "ChecksumCalculator.h" 9 | #include "renderControl_client_context.h" 10 | 11 | 12 | #include 13 | #include 14 | #include "glUtils.h" 15 | 16 | struct renderControl_encoder_context_t : public renderControl_client_context_t { 17 | 18 | IOStream *m_stream; 19 | ChecksumCalculator *m_checksumCalculator; 20 | 21 | renderControl_encoder_context_t(IOStream *stream, ChecksumCalculator *checksumCalculator); 22 | }; 23 | 24 | #endif // GUARD_renderControl_encoder_context_t -------------------------------------------------------------------------------- /android/opengl/system/renderControl_enc/renderControl_types.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 | #include 18 | #include 19 | #include "glUtils.h" 20 | 21 | // values for 'param' argument of rcGetFBParam 22 | #define FB_WIDTH 1 23 | #define FB_HEIGHT 2 24 | #define FB_XDPI 3 25 | #define FB_YDPI 4 26 | #define FB_FPS 5 27 | #define FB_MIN_SWAP_INTERVAL 6 28 | #define FB_MAX_SWAP_INTERVAL 7 29 | -------------------------------------------------------------------------------- /android/opengl/tests/gles_android_wrapper/ApiInitializer.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 _API_INITIALIZER_H_ 18 | #define _API_INITIALIZER_H_ 19 | #include 20 | #include 21 | 22 | class ApiInitializer { 23 | public: 24 | ApiInitializer(void *dso) : 25 | m_dso(dso) { 26 | } 27 | static void *s_getProc(const char *name, void *userData) { 28 | ApiInitializer *self = (ApiInitializer *)userData; 29 | return self->getProc(name); 30 | } 31 | private: 32 | void *m_dso; 33 | void *getProc(const char *name) { 34 | void *symbol = NULL; 35 | if (m_dso) { 36 | symbol = dlsym(m_dso, name); 37 | } 38 | return symbol; 39 | } 40 | }; 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /android/opengl/tests/gles_android_wrapper/ThreadInfo.cpp: -------------------------------------------------------------------------------- 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 | #include "ThreadInfo.h" 17 | #include "cutils/threads.h" 18 | 19 | thread_store_t s_tls = THREAD_STORE_INITIALIZER; 20 | 21 | static void tlsDestruct(void *ptr) 22 | { 23 | if (ptr) { 24 | EGLThreadInfo *ti = (EGLThreadInfo *)ptr; 25 | delete ti->serverConn; 26 | delete ti; 27 | } 28 | } 29 | 30 | EGLThreadInfo *getEGLThreadInfo() 31 | { 32 | EGLThreadInfo *ti = (EGLThreadInfo *)thread_store_get(&s_tls); 33 | if (ti) return ti; 34 | 35 | ti = new EGLThreadInfo(); 36 | thread_store_set(&s_tls, ti, tlsDestruct); 37 | 38 | return ti; 39 | } 40 | -------------------------------------------------------------------------------- /android/opengl/tests/gles_android_wrapper/egl.cfg: -------------------------------------------------------------------------------- 1 | 0 0 emul -------------------------------------------------------------------------------- /android/opengl/tests/gles_android_wrapper/gles_emul.cfg: -------------------------------------------------------------------------------- 1 | angeles 2 | my-tritex 3 | org.zeroxlab.benchmark 4 | com.cooliris.media 5 | com.polarbit.waveblazerlite 6 | test-opengl-gl2_basic 7 | com.trendy.ddapp 8 | -------------------------------------------------------------------------------- /android/opengl/tests/ut_rendercontrol_enc/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | 3 | $(call emugl-begin-shared-library,libut_rendercontrol_enc) 4 | $(call emugl-import,libOpenglCodecCommon) 5 | $(call emugl-gen-encoder,$(LOCAL_PATH),ut_rendercontrol) 6 | $(call emugl-export,C_INCLUDES,$(LOCAL_PATH)) 7 | $(call emugl-end-module) 8 | 9 | -------------------------------------------------------------------------------- /android/opengl/tests/ut_rendercontrol_enc/ut_rendercontrol.attrib: -------------------------------------------------------------------------------- 1 | GLOBAL 2 | base_opcode 10000 3 | encoder_headers 4 | 5 | -------------------------------------------------------------------------------- /android/opengl/tests/ut_rendercontrol_enc/ut_rendercontrol.in: -------------------------------------------------------------------------------- 1 | GL_ENTRY(int, createContext, uint32_t pid, uint32_t handle, uint32_t shareCtx, int version) 2 | GL_ENTRY(int, createSurface, uint32_t pid, uint32_t handle) 3 | GL_ENTRY(int, makeCurrentContext, uint32_t pid, uint32_t drawSurface, uint32_t readSurface, uint32_t ctxHandle) 4 | GL_ENTRY(void, swapBuffers, uint32_t pid, uint32_t surface) 5 | GL_ENTRY(int, destroyContext, uint32_t pid, uint32_t handle) 6 | GL_ENTRY(int, destroySurface, uint32_t pid, uint32_t handle) 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /android/opengl/tests/ut_rendercontrol_enc/ut_rendercontrol.types: -------------------------------------------------------------------------------- 1 | uint32_t 32 0x%08x false 2 | 3 | -------------------------------------------------------------------------------- /android/opengl/tests/ut_rendercontrol_enc/ut_rendercontrol_types.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 | #include 18 | -------------------------------------------------------------------------------- /android/power/Android.mk: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2012 The Android Open Source Project 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | 16 | LOCAL_PATH := $(call my-dir) 17 | 18 | # HAL module implemenation stored in 19 | # hw/..so 20 | include $(CLEAR_VARS) 21 | 22 | LOCAL_MODULE_RELATIVE_PATH := hw 23 | LOCAL_CFLAGS += -DQEMU_HARDWARE 24 | LOCAL_SHARED_LIBRARIES := liblog libcutils 25 | LOCAL_SRC_FILES := power_qemu.c 26 | LOCAL_MODULE := power.goldfish 27 | LOCAL_MODULE_TAGS := optional 28 | include $(BUILD_SHARED_LIBRARY) 29 | -------------------------------------------------------------------------------- /android/qemu-props/Android.mk: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2009 The Android Open Source Project 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # this file is used to build emulator-specific program tools 16 | # that should only run in the emulator. 17 | # 18 | 19 | LOCAL_PATH := $(call my-dir) 20 | 21 | # The 'qemu-props' program is run from /system/etc/init.goldfish.rc 22 | # to setup various system properties sent by the emulator program. 23 | # 24 | include $(CLEAR_VARS) 25 | LOCAL_MODULE := qemu-props 26 | LOCAL_SRC_FILES := qemu-props.c 27 | LOCAL_SHARED_LIBRARIES := libcutils liblog 28 | include $(BUILD_EXECUTABLE) 29 | -------------------------------------------------------------------------------- /android/qemud/Android.mk: -------------------------------------------------------------------------------- 1 | # Copyright 2008 The Android Open Source Project 2 | 3 | # We're moving the emulator-specific platform libs to 4 | # development.git/tools/emulator/. The following test is to ensure 5 | # smooth builds even if the tree contains both versions. 6 | # 7 | 8 | LOCAL_PATH:= $(call my-dir) 9 | include $(CLEAR_VARS) 10 | 11 | LOCAL_SRC_FILES:= \ 12 | qemud.c 13 | 14 | 15 | LOCAL_SHARED_LIBRARIES := \ 16 | libcutils liblog 17 | 18 | LOCAL_MODULE:= qemud 19 | 20 | include $(BUILD_EXECUTABLE) 21 | -------------------------------------------------------------------------------- /android/sensors/Android.mk: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2009 The Android Open Source Project 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | 16 | LOCAL_PATH := $(call my-dir) 17 | 18 | # HAL module implemenation stored in 19 | # hw/..so 20 | include $(CLEAR_VARS) 21 | 22 | LOCAL_MODULE_RELATIVE_PATH := hw 23 | LOCAL_SHARED_LIBRARIES := liblog libcutils 24 | LOCAL_SRC_FILES := sensors_qemu.c 25 | ifeq ($(TARGET_PRODUCT),vbox_x86) 26 | LOCAL_MODULE := sensors.vbox_x86 27 | else 28 | LOCAL_MODULE := sensors.goldfish 29 | endif 30 | include $(BUILD_SHARED_LIBRARY) 31 | 32 | 33 | include $(CLEAR_VARS) 34 | 35 | LOCAL_MODULE_RELATIVE_PATH := hw 36 | LOCAL_SHARED_LIBRARIES := liblog libcutils 37 | LOCAL_SRC_FILES := sensors_qemu.c 38 | LOCAL_MODULE := sensors.ranchu 39 | 40 | include $(BUILD_SHARED_LIBRARY) 41 | -------------------------------------------------------------------------------- /android/service/daemon.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Simon Fels 3 | * 4 | * This program is free software: you can redistribute it and/or modify it 5 | * under the terms of the GNU General Public License version 3, as published 6 | * by the Free Software Foundation. 7 | * 8 | * This program is distributed in the hope that it will be useful, but 9 | * WITHOUT ANY WARRANTY; without even the implied warranties of 10 | * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR 11 | * PURPOSE. See the GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License along 14 | * with this program. If not, see . 15 | * 16 | */ 17 | 18 | #ifndef ANBOX_ANDROID_DAEMON_H_ 19 | #define ANBOX_ANDROID_DAEMON_H_ 20 | 21 | namespace anbox { 22 | class Daemon { 23 | public: 24 | Daemon(); 25 | ~Daemon(); 26 | 27 | int run(); 28 | }; 29 | } // namespace anbox 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /android/service/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Simon Fels 3 | * 4 | * This program is free software: you can redistribute it and/or modify it 5 | * under the terms of the GNU General Public License version 3, as published 6 | * by the Free Software Foundation. 7 | * 8 | * This program is distributed in the hope that it will be useful, but 9 | * WITHOUT ANY WARRANTY; without even the implied warranties of 10 | * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR 11 | * PURPOSE. See the GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License along 14 | * with this program. If not, see . 15 | * 16 | */ 17 | 18 | #include "android/service/daemon.h" 19 | 20 | int main(int, char**) { 21 | anbox::Daemon daemon; 22 | return daemon.run(); 23 | } 24 | -------------------------------------------------------------------------------- /android/service/platform_server_proxy.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lag-linaro/robox/0bc0774c244d929f98e3c84c24183ac151403aa1/android/service/platform_server_proxy.cpp -------------------------------------------------------------------------------- /android/service/platform_server_proxy.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lag-linaro/robox/0bc0774c244d929f98e3c84c24183ac151403aa1/android/service/platform_server_proxy.h -------------------------------------------------------------------------------- /android/ueventd.goldfish.rc: -------------------------------------------------------------------------------- 1 | # These settings are specific to running under the Android emulator 2 | /dev/qemu_trace 0666 system system 3 | /dev/qemu_pipe 0666 system system 4 | /dev/goldfish_pipe 0666 system system 5 | /dev/ttyS* 0666 system system 6 | /proc 0666 system system 7 | -------------------------------------------------------------------------------- /android/vibrator/Android.mk: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2013 The Android Open Source Project 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | LOCAL_PATH := $(call my-dir) 16 | 17 | include $(CLEAR_VARS) 18 | 19 | LOCAL_MODULE := vibrator.goldfish 20 | 21 | # HAL module implemenation stored in 22 | # hw/.goldfish.so 23 | LOCAL_MODULE_RELATIVE_PATH := hw 24 | LOCAL_C_INCLUDES := hardware/libhardware hardware/libhardware_legacy 25 | LOCAL_SRC_FILES := vibrator_qemu.c 26 | LOCAL_SHARED_LIBRARIES := liblog libhardware libhardware_legacy 27 | LOCAL_MODULE_TAGS := optional 28 | 29 | include $(BUILD_SHARED_LIBRARY) 30 | -------------------------------------------------------------------------------- /cmake/FindEGL.cmake: -------------------------------------------------------------------------------- 1 | # - Try to find EGL 2 | # Once done this will define 3 | # EGL_FOUND - System has EGL 4 | # EGL_INCLUDE_DIRS - The EGL include directories 5 | # EGL_LIBRARIES - The libraries needed to use EGL 6 | 7 | find_package(PkgConfig) 8 | pkg_check_modules(PC_EGL QUIET egl) 9 | 10 | find_path(EGL_INCLUDE_DIR EGL/egl.h 11 | HINTS ${PC_EGL_INCLUDEDIR} ${PC_EGL_INCLUDE_DIRS}) 12 | 13 | find_library(EGL_LIBRARY EGL 14 | HINTS ${PC_EGL_LIBDIR} ${PC_EGL_LIBRARY_DIRS}) 15 | 16 | set(EGL_LIBRARIES ${EGL_LIBRARY}) 17 | set(EGL_INCLUDE_DIRS ${EGL_INCLUDE_DIR}) 18 | 19 | include(FindPackageHandleStandardArgs) 20 | # handle the QUIETLY and REQUIRED arguments and set EGL_FOUND to TRUE 21 | # if all listed variables are TRUE 22 | find_package_handle_standard_args(EGL DEFAULT_MSG 23 | EGL_LIBRARY EGL_INCLUDE_DIR) 24 | 25 | mark_as_advanced(EGL_INCLUDE_DIR EGL_LIBRARY) 26 | -------------------------------------------------------------------------------- /cmake/FindGLESv2.cmake: -------------------------------------------------------------------------------- 1 | # - Try to find GLESv2 2 | # Once done this will define 3 | # GLESv2_FOUND - System has GLESv2 4 | # GLESv2_INCLUDE_DIRS - The GLESv2 include directories 5 | # GLESv2_LIBRARIES - The libraries needed to use GLESv2 6 | 7 | find_package(PkgConfig) 8 | pkg_check_modules(PC_GLESv2 QUIET glesv2) 9 | 10 | find_path(GLESv2_INCLUDE_DIR GLES2/gl2.h 11 | HINTS ${PC_GLESv2_INCLUDEDIR} ${PC_GLESv2_INCLUDE_DIRS}) 12 | 13 | find_library(GLESv2_LIBRARY GLESv2 14 | HINTS ${PC_GLESv2_LIBDIR} ${PC_GLESv2_LIBRARY_DIRS}) 15 | 16 | set(GLESv2_LIBRARIES ${GLESv2_LIBRARY}) 17 | set(GLESv2_INCLUDE_DIRS ${GLESv2_INCLUDE_DIR}) 18 | 19 | include(FindPackageHandleStandardArgs) 20 | # handle the QUIETLY and REQUIRED arguments and set GLESv2_FOUND to TRUE 21 | # if all listed variables are TRUE 22 | find_package_handle_standard_args(GLESv2 DEFAULT_MSG 23 | GLESv2_LIBRARY GLESv2_INCLUDE_DIR) 24 | 25 | mark_as_advanced(GLESv2_INCLUDE_DIR GLESv2_LIBRARY) 26 | -------------------------------------------------------------------------------- /cmake_uninstall.cmake.in: -------------------------------------------------------------------------------- 1 | IF(NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt") 2 | MESSAGE(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_BINARY_DIR@/install_manifest.txt\"") 3 | ENDIF(NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt") 4 | 5 | FILE(READ "@CMAKE_BINARY_DIR@/install_manifest.txt" files) 6 | STRING(REGEX REPLACE "\n" ";" files "${files}") 7 | FOREACH(file ${files}) 8 | MESSAGE(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"") 9 | IF(EXISTS "$ENV{DESTDIR}${file}") 10 | EXEC_PROGRAM( 11 | "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\"" 12 | OUTPUT_VARIABLE rm_out 13 | RETURN_VALUE rm_retval 14 | ) 15 | IF(NOT "${rm_retval}" STREQUAL 0) 16 | MESSAGE(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"") 17 | ENDIF(NOT "${rm_retval}" STREQUAL 0) 18 | ELSE(EXISTS "$ENV{DESTDIR}${file}") 19 | MESSAGE(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.") 20 | ENDIF(EXISTS "$ENV{DESTDIR}${file}") 21 | ENDFOREACH(file) 22 | -------------------------------------------------------------------------------- /data/anbox.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Name=Anbox 3 | Exec=anbox run --rootfs=android-rootfs 4 | Icon=anbox 5 | Terminal=false 6 | Type=Application 7 | X-Ubuntu-Touch=true 8 | -------------------------------------------------------------------------------- /data/apparmor.json: -------------------------------------------------------------------------------- 1 | { 2 | "policy_version": 1.3, 3 | "template": "unconfined", 4 | "policy_groups": [] 5 | } 6 | -------------------------------------------------------------------------------- /data/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "architecture": "armhf", 3 | "description": "Android in a Box - An application-based approach to run a full Android system", 4 | "framework": "ubuntu-sdk-15.04", 5 | "hooks": { 6 | "anbox": { 7 | "apparmor": "apparmor.json", 8 | "desktop": "anbox.desktop" 9 | } 10 | }, 11 | "maintainer": "Simon Fels ", 12 | "name": "org.anbox", 13 | "title": "Anbox", 14 | "version": "0.1" 15 | } 16 | -------------------------------------------------------------------------------- /data/ui/loading-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lag-linaro/robox/0bc0774c244d929f98e3c84c24183ac151403aa1/data/ui/loading-screen.png -------------------------------------------------------------------------------- /data/xsession.conf: -------------------------------------------------------------------------------- 1 | # This file is sourced by Xsession(5), not executed. 2 | # Add additional anbox desktop path 3 | if [ -z "$XDG_DATA_DIRS" ]; then 4 | # 60x11-common_xdg_path does not always set XDG_DATA_DIRS 5 | # so we ensure we have sensible defaults here (LP: #1575014) 6 | # as a workaround 7 | XDG_DATA_DIRS=/usr/local/share/:/usr/share/:$HOME/snap/anbox/common/app-data 8 | else 9 | XDG_DATA_DIRS="$XDG_DATA_DIRS":$HOME/snap/anbox/common/app-data 10 | fi 11 | export XDG_DATA_DIRS 12 | -------------------------------------------------------------------------------- /debian/README.Debian: -------------------------------------------------------------------------------- 1 | MODULE_NAME DKMS module for Debian 2 | 3 | This package was automatically generated by the DKMS system, 4 | for distribution on Debian based operating systems. 5 | 6 | -------------------------------------------------------------------------------- /debian/anbox-common.install: -------------------------------------------------------------------------------- 1 | etc/X11/Xsession.d/68anbox 2 | -------------------------------------------------------------------------------- /debian/anbox-modules-dkms.install: -------------------------------------------------------------------------------- 1 | usr/src/anbox-modules-* 2 | etc/modules-load.d 3 | lib/udev/rules.d 4 | -------------------------------------------------------------------------------- /debian/anbox-modules-dkms.prerm: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | NAME=anbox-modules-dkms 4 | VERSION=`dpkg-query -W -f='${Version}' $DEB_NAME | awk -F "-" '{print $1}' | cut -d\: -f2` 5 | 6 | set -e 7 | 8 | case "$1" in 9 | remove|upgrade|deconfigure) 10 | if [ "`dkms status -m $NAME`" ]; then 11 | dkms remove -m $NAME -v $VERSION --all 12 | fi 13 | ;; 14 | 15 | failed-upgrade) 16 | ;; 17 | 18 | *) 19 | echo "prerm called with unknown argument \`$1'" >&2 20 | exit 1 21 | ;; 22 | esac 23 | 24 | #DEBHELPER# 25 | 26 | exit 0 27 | 28 | 29 | -------------------------------------------------------------------------------- /debian/compat: -------------------------------------------------------------------------------- 1 | 7 2 | -------------------------------------------------------------------------------- /debian/control: -------------------------------------------------------------------------------- 1 | Source: anbox 2 | Section: misc 3 | Priority: optional 4 | Maintainer: Simon Fels 5 | Build-Depends: debhelper (>= 7), dkms, dh-systemd 6 | Standards-Version: 3.9.7 7 | Homepage: http://anbox.io 8 | Vcs-Browser: https://github.com/anbox/anbox 9 | Vcs-Git: https://github.com/anbox/anbox.git 10 | 11 | Package: anbox-common 12 | Architecture: all 13 | Depends: ${misc:Depends} 14 | Description: Common files necessary for Anbox 15 | . 16 | This package contains necessary things which can't be shipped 17 | with anbox snap package 18 | 19 | Package: anbox-modules-dkms 20 | Architecture: all 21 | Depends: dkms (>= 1.95), ${misc:Depends} 22 | # Get existing installations to install the anbox-common package 23 | # as this will replace our existing classic snap based install 24 | # approach. 25 | Recommends: anbox-common 26 | Description: Android kernel driver (binder, ashmem) in DKMS format. 27 | . 28 | This package contains a out-of-tree version of the core Android 29 | kernel functionalities binder and ashmem. 30 | -------------------------------------------------------------------------------- /debian/dirs: -------------------------------------------------------------------------------- 1 | usr/src 2 | -------------------------------------------------------------------------------- /debian/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # -*- makefile -*- 3 | 4 | # Uncomment this to turn on verbose mode. 5 | #export DH_VERBOSE=1 6 | 7 | VERSION=$(shell dpkg-parsechangelog -SVersion) 8 | 9 | # include /usr/share/dpkg/default.mk 10 | 11 | %: 12 | dh $@ --parallel --fail-missing --with systemd 13 | 14 | override_dh_auto_configure: 15 | 16 | override_dh_auto_build: 17 | 18 | override_dh_install: 19 | VERSION=$(shell dpkg-parsechangelog -SVersion) 20 | install -d $(CURDIR)/debian/tmp/usr/src 21 | for d in ashmem binder ; do \ 22 | cp -a $(CURDIR)/kernel/$$d $(CURDIR)/debian/tmp/usr/src/anbox-modules-$$d-$(VERSION) ; \ 23 | done 24 | 25 | install -d $(CURDIR)/debian/tmp/lib/udev/rules.d 26 | install -m 0644 kernel/99-anbox.rules $(CURDIR)/debian/tmp/lib/udev/rules.d 27 | 28 | install -d $(CURDIR)/debian/tmp/etc/modules-load.d 29 | install -m 0644 kernel/anbox.conf $(CURDIR)/debian/tmp/etc/modules-load.d 30 | 31 | install -d $(CURDIR)/debian/tmp/etc/X11/Xsession.d 32 | install -m 0644 data/xsession.conf $(CURDIR)/debian/tmp/etc/X11/Xsession.d/68anbox 33 | 34 | dh_install 35 | -------------------------------------------------------------------------------- /debian/source/format: -------------------------------------------------------------------------------- 1 | 3.0 (native) 2 | -------------------------------------------------------------------------------- /debian/source/options: -------------------------------------------------------------------------------- 1 | tar-ignore = ".git" 2 | tar-ignore = "*.swp" 3 | -------------------------------------------------------------------------------- /docs/architecture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lag-linaro/robox/0bc0774c244d929f98e3c84c24183ac151403aa1/docs/architecture.png -------------------------------------------------------------------------------- /docs/generate-emugl-source.md: -------------------------------------------------------------------------------- 1 | # Generate Android EmuGL source 2 | 3 | Parts of the EmuGL layer are generated with a tool called emugen (see 4 | external/android-emugl/host/tools/emugen). 5 | 6 | To generate the source again after a modification simply call 7 | 8 | ``` 9 | $ scripts/update-emugl-sources.sh --emugen=/emugen 10 | ``` 11 | 12 | The definition of the various attributes/types/functions can be found in 13 | 14 | * external/android-emugl/host/libs/renderControl_dec 15 | * external/android-emugl/host/libs/GLESv1_dec 16 | * external/android-emugl/host/libs/GLESv2_dec 17 | -------------------------------------------------------------------------------- /external/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(process-cpp-minimal) 2 | add_subdirectory(android-emugl) 3 | add_subdirectory(xdg) 4 | -------------------------------------------------------------------------------- /external/android-emugl/README.anbox: -------------------------------------------------------------------------------- 1 | Taken from branch 'emu-2.0-release' of repository 2 | https://android.googlesource.com/platform/external/qemu/+/emu-2.0-release 3 | at comment 9a21e8c61517ca9aa8fc244810fea96b361e383c 4 | -------------------------------------------------------------------------------- /external/android-emugl/googletest.mk: -------------------------------------------------------------------------------- 1 | # This contains common definitions used to define a host module 2 | # to link GoogleTest with the EmuGL test programs. 3 | # 4 | # This is used instead of including external/gtest/Android.mk to 5 | # be able to build both the 32-bit and 64-bit binaries while 6 | # building a 32-bit only SDK (sdk-eng, sdk_x86-eng, sdk_mips-eng). 7 | 8 | 9 | LOCAL_PATH := $(EMULATOR_GTEST_SOURCES_DIR) 10 | 11 | common_SRC_FILES := \ 12 | src/gtest-all.cc \ 13 | src/gtest_main.cc 14 | 15 | common_CFLAGS := -O0 16 | 17 | ifneq (windows,$(BUILD_TARGET_OS)) 18 | common_LDLIBS += -lpthread 19 | endif 20 | 21 | $(call emugl-begin-host-static-library,libemugl_gtest) 22 | LOCAL_SRC_FILES := $(common_SRC_FILES) 23 | LOCAL_CFLAGS += $(common_CFLAGS) 24 | LOCAL_CPP_EXTENSION := .cc 25 | $(call emugl-export,C_INCLUDES,$(LOCAL_PATH)/include) 26 | $(call emugl-export,LDLIBS,$(common_LDLIBS)) 27 | $(call emugl-end-module) 28 | 29 | $(call emugl-begin-host-static-library,libemugl_gtest_host) 30 | LOCAL_SRC_FILES := $(common_SRC_FILES) 31 | LOCAL_CFLAGS += $(common_CFLAGS) 32 | LOCAL_C_INCLUDES += $(LOCAL_PATH)/include 33 | LOCAL_CPP_EXTENSION := .cc 34 | $(call emugl-export,C_INCLUDES,$(LOCAL_PATH)/include) 35 | $(call emugl-export,LDLIBS,$(common_LDLIBS) -lpthread) 36 | LOCAL_HOST_BUILD := true 37 | $(call emugl-end-module) 38 | -------------------------------------------------------------------------------- /external/android-emugl/host/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(tools) 2 | add_subdirectory(libs) 3 | -------------------------------------------------------------------------------- /external/android-emugl/host/include/GLES/glplatform.h: -------------------------------------------------------------------------------- 1 | #ifndef __glplatform_h_ 2 | #define __glplatform_h_ 3 | 4 | /* $Revision: 10601 $ on $Date:: 2010-03-04 22:15:27 -0800 #$ */ 5 | 6 | /* 7 | * This document is licensed under the SGI Free Software B License Version 8 | * 2.0. For details, see http://oss.sgi.com/projects/FreeB/ . 9 | */ 10 | 11 | /* Platform-specific types and definitions for OpenGL ES 1.X gl.h 12 | * 13 | * Adopters may modify khrplatform.h and this file to suit their platform. 14 | * You are encouraged to submit all modifications to the Khronos group so that 15 | * they can be included in future versions of this file. Please submit changes 16 | * by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla) 17 | * by filing a bug against product "OpenGL-ES" component "Registry". 18 | */ 19 | 20 | #include 21 | 22 | #ifndef GL_API 23 | #define GL_API KHRONOS_APICALL 24 | #endif 25 | 26 | #ifndef GL_APIENTRY 27 | #define GL_APIENTRY KHRONOS_APIENTRY 28 | #endif 29 | 30 | #endif /* __glplatform_h_ */ 31 | -------------------------------------------------------------------------------- /external/android-emugl/host/libs/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(GENERATED_SOURCES 2 | gles1_extensions_functions.h 3 | gles1_only_functions.h 4 | gles2_extensions_functions.h 5 | gles2_only_functions.h 6 | gles3_only_functions.h 7 | gles_common_functions.h 8 | gles_extensions_functions.h 9 | gles_functions.h 10 | RenderEGL_extensions_functions.h 11 | RenderEGL_functions.h) 12 | 13 | add_custom_target(GLHeaders) 14 | add_custom_command( 15 | TARGET GLHeaders 16 | POST_BUILD 17 | COMMAND ${CMAKE_SOURCE_DIR}/scripts/gen-emugl-headers.sh ${CMAKE_BINARY_DIR} 18 | WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) 19 | 20 | add_subdirectory(GLESv1_dec) 21 | add_subdirectory(GLESv2_dec) 22 | add_subdirectory(libOpenGLESDispatch) 23 | add_subdirectory(renderControl_dec) 24 | add_subdirectory(Translator) 25 | -------------------------------------------------------------------------------- /external/android-emugl/host/libs/GLESv1_dec/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(GENERATED_SOURCES 2 | gles1_dec.cpp 3 | gles1_opcodes.h 4 | gles1_server_context.cpp) 5 | 6 | add_custom_command( 7 | OUTPUT ${GENERATED_SOURCES} 8 | POST_BUILD 9 | COMMAND ${CMAKE_BINARY_DIR}/external/android-emugl/host/tools/emugen/emugen 10 | -D ${CMAKE_CURRENT_BINARY_DIR} gles1 11 | WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} 12 | DEPENDS emugen) 13 | 14 | set(SOURCES 15 | GLESv1Decoder.cpp) 16 | 17 | if ("${cmake_build_type_lower}" STREQUAL "trace") 18 | set(OPENGL_DEBUG "-DOPENGL_DEBUG_PRINTOUT -DCHECK_GL_ERROR") 19 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OPENGL_DEBUG}") 20 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OPENGL_DEBUG}") 21 | endif() 22 | 23 | add_library(GLESv1_dec STATIC ${SOURCES} ${GENERATED_SOURCES}) 24 | add_dependencies(GLESv1_dec GLHeaders) 25 | target_link_libraries(GLESv1_dec OpenglCodecCommon) 26 | -------------------------------------------------------------------------------- /external/android-emugl/host/libs/GLESv1_dec/gles1.addon: -------------------------------------------------------------------------------- 1 | GL_ENTRY(void, glVertexPointerOffset, GLint size, GLenum type, GLsizei stride, GLuint offset) 2 | GL_ENTRY(void, glColorPointerOffset, GLint size, GLenum type, GLsizei stride, GLuint offset) 3 | GL_ENTRY(void, glNormalPointerOffset, GLenum type, GLsizei stride, GLuint offset) 4 | GL_ENTRY(void, glPointSizePointerOffset, GLenum type, GLsizei stride, GLuint offset) 5 | GL_ENTRY(void, glTexCoordPointerOffset, GLint size, GLenum type, GLsizei stride, GLuint offset) 6 | 7 | GL_ENTRY(void, glVertexPointerData, GLint size, GLenum type, GLsizei stride, void * data, GLuint datalen) 8 | GL_ENTRY(void, glColorPointerData, GLint size, GLenum type, GLsizei stride, void * data, GLuint datalen) 9 | GL_ENTRY(void, glNormalPointerData, GLenum type, GLsizei stride, void * data, GLuint datalen) 10 | GL_ENTRY(void, glTexCoordPointerData, GLint size, GLenum type, GLsizei stride, void * data, GLuint datalen) 11 | GL_ENTRY(void, glPointSizePointerData, GLenum type, GLsizei stride, void * data, GLuint datalen) 12 | 13 | GL_ENTRY(void, glDrawElementsOffset, GLenum mode, GLsizei count, GLenum type, GLuint offset); 14 | GL_ENTRY(void, glDrawElementsData, GLenum mode, GLsizei count, GLenum type, void *data, GLuint datalen); 15 | 16 | -------------------------------------------------------------------------------- /external/android-emugl/host/libs/GLESv1_dec/gles1.types: -------------------------------------------------------------------------------- 1 | GLbitfield 32 0x%08x 2 | GLboolean 8 %d 3 | GLclampf 32 %f 4 | GLclampx 32 0x%08x 5 | GLeglImageOES 32 %p 6 | GLenum 32 0x%08x 7 | GLfixed 32 0x%08x 8 | GLfloat 32 %f 9 | GLint 32 %d 10 | GLintptr 32 %p 11 | GLshort 16 %d 12 | GLsizei 32 %d 13 | GLsizeiptr 32 %p 14 | GLubyte 8 0x%02x 15 | GLuint 32 %u 16 | GLvoid 0 %x 17 | GLchar 8 %d 18 | GLenum* 32 0x%08x 19 | GLboolean* 32 0x%08x 20 | GLclampf* 32 0x%08x 21 | GLclampx* 32 0x%08x 22 | GLeglImageOES* 32 0x%08x 23 | GLfixed* 32 0x%08x 24 | GLfloat* 32 0x%08x 25 | GLint* 32 0x%08x 26 | GLshort* 32 0x%08x 27 | GLsizei* 32 0x%08x 28 | GLubyte* 32 0x%08x 29 | GLuint* 32 0x%08x 30 | GLvoid* 32 0x%08x 31 | GLchar* 32 0x%08x 32 | GLvoid** 32 0x%08x 33 | void* 32 0x%08x 34 | GLvoid*const* 32 0x%08x 35 | -------------------------------------------------------------------------------- /external/android-emugl/host/libs/GLESv1_dec/gles1_types.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 | #ifndef __GLES1_TYPES__H 17 | #define __GLES1_TYPES__H 18 | 19 | #include "gl_base_types.h" 20 | 21 | #endif // __GLES1_TYPES__H 22 | -------------------------------------------------------------------------------- /external/android-emugl/host/libs/GLESv2_dec/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(GENERATED_SOURCES 2 | gles2_dec.cpp 3 | gles2_opcodes.h 4 | gles2_server_context.cpp) 5 | 6 | add_custom_command( 7 | OUTPUT ${GENERATED_SOURCES} 8 | POST_BUILD 9 | COMMAND ${CMAKE_BINARY_DIR}/external/android-emugl/host/tools/emugen/emugen 10 | -D ${CMAKE_CURRENT_BINARY_DIR} gles2 11 | WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} 12 | DEPENDS emugen) 13 | 14 | set(SOURCES 15 | GLESv2Decoder.cpp) 16 | 17 | if ("${cmake_build_type_lower}" STREQUAL "trace") 18 | set(OPENGL_DEBUG "-DOPENGL_DEBUG_PRINTOUT -DCHECK_GL_ERROR") 19 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OPENGL_DEBUG}") 20 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OPENGL_DEBUG}") 21 | endif() 22 | 23 | add_library(GLESv2_dec STATIC ${SOURCES} ${GENERATED_SOURCES}) 24 | add_dependencies(GLESv2_dec GLHeaders) 25 | target_link_libraries(GLESv2_dec OpenglCodecCommon) 26 | -------------------------------------------------------------------------------- /external/android-emugl/host/libs/GLESv2_dec/gles2.types: -------------------------------------------------------------------------------- 1 | GLbitfield 32 0x%08x 2 | GLboolean 8 %d 3 | GLclampf 32 %f 4 | GLclampx 32 0x%08x 5 | GLeglImageOES 32 %p 6 | GLenum 32 0x%08x 7 | GLfixed 32 0x%08x 8 | GLfloat 32 %f 9 | GLint 32 %d 10 | GLintptr 32 %p 11 | GLshort 16 %d 12 | GLsizei 32 %d 13 | GLsizeiptr 32 %p 14 | GLubyte 8 0x%02x 15 | GLuint 32 %u 16 | GLvoid 0 %x 17 | GLchar 8 %d 18 | GLenum* 32 0x%08x 19 | GLboolean* 32 0x%08x 20 | GLclampf* 32 0x%08x 21 | GLclampx* 32 0x%08x 22 | GLeglImageOES* 32 0x%08x 23 | GLfixed* 32 0x%08x 24 | GLfloat* 32 0x%08x 25 | GLint* 32 0x%08x 26 | GLshort* 32 0x%08x 27 | GLsizei* 32 0x%08x 28 | GLubyte* 32 0x%08x 29 | GLuint* 32 0x%08x 30 | GLvoid* 32 0x%08x 31 | GLchar* 32 0x%08x 32 | GLchar** 32 0x%08x 33 | GLvoid** 32 0x%08x 34 | void* 32 0x%08x 35 | GLstr* 32 0x%08x 36 | GLvoidptr* 32 0x%08x 37 | GLchar*const* 32 0x%08x 38 | GLvoid*const* 32 0x%08x 39 | -------------------------------------------------------------------------------- /external/android-emugl/host/libs/GLESv2_dec/gles2_types.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 | #ifndef _GL_2_TYPES_H_ 17 | #define _GL_2_TYPES_H_ 18 | #include "gl_base_types.h" 19 | 20 | typedef void *GLvoidptr; 21 | #endif 22 | -------------------------------------------------------------------------------- /external/android-emugl/host/libs/Translator/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(GLcommon) 2 | add_subdirectory(EGL) 3 | add_subdirectory(GLES_CM) 4 | add_subdirectory(GLES_V2) 5 | -------------------------------------------------------------------------------- /external/android-emugl/host/libs/Translator/EGL/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(SOURCES 2 | ThreadInfo.cpp 3 | EglImp.cpp 4 | EglConfig.cpp 5 | EglContext.cpp 6 | EglGlobalInfo.cpp 7 | EglValidate.cpp 8 | EglSurface.cpp 9 | EglWindowSurface.cpp 10 | EglPbufferSurface.cpp 11 | EglThreadInfo.cpp 12 | EglDisplay.cpp 13 | EglOsApi_glx.cpp 14 | ClientAPIExts.cpp) 15 | 16 | include_directories(BEFORE 17 | ${EGL_INCLUDE_DIRS} 18 | ${GLESv2_INCLUDE_DIRS}) 19 | 20 | add_library(EGL_translator SHARED ${SOURCES}) 21 | target_link_libraries(EGL_translator 22 | GLcommon 23 | ${EGL_LDFLAGS} 24 | ${EGL_LIBRARIES} 25 | ${GLESv2_LDFLAGS} 26 | ${GLESv2_LIBRARIES}) 27 | 28 | install( 29 | TARGETS EGL_translator 30 | LIBRARY DESTINATION ${ANBOX_TRANSLATOR_INSTALL_DIR}) 31 | -------------------------------------------------------------------------------- /external/android-emugl/host/libs/Translator/EGL/ClientAPIExts.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 | #ifndef _CLIENT_APIS_EXTS_H 17 | #define _CLIENT_APIS_EXTS_H 18 | 19 | #include "GLcommon/TranslatorIfaces.h" 20 | 21 | namespace ClientAPIExts 22 | { 23 | 24 | void initClientFuncs(const GLESiface *iface, int idx); 25 | __translatorMustCastToProperFunctionPointerType getProcAddress(const char *fname); 26 | 27 | } // of namespace ClientAPIExts 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /external/android-emugl/host/libs/Translator/EGL/MacPixelFormatsAttribs.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 MAC_PIXELS_FORMATS_ATTRIBS_H 18 | #define MAC_PIXELS_FORMATS_ATTRIBS_H 19 | 20 | #include 21 | NSOpenGLPixelFormatAttribute** getPixelFormatsAttributes(int* size); 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /external/android-emugl/host/libs/Translator/GLES_CM/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | 3 | host_common_SRC_FILES := \ 4 | GLEScmImp.cpp \ 5 | GLEScmUtils.cpp \ 6 | GLEScmContext.cpp \ 7 | GLEScmValidate.cpp 8 | 9 | 10 | ### GLES_CM host implementation (On top of OpenGL) ######################## 11 | $(call emugl-begin-host-shared-library,lib$(BUILD_TARGET_SUFFIX)GLES_CM_translator) 12 | $(call emugl-import,libGLcommon) 13 | LOCAL_SRC_FILES := $(host_common_SRC_FILES) 14 | $(call emugl-end-module) 15 | -------------------------------------------------------------------------------- /external/android-emugl/host/libs/Translator/GLES_CM/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(SOURCES 2 | GLEScmImp.cpp 3 | GLEScmUtils.cpp 4 | GLEScmContext.cpp 5 | GLEScmValidate.cpp) 6 | 7 | add_library(GLES_CM_translator SHARED ${SOURCES}) 8 | target_link_libraries(GLES_CM_translator GLcommon) 9 | 10 | install( 11 | TARGETS GLES_CM_translator 12 | LIBRARY DESTINATION ${ANBOX_TRANSLATOR_INSTALL_DIR}) 13 | -------------------------------------------------------------------------------- /external/android-emugl/host/libs/Translator/GLES_CM/GLEScmUtils.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 | #ifndef GLES_UTILS_H 17 | #define GLES_UTILS_H 18 | #include 19 | #include 20 | 21 | size_t glParamSize(GLenum param); 22 | #endif 23 | -------------------------------------------------------------------------------- /external/android-emugl/host/libs/Translator/GLES_V2/.GLESv2Imp.cpp.swp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lag-linaro/robox/0bc0774c244d929f98e3c84c24183ac151403aa1/external/android-emugl/host/libs/Translator/GLES_V2/.GLESv2Imp.cpp.swp -------------------------------------------------------------------------------- /external/android-emugl/host/libs/Translator/GLES_V2/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | 3 | host_common_SRC_FILES := \ 4 | GLESv2Imp.cpp \ 5 | GLESv2Context.cpp \ 6 | GLESv2Validate.cpp \ 7 | ShaderParser.cpp \ 8 | ProgramData.cpp 9 | 10 | 11 | ### GLES_V2 host implementation (On top of OpenGL) ######################## 12 | $(call emugl-begin-host-shared-library,lib$(BUILD_TARGET_SUFFIX)GLES_V2_translator) 13 | $(call emugl-import, libGLcommon) 14 | 15 | LOCAL_SRC_FILES := $(host_common_SRC_FILES) 16 | 17 | $(call emugl-end-module) 18 | -------------------------------------------------------------------------------- /external/android-emugl/host/libs/Translator/GLES_V2/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(SOURCES 2 | GLESv2Imp.cpp 3 | GLESv2Context.cpp 4 | GLESv2Validate.cpp 5 | ShaderParser.cpp 6 | ProgramData.cpp) 7 | 8 | add_library(GLES_V2_translator SHARED ${SOURCES}) 9 | target_link_libraries(GLES_V2_translator GLcommon) 10 | 11 | install( 12 | TARGETS GLES_V2_translator 13 | LIBRARY DESTINATION ${ANBOX_TRANSLATOR_INSTALL_DIR}) 14 | -------------------------------------------------------------------------------- /external/android-emugl/host/libs/Translator/GLcommon/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(SOURCES 2 | GLDispatch.cpp 3 | GLutils.cpp 4 | GLEScontext.cpp 5 | GLESvalidate.cpp 6 | GLESpointer.cpp 7 | GLESbuffer.cpp 8 | RangeManip.cpp 9 | TextureUtils.cpp 10 | PaletteTexture.cpp 11 | etc1.cpp 12 | objectNameManager.cpp 13 | FramebufferData.cpp) 14 | 15 | add_library(GLcommon STATIC ${SOURCES}) 16 | target_link_libraries(GLcommon 17 | emugl_common) 18 | -------------------------------------------------------------------------------- /external/android-emugl/host/libs/Translator/GLcommon/GLutils.cpp: -------------------------------------------------------------------------------- 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 | #include 17 | 18 | bool isPowerOf2(int num) { 19 | return (num & (num -1)) == 0; 20 | } 21 | -------------------------------------------------------------------------------- /external/android-emugl/host/libs/Translator/include/GLcommon/GLconversion_macros.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 | #ifndef _GL_FIXED_OPS_H 17 | #define _GL_FIXED_OPS_H 18 | 19 | #define X2F(x) (((float)(x))/65536.0f) 20 | #define X2D(x) (((double)(x))/65536.0) 21 | #define X2I(x) ((x) /65536) 22 | #define B2S(x) ((short)x) 23 | 24 | 25 | #define F2X(d) ((d) > 32767.65535 ? 32767 * 65536 + 65535 : \ 26 | (d) < -32768.65535 ? -32768 * 65536 + 65535 : \ 27 | ((GLfixed) ((d) * 65536))) 28 | 29 | #define I2X(d) ((d)*65536) 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /external/android-emugl/host/libs/Translator/include/GLcommon/PaletteTexture.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 | #ifndef __PALETTE_TEXTURE_H__ 17 | #define __PALETTE_TEXTURE_H__ 18 | 19 | #include 20 | 21 | #define MAX_SUPPORTED_PALETTE 10 22 | 23 | unsigned char* uncompressTexture(GLenum internalformat,GLenum& formatOut,GLsizei width,GLsizei height,GLsizei imageSize, const GLvoid* data,GLint level); 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /external/android-emugl/host/libs/Translator/include/GLcommon/TextureUtils.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 | #ifndef _TEXTURE_UTILS_H 17 | #define _TEXTURE_UTILS_H 18 | 19 | #include 20 | #include 21 | #include "GLEScontext.h" 22 | #include "PaletteTexture.h" 23 | #include "etc1.h" 24 | 25 | int getCompressedFormats(int* formats); 26 | void doCompressedTexImage2D(GLEScontext * ctx, GLenum target, GLint level, 27 | GLenum internalformat, GLsizei width, 28 | GLsizei height, GLint border, 29 | GLsizei imageSize, const GLvoid* data, void * funcPtr); 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /external/android-emugl/host/libs/libOpenGLESDispatch/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(SOURCES 2 | EGLDispatch.cpp 3 | GLESv2Dispatch.cpp 4 | GLESv1Dispatch.cpp) 5 | 6 | add_library(OpenGLESDispatch STATIC ${SOURCES}) 7 | add_dependencies(OpenGLESDispatch GLHeaders) 8 | target_link_libraries(OpenGLESDispatch 9 | emugl_common 10 | GLESv2_dec 11 | GLESv1_dec) 12 | -------------------------------------------------------------------------------- /external/android-emugl/host/libs/libOpenGLESDispatch/gles2_extensions.entries: -------------------------------------------------------------------------------- 1 | !gles2_extensions 2 | 3 | # GLES 2.0 extensions 4 | void glGetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision); 5 | void glReleaseShaderCompiler(void); 6 | void glShaderBinary(GLsizei n, const GLuint* shaders, GLenum binaryformat, const GLvoid* binary, GLsizei length); 7 | -------------------------------------------------------------------------------- /external/android-emugl/host/libs/libOpenGLESDispatch/gles3_only.entries: -------------------------------------------------------------------------------- 1 | !gles3_only 2 | 3 | # GLES 3.x functions required by the translator library. 4 | # Right now, this is only use to get glGetStringi() from the host GL library 5 | # in order to deal with the fact that glGetString(GL_EXTENSIONS) is obsolete 6 | # in OpenGL 3.0, and some drivers don't implement it anymore (i.e. the 7 | # function just returns NULL). 8 | 9 | %#include 10 | % 11 | %// Used to avoid adding GLES3/gl3.h to our headers. 12 | %#ifndef GL_NUM_EXTENSIONS 13 | %#define GL_NUM_EXTENSIONS 0x821D 14 | %#endif 15 | 16 | %typedef const GLubyte* GLconstubyteptr; 17 | 18 | GLconstubyteptr glGetStringi(GLenum name, GLint index); 19 | -------------------------------------------------------------------------------- /external/android-emugl/host/libs/libOpenGLESDispatch/render_egl_extensions.entries: -------------------------------------------------------------------------------- 1 | # The list of EGL extension functions used by libOpenglRender. 2 | # This is only a subset of the full EGL API. 3 | 4 | !Render_EGL_extensions 5 | 6 | %#include 7 | %#define EGL_EGLEXT_PROTOTYPES 8 | %#include 9 | 10 | EGLImageKHR eglCreateImageKHR(EGLDisplay display, EGLContext context, EGLenum target, EGLClientBuffer buffer, const EGLint* attrib_list); 11 | EGLBoolean eglDestroyImageKHR(EGLDisplay display, EGLImageKHR image); 12 | -------------------------------------------------------------------------------- /external/android-emugl/host/libs/renderControl_dec/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(GENERATED_SOURCES 2 | renderControl_dec.cpp 3 | renderControl_server_context.cpp) 4 | 5 | add_custom_command( 6 | OUTPUT ${GENERATED_SOURCES} 7 | POST_BUILD 8 | COMMAND ${CMAKE_BINARY_DIR}/external/android-emugl/host/tools/emugen/emugen 9 | -D ${CMAKE_CURRENT_BINARY_DIR} renderControl 10 | WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} 11 | DEPENDS emugen) 12 | 13 | if ("${cmake_build_type_lower}" STREQUAL "trace") 14 | set(OPENGL_DEBUG "-DOPENGL_DEBUG_PRINTOUT -DCHECK_GL_ERROR") 15 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OPENGL_DEBUG}") 16 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OPENGL_DEBUG}") 17 | endif() 18 | 19 | add_library(renderControl_dec STATIC ${GENERATED_SOURCES}) 20 | target_link_libraries(renderControl_dec OpenglCodecCommon) 21 | -------------------------------------------------------------------------------- /external/android-emugl/host/libs/renderControl_dec/renderControl.attrib: -------------------------------------------------------------------------------- 1 | GLOBAL 2 | base_opcode 10000 3 | encoder_headers "glUtils.h" 4 | 5 | rcGetEGLVersion 6 | dir major out 7 | len major sizeof(EGLint) 8 | dir minor out 9 | len minor sizeof(EGLint) 10 | 11 | rcQueryEGLString 12 | dir buffer out 13 | len buffer bufferSize 14 | 15 | rcGetGLString 16 | dir buffer out 17 | len buffer bufferSize 18 | 19 | rcGetNumConfigs 20 | dir numAttribs out 21 | len numAttribs sizeof(uint32_t) 22 | 23 | rcGetConfigs 24 | dir buffer out 25 | len buffer bufSize 26 | 27 | rcChooseConfig 28 | dir attribs in 29 | len attribs attribs_size 30 | dir configs out 31 | var_flag configs nullAllowed 32 | len configs configs_size*sizeof(uint32_t) 33 | 34 | rcReadColorBuffer 35 | dir pixels out 36 | len pixels (((glUtilsPixelBitSize(format, type) * width) >> 3) * height) 37 | 38 | rcUpdateColorBuffer 39 | dir pixels in 40 | len pixels (((glUtilsPixelBitSize(format, type) * width) >> 3) * height) 41 | var_flag pixels isLarge 42 | 43 | rcCloseColorBuffer 44 | flag flushOnEncode 45 | 46 | rcPostLayer 47 | len name (strlen(name) + 1) 48 | -------------------------------------------------------------------------------- /external/android-emugl/host/libs/renderControl_dec/renderControl.types: -------------------------------------------------------------------------------- 1 | uint32_t 32 0x%08x 2 | int32_t 32 0x%08x 3 | EGLint 32 0x%08x 4 | GLint 32 0x%08x 5 | GLuint 32 0x%08x 6 | GLenum 32 0x%08x 7 | EGLenum 32 0x%08x 8 | uint32_t* 32 0x%08x 9 | EGLint* 32 0x%08x 10 | GLint* 32 0x%08x 11 | GLuint* 32 0x%08x 12 | void* 32 0x%08x 13 | char* 32 0x%08x 14 | -------------------------------------------------------------------------------- /external/android-emugl/host/libs/renderControl_dec/renderControl_types.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 | #include 18 | #include 19 | #include "glUtils.h" 20 | 21 | // values for 'param' argument of rcGetFBParam 22 | #define FB_WIDTH 1 23 | #define FB_HEIGHT 2 24 | #define FB_XDPI 3 25 | #define FB_YDPI 4 26 | #define FB_FPS 5 27 | #define FB_MIN_SWAP_INTERVAL 6 28 | #define FB_MAX_SWAP_INTERVAL 7 29 | -------------------------------------------------------------------------------- /external/android-emugl/host/tools/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(emugen) 2 | -------------------------------------------------------------------------------- /external/android-emugl/host/tools/emugen/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if (NOT "${HOST_CMAKE_CXX_COMPILER}" STREQUAL "") 2 | set (CMAKE_CXX_COMPILER "${HOST_CMAKE_CXX_COMPILER}") 3 | endif() 4 | 5 | set(SOURCES 6 | ApiGen.cpp 7 | EntryPoint.cpp 8 | main.cpp 9 | Parser.cpp 10 | strUtils.cpp 11 | TypeFactory.cpp) 12 | 13 | add_executable(emugen ${SOURCES}) 14 | -------------------------------------------------------------------------------- /external/android-emugl/host/tools/emugen/TypeFactory.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 | #ifndef __TYPE__FACTORY__H__ 17 | #define __TYPE__FACTORY__H__ 18 | 19 | #include 20 | #include "VarType.h" 21 | 22 | class TypeFactory { 23 | public: 24 | static TypeFactory *instance() { 25 | if (m_instance == NULL) { 26 | m_instance = new TypeFactory; 27 | } 28 | return m_instance; 29 | } 30 | const VarType * getVarTypeByName(const std::string &type); 31 | int initFromFile(const std::string &filename); 32 | private: 33 | static TypeFactory *m_instance; 34 | void initBaseTypes(); 35 | TypeFactory() {} 36 | }; 37 | #endif 38 | -------------------------------------------------------------------------------- /external/android-emugl/host/tools/emugen/errors.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 | #ifndef _ERRORS_H_ 17 | #define _ERRORS_H_ 18 | 19 | #define BAD_USAGE -1 20 | #define BAD_SPEC_FILE -2 21 | #define BAD_TYPES_FILE -3 22 | #define BAD_ATTRIBUTES_FILE -4 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /external/android-emugl/host/tools/emugen/getopt.h: -------------------------------------------------------------------------------- 1 | #ifndef GETOPT_H 2 | #define GETOPT_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | extern int optind; 9 | extern char* optarg; 10 | extern int optopt; 11 | 12 | int getopt(int argc, char* const argv[], const char* ostr); 13 | 14 | #ifdef __cplusplus 15 | } 16 | #endif 17 | 18 | #endif // GETOPT_H 19 | -------------------------------------------------------------------------------- /external/android-emugl/host/tools/emugen/strUtils.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 | #ifndef STR_UTILS_H_ 17 | #define STR_UTILS_H_ 18 | 19 | #include 20 | #include 21 | 22 | #define WHITESPACE " \t\n" 23 | 24 | std::string trim(const std::string & str); 25 | std::string getNextToken(const std::string & str, size_t pos, size_t * last, const std::string & delim); 26 | template std::string inline toString(const T& t) { 27 | std::stringstream ss; 28 | ss << t; 29 | return ss.str(); 30 | 31 | } 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /external/android-emugl/host/tools/emugen/tests/t.001/expected/decoder/foo_dec.h: -------------------------------------------------------------------------------- 1 | // Generated Code - DO NOT EDIT !! 2 | // generated by 'emugen' 3 | 4 | #ifndef GUARD_foo_decoder_context_t 5 | #define GUARD_foo_decoder_context_t 6 | 7 | #include "IOStream.h" 8 | #include "foo_server_context.h" 9 | 10 | 11 | 12 | struct foo_decoder_context_t : public foo_server_context_t { 13 | 14 | size_t decode(void *buf, size_t bufsize, IOStream *stream); 15 | 16 | }; 17 | 18 | #endif // GUARD_foo_decoder_context_t 19 | -------------------------------------------------------------------------------- /external/android-emugl/host/tools/emugen/tests/t.001/expected/decoder/foo_opcodes.h: -------------------------------------------------------------------------------- 1 | // Generated Code - DO NOT EDIT !! 2 | // generated by 'emugen' 3 | #ifndef __GUARD_foo_opcodes_h_ 4 | #define __GUARD_foo_opcodes_h_ 5 | 6 | #define OP_fooAlphaFunc 200 7 | #define OP_fooIsBuffer 201 8 | #define OP_fooUnsupported 202 9 | #define OP_fooDoEncoderFlush 203 10 | #define OP_fooTakeConstVoidPtrConstPtr 204 11 | #define OP_last 205 12 | 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /external/android-emugl/host/tools/emugen/tests/t.001/expected/decoder/foo_server_context.cpp: -------------------------------------------------------------------------------- 1 | // Generated Code - DO NOT EDIT !! 2 | // generated by 'emugen' 3 | 4 | 5 | #include 6 | #include "foo_server_context.h" 7 | 8 | 9 | #include 10 | 11 | int foo_server_context_t::initDispatchByName(void *(*getProc)(const char *, void *userData), void *userData) 12 | { 13 | fooAlphaFunc = (fooAlphaFunc_server_proc_t) getProc("fooAlphaFunc", userData); 14 | fooIsBuffer = (fooIsBuffer_server_proc_t) getProc("fooIsBuffer", userData); 15 | fooUnsupported = (fooUnsupported_server_proc_t) getProc("fooUnsupported", userData); 16 | fooDoEncoderFlush = (fooDoEncoderFlush_server_proc_t) getProc("fooDoEncoderFlush", userData); 17 | fooTakeConstVoidPtrConstPtr = (fooTakeConstVoidPtrConstPtr_server_proc_t) getProc("fooTakeConstVoidPtrConstPtr", userData); 18 | return 0; 19 | } 20 | 21 | -------------------------------------------------------------------------------- /external/android-emugl/host/tools/emugen/tests/t.001/expected/decoder/foo_server_context.h: -------------------------------------------------------------------------------- 1 | // Generated Code - DO NOT EDIT !! 2 | // generated by 'emugen' 3 | #ifndef __foo_server_context_t_h 4 | #define __foo_server_context_t_h 5 | 6 | #include "foo_server_proc.h" 7 | 8 | #include "foo_types.h" 9 | 10 | 11 | struct foo_server_context_t { 12 | 13 | fooAlphaFunc_server_proc_t fooAlphaFunc; 14 | fooIsBuffer_server_proc_t fooIsBuffer; 15 | fooUnsupported_server_proc_t fooUnsupported; 16 | fooDoEncoderFlush_server_proc_t fooDoEncoderFlush; 17 | fooTakeConstVoidPtrConstPtr_server_proc_t fooTakeConstVoidPtrConstPtr; 18 | virtual ~foo_server_context_t() {} 19 | int initDispatchByName( void *(*getProc)(const char *name, void *userData), void *userData); 20 | }; 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /external/android-emugl/host/tools/emugen/tests/t.001/expected/decoder/foo_server_proc.h: -------------------------------------------------------------------------------- 1 | // Generated Code - DO NOT EDIT !! 2 | // generated by 'emugen' 3 | #ifndef __foo_server_proc_t_h 4 | #define __foo_server_proc_t_h 5 | 6 | 7 | 8 | #include "foo_types.h" 9 | 10 | #include "emugl/common/logging.h" 11 | #ifndef foo_APIENTRY 12 | #define foo_APIENTRY 13 | #endif 14 | typedef void (foo_APIENTRY *fooAlphaFunc_server_proc_t) (FooInt, FooFloat); 15 | typedef FooBoolean (foo_APIENTRY *fooIsBuffer_server_proc_t) (void*); 16 | typedef void (foo_APIENTRY *fooUnsupported_server_proc_t) (void*); 17 | typedef void (foo_APIENTRY *fooDoEncoderFlush_server_proc_t) (FooInt); 18 | typedef void (foo_APIENTRY *fooTakeConstVoidPtrConstPtr_server_proc_t) (const void* const*); 19 | 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /external/android-emugl/host/tools/emugen/tests/t.001/expected/encoder/foo_client_context.cpp: -------------------------------------------------------------------------------- 1 | // Generated Code - DO NOT EDIT !! 2 | // generated by 'emugen' 3 | 4 | 5 | #include 6 | #include "foo_client_context.h" 7 | 8 | 9 | #include 10 | 11 | int foo_client_context_t::initDispatchByName(void *(*getProc)(const char *, void *userData), void *userData) 12 | { 13 | fooAlphaFunc = (fooAlphaFunc_client_proc_t) getProc("fooAlphaFunc", userData); 14 | fooIsBuffer = (fooIsBuffer_client_proc_t) getProc("fooIsBuffer", userData); 15 | fooUnsupported = (fooUnsupported_client_proc_t) getProc("fooUnsupported", userData); 16 | fooDoEncoderFlush = (fooDoEncoderFlush_client_proc_t) getProc("fooDoEncoderFlush", userData); 17 | fooTakeConstVoidPtrConstPtr = (fooTakeConstVoidPtrConstPtr_client_proc_t) getProc("fooTakeConstVoidPtrConstPtr", userData); 18 | return 0; 19 | } 20 | 21 | -------------------------------------------------------------------------------- /external/android-emugl/host/tools/emugen/tests/t.001/expected/encoder/foo_client_context.h: -------------------------------------------------------------------------------- 1 | // Generated Code - DO NOT EDIT !! 2 | // generated by 'emugen' 3 | #ifndef __foo_client_context_t_h 4 | #define __foo_client_context_t_h 5 | 6 | #include "foo_client_proc.h" 7 | 8 | #include "foo_types.h" 9 | 10 | 11 | struct foo_client_context_t { 12 | 13 | fooAlphaFunc_client_proc_t fooAlphaFunc; 14 | fooIsBuffer_client_proc_t fooIsBuffer; 15 | fooUnsupported_client_proc_t fooUnsupported; 16 | fooDoEncoderFlush_client_proc_t fooDoEncoderFlush; 17 | fooTakeConstVoidPtrConstPtr_client_proc_t fooTakeConstVoidPtrConstPtr; 18 | virtual ~foo_client_context_t() {} 19 | 20 | typedef foo_client_context_t *CONTEXT_ACCESSOR_TYPE(void); 21 | static void setContextAccessor(CONTEXT_ACCESSOR_TYPE *f); 22 | int initDispatchByName( void *(*getProc)(const char *name, void *userData), void *userData); 23 | virtual void setError(unsigned int error){ (void)error; }; 24 | virtual unsigned int getError(){ return 0; }; 25 | }; 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /external/android-emugl/host/tools/emugen/tests/t.001/expected/encoder/foo_client_proc.h: -------------------------------------------------------------------------------- 1 | // Generated Code - DO NOT EDIT !! 2 | // generated by 'emugen' 3 | #ifndef __foo_client_proc_t_h 4 | #define __foo_client_proc_t_h 5 | 6 | 7 | 8 | #include "foo_types.h" 9 | 10 | #include "emugl/common/logging.h" 11 | #ifndef foo_APIENTRY 12 | #define foo_APIENTRY 13 | #endif 14 | typedef void (foo_APIENTRY *fooAlphaFunc_client_proc_t) (void * ctx, FooInt, FooFloat); 15 | typedef FooBoolean (foo_APIENTRY *fooIsBuffer_client_proc_t) (void * ctx, void*); 16 | typedef void (foo_APIENTRY *fooUnsupported_client_proc_t) (void * ctx, void*); 17 | typedef void (foo_APIENTRY *fooDoEncoderFlush_client_proc_t) (void * ctx, FooInt); 18 | typedef void (foo_APIENTRY *fooTakeConstVoidPtrConstPtr_client_proc_t) (void * ctx, const void* const*); 19 | 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /external/android-emugl/host/tools/emugen/tests/t.001/expected/encoder/foo_enc.h: -------------------------------------------------------------------------------- 1 | // Generated Code - DO NOT EDIT !! 2 | // generated by 'emugen' 3 | 4 | #ifndef GUARD_foo_encoder_context_t 5 | #define GUARD_foo_encoder_context_t 6 | 7 | #include "IOStream.h" 8 | #include "ChecksumCalculator.h" 9 | #include "foo_client_context.h" 10 | 11 | 12 | #include "fooUtils.h" 13 | #include "fooBase.h" 14 | 15 | struct foo_encoder_context_t : public foo_client_context_t { 16 | 17 | IOStream *m_stream; 18 | ChecksumCalculator *m_checksumCalculator; 19 | 20 | foo_encoder_context_t(IOStream *stream, ChecksumCalculator *checksumCalculator); 21 | }; 22 | 23 | #endif // GUARD_foo_encoder_context_t -------------------------------------------------------------------------------- /external/android-emugl/host/tools/emugen/tests/t.001/expected/encoder/foo_ftable.h: -------------------------------------------------------------------------------- 1 | // Generated Code - DO NOT EDIT !! 2 | // generated by 'emugen' 3 | #ifndef __foo_client_ftable_t_h 4 | #define __foo_client_ftable_t_h 5 | 6 | 7 | static const struct _foo_funcs_by_name { 8 | const char *name; 9 | void *proc; 10 | } foo_funcs_by_name[] = { 11 | {"fooAlphaFunc", (void*)fooAlphaFunc}, 12 | {"fooIsBuffer", (void*)fooIsBuffer}, 13 | {"fooUnsupported", (void*)fooUnsupported}, 14 | {"fooDoEncoderFlush", (void*)fooDoEncoderFlush}, 15 | {"fooTakeConstVoidPtrConstPtr", (void*)fooTakeConstVoidPtrConstPtr}, 16 | }; 17 | static const int foo_num_funcs = sizeof(foo_funcs_by_name) / sizeof(struct _foo_funcs_by_name); 18 | 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /external/android-emugl/host/tools/emugen/tests/t.001/expected/encoder/foo_opcodes.h: -------------------------------------------------------------------------------- 1 | // Generated Code - DO NOT EDIT !! 2 | // generated by 'emugen' 3 | #ifndef __GUARD_foo_opcodes_h_ 4 | #define __GUARD_foo_opcodes_h_ 5 | 6 | #define OP_fooAlphaFunc 200 7 | #define OP_fooIsBuffer 201 8 | #define OP_fooUnsupported 202 9 | #define OP_fooDoEncoderFlush 203 10 | #define OP_fooTakeConstVoidPtrConstPtr 204 11 | #define OP_last 205 12 | 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /external/android-emugl/host/tools/emugen/tests/t.001/expected/wrapper/foo_wrapper_context.cpp: -------------------------------------------------------------------------------- 1 | // Generated Code - DO NOT EDIT !! 2 | // generated by 'emugen' 3 | 4 | 5 | #include 6 | #include "foo_wrapper_context.h" 7 | 8 | 9 | #include 10 | 11 | int foo_wrapper_context_t::initDispatchByName(void *(*getProc)(const char *, void *userData), void *userData) 12 | { 13 | fooAlphaFunc = (fooAlphaFunc_wrapper_proc_t) getProc("fooAlphaFunc", userData); 14 | fooIsBuffer = (fooIsBuffer_wrapper_proc_t) getProc("fooIsBuffer", userData); 15 | fooUnsupported = (fooUnsupported_wrapper_proc_t) getProc("fooUnsupported", userData); 16 | fooDoEncoderFlush = (fooDoEncoderFlush_wrapper_proc_t) getProc("fooDoEncoderFlush", userData); 17 | fooTakeConstVoidPtrConstPtr = (fooTakeConstVoidPtrConstPtr_wrapper_proc_t) getProc("fooTakeConstVoidPtrConstPtr", userData); 18 | return 0; 19 | } 20 | 21 | -------------------------------------------------------------------------------- /external/android-emugl/host/tools/emugen/tests/t.001/expected/wrapper/foo_wrapper_context.h: -------------------------------------------------------------------------------- 1 | // Generated Code - DO NOT EDIT !! 2 | // generated by 'emugen' 3 | #ifndef __foo_wrapper_context_t_h 4 | #define __foo_wrapper_context_t_h 5 | 6 | #include "foo_server_proc.h" 7 | 8 | #include "foo_types.h" 9 | 10 | 11 | struct foo_wrapper_context_t { 12 | 13 | fooAlphaFunc_wrapper_proc_t fooAlphaFunc; 14 | fooIsBuffer_wrapper_proc_t fooIsBuffer; 15 | fooUnsupported_wrapper_proc_t fooUnsupported; 16 | fooDoEncoderFlush_wrapper_proc_t fooDoEncoderFlush; 17 | fooTakeConstVoidPtrConstPtr_wrapper_proc_t fooTakeConstVoidPtrConstPtr; 18 | virtual ~foo_wrapper_context_t() {} 19 | 20 | typedef foo_wrapper_context_t *CONTEXT_ACCESSOR_TYPE(void); 21 | static void setContextAccessor(CONTEXT_ACCESSOR_TYPE *f); 22 | int initDispatchByName( void *(*getProc)(const char *name, void *userData), void *userData); 23 | }; 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /external/android-emugl/host/tools/emugen/tests/t.001/expected/wrapper/foo_wrapper_proc.h: -------------------------------------------------------------------------------- 1 | // Generated Code - DO NOT EDIT !! 2 | // generated by 'emugen' 3 | #ifndef __foo_wrapper_proc_t_h 4 | #define __foo_wrapper_proc_t_h 5 | 6 | 7 | 8 | #include "foo_types.h" 9 | 10 | #include "emugl/common/logging.h" 11 | #ifndef foo_APIENTRY 12 | #define foo_APIENTRY 13 | #endif 14 | typedef void (foo_APIENTRY *fooAlphaFunc_wrapper_proc_t) (FooInt, FooFloat); 15 | typedef FooBoolean (foo_APIENTRY *fooIsBuffer_wrapper_proc_t) (void*); 16 | typedef void (foo_APIENTRY *fooUnsupported_wrapper_proc_t) (void*); 17 | typedef void (foo_APIENTRY *fooDoEncoderFlush_wrapper_proc_t) (FooInt); 18 | typedef void (foo_APIENTRY *fooTakeConstVoidPtrConstPtr_wrapper_proc_t) (const void* const*); 19 | 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /external/android-emugl/host/tools/emugen/tests/t.001/input/foo.attrib: -------------------------------------------------------------------------------- 1 | GLOBAL 2 | base_opcode 200 3 | encoder_headers "fooUtils.h" "fooBase.h" 4 | 5 | fooIsBuffer 6 | dir stuff in 7 | len stuff (4 * sizeof(float)) 8 | param_check stuff if (n == NULL) { LOG(ERROR) << "NULL stuff"; return; } 9 | 10 | fooUnsupported 11 | dir params in 12 | flag unsupported 13 | 14 | fooDoEncoderFlush 15 | flag flushOnEncode 16 | -------------------------------------------------------------------------------- /external/android-emugl/host/tools/emugen/tests/t.001/input/foo.in: -------------------------------------------------------------------------------- 1 | FOO_ENTRY(void, fooAlphaFunc, FooInt func, FooFloat ref) 2 | FOO_ENTRY(FooBoolean, fooIsBuffer, void* stuff) 3 | FOO_ENTRY(void, fooUnsupported, void* params) 4 | FOO_ENTRY(void, fooDoEncoderFlush, FooInt param) 5 | FOO_ENTRY(void, fooTakeConstVoidPtrConstPtr, const void* const* param) 6 | -------------------------------------------------------------------------------- /external/android-emugl/host/tools/emugen/tests/t.001/input/foo.types: -------------------------------------------------------------------------------- 1 | FooBoolean 8 %d 2 | FooInt 32 %d 3 | FooShort 16 %d 4 | FooFloat 32 %f 5 | FooEnum 32 %08x 6 | FooVoid 0 %x 7 | FooChar 8 %d 8 | FooChar* 32 0x%08x 9 | void* 32 0x%08x 10 | void*const* 32 0x%08x 11 | -------------------------------------------------------------------------------- /external/android-emugl/shared/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(emugl) 2 | add_subdirectory(OpenglCodecCommon) 3 | -------------------------------------------------------------------------------- /external/android-emugl/shared/OpenglCodecCommon/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(SOURCES 2 | ChecksumCalculator.cpp 3 | ChecksumCalculator.h 4 | ChecksumCalculatorThreadInfo.cpp 5 | ChecksumCalculatorThreadInfo.h 6 | CMakeLists.txt 7 | ErrorLog.h 8 | gl_base_types.h 9 | GLDecoderContextData.h 10 | glUtils.cpp 11 | glUtils.h 12 | Makefile 13 | ProtocolUtils.h) 14 | 15 | add_library(OpenglCodecCommon STATIC ${SOURCES}) 16 | -------------------------------------------------------------------------------- /external/android-emugl/shared/OpenglCodecCommon/ErrorLog.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 | #ifndef _ERROR_LOG_H_ 17 | #define _ERROR_LOG_H_ 18 | 19 | #include 20 | #define ERR(...) fprintf(stderr, __VA_ARGS__) 21 | #define EMUGL_DEBUG 22 | #ifdef EMUGL_DEBUG 23 | # define DBG(...) fprintf(stderr, __VA_ARGS__) 24 | #else 25 | # define DBG(...) ((void)0) 26 | #endif 27 | 28 | #endif // _ERROR_LOG_H_ 29 | -------------------------------------------------------------------------------- /external/android-emugl/shared/OpenglCodecCommon/Makefile: -------------------------------------------------------------------------------- 1 | 2 | ROOT=../.. 3 | 4 | include $(ROOT)/make/commondefs 5 | 6 | CXXFILES = TcpStream.cpp GLClientState.cpp glUtils.cpp 7 | CXXINCS += -I$(ROOT)/libs/GLESv1 -I$(ROOT)/include 8 | 9 | LIBRARY_NAME = libcodecCommon.a 10 | 11 | include $(COMMONRULES) 12 | 13 | 14 | -------------------------------------------------------------------------------- /external/android-emugl/shared/OpenglCodecCommon/glUtils.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 | #pragma once 17 | 18 | #include 19 | #include 20 | #include 21 | #include 22 | 23 | #include 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | size_t glSizeof(GLenum type); 30 | 31 | size_t glUtilsParamSize(GLenum param); 32 | 33 | void glUtilsPackPointerData(unsigned char *dst, unsigned char *str, 34 | int size, GLenum type, unsigned int stride, 35 | unsigned int datalen); 36 | 37 | int glUtilsPixelBitSize(GLenum format, GLenum type); 38 | 39 | #ifdef __cplusplus 40 | } 41 | #endif 42 | -------------------------------------------------------------------------------- /external/android-emugl/shared/emugl/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(common) 2 | -------------------------------------------------------------------------------- /external/android-emugl/shared/emugl/common/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(COMMON_SOURCES 2 | condition_variable.h 3 | crash_reporter.cpp 4 | crash_reporter.h 5 | id_to_object_map.cpp 6 | id_to_object_map.h 7 | lazy_instance.cpp 8 | lazy_instance.h 9 | logging.cpp 10 | logging.h 11 | message_channel.cpp 12 | message_channel.h 13 | mutex.h 14 | mutex_unittest.cpp 15 | pod_vector.cpp 16 | pod_vector.h 17 | scoped_pointer_vector.h 18 | shared_library.cpp 19 | shared_library.h 20 | smart_ptr.cpp 21 | smart_ptr.h 22 | sockets.cpp 23 | sockets.h 24 | thread.h 25 | thread_pthread.cpp 26 | thread_store.cpp 27 | thread_store.h 28 | thread_unittest.cpp 29 | unique_integer_map.h) 30 | 31 | add_library(emugl_common STATIC ${COMMON_SOURCES}) 32 | target_link_libraries(emugl_common 33 | dl pthread) 34 | -------------------------------------------------------------------------------- /external/android-emugl/shared/emugl/common/condition_variable_unittest.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014 The Android Open Source Project 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #include "emugl/common/condition_variable.h" 16 | 17 | #include "emugl/common/mutex.h" 18 | 19 | #include 20 | 21 | namespace emugl { 22 | 23 | TEST(ConditionVariable, init) { 24 | ConditionVariable cond; 25 | } 26 | 27 | } // namespace emugl 28 | -------------------------------------------------------------------------------- /external/android-emugl/shared/emugl/common/crash_reporter.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 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 | #include "crash_reporter.h" 18 | 19 | #include 20 | 21 | void default_crash_reporter(const emugl::LogLevel &level, const char* format, ...) { 22 | abort(); 23 | } 24 | 25 | logger_t emugl_crash_reporter = default_crash_reporter; 26 | 27 | void set_emugl_crash_reporter(logger_t crash_reporter) { 28 | if (crash_reporter) { 29 | emugl_crash_reporter = crash_reporter; 30 | } else { 31 | emugl_crash_reporter = default_crash_reporter; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /external/android-emugl/shared/emugl/common/crash_reporter.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 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 | #pragma once 18 | 19 | #include "emugl/common/logging.h" 20 | 21 | extern logger_t emugl_crash_reporter; 22 | void set_emugl_crash_reporter(logger_t crash_reporter); 23 | -------------------------------------------------------------------------------- /external/android-emugl/shared/emugl/common/logging.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 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 | #include "emugl/common/logging.h" 18 | 19 | void default_logger(const emugl::LogLevel &level, const char* fmt, ...) { } 20 | 21 | logger_t emugl_logger = default_logger; 22 | logger_t emugl_cxt_logger = default_logger; 23 | 24 | void set_emugl_logger(logger_t f) { 25 | if (!f) { 26 | emugl_logger = default_logger; 27 | } else { 28 | emugl_logger = f; 29 | } 30 | } 31 | 32 | void set_emugl_cxt_logger(logger_t f) { 33 | if (!f) { 34 | emugl_cxt_logger = default_logger; 35 | } else { 36 | emugl_cxt_logger = f; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /external/android-emugl/shared/emugl/common/scoped_pointer_vector.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014 The Android Open Source Project 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #ifndef EMUGL_COMMON_SCOPED_POINTER_VECTOR_H 16 | #define EMUGL_COMMON_SCOPED_POINTER_VECTOR_H 17 | 18 | namespace emugl { 19 | 20 | template 21 | class ScopedPointerVector { 22 | ScopedPointerVector 23 | }; 24 | 25 | } // namespace emugl 26 | 27 | #endif // EMUGL_COMMON_SCOPED_POINTER_VECTOR_H 28 | -------------------------------------------------------------------------------- /external/android-emugl/shared/emugl/common/testing/test_shared_library.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014 The Android Open Source Project 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // This source file must be compiled into a simple shared library which 16 | // will be used by shared_library_unittest.cpp to verify that the 17 | // emugl::SharedLibrary class works properly. 18 | 19 | 20 | extern "C" int foo_function(void) { 21 | return 42; 22 | } 23 | -------------------------------------------------------------------------------- /external/process-cpp-minimal/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright © 2013 Canonical Ltd. 2 | # 3 | # This program is free software: you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License version 3 as 5 | # published by the Free Software Foundation. 6 | # 7 | # This program is distributed in the hope that it will be useful, 8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | # GNU General Public License for more details. 11 | # 12 | # You should have received a copy of the GNU General Public License 13 | # along with this program. If not, see . 14 | # 15 | # Authored by: Thomas Voss 16 | 17 | cmake_minimum_required(VERSION 2.8) 18 | 19 | project(process-cpp) 20 | 21 | find_package(Boost COMPONENTS iostreams system REQUIRED) 22 | find_package(Threads REQUIRED) 23 | 24 | include(GNUInstallDirs) 25 | 26 | set(PROCESS_CPP_VERSION_MAJOR 2) 27 | set(PROCESS_CPP_VERSION_MINOR 0) 28 | set(PROCESS_CPP_VERSION_PATCH 0) 29 | 30 | include(CTest) 31 | 32 | include_directories( 33 | include/ 34 | src/ 35 | external/process-cpp-minimal 36 | ${Boost_INCLUDE_DIRS} 37 | ) 38 | 39 | add_subdirectory(src) 40 | -------------------------------------------------------------------------------- /external/process-cpp-minimal/include/core/posix/exit.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2013 Canonical Ltd. 3 | * 4 | * This program is free software: you can redistribute it and/or modify it 5 | * under the terms of the GNU Lesser General Public License version 3, 6 | * as published by the Free Software Foundation. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU Lesser General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU Lesser General Public License 14 | * along with this program. If not, see . 15 | * 16 | * Authored by: Thomas Voß 17 | */ 18 | 19 | #ifndef CORE_POSIX_EXIT_H_ 20 | #define CORE_POSIX_EXIT_H_ 21 | 22 | #include 23 | 24 | namespace core 25 | { 26 | namespace posix 27 | { 28 | namespace exit 29 | { 30 | /** 31 | * @brief The Status enum wrap's the posix exit status. 32 | */ 33 | enum class Status 34 | { 35 | success = EXIT_SUCCESS, 36 | failure = EXIT_FAILURE 37 | }; 38 | } 39 | } 40 | } 41 | 42 | #endif // CORE_POSIX_EXIT_H_ 43 | -------------------------------------------------------------------------------- /external/process-cpp-minimal/include/core/posix/visibility.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2013 Canonical Ltd. 3 | * 4 | * This program is free software: you can redistribute it and/or modify it 5 | * under the terms of the GNU Lesser General Public License version 3, 6 | * as published by the Free Software Foundation. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU Lesser General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU Lesser General Public License 14 | * along with this program. If not, see . 15 | * 16 | * Authored by: Thomas Voß 17 | */ 18 | 19 | #ifndef CORE_POSIX_VISIBILITY_H_ 20 | #define CORE_POSIX_VISIBILITY_H_ 21 | 22 | #if __GNUC__ >= 4 23 | #define CORE_POSIX_DLL_PUBLIC __attribute__ ((visibility ("default"))) 24 | #define CORE_POSIX_DLL_LOCAL __attribute__ ((visibility ("hidden"))) 25 | #else 26 | #define CORE_POSIX_DLL_PUBLIC 27 | #define CORE_POSIX_DLL_LOCAL 28 | #endif 29 | 30 | #endif // CORE_POSIX_VISIBILITY_H_ 31 | -------------------------------------------------------------------------------- /external/process-cpp-minimal/src/core/posix/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright © 2013 Canonical Ltd. 2 | # 3 | # This program is free software: you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License version 3 as 5 | # published by the Free Software Foundation. 6 | # 7 | # This program is distributed in the hope that it will be useful, 8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | # GNU General Public License for more details. 11 | # 12 | # You should have received a copy of the GNU General Public License 13 | # along with this program. If not, see . 14 | # 15 | # Authored by: Thomas Voss 16 | 17 | add_library( 18 | posix-process 19 | 20 | process.cpp 21 | ) 22 | 23 | add_subdirectory(linux) 24 | -------------------------------------------------------------------------------- /external/process-cpp-minimal/src/core/posix/linux/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright © 2013 Canonical Ltd. 2 | # 3 | # This program is free software: you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License version 3 as 5 | # published by the Free Software Foundation. 6 | # 7 | # This program is distributed in the hope that it will be useful, 8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | # GNU General Public License for more details. 11 | # 12 | # You should have received a copy of the GNU General Public License 13 | # along with this program. If not, see . 14 | # 15 | # Authored by: Thomas Voss 16 | 17 | add_library( 18 | linux-process 19 | 20 | process.cpp 21 | ) 22 | 23 | target_link_libraries( 24 | linux-process 25 | 26 | posix-process 27 | ) 28 | -------------------------------------------------------------------------------- /external/process-cpp-minimal/src/core/posix/linux/proc/process/state.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2013 Canonical Ltd. 3 | * 4 | * This program is free software: you can redistribute it and/or modify it 5 | * under the terms of the GNU Lesser General Public License version 3, 6 | * as published by the Free Software Foundation. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU Lesser General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU Lesser General Public License 14 | * along with this program. If not, see . 15 | * 16 | * Authored by: Thomas Voß 17 | */ 18 | 19 | #include 20 | 21 | #include 22 | 23 | #include 24 | 25 | namespace core 26 | { 27 | namespace posix 28 | { 29 | namespace linux 30 | { 31 | namespace proc 32 | { 33 | namespace process 34 | { 35 | 36 | } 37 | } 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /external/process-cpp-minimal/src/core/posix/standard_stream.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2013 Canonical Ltd. 3 | * 4 | * This program is free software: you can redistribute it and/or modify it 5 | * under the terms of the GNU Lesser General Public License version 3, 6 | * as published by the Free Software Foundation. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU Lesser General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU Lesser General Public License 14 | * along with this program. If not, see . 15 | * 16 | * Authored by: Thomas Voß 17 | */ 18 | 19 | #include 20 | 21 | namespace core 22 | { 23 | namespace posix 24 | { 25 | StandardStream operator|(StandardStream l, StandardStream r) 26 | { 27 | return static_cast(static_cast(l) | static_cast(r)); 28 | } 29 | 30 | StandardStream operator&(StandardStream l, StandardStream r) 31 | { 32 | return static_cast(static_cast(l) & static_cast(r)); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /external/process-cpp-minimal/src/core/posix/wait.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2013 Canonical Ltd. 3 | * 4 | * This program is free software: you can redistribute it and/or modify it 5 | * under the terms of the GNU Lesser General Public License version 3, 6 | * as published by the Free Software Foundation. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU Lesser General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU Lesser General Public License 14 | * along with this program. If not, see . 15 | * 16 | * Authored by: Thomas Voß 17 | */ 18 | 19 | #include 20 | 21 | namespace core 22 | { 23 | namespace posix 24 | { 25 | namespace wait 26 | { 27 | Flags operator|(Flags l, Flags r) 28 | { 29 | return static_cast(static_cast(l) | static_cast(r)); 30 | } 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /external/process-cpp-minimal/symbols.map: -------------------------------------------------------------------------------- 1 | { 2 | global: 3 | extern "C++" { 4 | core::*; 5 | typeinfo?for?core::*; 6 | typeinfo?name?for?core::*; 7 | VTT?for?core::*; 8 | virtual?thunk?to?core::*; 9 | vtable?for?core::*; 10 | std::hash*; 11 | }; 12 | local: 13 | extern "C++" { 14 | *; 15 | }; 16 | }; -------------------------------------------------------------------------------- /external/xdg/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # We have to manually alter the cxx flags to have a working 2 | # travis-ci build. Its container-based infrastructure only features 3 | # a very old cmake that does not support the more current: 4 | # set_property(TARGET xdg_test PROPERTY CXX_STANDARD 11) 5 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") 6 | 7 | find_package(Boost COMPONENTS filesystem system unit_test_framework) 8 | 9 | include_directories( 10 | . 11 | ${Boost_INCLUDE_DIRS} 12 | ) 13 | 14 | add_library(xdg STATIC xdg.cpp) 15 | set_property(TARGET xdg PROPERTY CXX_STANDARD 11) 16 | target_link_libraries(xdg ${Boost_LIBRARIES}) 17 | 18 | enable_testing() 19 | add_definitions(-DBOOST_TEST_DYN_LINK -DBOOST_TEST_MAIN -DBOOST_TEST_MODULE=xdg) 20 | add_executable(xdg_test xdg_test.cpp) 21 | set_property(TARGET xdg_test PROPERTY CXX_STANDARD 11) 22 | target_link_libraries(xdg_test xdg ${Boost_LIBRARIES}) 23 | 24 | add_test(xdg_test xdg_test) 25 | -------------------------------------------------------------------------------- /kernel/99-anbox.rules: -------------------------------------------------------------------------------- 1 | KERNEL=="ashmem", NAME="%k", MODE="0666" 2 | KERNEL=="binder*", NAME="%k", MODE="0666" 3 | -------------------------------------------------------------------------------- /kernel/anbox.conf: -------------------------------------------------------------------------------- 1 | ashmem_linux 2 | binder_linux 3 | -------------------------------------------------------------------------------- /kernel/ashmem/Makefile: -------------------------------------------------------------------------------- 1 | ccflags-y += -I$(src) -Wno-error=implicit-int -Wno-int-conversion 2 | obj-m := ashmem_linux.o 3 | ashmem_linux-y := deps.o ashmem.o 4 | 5 | KERNEL_SRC ?= /lib/modules/$(shell uname -r)/build 6 | 7 | all: 8 | $(MAKE) -C $(KERNEL_SRC) V=0 M=$$PWD 9 | 10 | install: 11 | cp ashmem_linux.ko $(DESTDIR)/ 12 | 13 | clean: 14 | rm -rf deps.h *.o *.ko *.mod.c *.symvers *.order .*.cmd .tmp_versions 15 | -------------------------------------------------------------------------------- /kernel/ashmem/ashmem.h: -------------------------------------------------------------------------------- 1 | /* 2 | * include/linux/ashmem.h 3 | * 4 | * Copyright 2008 Google Inc. 5 | * Author: Robert Love 6 | * 7 | * This file is dual licensed. It may be redistributed and/or modified 8 | * under the terms of the Apache 2.0 License OR version 2 of the GNU 9 | * General Public License. 10 | */ 11 | 12 | #ifndef _LINUX_ASHMEM_H 13 | #define _LINUX_ASHMEM_H 14 | 15 | #include 16 | #include 17 | #include 18 | 19 | #include "uapi/ashmem.h" 20 | 21 | /* support of 32bit userspace on 64bit platforms */ 22 | #ifdef CONFIG_COMPAT 23 | #define COMPAT_ASHMEM_SET_SIZE _IOW(__ASHMEMIOC, 3, compat_size_t) 24 | #define COMPAT_ASHMEM_SET_PROT_MASK _IOW(__ASHMEMIOC, 5, unsigned int) 25 | #endif 26 | 27 | #endif /* _LINUX_ASHMEM_H */ 28 | -------------------------------------------------------------------------------- /kernel/ashmem/deps.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | static int (*shmem_zero_setup_ptr)(struct vm_area_struct *) = NULL; 5 | 6 | int shmem_zero_setup(struct vm_area_struct *vma) 7 | { 8 | if (!shmem_zero_setup_ptr) 9 | shmem_zero_setup_ptr = kallsyms_lookup_name("shmem_zero_setup"); 10 | return shmem_zero_setup_ptr(vma); 11 | } 12 | -------------------------------------------------------------------------------- /kernel/ashmem/dkms.conf: -------------------------------------------------------------------------------- 1 | PACKAGE_NAME="anbox-ashmem" 2 | PACKAGE_VERSION="1" 3 | CLEAN="make clean" 4 | MAKE[0]="make all KERNEL_SRC=/lib/modules/$(uname -r)/build" 5 | BUILT_MODULE_NAME[0]="ashmem_linux" 6 | DEST_MODULE_LOCATION[0]="/updates" 7 | AUTOINSTALL="yes" 8 | -------------------------------------------------------------------------------- /kernel/binder/Makefile: -------------------------------------------------------------------------------- 1 | ccflags-y += -I$(src) -Wno-int-conversion -DCONFIG_ANDROID_BINDER_DEVICES="\"binder\"" 2 | obj-m := binder_linux.o 3 | binder_linux-y := deps.o binder.o 4 | 5 | KERNEL_SRC ?= /lib/modules/$(shell uname -r)/build 6 | 7 | all: 8 | $(MAKE) -C $(KERNEL_SRC) V=0 M=$$PWD 9 | 10 | install: 11 | cp binder_linux.ko $(DESTDIR)/ 12 | 13 | clean: 14 | rm -rf deps.h *.o *.ko *.mod.c *.symvers *.order .*.cmd .tmp_versions 15 | -------------------------------------------------------------------------------- /kernel/binder/dkms.conf: -------------------------------------------------------------------------------- 1 | PACKAGE_NAME="anbox-binder" 2 | PACKAGE_VERSION="1" 3 | CLEAN="make clean" 4 | MAKE[0]="make all KERNEL_SRC=/lib/modules/$(uname -r)/build" 5 | BUILT_MODULE_NAME[0]="binder_linux" 6 | DEST_MODULE_LOCATION[0]="/updates" 7 | AUTOINSTALL="yes" 8 | -------------------------------------------------------------------------------- /products/AndroidProducts.mk: -------------------------------------------------------------------------------- 1 | PRODUCT_MAKEFILES := \ 2 | $(LOCAL_DIR)/anbox_x86_64.mk \ 3 | $(LOCAL_DIR)/anbox_armv7a_neon.mk \ 4 | $(LOCAL_DIR)/anbox_arm64.mk 5 | -------------------------------------------------------------------------------- /products/anbox_arm64.mk: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2013 The Android Open-Source Project 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | $(call inherit-product, $(LOCAL_PATH)/arm64/device.mk) 18 | $(call inherit-product, $(LOCAL_PATH)/anbox.mk) 19 | 20 | PRODUCT_NAME := anbox_arm64 21 | # We're using device/generic/arm64/BoardConfig.mk here 22 | PRODUCT_DEVICE := arm64 23 | PRODUCT_BRAND := Android 24 | PRODUCT_MODEL := Anbox 25 | -------------------------------------------------------------------------------- /products/anbox_armv7a_neon.mk: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2013 The Android Open-Source Project 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | $(call inherit-product, $(LOCAL_PATH)/armv7-a-neon/device.mk) 18 | $(call inherit-product, $(LOCAL_PATH)/anbox.mk) 19 | 20 | # Enable low-mem related options (see https://source.android.com/devices/tech/config/low-ram) 21 | PRODUCT_PROPERTY_OVERRIDES += ro.config.low_ram=true 22 | PRODUCT_PROPERTY_OVERRIDES += dalvik.vm.jit.codecachesize=0 23 | 24 | PRODUCT_NAME := anbox_armv7a_neon 25 | PRODUCT_DEVICE := armv7-a-neon 26 | PRODUCT_BRAND := Android 27 | PRODUCT_MODEL := Anbox 28 | -------------------------------------------------------------------------------- /products/anbox_x86_64.mk: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2013 The Android Open-Source Project 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | $(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk) 18 | $(call inherit-product, $(LOCAL_PATH)/x86_64/device.mk) 19 | 20 | $(call inherit-product, $(LOCAL_PATH)/anbox.mk) 21 | 22 | PRODUCT_NAME := anbox_x86_64 23 | PRODUCT_DEVICE := x86_64 24 | PRODUCT_BRAND := Android 25 | PRODUCT_MODEL := Anbox 26 | -------------------------------------------------------------------------------- /products/arm64/device.mk: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2013 The Android Open-Source Project 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | # Copy the 64-bit primary, 32-bit secondary zygote startup script 18 | PRODUCT_COPY_FILES += system/core/rootdir/init.zygote64_32.rc:root/init.zygote64_32.rc 19 | 20 | # Set the zygote property to select the 64-bit primary, 32-bit secondary script 21 | # This line must be parsed before the one in core_minimal.mk 22 | PRODUCT_DEFAULT_PROPERTY_OVERRIDES += ro.zygote=zygote64_32 23 | 24 | TARGET_SUPPORTS_32_BIT_APPS := true 25 | TARGET_SUPPORTS_64_BIT_APPS := true 26 | -------------------------------------------------------------------------------- /products/armv7-a-neon/BoardConfig.mk: -------------------------------------------------------------------------------- 1 | # config.mk 2 | # 3 | # Product-specific compile-time definitions. 4 | # 5 | 6 | # The generic product target doesn't have any hardware-specific pieces. 7 | TARGET_NO_BOOTLOADER := true 8 | TARGET_NO_KERNEL := true 9 | TARGET_ARCH := arm 10 | 11 | TARGET_ARCH_VARIANT := armv7-a-neon 12 | TARGET_CPU_VARIANT := generic 13 | TARGET_CPU_ABI := armeabi-v7a 14 | TARGET_CPU_ABI2 := armeabi 15 | 16 | SMALLER_FONT_FOOTPRINT := true 17 | MINIMAL_FONT_FOOTPRINT := true 18 | # Some framework code requires this to enable BT 19 | BOARD_HAVE_BLUETOOTH := true 20 | BOARD_BLUETOOTH_BDROID_BUILDCFG_INCLUDE_DIR := device/generic/common/bluetooth 21 | 22 | BOARD_USES_GENERIC_AUDIO := true 23 | 24 | USE_CAMERA_STUB := true 25 | 26 | BUILD_EMULATOR_OPENGL := true 27 | USE_OPENGL_RENDERER := true 28 | 29 | BOARD_USE_LEGACY_UI := true 30 | 31 | TARGET_USERIMAGES_USE_EXT4 := true 32 | BOARD_SYSTEMIMAGE_PARTITION_SIZE := 2147483648 # 2 GB 33 | BOARD_USERDATAIMAGE_PARTITION_SIZE := 576716800 34 | BOARD_CACHEIMAGE_PARTITION_SIZE := 69206016 35 | BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := ext4 36 | BOARD_FLASH_BLOCK_SIZE := 512 37 | TARGET_USERIMAGES_SPARSE_EXT_DISABLED := true 38 | 39 | BOARD_SEPOLICY_DIRS += build/target/board/generic/sepolicy 40 | -------------------------------------------------------------------------------- /products/armv7-a-neon/device.mk: -------------------------------------------------------------------------------- 1 | # Nothing yet 2 | -------------------------------------------------------------------------------- /products/overlay/frameworks/base/packages/SettingsProvider/res/values/defaults.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 18 | false 19 | 20 | true 21 | 22 | true 23 | true 24 | 25 | -------------------------------------------------------------------------------- /products/overlay/frameworks/base/packages/SystemUI/res/values/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 18 | 19 | com.android.systemui.statusbar.tv.TvStatusBar 20 | 21 | false 22 | 23 | -------------------------------------------------------------------------------- /products/vendorsetup.sh: -------------------------------------------------------------------------------- 1 | add_lunch_combo anbox_x86_64-userdebug 2 | add_lunch_combo anbox_armv7a_neon-userdebug 3 | add_lunch_combo anbox_arm64-userdebug 4 | -------------------------------------------------------------------------------- /products/x86_64/BoardConfig.mk: -------------------------------------------------------------------------------- 1 | TARGET_NO_BOOTLOADER := true 2 | TARGET_NO_KERNEL := true 3 | TARGET_CPU_ABI := x86_64 4 | TARGET_ARCH := x86_64 5 | TARGET_ARCH_VARIANT := x86_64 6 | TARGET_PRELINK_MODULE := false 7 | 8 | TARGET_2ND_CPU_ABI := x86 9 | TARGET_2ND_ARCH := x86 10 | TARGET_2ND_ARCH_VARIANT := x86 11 | 12 | TARGET_USES_64_BIT_BINDER := true 13 | 14 | # no hardware camera 15 | USE_CAMERA_STUB := true 16 | 17 | # Enable dex-preoptimization to speed up the first boot sequence 18 | # of an SDK AVD. Note that this operation only works on Linux for now 19 | ifeq ($(HOST_OS),linux) 20 | WITH_DEXPREOPT ?= true 21 | endif 22 | 23 | # Build OpenGLES emulation host and guest libraries 24 | BUILD_EMULATOR_OPENGL := true 25 | 26 | # Build and enable the OpenGL ES View renderer. When running on the emulator, 27 | # the GLES renderer disables itself if host GL acceleration isn't available. 28 | USE_OPENGL_RENDERER := true 29 | 30 | TARGET_USERIMAGES_USE_EXT4 := true 31 | BOARD_SYSTEMIMAGE_PARTITION_SIZE := 2147483648 # 2 GB 32 | BOARD_USERDATAIMAGE_PARTITION_SIZE := 576716800 33 | BOARD_CACHEIMAGE_PARTITION_SIZE := 69206016 34 | BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := ext4 35 | BOARD_FLASH_BLOCK_SIZE := 512 36 | TARGET_USERIMAGES_SPARSE_EXT_DISABLED := true 37 | -------------------------------------------------------------------------------- /products/x86_64/device.mk: -------------------------------------------------------------------------------- 1 | # Nothing yet 2 | -------------------------------------------------------------------------------- /scripts/android-sync.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -ex 4 | 5 | if [ -z "$ANDROID_PRODUCT_OUT" ]; then 6 | echo "ANDROID_PRODUCT_OUT is not set!" 7 | exit 1 8 | fi 9 | 10 | target=$1 11 | if [ -z "$target" ]; then 12 | echo "No target path provided!" 13 | exit 1 14 | fi 15 | 16 | sudo cp -rv $ANDROID_PRODUCT_OUT/system $target 17 | sudo rm /var/lib/anbox/rootfs/.anbox_setup_done 18 | -------------------------------------------------------------------------------- /scripts/build-with-docker.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | docker pull ubuntu:16.04 3 | docker run -i -t -v $PWD:/anbox ubuntu:16.04 /anbox/scripts/clean-build.sh 4 | -------------------------------------------------------------------------------- /scripts/clean-format.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | find src -name "*.h" | xargs clang-format -style=file -i 3 | find src -name "*.cpp" | xargs clang-format -style=file -i 4 | -------------------------------------------------------------------------------- /scripts/create-package.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -ex 4 | 5 | ramdisk=$1 6 | system=$2 7 | 8 | if [ -z "$ramdisk" ] || [ -z "$system" ]; then 9 | echo "Usage: $0 " 10 | exit 1 11 | fi 12 | 13 | workdir=`mktemp -d` 14 | rootfs=$workdir/rootfs 15 | 16 | mkdir -p $rootfs 17 | 18 | # Extract ramdisk and preserve ownership of files 19 | (cd $rootfs ; cat $ramdisk | gzip -d | sudo cpio -i) 20 | 21 | mkdir $workdir/system 22 | sudo mount -o loop,ro $system $workdir/system 23 | sudo cp -ar $workdir/system/* $rootfs/system 24 | sudo umount $workdir/system 25 | 26 | # FIXME 27 | sudo chmod +x $rootfs/anbox-init.sh 28 | 29 | if [ -e android.img ]; then 30 | DATE=`date +%F_%R` 31 | SAVETO=android-old-$DATE.img 32 | 33 | echo "#########################################################" 34 | echo "# WARNING: Old android.img still exists. " 35 | echo "# Moving it to $SAVETO. " 36 | echo "#########################################################" 37 | 38 | mv android.img $SAVETO 39 | fi 40 | 41 | sudo mksquashfs $rootfs android.img -comp xz -no-xattrs 42 | sudo chown $USER:$USER android.img 43 | 44 | sudo rm -rf $workdir 45 | -------------------------------------------------------------------------------- /scripts/load-kmods.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh -ex 2 | sudo rmmod binder_linux || true 3 | sudo rmmod ashmem_linux || true 4 | (cd kernel/binder ; make clean && make -j4 ; sudo insmod binder_linux.ko; sudo chmod 666 /dev/binder) 5 | (cd kernel/ashmem ; make clean && make -j4 ; sudo insmod ashmem_linux.ko; sudo chmod 666 /dev/ashmem) 6 | -------------------------------------------------------------------------------- /scripts/mount-android.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DATA_PATH=/var/lib/anbox 4 | ROOTFS_PATH=$DATA_PATH/rootfs 5 | ANDROID_IMG=$1 6 | CONTAINER_BASE_UID=100000 7 | DIR="$(dirname $0)" 8 | 9 | if [[ $EUID -ne 0 ]]; then 10 | echo "This script must be run as root" 1>&2 11 | exit 1 12 | fi 13 | 14 | if [ -z "$1" ]; then 15 | echo "Usage:" 16 | echo "./mount-android.sh [Android image]" 17 | exit 1 18 | fi 19 | 20 | if [ ! -f $ANDROID_IMG ]; then 21 | echo "Android image not found" 22 | exit 1 23 | fi 24 | 25 | # Setup the read-only rootfs 26 | mkdir -p $ROOTFS_PATH 27 | mount -o loop,ro $ANDROID_IMG $ROOTFS_PATH 28 | 29 | # but certain top-level directories need to be in a writable space 30 | for dir in cache data; do 31 | mkdir -p $DATA_PATH/android-$dir 32 | chown $CONTAINER_BASE_UID:$CONTAINER_BASE_UID $DATA_PATH/android-$dir 33 | mount -o bind $DATA_PATH/android-$dir $ROOTFS_PATH/$dir 34 | done 35 | 36 | $DIR/anbox-bridge.sh start 37 | $DIR/load-kmods.sh 38 | -------------------------------------------------------------------------------- /scripts/start-container.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | exec $SNAP/bin/lxc-start -P $SNAP_COMMON/var/lib/anbox/containers -n default -F 4 | -------------------------------------------------------------------------------- /snap/gui/anbox.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Name=Anbox 3 | GenericName=Android in a box 4 | Version=1.0 5 | Type=Application 6 | Icon=${SNAP}/meta/gui/icon.png 7 | Exec=anbox launch --package=org.anbox.appmgr --component=org.anbox.appmgr.AppViewActivity 8 | Terminal=false 9 | -------------------------------------------------------------------------------- /snap/gui/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lag-linaro/robox/0bc0774c244d929f98e3c84c24183ac151403aa1/snap/gui/icon.png -------------------------------------------------------------------------------- /src/anbox/android/intent.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Simon Fels 3 | * 4 | * This program is free software: you can redistribute it and/or modify it 5 | * under the terms of the GNU General Public License version 3, as published 6 | * by the Free Software Foundation. 7 | * 8 | * This program is distributed in the hope that it will be useful, but 9 | * WITHOUT ANY WARRANTY; without even the implied warranties of 10 | * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR 11 | * PURPOSE. See the GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License along 14 | * with this program. If not, see . 15 | * 16 | */ 17 | 18 | #ifndef ANBOX_ANDROID_INTENT_H_ 19 | #define ANBOX_ANDROID_INTENT_H_ 20 | 21 | #include 22 | #include 23 | 24 | namespace anbox { 25 | namespace android { 26 | struct Intent { 27 | std::string action; 28 | std::string uri; 29 | std::string type; 30 | int flags = 0; 31 | std::string package; 32 | std::string component; 33 | std::vector categories; 34 | 35 | bool valid() const; 36 | }; 37 | 38 | std::ostream &operator<<(std::ostream &out, const Intent &intent); 39 | } // namespace android 40 | } // namespace anbox 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /src/anbox/audio/client_info.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017 Simon Fels 3 | * 4 | * This program is free software: you can redistribute it and/or modify it 5 | * under the terms of the GNU General Public License version 3, as published 6 | * by the Free Software Foundation. 7 | * 8 | * This program is distributed in the hope that it will be useful, but 9 | * WITHOUT ANY WARRANTY; without even the implied warranties of 10 | * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR 11 | * PURPOSE. See the GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License along 14 | * with this program. If not, see . 15 | * 16 | */ 17 | 18 | #ifndef ANBOX_AUDIO_CLIENT_INFO_H_ 19 | #define ANBOX_AUDIO_CLIENT_INFO_H_ 20 | 21 | #include 22 | 23 | namespace anbox { 24 | namespace audio { 25 | struct ClientInfo { 26 | enum class Type : std::uint8_t { 27 | Playback = 0, 28 | Recording = 1, 29 | Max = 2, 30 | }; 31 | Type type; 32 | }; 33 | } // namespace audio 34 | } // namespace anbox 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /src/anbox/audio/sink.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017 Simon Fels 3 | * 4 | * This program is free software: you can redistribute it and/or modify it 5 | * under the terms of the GNU General Public License version 3, as published 6 | * by the Free Software Foundation. 7 | * 8 | * This program is distributed in the hope that it will be useful, but 9 | * WITHOUT ANY WARRANTY; without even the implied warranties of 10 | * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR 11 | * PURPOSE. See the GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License along 14 | * with this program. If not, see . 15 | * 16 | */ 17 | 18 | #ifndef ANBOX_AUDIO_SINK_H_ 19 | #define ANBOX_AUDIO_SINK_H_ 20 | 21 | #include 22 | 23 | #include 24 | 25 | namespace anbox { 26 | namespace audio { 27 | class Sink { 28 | public: 29 | virtual ~Sink() {} 30 | virtual void write_data(const std::vector &data) = 0; 31 | }; 32 | } // namespace audio 33 | } // namespace anbox 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /src/anbox/audio/source.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017 Simon Fels 3 | * 4 | * This program is free software: you can redistribute it and/or modify it 5 | * under the terms of the GNU General Public License version 3, as published 6 | * by the Free Software Foundation. 7 | * 8 | * This program is distributed in the hope that it will be useful, but 9 | * WITHOUT ANY WARRANTY; without even the implied warranties of 10 | * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR 11 | * PURPOSE. See the GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License along 14 | * with this program. If not, see . 15 | * 16 | */ 17 | 18 | #ifndef ANBOX_AUDIO_SOURCE_H_ 19 | #define ANBOX_AUDIO_SOURCE_H_ 20 | 21 | #include 22 | 23 | #include 24 | 25 | namespace anbox { 26 | namespace audio { 27 | class Source { 28 | public: 29 | virtual ~Source() {} 30 | 31 | virtual void read_data(std::vector &data) = 0; 32 | }; 33 | } // namespace audio 34 | } // namespace anbox 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /src/anbox/build/config.h.in: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Canonical, Ltd. 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU Lesser General Public License as published by 6 | * the Free Software Foundation; version 3. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU Lesser General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU Lesser General Public License 14 | * along with this program. If not, see . 15 | * 16 | * Authored by: Thomas Voß 17 | * 18 | */ 19 | 20 | #ifndef ANBOX_CONFIG_H_ 21 | #define ANBOX_CONFIG_H_ 22 | 23 | #include 24 | #include 25 | 26 | namespace anbox { 27 | namespace build { 28 | /// @brief version marks the version 29 | static constexpr const char *version{"@ANBOX_VERSION@"}; 30 | 31 | // path for system configuration 32 | static constexpr const char *default_resource_path{"@ANBOX_RESOURCE_DIR_FULL@"}; 33 | static constexpr const char *default_data_path{"@ANBOX_STATEDIR_FULL@"}; 34 | } // namespace build 35 | } // namespace anbox 36 | 37 | #endif // ANBOX_CONFIG_H_ 38 | -------------------------------------------------------------------------------- /src/anbox/cmds/generate_ip_config.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017 Lee Jones 3 | * 4 | * This program is free software: you can redistribute it and/or modify it 5 | * under the terms of the GNU General Public License version 3, as published 6 | * by the Free Software Foundation. 7 | * 8 | * This program is distributed in the hope that it will be useful, but 9 | * WITHOUT ANY WARRANTY; without even the implied warranties of 10 | * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR 11 | * PURPOSE. See the GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License along 14 | * with this program. If not, see . 15 | * 16 | */ 17 | 18 | #ifndef ANBOX_CMDS_GEN_IP_CONFIG_H_ 19 | #define ANBOX_CMDS_GEN_IP_CONFIG_H_ 20 | 21 | #include "anbox/cli.h" 22 | 23 | #include 24 | 25 | namespace anbox { 26 | namespace cmds { 27 | class GenerateIpConfig : public cli::CommandWithFlagsAndAction { 28 | public: 29 | GenerateIpConfig(); 30 | 31 | private: 32 | std::string ip_; 33 | std::string gateway_; 34 | std::string dns_; 35 | uint32_t cidr_; 36 | }; 37 | } // namespace cmds 38 | } // namespace anbox 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /src/anbox/cmds/install.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Simon Fels 3 | * 4 | * This program is free software: you can redistribute it and/or modify it 5 | * under the terms of the GNU General Public License version 3, as published 6 | * by the Free Software Foundation. 7 | * 8 | * This program is distributed in the hope that it will be useful, but 9 | * WITHOUT ANY WARRANTY; without even the implied warranties of 10 | * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR 11 | * PURPOSE. See the GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License along 14 | * with this program. If not, see . 15 | * 16 | */ 17 | 18 | #ifndef ANBOX_CMDS_INSTALL_H_ 19 | #define ANBOX_CMDS_INSTALL_H_ 20 | 21 | #include 22 | #include 23 | #include 24 | 25 | #include "anbox/cli.h" 26 | 27 | namespace anbox { 28 | namespace cmds { 29 | class Install : public cli::CommandWithFlagsAndAction { 30 | public: 31 | Install(); 32 | 33 | private: 34 | std::string apk_; 35 | }; 36 | } // namespace cmds 37 | } // namespace anbox 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /src/anbox/cmds/system_info.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017 Simon Fels 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU Lesser General Public License as published by 6 | * the Free Software Foundation; version 3. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU Lesser General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU Lesser General Public License 14 | * along with this program. If not, see . 15 | * 16 | */ 17 | 18 | #ifndef ANBOX_CMDS_SYSTEM_INFO_H_ 19 | #define ANBOX_CMDS_SYSTEM_INFO_H_ 20 | 21 | #include 22 | #include 23 | #include 24 | 25 | #include "anbox/cli.h" 26 | 27 | namespace anbox { 28 | namespace cmds { 29 | class SystemInfo : public cli::CommandWithFlagsAndAction { 30 | public: 31 | SystemInfo(); 32 | }; 33 | } // namespace cmds 34 | } // namespace anbox 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /src/anbox/cmds/version.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Canonical, Ltd. 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU Lesser General Public License as published by 6 | * the Free Software Foundation; version 3. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU Lesser General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU Lesser General Public License 14 | * along with this program. If not, see . 15 | * 16 | * Authored by: Thomas Voß 17 | * 18 | */ 19 | 20 | #include "anbox/cmds/version.h" 21 | #include "anbox/build/config.h" 22 | #include "anbox/utils.h" 23 | 24 | anbox::cmds::Version::Version() 25 | : CommandWithFlagsAndAction{ 26 | cli::Name{"version"}, cli::Usage{"version"}, 27 | cli::Description{"print the version of the daemon"}} { 28 | action([](const cli::Command::Context& ctxt) { 29 | ctxt.cout << "anbox " << build::version << std::endl; 30 | return 0; 31 | }); 32 | } 33 | -------------------------------------------------------------------------------- /src/anbox/cmds/version.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Canonical, Ltd. 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU Lesser General Public License as published by 6 | * the Free Software Foundation; version 3. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU Lesser General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU Lesser General Public License 14 | * along with this program. If not, see . 15 | * 16 | * Authored by: Thomas Voß 17 | * 18 | */ 19 | 20 | #ifndef ANBOX_CMDS_VERSION_H_ 21 | #define ANBOX_CMDS_VERSION_H_ 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | #include "anbox/cli.h" 28 | 29 | namespace anbox { 30 | namespace cmds { 31 | class Version : public cli::CommandWithFlagsAndAction { 32 | public: 33 | Version(); 34 | }; 35 | } // namespace cmds 36 | } // namespace anbox 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /src/anbox/common/fd_sets.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2013 Canonical Ltd. 3 | * 4 | * This program is free software: you can redistribute it and/or modify it 5 | * under the terms of the GNU General Public License version 3, 6 | * as published by the Free Software Foundation. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program. If not, see . 15 | * 16 | * Authored by: Robert Carr 17 | */ 18 | 19 | #ifndef ANBOX_COMMON_FD_SETS_H_ 20 | #define ANBOX_COMMON_FD_SETS_H_ 21 | 22 | #include 23 | #include 24 | 25 | #include "anbox/common/fd.h" 26 | 27 | namespace anbox { 28 | typedef std::vector> FdSets; 29 | } // namespace anbox 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /src/anbox/common/loop_device_allocator.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017 Simon Fels 3 | * 4 | * This program is free software: you can redistribute it and/or modify it 5 | * under the terms of the GNU General Public License version 3, as published 6 | * by the Free Software Foundation. 7 | * 8 | * This program is distributed in the hope that it will be useful, but 9 | * WITHOUT ANY WARRANTY; without even the implied warranties of 10 | * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR 11 | * PURPOSE. See the GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License along 14 | * with this program. If not, see . 15 | * 16 | */ 17 | 18 | #ifndef ANBOX_COMMON_LOOP_DEVICE_ALLOCATOR_H_ 19 | #define ANBOX_COMMON_LOOP_DEVICE_ALLOCATOR_H_ 20 | 21 | #include 22 | 23 | namespace anbox { 24 | namespace common { 25 | class LoopDevice; 26 | class LoopDeviceAllocator { 27 | public: 28 | static std::shared_ptr new_device(); 29 | }; 30 | } // namespace common 31 | } // namespace anbox 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /src/anbox/container/configuration.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Simon Fels 3 | * 4 | * This program is free software: you can redistribute it and/or modify it 5 | * under the terms of the GNU General Public License version 3, as published 6 | * by the Free Software Foundation. 7 | * 8 | * This program is distributed in the hope that it will be useful, but 9 | * WITHOUT ANY WARRANTY; without even the implied warranties of 10 | * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR 11 | * PURPOSE. See the GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License along 14 | * with this program. If not, see . 15 | * 16 | */ 17 | 18 | #ifndef ANBOX_CONTAINER_CONFIGURATION_H_ 19 | #define ANBOX_CONTAINER_CONFIGURATION_H_ 20 | 21 | #include 22 | #include 23 | 24 | namespace anbox { 25 | namespace container { 26 | struct Configuration { 27 | std::map bind_mounts; 28 | }; 29 | } // namespace container 30 | } // namespace anbox 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /src/anbox/container/container.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Simon Fels 3 | * 4 | * This program is free software: you can redistribute it and/or modify it 5 | * under the terms of the GNU General Public License version 3, as published 6 | * by the Free Software Foundation. 7 | * 8 | * This program is distributed in the hope that it will be useful, but 9 | * WITHOUT ANY WARRANTY; without even the implied warranties of 10 | * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR 11 | * PURPOSE. See the GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License along 14 | * with this program. If not, see . 15 | * 16 | */ 17 | 18 | #include "anbox/container/container.h" 19 | 20 | namespace anbox { 21 | namespace container { 22 | Container::~Container() {} 23 | } // namespace container 24 | } // namespace anbox 25 | -------------------------------------------------------------------------------- /src/anbox/daemon.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Simon Fels 3 | * 4 | * This program is free software: you can redistribute it and/or modify it 5 | * under the terms of the GNU General Public License version 3, as published 6 | * by the Free Software Foundation. 7 | * 8 | * This program is distributed in the hope that it will be useful, but 9 | * WITHOUT ANY WARRANTY; without even the implied warranties of 10 | * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR 11 | * PURPOSE. See the GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License along 14 | * with this program. If not, see . 15 | * 16 | */ 17 | 18 | #ifndef ANBOX_DAEMON_H_ 19 | #define ANBOX_DAEMON_H_ 20 | 21 | #include 22 | #include 23 | 24 | #include "anbox/cli.h" 25 | #include "anbox/do_not_copy_or_move.h" 26 | 27 | namespace anbox { 28 | class Daemon : public DoNotCopyOrMove { 29 | public: 30 | Daemon(); 31 | 32 | int Run(const std::vector &arguments); 33 | 34 | private: 35 | cli::CommandWithSubcommands cmd; 36 | }; 37 | } // namespace anbox 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /src/anbox/defer_action.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Simon Fels 3 | * 4 | * This program is free software: you can redistribute it and/or modify it 5 | * under the terms of the GNU General Public License version 3, as published 6 | * by the Free Software Foundation. 7 | * 8 | * This program is distributed in the hope that it will be useful, but 9 | * WITHOUT ANY WARRANTY; without even the implied warranties of 10 | * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR 11 | * PURPOSE. See the GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License along 14 | * with this program. If not, see . 15 | * 16 | */ 17 | 18 | #ifndef ANBOX_DEFER_ACTION_H_ 19 | #define ANBOX_DEFER_ACTION_H_ 20 | 21 | #include 22 | 23 | #include "anbox/do_not_copy_or_move.h" 24 | 25 | namespace anbox { 26 | 27 | class DeferAction : public DoNotCopyOrMove { 28 | public: 29 | DeferAction(const std::function action) : action_(action) {} 30 | 31 | ~DeferAction() { 32 | if (action_) action_(); 33 | } 34 | 35 | private: 36 | std::function action_; 37 | }; 38 | 39 | } // namespace anbox 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /src/anbox/do_not_copy_or_move.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Simon Fels 3 | * 4 | * This program is free software: you can redistribute it and/or modify it 5 | * under the terms of the GNU General Public License version 3, as published 6 | * by the Free Software Foundation. 7 | * 8 | * This program is distributed in the hope that it will be useful, but 9 | * WITHOUT ANY WARRANTY; without even the implied warranties of 10 | * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR 11 | * PURPOSE. See the GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License along 14 | * with this program. If not, see . 15 | * 16 | */ 17 | 18 | #ifndef ANBOX_DO_NOT_COPY_OR_MOVE_H_ 19 | #define ANBOX_DO_NOT_COPY_OR_MOVE_H_ 20 | 21 | namespace anbox { 22 | 23 | class DoNotCopyOrMove { 24 | public: 25 | DoNotCopyOrMove(const DoNotCopyOrMove&) = delete; 26 | DoNotCopyOrMove(DoNotCopyOrMove&&) = delete; 27 | virtual ~DoNotCopyOrMove() = default; 28 | DoNotCopyOrMove& operator=(const DoNotCopyOrMove&) = delete; 29 | DoNotCopyOrMove& operator=(DoNotCopyOrMove&&) = delete; 30 | 31 | protected: 32 | DoNotCopyOrMove() = default; 33 | }; 34 | } 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /src/anbox/graphics/emugl/DispatchTables.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011-2015 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 | #pragma once 17 | 18 | #include "OpenGLESDispatch/GLESv1Dispatch.h" 19 | #include "OpenGLESDispatch/GLESv2Dispatch.h" 20 | 21 | extern GLESv2Dispatch s_gles2; 22 | extern GLESv1Dispatch s_gles1; 23 | -------------------------------------------------------------------------------- /src/anbox/graphics/emugl/RenderControl.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 _RENDER_CONTROL_H 18 | #define _RENDER_CONTROL_H 19 | 20 | // Generated with emugl at build time 21 | #include "renderControl_dec.h" 22 | 23 | #include 24 | 25 | class Renderer; 26 | 27 | namespace anbox { 28 | namespace graphics { 29 | class LayerComposer; 30 | } // namespace graphics 31 | } // namespace anbox 32 | 33 | void initRenderControlContext(renderControl_decoder_context_t *dec); 34 | void registerLayerComposer( 35 | const std::shared_ptr &c); 36 | void registerRenderer(const std::shared_ptr &r); 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /src/anbox/graphics/emugl/TimeUtils.cpp: -------------------------------------------------------------------------------- 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 | #include "anbox/graphics/emugl/TimeUtils.h" 18 | 19 | #include 20 | #include 21 | #include 22 | #include 23 | 24 | long long GetCurrentTimeMS() { 25 | struct timespec now; 26 | clock_gettime(CLOCK_MONOTONIC, &now); 27 | long long iDiff = (now.tv_sec * 1000LL) + now.tv_nsec / 1000000LL; 28 | return iDiff; 29 | } 30 | 31 | void TimeSleepMS(int p_mili) { usleep(p_mili * 1000); } 32 | -------------------------------------------------------------------------------- /src/anbox/graphics/emugl/TimeUtils.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 _TIME_UTILS_H 18 | #define _TIME_UTILS_H 19 | 20 | long long GetCurrentTimeMS(); 21 | void TimeSleepMS(int p_mili); 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /src/anbox/graphics/renderer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Simon Fels 3 | * 4 | * This program is free software: you can redistribute it and/or modify it 5 | * under the terms of the GNU General Public License version 3, as published 6 | * by the Free Software Foundation. 7 | * 8 | * This program is distributed in the hope that it will be useful, but 9 | * WITHOUT ANY WARRANTY; without even the implied warranties of 10 | * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR 11 | * PURPOSE. See the GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License along 14 | * with this program. If not, see . 15 | * 16 | */ 17 | 18 | #ifndef ANBOX_GRAPHICS_RENDERER_H_ 19 | #define ANBOX_GRAPHICS_RENDERER_H_ 20 | 21 | #include "anbox/graphics/emugl/Renderable.h" 22 | 23 | #include 24 | 25 | namespace anbox { 26 | namespace graphics { 27 | class Renderer { 28 | public: 29 | virtual ~Renderer() {} 30 | 31 | virtual bool draw(EGLNativeWindowType native_window, 32 | const anbox::graphics::Rect& window_frame, 33 | const RenderableList& renderables) = 0; 34 | }; 35 | } // namespace graphics 36 | } // namespace anbox 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /src/anbox/network/connection_context.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Simon Fels 3 | * 4 | * This program is free software: you can redistribute it and/or modify it 5 | * under the terms of the GNU General Public License version 3, as published 6 | * by the Free Software Foundation. 7 | * 8 | * This program is distributed in the hope that it will be useful, but 9 | * WITHOUT ANY WARRANTY; without even the implied warranties of 10 | * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR 11 | * PURPOSE. See the GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License along 14 | * with this program. If not, see . 15 | * 16 | */ 17 | 18 | #include "anbox/network/connection_context.h" 19 | 20 | namespace anbox { 21 | namespace network { 22 | 23 | ConnectionContext::ConnectionContext( 24 | std::function const connect_handler, Connector const* connector) 25 | : connect_handler(connect_handler), connector(connector) {} 26 | 27 | } // namespace anbox 28 | } // namespace network 29 | -------------------------------------------------------------------------------- /src/anbox/network/connection_creator.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Simon Fels 3 | * 4 | * This program is free software: you can redistribute it and/or modify it 5 | * under the terms of the GNU General Public License version 3, as published 6 | * by the Free Software Foundation. 7 | * 8 | * This program is distributed in the hope that it will be useful, but 9 | * WITHOUT ANY WARRANTY; without even the implied warranties of 10 | * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR 11 | * PURPOSE. See the GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License along 14 | * with this program. If not, see . 15 | * 16 | */ 17 | -------------------------------------------------------------------------------- /src/anbox/network/connection_creator.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Simon Fels 3 | * 4 | * This program is free software: you can redistribute it and/or modify it 5 | * under the terms of the GNU General Public License version 3, as published 6 | * by the Free Software Foundation. 7 | * 8 | * This program is distributed in the hope that it will be useful, but 9 | * WITHOUT ANY WARRANTY; without even the implied warranties of 10 | * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR 11 | * PURPOSE. See the GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License along 14 | * with this program. If not, see . 15 | * 16 | */ 17 | 18 | #ifndef ANBOX_NETWORK_CONNECTION_CREATOR_H_ 19 | #define ANBOX_NETWORK_CONNECTION_CREATOR_H_ 20 | 21 | #include 22 | 23 | #include 24 | 25 | #include "anbox/do_not_copy_or_move.h" 26 | namespace anbox { 27 | namespace network { 28 | template 29 | class ConnectionCreator : public DoNotCopyOrMove { 30 | public: 31 | virtual void create_connection_for( 32 | std::shared_ptr> const& 33 | socket) = 0; 34 | }; 35 | } // namespace anbox 36 | } // namespace network 37 | #endif 38 | -------------------------------------------------------------------------------- /src/anbox/network/connector.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Simon Fels 3 | * 4 | * This program is free software: you can redistribute it and/or modify it 5 | * under the terms of the GNU General Public License version 3, as published 6 | * by the Free Software Foundation. 7 | * 8 | * This program is distributed in the hope that it will be useful, but 9 | * WITHOUT ANY WARRANTY; without even the implied warranties of 10 | * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR 11 | * PURPOSE. See the GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License along 14 | * with this program. If not, see . 15 | * 16 | */ 17 | 18 | #ifndef ANBOX_NETWORK_CONNECTOR_H 19 | #define ANBOX_NETWORK_CONNECTOR_H 20 | 21 | namespace anbox { 22 | namespace network { 23 | class Connector { 24 | public: 25 | }; 26 | } // namespace network 27 | } // namespace anbox 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /src/anbox/network/credentials.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Simon Fels 3 | * 4 | * This program is free software: you can redistribute it and/or modify it 5 | * under the terms of the GNU General Public License version 3, as published 6 | * by the Free Software Foundation. 7 | * 8 | * This program is distributed in the hope that it will be useful, but 9 | * WITHOUT ANY WARRANTY; without even the implied warranties of 10 | * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR 11 | * PURPOSE. See the GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License along 14 | * with this program. If not, see . 15 | * 16 | */ 17 | 18 | #include "anbox/network/credentials.h" 19 | 20 | namespace anbox { 21 | namespace network { 22 | Credentials::Credentials(pid_t pid, uid_t uid, gid_t gid) 23 | : pid_{pid}, uid_{uid}, gid_{gid} {} 24 | 25 | pid_t Credentials::pid() const { return pid_; } 26 | 27 | uid_t Credentials::uid() const { return uid_; } 28 | 29 | gid_t Credentials::gid() const { return gid_; } 30 | } // namespace network 31 | } // namespace anbox 32 | -------------------------------------------------------------------------------- /src/anbox/network/credentials.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Simon Fels 3 | * 4 | * This program is free software: you can redistribute it and/or modify it 5 | * under the terms of the GNU General Public License version 3, as published 6 | * by the Free Software Foundation. 7 | * 8 | * This program is distributed in the hope that it will be useful, but 9 | * WITHOUT ANY WARRANTY; without even the implied warranties of 10 | * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR 11 | * PURPOSE. See the GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License along 14 | * with this program. If not, see . 15 | * 16 | */ 17 | 18 | #ifndef ANBOX_NETWORK_CREDENTIALS_H_ 19 | #define ANBOX_NETWORK_CREDENTIALS_H_ 20 | 21 | #include 22 | 23 | namespace anbox { 24 | namespace network { 25 | class Credentials { 26 | public: 27 | Credentials(pid_t pid, uid_t uid, gid_t gid); 28 | 29 | pid_t pid() const; 30 | uid_t uid() const; 31 | gid_t gid() const; 32 | 33 | private: 34 | Credentials() = delete; 35 | 36 | pid_t pid_; 37 | uid_t uid_; 38 | gid_t gid_; 39 | }; 40 | } // namespace network 41 | } // namespace anbox 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /src/anbox/network/delegate_message_processor.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Simon Fels 3 | * 4 | * This program is free software: you can redistribute it and/or modify it 5 | * under the terms of the GNU General Public License version 3, as published 6 | * by the Free Software Foundation. 7 | * 8 | * This program is distributed in the hope that it will be useful, but 9 | * WITHOUT ANY WARRANTY; without even the implied warranties of 10 | * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR 11 | * PURPOSE. See the GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License along 14 | * with this program. If not, see . 15 | * 16 | */ 17 | 18 | #include "anbox/network/delegate_message_processor.h" 19 | 20 | namespace anbox { 21 | namespace network { 22 | DelegateMessageProcessor::DelegateMessageProcessor( 23 | std::function &)> process_data) 24 | : process_data_(process_data) {} 25 | 26 | DelegateMessageProcessor::~DelegateMessageProcessor() {} 27 | 28 | bool DelegateMessageProcessor::process_data( 29 | const std::vector &data) { 30 | if (!process_data_) return false; 31 | 32 | return process_data_(data); 33 | } 34 | } // namespace network 35 | } // namespace anbox 36 | -------------------------------------------------------------------------------- /src/anbox/network/message_processor.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Simon Fels 3 | * 4 | * This program is free software: you can redistribute it and/or modify it 5 | * under the terms of the GNU General Public License version 3, as published 6 | * by the Free Software Foundation. 7 | * 8 | * This program is distributed in the hope that it will be useful, but 9 | * WITHOUT ANY WARRANTY; without even the implied warranties of 10 | * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR 11 | * PURPOSE. See the GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License along 14 | * with this program. If not, see . 15 | * 16 | */ 17 | 18 | #ifndef ANBOX_NETWORK_MESSAGE_PROCESSOR_H 19 | #define ANBOX_NETWORK_MESSAGE_PROCESSOR_H 20 | 21 | #include 22 | #include 23 | 24 | namespace anbox { 25 | namespace network { 26 | class MessageProcessor { 27 | public: 28 | virtual ~MessageProcessor() {} 29 | virtual bool process_data(const std::vector &data) = 0; 30 | }; 31 | } // namespace network 32 | } // namespace anbox 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /src/anbox/network/socket_helper.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Simon Fels 3 | * 4 | * This program is free software: you can redistribute it and/or modify it 5 | * under the terms of the GNU General Public License version 3, as published 6 | * by the Free Software Foundation. 7 | * 8 | * This program is distributed in the hope that it will be useful, but 9 | * WITHOUT ANY WARRANTY; without even the implied warranties of 10 | * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR 11 | * PURPOSE. See the GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License along 14 | * with this program. If not, see . 15 | * 16 | */ 17 | 18 | #ifndef ANBOX_NETWORK_SOCKET_HELPER_H_ 19 | #define ANBOX_NETWORK_SOCKET_HELPER_H_ 20 | 21 | #include 22 | 23 | namespace anbox { 24 | namespace network { 25 | bool socket_file_exists(std::string const& filename); 26 | bool socket_exists(std::string const& socket_name); 27 | std::string remove_socket_if_stale(std::string const& socket_name); 28 | } // namespace network 29 | } // namespace anbox 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /src/anbox/network/socket_messenger.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lag-linaro/robox/0bc0774c244d929f98e3c84c24183ac151403aa1/src/anbox/network/socket_messenger.cpp -------------------------------------------------------------------------------- /src/anbox/optional.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Canonical, Ltd. 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU Lesser General Public License as published by 6 | * the Free Software Foundation; version 3. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU Lesser General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU Lesser General Public License 14 | * along with this program. If not, see . 15 | * 16 | * Authored by: Thomas Voß 17 | * 18 | */ 19 | 20 | #ifndef ANBOX_OPTIONAL_H_ 21 | #define ANBOX_OPTIONAL_H_ 22 | 23 | #include 24 | #include 25 | 26 | namespace anbox { 27 | template 28 | using Optional = boost::optional; 29 | } 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /src/anbox/platform/sdl/keycode_converter.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Simon Fels 3 | * 4 | * This program is free software: you can redistribute it and/or modify it 5 | * under the terms of the GNU General Public License version 3, as published 6 | * by the Free Software Foundation. 7 | * 8 | * This program is distributed in the hope that it will be useful, but 9 | * WITHOUT ANY WARRANTY; without even the implied warranties of 10 | * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR 11 | * PURPOSE. See the GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License along 14 | * with this program. If not, see . 15 | * 16 | */ 17 | 18 | #ifndef ANBOX_PLATFORM_SDL_KEYCODE_CONVERTER_H_ 19 | #define ANBOX_PLATFORM_SDL_KEYCODE_CONVERTER_H_ 20 | 21 | #include "anbox/platform/sdl/sdl_wrapper.h" 22 | 23 | #include 24 | 25 | #include 26 | 27 | namespace anbox { 28 | namespace platform { 29 | namespace sdl { 30 | class KeycodeConverter { 31 | public: 32 | static std::uint16_t convert(const SDL_Scancode &scan_code); 33 | 34 | private: 35 | static const std::array code_map; 36 | }; 37 | } // namespace sdl 38 | } // namespace platform 39 | } // namespace anbox 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /src/anbox/platform/sdl/sdl_wrapper.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Simon Fels 3 | * 4 | * This program is free software: you can redistribute it and/or modify it 5 | * under the terms of the GNU General Public License version 3, as published 6 | * by the Free Software Foundation. 7 | * 8 | * This program is distributed in the hope that it will be useful, but 9 | * WITHOUT ANY WARRANTY; without even the implied warranties of 10 | * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR 11 | * PURPOSE. See the GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License along 14 | * with this program. If not, see . 15 | * 16 | */ 17 | 18 | #ifndef ANBOX_PLATFORM_SDL_WRAPPER_H_ 19 | #define ANBOX_PLATFORM_SDL_WRAPPER_H_ 20 | 21 | #pragma GCC diagnostic push 22 | #pragma GCC diagnostic ignored "-Wswitch-default" 23 | #include 24 | #include 25 | #include 26 | #include 27 | #pragma GCC diagnostic pop 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /src/anbox/protobuf/anbox_container.proto: -------------------------------------------------------------------------------- 1 | option optimize_for = LITE_RUNTIME; 2 | 3 | package anbox.protobuf.container; 4 | 5 | message Configuration { 6 | message BindMount { 7 | required string source = 1; 8 | required string target = 2; 9 | } 10 | repeated BindMount bind_mounts = 1; 11 | } 12 | 13 | message StartContainer { 14 | required Configuration configuration = 1; 15 | } 16 | 17 | message StopContainer { 18 | optional bool force = 1; 19 | } 20 | -------------------------------------------------------------------------------- /src/anbox/protobuf/anbox_rpc.proto: -------------------------------------------------------------------------------- 1 | option optimize_for = LITE_RUNTIME; 2 | 3 | package anbox.protobuf.rpc; 4 | 5 | message Invocation { 6 | required uint32 id = 1; 7 | required string method_name = 2; 8 | required bytes parameters = 3; 9 | required uint32 protocol_version = 4; 10 | } 11 | 12 | message Result { 13 | optional uint32 id = 1; 14 | optional bytes response = 2; 15 | repeated bytes events = 3; 16 | } 17 | 18 | message StructuredError { 19 | optional uint32 domain = 1; 20 | optional uint32 code = 2; 21 | } 22 | 23 | message Void { 24 | optional string error = 127; 25 | optional StructuredError structured_error = 128; 26 | } 27 | -------------------------------------------------------------------------------- /src/anbox/protobuf/google_protobuf_guard.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2012 Canonical Ltd. 3 | * 4 | * This program is free software: you can redistribute it and/or modify it 5 | * under the terms of the GNU Lesser General Public License version 3, 6 | * as published by the Free Software Foundation. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU Lesser General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU Lesser General Public License 14 | * along with this program. If not, see . 15 | * 16 | * Authored by: Alan Griffiths 17 | */ 18 | 19 | #include 20 | 21 | extern "C" int __attribute__((constructor)) init_google_protobuf() { 22 | GOOGLE_PROTOBUF_VERIFY_VERSION; 23 | return 0; 24 | } 25 | 26 | extern "C" int __attribute__((destructor)) shutdown_google_protobuf() { 27 | google::protobuf::ShutdownProtobufLibrary(); 28 | return 0; 29 | } 30 | 31 | // Preserve ABI 32 | namespace anbox { 33 | namespace protobuf { 34 | void google_protobuf_guard(); 35 | } 36 | } 37 | 38 | void anbox::protobuf::google_protobuf_guard() {} 39 | -------------------------------------------------------------------------------- /src/anbox/qemu/hwcontrol_message_processor.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Simon Fels 3 | * 4 | * This program is free software: you can redistribute it and/or modify it 5 | * under the terms of the GNU General Public License version 3, as published 6 | * by the Free Software Foundation. 7 | * 8 | * This program is distributed in the hope that it will be useful, but 9 | * WITHOUT ANY WARRANTY; without even the implied warranties of 10 | * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR 11 | * PURPOSE. See the GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License along 14 | * with this program. If not, see . 15 | * 16 | */ 17 | 18 | #ifndef ANBOX_QEMU_HWCONTROL_MESSAGE_PROCESSOR_H_ 19 | #define ANBOX_QEMU_HWCONTROL_MESSAGE_PROCESSOR_H_ 20 | 21 | #include "anbox/qemu/qemud_message_processor.h" 22 | 23 | namespace anbox { 24 | namespace qemu { 25 | class HwControlMessageProcessor : public QemudMessageProcessor { 26 | public: 27 | HwControlMessageProcessor( 28 | const std::shared_ptr &messenger); 29 | ~HwControlMessageProcessor(); 30 | 31 | protected: 32 | void handle_command(const std::string &command) override; 33 | }; 34 | } // namespace graphics 35 | } // namespace anbox 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /src/anbox/qemu/null_message_processor.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Simon Fels 3 | * 4 | * This program is free software: you can redistribute it and/or modify it 5 | * under the terms of the GNU General Public License version 3, as published 6 | * by the Free Software Foundation. 7 | * 8 | * This program is distributed in the hope that it will be useful, but 9 | * WITHOUT ANY WARRANTY; without even the implied warranties of 10 | * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR 11 | * PURPOSE. See the GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License along 14 | * with this program. If not, see . 15 | * 16 | */ 17 | 18 | #include "anbox/qemu/null_message_processor.h" 19 | #include "anbox/logger.h" 20 | #include "anbox/utils.h" 21 | 22 | #include 23 | 24 | namespace anbox { 25 | namespace qemu { 26 | NullMessageProcessor::NullMessageProcessor() {} 27 | 28 | NullMessageProcessor::~NullMessageProcessor() {} 29 | 30 | bool NullMessageProcessor::process_data(const std::vector &data) { 31 | (void)data; 32 | return true; 33 | } 34 | } // namespace qemu 35 | } // namespace anbox 36 | -------------------------------------------------------------------------------- /src/anbox/qemu/null_message_processor.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Simon Fels 3 | * 4 | * This program is free software: you can redistribute it and/or modify it 5 | * under the terms of the GNU General Public License version 3, as published 6 | * by the Free Software Foundation. 7 | * 8 | * This program is distributed in the hope that it will be useful, but 9 | * WITHOUT ANY WARRANTY; without even the implied warranties of 10 | * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR 11 | * PURPOSE. See the GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License along 14 | * with this program. If not, see . 15 | * 16 | */ 17 | 18 | #ifndef ANBOX_QEMU_NULL_MESSAGE_PROCESSOR_H_ 19 | #define ANBOX_QEMU_NULL_MESSAGE_PROCESSOR_H_ 20 | 21 | #include "anbox/network/message_processor.h" 22 | 23 | namespace anbox { 24 | namespace qemu { 25 | class NullMessageProcessor : public network::MessageProcessor { 26 | public: 27 | NullMessageProcessor(); 28 | ~NullMessageProcessor(); 29 | 30 | bool process_data(const std::vector &data) override; 31 | }; 32 | } // namespace graphics 33 | } // namespace anbox 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /src/anbox/qemu/telephony_manager.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Simon Fels 3 | * 4 | * This program is free software: you can redistribute it and/or modify it 5 | * under the terms of the GNU General Public License version 3, as published 6 | * by the Free Software Foundation. 7 | * 8 | * This program is distributed in the hope that it will be useful, but 9 | * WITHOUT ANY WARRANTY; without even the implied warranties of 10 | * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR 11 | * PURPOSE. See the GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License along 14 | * with this program. If not, see . 15 | * 16 | */ 17 | 18 | #ifndef ANBOX_QEMU_TELEPHONY_MANAGER_H_ 19 | #define ANBOX_QEMU_TELEPHONY_MANAGER_H_ 20 | 21 | #include 22 | #include 23 | #include 24 | 25 | namespace anbox { 26 | namespace qemu { 27 | class TelephonyManager { 28 | public: 29 | TelephonyManager(const core::dbus::Bus::Ptr &bus); 30 | ~TelephonyManager(); 31 | 32 | private: 33 | core::dbus::Bus::Ptr bus_; 34 | core::dbus::Service::Ptr ofono_; 35 | core::dbus::Object::Ptr modem_; 36 | }; 37 | } // namespace qemu 38 | } // namespace anbox 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /src/anbox/rotation_status.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018 Linaro Ltd. 3 | * 4 | * This program is free software: you can redistribute it and/or modify it 5 | * under the terms of the GNU General Public License version 3, as published 6 | * by the Free Software Foundation. 7 | * 8 | * This program is distributed in the hope that it will be useful, but 9 | * WITHOUT ANY WARRANTY; without even the implied warranties of 10 | * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR 11 | * PURPOSE. See the GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License along 14 | * with this program. If not, see . 15 | * 16 | */ 17 | 18 | #ifndef ANBOX_ROTATIONSTATUS_H_ 19 | #define ANBOX_ROTATIONSTATUS_H_ 20 | 21 | // These APIs will be used to set and get the current screen 22 | // orientation 23 | 24 | int rotation_angle = 0; 25 | 26 | void set_rotation_status (int status) 27 | { 28 | rotation_angle = status; 29 | } 30 | 31 | int get_rotation_status () 32 | { 33 | return (rotation_angle); 34 | } 35 | #endif 36 | 37 | -------------------------------------------------------------------------------- /src/anbox/rpc/constants.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Simon Fels 3 | * 4 | * This program is free software: you can redistribute it and/or modify it 5 | * under the terms of the GNU General Public License version 3, as published 6 | * by the Free Software Foundation. 7 | * 8 | * This program is distributed in the hope that it will be useful, but 9 | * WITHOUT ANY WARRANTY; without even the implied warranties of 10 | * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR 11 | * PURPOSE. See the GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License along 14 | * with this program. If not, see . 15 | * 16 | */ 17 | 18 | #ifndef ANBOX_RPC_CONSTANTS_H_ 19 | #define ANBOX_RPC_CONSTANTS_H_ 20 | 21 | namespace anbox { 22 | namespace rpc { 23 | static constexpr const long header_size{3}; 24 | static constexpr unsigned int const serialization_buffer_size{2048}; 25 | 26 | enum MessageType { 27 | invocation = 0, 28 | response = 1, 29 | }; 30 | } // namespace rpc 31 | } // namespace network 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /src/anbox/sensors/sensors_data.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017 Lee Jones 3 | * 4 | * This program is free software: you can redistribute it and/or modify it 5 | * under the terms of the GNU General Public License version 3, as published 6 | * by the Free Software Foundation. 7 | * 8 | * This program is distributed in the hope that it will be useful, but 9 | * WITHOUT ANY WARRANTY; without even the implied warranties of 10 | * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR 11 | * PURPOSE. See the GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License along 14 | * with this program. If not, see . 15 | * 16 | */ 17 | 18 | #ifndef ANBOX_SENSORS_DATA_H_ 19 | #define ANBOX_SENSORS_DATA_H_ 20 | 21 | namespace anbox { 22 | namespace sensors { 23 | class Data { 24 | public: 25 | Data(const int id, const int groupsize); 26 | ~Data(); 27 | 28 | void get_data(float data[3]); 29 | 30 | private: 31 | void pluck(const float samples[][3], unsigned int rows, float data[3]); 32 | 33 | unsigned int select_ = 0; 34 | unsigned int updown_ = 0; 35 | const int id_; 36 | const int groupsize_; 37 | }; 38 | } // namespace sensors 39 | } // namespace anbox 40 | 41 | #endif // ANBOX_SENSORS_DATA_H_ 42 | -------------------------------------------------------------------------------- /src/anbox/ui/splash_screen.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017 Simon Fels 3 | * 4 | * This program is free software: you can redistribute it and/or modify it 5 | * under the terms of the GNU General Public License version 3, as published 6 | * by the Free Software Foundation. 7 | * 8 | * This program is distributed in the hope that it will be useful, but 9 | * WITHOUT ANY WARRANTY; without even the implied warranties of 10 | * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR 11 | * PURPOSE. See the GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License along 14 | * with this program. If not, see . 15 | * 16 | */ 17 | 18 | #ifndef ANBOX_UI_SPLASH_SCREEN_H_ 19 | #define ANBOX_UI_SPLASH_SCREEN_H_ 20 | 21 | #include 22 | 23 | #include 24 | 25 | namespace anbox { 26 | namespace ui { 27 | class SplashScreen { 28 | public: 29 | SplashScreen(); 30 | ~SplashScreen(); 31 | 32 | private: 33 | void process_events(); 34 | 35 | std::thread event_thread_; 36 | bool event_thread_running_; 37 | SDL_Window *window_; 38 | }; 39 | } // namespace ui 40 | } // namespace anbox 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /src/anbox/utils/environment_file.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017 Simon Fels 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU Lesser General Public License as published by 6 | * the Free Software Foundation; version 3. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU Lesser General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU Lesser General Public License 14 | * along with this program. If not, see . 15 | * 16 | */ 17 | 18 | #ifndef ANBOX_UTILS_ENVIRONMENT_FILE_H_ 19 | #define ANBOX_UTILS_ENVIRONMENT_FILE_H_ 20 | 21 | #include 22 | #include 23 | #include 24 | 25 | namespace anbox { 26 | namespace utils { 27 | class EnvironmentFile { 28 | public: 29 | EnvironmentFile(const boost::filesystem::path &path); 30 | ~EnvironmentFile() = default; 31 | 32 | std::string value(const std::string &key, const std::string &default_value = "") const; 33 | 34 | private: 35 | std::map data_; 36 | }; 37 | } // namespace utils 38 | } // namespace anbox 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /src/anbox/wm/display.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Simon Fels 3 | * 4 | * This program is free software: you can redistribute it and/or modify it 5 | * under the terms of the GNU General Public License version 3, as published 6 | * by the Free Software Foundation. 7 | * 8 | * This program is distributed in the hope that it will be useful, but 9 | * WITHOUT ANY WARRANTY; without even the implied warranties of 10 | * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR 11 | * PURPOSE. See the GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License along 14 | * with this program. If not, see . 15 | * 16 | */ 17 | 18 | #include "anbox/wm/display.h" 19 | 20 | namespace anbox { 21 | namespace wm { 22 | Display::Id Display::Invalid = -1; 23 | Display::Id Display::Default = 0; 24 | } // namespace wm 25 | } // namespace anbox 26 | -------------------------------------------------------------------------------- /src/anbox/wm/display.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Simon Fels 3 | * 4 | * This program is free software: you can redistribute it and/or modify it 5 | * under the terms of the GNU General Public License version 3, as published 6 | * by the Free Software Foundation. 7 | * 8 | * This program is distributed in the hope that it will be useful, but 9 | * WITHOUT ANY WARRANTY; without even the implied warranties of 10 | * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR 11 | * PURPOSE. See the GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License along 14 | * with this program. If not, see . 15 | * 16 | */ 17 | 18 | #ifndef ANBOX_WM_DISPLAY_H_ 19 | #define ANBOX_WM_DISPLAY_H_ 20 | 21 | #include 22 | 23 | namespace anbox { 24 | namespace wm { 25 | class Display { 26 | public: 27 | typedef std::int32_t Id; 28 | 29 | static Id Invalid; 30 | static Id Default; 31 | 32 | Display() = delete; 33 | Display(const Display&) = delete; 34 | }; 35 | } // namespace wm 36 | } // namespace anbox 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /src/anbox/wm/manager.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Simon Fels 3 | * 4 | * This program is free software: you can redistribute it and/or modify it 5 | * under the terms of the GNU General Public License version 3, as published 6 | * by the Free Software Foundation. 7 | * 8 | * This program is distributed in the hope that it will be useful, but 9 | * WITHOUT ANY WARRANTY; without even the implied warranties of 10 | * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR 11 | * PURPOSE. See the GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License along 14 | * with this program. If not, see . 15 | * 16 | */ 17 | 18 | #include "anbox/wm/manager.h" 19 | 20 | namespace anbox { 21 | namespace wm { 22 | Manager::~Manager() {} 23 | } // namespace wm 24 | } // namespace anbox 25 | -------------------------------------------------------------------------------- /src/anbox/wm/stack.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Simon Fels 3 | * 4 | * This program is free software: you can redistribute it and/or modify it 5 | * under the terms of the GNU General Public License version 3, as published 6 | * by the Free Software Foundation. 7 | * 8 | * This program is distributed in the hope that it will be useful, but 9 | * WITHOUT ANY WARRANTY; without even the implied warranties of 10 | * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR 11 | * PURPOSE. See the GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License along 14 | * with this program. If not, see . 15 | * 16 | */ 17 | 18 | #ifndef ANBOX_WM_STACK_H_ 19 | #define ANBOX_WM_STACK_H_ 20 | 21 | #include 22 | 23 | namespace anbox { 24 | namespace wm { 25 | class Stack { 26 | public: 27 | enum class Id { 28 | Invalid = -1, 29 | Default = 0, 30 | Fullscreen = 1, 31 | Freeform = 2, 32 | }; 33 | 34 | Stack() = delete; 35 | Stack(const Stack&) = delete; 36 | }; 37 | 38 | std::ostream& operator<<(std::ostream &out, Stack::Id const &stack); 39 | std::istream& operator>>(std::istream &in, Stack::Id &stack); 40 | } // namespace wm 41 | } // namespace anbox 42 | 43 | 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /src/anbox/wm/task.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Simon Fels 3 | * 4 | * This program is free software: you can redistribute it and/or modify it 5 | * under the terms of the GNU General Public License version 3, as published 6 | * by the Free Software Foundation. 7 | * 8 | * This program is distributed in the hope that it will be useful, but 9 | * WITHOUT ANY WARRANTY; without even the implied warranties of 10 | * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR 11 | * PURPOSE. See the GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License along 14 | * with this program. If not, see . 15 | * 16 | */ 17 | 18 | #include "anbox/wm/task.h" 19 | 20 | namespace anbox { 21 | namespace wm { 22 | Task::Id Task::Invalid = -1; 23 | } // namespace wm 24 | } // namespace anbox 25 | -------------------------------------------------------------------------------- /src/anbox/wm/task.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Simon Fels 3 | * 4 | * This program is free software: you can redistribute it and/or modify it 5 | * under the terms of the GNU General Public License version 3, as published 6 | * by the Free Software Foundation. 7 | * 8 | * This program is distributed in the hope that it will be useful, but 9 | * WITHOUT ANY WARRANTY; without even the implied warranties of 10 | * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR 11 | * PURPOSE. See the GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License along 14 | * with this program. If not, see . 15 | * 16 | */ 17 | 18 | #ifndef ANBOX_WM_TASK_H_ 19 | #define ANBOX_WM_TASK_H_ 20 | 21 | #include 22 | 23 | namespace anbox { 24 | namespace wm { 25 | class Task { 26 | public: 27 | typedef std::int32_t Id; 28 | 29 | static Id Invalid; 30 | 31 | Task() = delete; 32 | Task(const Task&) = delete; 33 | }; 34 | } // namespace wm 35 | } // namespace anbox 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /src/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Simon Fels 3 | * 4 | * This program is free software: you can redistribute it and/or modify it 5 | * under the terms of the GNU General Public License version 3, as published 6 | * by the Free Software Foundation. 7 | * 8 | * This program is distributed in the hope that it will be useful, but 9 | * WITHOUT ANY WARRANTY; without even the implied warranties of 10 | * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR 11 | * PURPOSE. See the GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License along 14 | * with this program. If not, see . 15 | * 16 | */ 17 | 18 | #include "anbox/daemon.h" 19 | #include "anbox/utils.h" 20 | 21 | int main(int argc, char **argv) { 22 | anbox::Daemon daemon; 23 | return daemon.Run(anbox::utils::collect_arguments(argc, argv)); 24 | } 25 | -------------------------------------------------------------------------------- /tests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-sign-compare") 2 | 3 | include_directories( 4 | ${Boost_INCLUDE_DIRS} 5 | ${CMAKE_SOURCE_DIR} 6 | ${CMAKE_SOURCE_DIR}/external/android-emugl/host/include 7 | ${CMAKE_SOURCE_DIR}/src 8 | ) 9 | 10 | macro(ANBOX_ADD_TEST test_name src) 11 | add_executable( 12 | ${test_name} 13 | ${src} 14 | ) 15 | 16 | target_link_libraries( 17 | ${test_name} 18 | 19 | anbox-core 20 | 21 | ${GMOCK_LIBRARIES} 22 | ${GTEST_BOTH_LIBRARIES} 23 | 24 | ${ARGN} 25 | 26 | ${Boost_LIBRARIES} 27 | ${CMAKE_THREAD_LIBS_INIT} 28 | ) 29 | 30 | add_test(${test_name} ${CMAKE_CURRENT_BINARY_DIR}/${test_name} --gtest_filter=*-*requires*) 31 | endmacro(ANBOX_ADD_TEST) 32 | 33 | add_subdirectory(anbox) 34 | -------------------------------------------------------------------------------- /tests/anbox/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(android) 2 | add_subdirectory(application) 3 | add_subdirectory(support) 4 | add_subdirectory(common) 5 | add_subdirectory(graphics) 6 | -------------------------------------------------------------------------------- /tests/anbox/android/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ANBOX_ADD_TEST(intent_tests intent_tests.cpp) 2 | -------------------------------------------------------------------------------- /tests/anbox/android/intent_tests.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017 Simon Fels 3 | * 4 | * This program is free software: you can redistribute it and/or modify it 5 | * under the terms of the GNU General Public License version 3, as published 6 | * by the Free Software Foundation. 7 | * 8 | * This program is distributed in the hope that it will be useful, but 9 | * WITHOUT ANY WARRANTY; without even the implied warranties of 10 | * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR 11 | * PURPOSE. See the GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License along 14 | * with this program. If not, see . 15 | * 16 | */ 17 | 18 | #include "anbox/android/intent.h" 19 | 20 | #include 21 | 22 | TEST(Intent, IsValid) { 23 | anbox::android::Intent intent; 24 | ASSERT_FALSE(intent.valid()); 25 | intent.component = "foo"; 26 | ASSERT_TRUE(intent.valid()); 27 | intent.package = "bla"; 28 | ASSERT_TRUE(intent.valid()); 29 | intent.component = ""; 30 | ASSERT_TRUE(intent.valid()); 31 | } 32 | -------------------------------------------------------------------------------- /tests/anbox/application/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ANBOX_ADD_TEST(restricted_manager_tests restricted_manager_tests.cpp) 2 | -------------------------------------------------------------------------------- /tests/anbox/common/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ANBOX_ADD_TEST(message_channel_tests message_channel_tests.cpp) 2 | ANBOX_ADD_TEST(small_vector_tests small_vector_tests.cpp) 3 | ANBOX_ADD_TEST(type_traits_tests type_traits_tests.cpp) 4 | ANBOX_ADD_TEST(scope_ptr_tests scope_ptr_tests.cpp) 5 | ANBOX_ADD_TEST(binary_writer_tests binary_writer_tests.cpp) 6 | -------------------------------------------------------------------------------- /tests/anbox/graphics/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ANBOX_ADD_TEST(buffer_queue_tests buffer_queue_tests.cpp) 2 | ANBOX_ADD_TEST(buffered_io_stream_tests buffered_io_stream_tests.cpp) 3 | ANBOX_ADD_TEST(layer_composer_tests layer_composer_tests.cpp) 4 | ANBOX_ADD_TEST(render_control_tests render_control_tests.cpp) 5 | -------------------------------------------------------------------------------- /tests/anbox/graphics/render_control_tests.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017 Simon Fels 3 | * 4 | * This program is free software: you can redistribute it and/or modify it 5 | * under the terms of the GNU General Public License version 3, as published 6 | * by the Free Software Foundation. 7 | * 8 | * This program is distributed in the hope that it will be useful, but 9 | * WITHOUT ANY WARRANTY; without even the implied warranties of 10 | * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR 11 | * PURPOSE. See the GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License along 14 | * with this program. If not, see . 15 | * 16 | */ 17 | 18 | #include 19 | 20 | #include "anbox/graphics/emugl/DisplayManager.h" 21 | 22 | extern int rcGetDisplayWidth(uint32_t display_id); 23 | extern int rcGetDisplayHeight(uint32_t display_id); 24 | 25 | TEST(RenderControl, WidthHeightAreCorrectlyAssigned) { 26 | anbox::graphics::emugl::DisplayInfo::get()->set_resolution(640, 480); 27 | ASSERT_EQ(rcGetDisplayWidth(0), 640); 28 | ASSERT_EQ(rcGetDisplayHeight(0), 480); 29 | } 30 | -------------------------------------------------------------------------------- /tests/anbox/support/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ANBOX_ADD_TEST(at_parser_tests at_parser_tests.cpp) 2 | --------------------------------------------------------------------------------