From e78f853e469e37bc2cc4f22d9f102d38d756af04 Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Wed, 14 Dec 2016 13:03:12 -0800 Subject: Move libstorage includes into frameworks/base/lib/storage Move the libstorage includes out of the global include path and into frameworks/base/lib/storage/include, and export it. Bug: 33630870 Test: m -j native Change-Id: Idc0735360abc703496b9bc46d1a76ce8039af0d1 --- libs/storage/Android.mk | 3 + libs/storage/include/storage/IMountService.h | 87 ++++++++++++++++++++++ .../include/storage/IMountServiceListener.h | 45 +++++++++++ .../include/storage/IMountShutdownObserver.h | 46 ++++++++++++ libs/storage/include/storage/IObbActionListener.h | 48 ++++++++++++ 5 files changed, 229 insertions(+) create mode 100644 libs/storage/include/storage/IMountService.h create mode 100644 libs/storage/include/storage/IMountServiceListener.h create mode 100644 libs/storage/include/storage/IMountShutdownObserver.h create mode 100644 libs/storage/include/storage/IObbActionListener.h (limited to 'libs') diff --git a/libs/storage/Android.mk b/libs/storage/Android.mk index d0eb6d4eb425..f8524e379599 100644 --- a/libs/storage/Android.mk +++ b/libs/storage/Android.mk @@ -9,6 +9,9 @@ LOCAL_SRC_FILES:= \ LOCAL_MODULE:= libstorage +LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include +LOCAL_C_INCLUDES := $(LOCAL_PATH)/include + LOCAL_CFLAGS += -Wall -Werror LOCAL_SHARED_LIBRARIES := libbinder diff --git a/libs/storage/include/storage/IMountService.h b/libs/storage/include/storage/IMountService.h new file mode 100644 index 000000000000..c3d34d84958b --- /dev/null +++ b/libs/storage/include/storage/IMountService.h @@ -0,0 +1,87 @@ +/* + * Copyright (C) 2010 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ANDROID_IMOUNTSERVICE_H +#define ANDROID_IMOUNTSERVICE_H + +#include +#include +#include + +#include + +#include +#include + +namespace android { + +class IMountService: public IInterface { +public: + DECLARE_META_INTERFACE(MountService); + + virtual void registerListener(const sp& listener) = 0; + virtual void + unregisterListener(const sp& listener) = 0; + virtual bool isUsbMassStorageConnected() = 0; + virtual void setUsbMassStorageEnabled(const bool enable) = 0; + virtual bool isUsbMassStorageEnabled() = 0; + virtual int32_t mountVolume(const String16& mountPoint) = 0; + virtual int32_t unmountVolume( + const String16& mountPoint, const bool force, const bool removeEncryption) = 0; + virtual int32_t formatVolume(const String16& mountPoint) = 0; + virtual int32_t + getStorageUsers(const String16& mountPoint, int32_t** users) = 0; + virtual int32_t getVolumeState(const String16& mountPoint) = 0; + virtual int32_t createSecureContainer(const String16& id, + const int32_t sizeMb, const String16& fstype, const String16& key, + const int32_t ownerUid) = 0; + virtual int32_t finalizeSecureContainer(const String16& id) = 0; + virtual int32_t destroySecureContainer(const String16& id) = 0; + virtual int32_t mountSecureContainer(const String16& id, + const String16& key, const int32_t ownerUid) = 0; + virtual int32_t + unmountSecureContainer(const String16& id, const bool force) = 0; + virtual bool isSecureContainerMounted(const String16& id) = 0; + virtual int32_t renameSecureContainer(const String16& oldId, + const String16& newId) = 0; + virtual bool getSecureContainerPath(const String16& id, String16& path) = 0; + virtual int32_t getSecureContainerList(const String16& id, + String16*& containers) = 0; + virtual void shutdown(const sp& observer) = 0; + virtual void finishMediaUpdate() = 0; + virtual void mountObb(const String16& rawPath, const String16& canonicalPath, + const String16& key, const sp& token, + const int32_t nonce) = 0; + virtual void unmountObb(const String16& filename, const bool force, + const sp& token, const int32_t nonce) = 0; + virtual bool isObbMounted(const String16& filename) = 0; + virtual bool getMountedObbPath(const String16& filename, String16& path) = 0; + virtual int32_t decryptStorage(const String16& password) = 0; + virtual int32_t encryptStorage(const String16& password) = 0; +}; + +// ---------------------------------------------------------------------------- + +class BnMountService: public BnInterface { +public: + virtual status_t onTransact(uint32_t code, const Parcel& data, + Parcel* reply, uint32_t flags = 0); +}; + +} +; // namespace android + +#endif // ANDROID_IMOUNTSERVICE_H diff --git a/libs/storage/include/storage/IMountServiceListener.h b/libs/storage/include/storage/IMountServiceListener.h new file mode 100644 index 000000000000..5b1f21cf98b5 --- /dev/null +++ b/libs/storage/include/storage/IMountServiceListener.h @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2010 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ANDROID_IMOUNTSERVICELISTENER_H +#define ANDROID_IMOUNTSERVICELISTENER_H + +#include +#include + +namespace android { + +class IMountServiceListener: public IInterface { +public: + DECLARE_META_INTERFACE(MountServiceListener); + + virtual void onUsbMassStorageConnectionChanged(const bool connected) = 0; + virtual void onStorageStateChanged(const String16& path, + const String16& oldState, const String16& newState) = 0; +}; + +// ---------------------------------------------------------------------------- + +class BnMountServiceListener: public BnInterface { +public: + virtual status_t onTransact(uint32_t code, const Parcel& data, + Parcel* reply, uint32_t flags = 0); +}; + +} +; // namespace android + +#endif // ANDROID_IMOUNTSERVICELISTENER_H diff --git a/libs/storage/include/storage/IMountShutdownObserver.h b/libs/storage/include/storage/IMountShutdownObserver.h new file mode 100644 index 000000000000..d019e019bc0d --- /dev/null +++ b/libs/storage/include/storage/IMountShutdownObserver.h @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2010 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ANDROID_IMOUNTSHUTDOWNOBSERVER_H +#define ANDROID_IMOUNTSHUTDOWNOBSERVER_H + +#include +#include + +namespace android { + +class IMountShutdownObserver: public IInterface +{ +public: + DECLARE_META_INTERFACE(MountShutdownObserver); + + virtual void onShutDownComplete(const int32_t statusCode) = 0; +}; + +// ---------------------------------------------------------------------------- + +class BnMountShutdownObserver: public BnInterface +{ +public: + virtual status_t onTransact( uint32_t code, + const Parcel& data, + Parcel* reply, + uint32_t flags = 0); +}; + +}; // namespace android + +#endif // ANDROID_IMOUNTSHUTDOWNOBSERVER_H diff --git a/libs/storage/include/storage/IObbActionListener.h b/libs/storage/include/storage/IObbActionListener.h new file mode 100644 index 000000000000..d78273cf2dd4 --- /dev/null +++ b/libs/storage/include/storage/IObbActionListener.h @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2010 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ANDROID_IOBBACTIONLISTENER_H +#define ANDROID_IOBBACTIONLISTENER_H + +#include +#include + +#include + +namespace android { + +class IObbActionListener: public IInterface +{ +public: + DECLARE_META_INTERFACE(ObbActionListener); + + virtual void onObbResult(const String16& filename, const int32_t nonce, const int32_t state) = 0; +}; + +// ---------------------------------------------------------------------------- + +class BnObbActionListener: public BnInterface +{ +public: + virtual status_t onTransact( uint32_t code, + const Parcel& data, + Parcel* reply, + uint32_t flags = 0); +}; + +}; // namespace android + +#endif // ANDROID_IOBBACTIONLISTENER_H -- cgit v1.2.3-59-g8ed1b From 3ac2be93a9f52103ec60a2f13cbaf31017cfdf54 Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Wed, 14 Dec 2016 13:06:07 -0800 Subject: Convert libstorage to Android.bp See build/soong/README.md for more information. Test: m -j native Change-Id: Ieb34d79af10e4e7cd146d0d40fd6946499dd1da0 --- libs/storage/Android.bp | 19 +++++++++++++++++++ libs/storage/Android.mk | 19 ------------------- 2 files changed, 19 insertions(+), 19 deletions(-) create mode 100644 libs/storage/Android.bp delete mode 100644 libs/storage/Android.mk (limited to 'libs') diff --git a/libs/storage/Android.bp b/libs/storage/Android.bp new file mode 100644 index 000000000000..911bd1d25393 --- /dev/null +++ b/libs/storage/Android.bp @@ -0,0 +1,19 @@ +cc_library_static { + name: "libstorage", + + srcs: [ + "IMountServiceListener.cpp", + "IMountShutdownObserver.cpp", + "IObbActionListener.cpp", + "IMountService.cpp", + ], + + export_include_dirs: ["include"], + + cflags: [ + "-Wall", + "-Werror", + ], + + shared_libs: ["libbinder"], +} diff --git a/libs/storage/Android.mk b/libs/storage/Android.mk deleted file mode 100644 index f8524e379599..000000000000 --- a/libs/storage/Android.mk +++ /dev/null @@ -1,19 +0,0 @@ -LOCAL_PATH:= $(call my-dir) -include $(CLEAR_VARS) - -LOCAL_SRC_FILES:= \ - IMountServiceListener.cpp \ - IMountShutdownObserver.cpp \ - IObbActionListener.cpp \ - IMountService.cpp - -LOCAL_MODULE:= libstorage - -LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include -LOCAL_C_INCLUDES := $(LOCAL_PATH)/include - -LOCAL_CFLAGS += -Wall -Werror - -LOCAL_SHARED_LIBRARIES := libbinder - -include $(BUILD_STATIC_LIBRARY) -- cgit v1.2.3-59-g8ed1b From 19def9943abae2455ad6fa508f176fb5e1c4c1fd Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Wed, 14 Dec 2016 13:34:20 -0800 Subject: Move hwui private headers to frameworks/base/libs/hwui/private hwui already exports most of its headers, move its private headers into its source directory. Bug: 33630870 Test: m -j native Change-Id: I4968d5aaaa68d9e92c826841d20f29cef349c9d8 --- include/private/README | 4 -- include/private/hwui/DrawGlInfo.h | 89 ------------------------------------- libs/hwui/private/README | 4 ++ libs/hwui/private/hwui/DrawGlInfo.h | 89 +++++++++++++++++++++++++++++++++++++ 4 files changed, 93 insertions(+), 93 deletions(-) delete mode 100644 include/private/README delete mode 100644 include/private/hwui/DrawGlInfo.h create mode 100644 libs/hwui/private/README create mode 100644 libs/hwui/private/hwui/DrawGlInfo.h (limited to 'libs') diff --git a/include/private/README b/include/private/README deleted file mode 100644 index ee4149270ae2..000000000000 --- a/include/private/README +++ /dev/null @@ -1,4 +0,0 @@ -This folder contains private include files. - -These include files are part of the private implementation details of -various framework components. Use at your peril. diff --git a/include/private/hwui/DrawGlInfo.h b/include/private/hwui/DrawGlInfo.h deleted file mode 100644 index f57851322716..000000000000 --- a/include/private/hwui/DrawGlInfo.h +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright (C) 2011 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef ANDROID_HWUI_DRAW_GL_INFO_H -#define ANDROID_HWUI_DRAW_GL_INFO_H - -namespace android { -namespace uirenderer { - -/** - * Structure used by OpenGLRenderer::callDrawGLFunction() to pass and - * receive data from OpenGL functors. - */ -struct DrawGlInfo { - // Input: current clip rect - int clipLeft; - int clipTop; - int clipRight; - int clipBottom; - - // Input: current width/height of destination surface - int width; - int height; - - // Input: is the render target an FBO - bool isLayer; - - // Input: current transform matrix, in OpenGL format - float transform[16]; - - // Output: dirty region to redraw - float dirtyLeft; - float dirtyTop; - float dirtyRight; - float dirtyBottom; - - /** - * Values used as the "what" parameter of the functor. - */ - enum Mode { - // Indicates that the functor is called to perform a draw - kModeDraw, - // Indicates the the functor is called only to perform - // processing and that no draw should be attempted - kModeProcess, - // Same as kModeProcess, however there is no GL context because it was - // lost or destroyed - kModeProcessNoContext, - // Invoked every time the UI thread pushes over a frame to the render thread - // *and the owning view has a dirty display list*. This is a signal to sync - // any data that needs to be shared between the UI thread and the render thread. - // During this time the UI thread is blocked. - kModeSync - }; - - /** - * Values used by OpenGL functors to tell the framework - * what to do next. - */ - enum Status { - // The functor is done - kStatusDone = 0x0, - // DisplayList actually issued GL drawing commands. - // This is used to signal the HardwareRenderer that the - // buffers should be flipped - otherwise, there were no - // changes to the buffer, so no need to flip. Some hardware - // has issues with stale buffer contents when no GL - // commands are issued. - kStatusDrew = 0x4 - }; -}; // struct DrawGlInfo - -}; // namespace uirenderer -}; // namespace android - -#endif // ANDROID_HWUI_DRAW_GL_INFO_H diff --git a/libs/hwui/private/README b/libs/hwui/private/README new file mode 100644 index 000000000000..ee4149270ae2 --- /dev/null +++ b/libs/hwui/private/README @@ -0,0 +1,4 @@ +This folder contains private include files. + +These include files are part of the private implementation details of +various framework components. Use at your peril. diff --git a/libs/hwui/private/hwui/DrawGlInfo.h b/libs/hwui/private/hwui/DrawGlInfo.h new file mode 100644 index 000000000000..f57851322716 --- /dev/null +++ b/libs/hwui/private/hwui/DrawGlInfo.h @@ -0,0 +1,89 @@ +/* + * Copyright (C) 2011 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ANDROID_HWUI_DRAW_GL_INFO_H +#define ANDROID_HWUI_DRAW_GL_INFO_H + +namespace android { +namespace uirenderer { + +/** + * Structure used by OpenGLRenderer::callDrawGLFunction() to pass and + * receive data from OpenGL functors. + */ +struct DrawGlInfo { + // Input: current clip rect + int clipLeft; + int clipTop; + int clipRight; + int clipBottom; + + // Input: current width/height of destination surface + int width; + int height; + + // Input: is the render target an FBO + bool isLayer; + + // Input: current transform matrix, in OpenGL format + float transform[16]; + + // Output: dirty region to redraw + float dirtyLeft; + float dirtyTop; + float dirtyRight; + float dirtyBottom; + + /** + * Values used as the "what" parameter of the functor. + */ + enum Mode { + // Indicates that the functor is called to perform a draw + kModeDraw, + // Indicates the the functor is called only to perform + // processing and that no draw should be attempted + kModeProcess, + // Same as kModeProcess, however there is no GL context because it was + // lost or destroyed + kModeProcessNoContext, + // Invoked every time the UI thread pushes over a frame to the render thread + // *and the owning view has a dirty display list*. This is a signal to sync + // any data that needs to be shared between the UI thread and the render thread. + // During this time the UI thread is blocked. + kModeSync + }; + + /** + * Values used by OpenGL functors to tell the framework + * what to do next. + */ + enum Status { + // The functor is done + kStatusDone = 0x0, + // DisplayList actually issued GL drawing commands. + // This is used to signal the HardwareRenderer that the + // buffers should be flipped - otherwise, there were no + // changes to the buffer, so no need to flip. Some hardware + // has issues with stale buffer contents when no GL + // commands are issued. + kStatusDrew = 0x4 + }; +}; // struct DrawGlInfo + +}; // namespace uirenderer +}; // namespace android + +#endif // ANDROID_HWUI_DRAW_GL_INFO_H -- cgit v1.2.3-59-g8ed1b