diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-12-02 00:30:14 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-12-02 00:30:14 +0000 |
commit | 86bd4daa3469dc7b7bfc287b61ea73e7043b3738 (patch) | |
tree | 5a3f309960435e35391a9282bc18df3fbf6e10bc | |
parent | 766820f6276906ca9a532a528952d649f00a9dcf (diff) | |
parent | 4762c22aba406edd48e5c3bb91facb74a62a9b6e (diff) | |
download | core-android13-qpr2-s9-release.tar.gz |
Snap for 9358956 from 4762c22aba406edd48e5c3bb91facb74a62a9b6e to tm-qpr2-releaseandroid-13.0.0_r49android-13.0.0_r45android-13.0.0_r44android-13.0.0_r43android-13.0.0_r42android-13.0.0_r41android-13.0.0_r40android-13.0.0_r39android-13.0.0_r38android-13.0.0_r37android-13.0.0_r36android-13.0.0_r35android-13.0.0_r34android-13.0.0_r33android-13.0.0_r32android13-qpr2-s9-releaseandroid13-qpr2-s8-releaseandroid13-qpr2-s7-releaseandroid13-qpr2-s6-releaseandroid13-qpr2-s5-releaseandroid13-qpr2-s3-releaseandroid13-qpr2-s2-releaseandroid13-qpr2-s12-releaseandroid13-qpr2-s11-releaseandroid13-qpr2-s10-releaseandroid13-qpr2-s1-releaseandroid13-qpr2-releaseandroid13-qpr2-b-s1-release
Change-Id: I0a90ea9a2968aa9b6ab12f118ce6943259ad2693
-rw-r--r-- | trusty/storage/proxy/Android.bp | 2 | ||||
-rw-r--r-- | trusty/storage/proxy/storage.c | 27 |
2 files changed, 28 insertions, 1 deletions
diff --git a/trusty/storage/proxy/Android.bp b/trusty/storage/proxy/Android.bp index 94f26d8a6..e952ee0bc 100644 --- a/trusty/storage/proxy/Android.bp +++ b/trusty/storage/proxy/Android.bp @@ -32,11 +32,11 @@ cc_binary { shared_libs: [ "libbase", + "libcutils", "liblog", "libhardware_legacy", ], header_libs: [ - "libcutils_headers", "libgsi_headers", ], diff --git a/trusty/storage/proxy/storage.c b/trusty/storage/proxy/storage.c index c531cfd13..033dc2117 100644 --- a/trusty/storage/proxy/storage.c +++ b/trusty/storage/proxy/storage.c @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +#include <cutils/properties.h> #include <errno.h> #include <fcntl.h> #include <inttypes.h> @@ -43,6 +44,22 @@ enum sync_state { static const char *ssdir_name; +/* + * Property set to 1 after we have opened a file under ssdir_name. The backing + * files for both TD and TDP are currently located under /data/vendor/ss and can + * only be opened once userdata is mounted. This storageproxyd service is + * restarted when userdata is available, which causes the Trusty storage service + * to reconnect and attempt to open the backing files for TD and TDP. Once we + * set this property, other users can expect that the Trusty storage service + * ports will be available (although they may block if still being initialized), + * and connections will not be reset after this point (assuming the + * storageproxyd service stays running). + */ +#define FS_READY_PROPERTY "ro.vendor.trusty.storage.fs_ready" + +/* has FS_READY_PROPERTY been set? */ +static bool fs_ready_initialized = false; + static enum sync_state fs_state; static enum sync_state fd_state[FD_TBL_SIZE]; @@ -336,6 +353,16 @@ int storage_file_open(struct storage_msg* msg, const void* r, size_t req_len) { ALOGV("%s: \"%s\": fd = %u: handle = %d\n", __func__, path, rc, resp.handle); + /* a backing file has been opened, notify any waiting init steps */ + if (!fs_ready_initialized) { + rc = property_set(FS_READY_PROPERTY, "1"); + if (rc == 0) { + fs_ready_initialized = true; + } else { + ALOGE("Could not set property %s, rc: %d\n", FS_READY_PROPERTY, rc); + } + } + return ipc_respond(msg, &resp, sizeof(resp)); err_response: |