diff options
author | Alex Buynytskyy <alexbuy@google.com> | 2021-03-12 20:26:39 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2021-03-12 20:26:39 +0000 |
commit | e13b0b514ab12c8f6868024bc8c5f8f1e70320d0 (patch) | |
tree | 3497a5e43a2c297959f9f08c107cc24a781c825e | |
parent | 96ed638e4ed39c827a01ac0eccbae9a30114cdd5 (diff) | |
parent | 92aa5d428790de5508165ffae80d2a89874cb55e (diff) | |
download | incremental_delivery-e13b0b514ab12c8f6868024bc8c5f8f1e70320d0.tar.gz |
Merge "Decouple DL statuses from internal Incremental statuses." into sc-dev am: 92aa5d4287
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/incremental_delivery/+/13837525
MUST ONLY BE SUBMITTED BY AUTOMERGER
Change-Id: I4f76a714c360a0c8c2fc1f7c53c677899fb1c0f2
-rw-r--r-- | libdataloader/DataLoaderConnector.cpp | 20 | ||||
-rw-r--r-- | libdataloader/include/dataloader_ndk.h | 4 |
2 files changed, 13 insertions, 11 deletions
diff --git a/libdataloader/DataLoaderConnector.cpp b/libdataloader/DataLoaderConnector.cpp index 5318630..aa6ad22 100644 --- a/libdataloader/DataLoaderConnector.cpp +++ b/libdataloader/DataLoaderConnector.cpp @@ -116,8 +116,6 @@ struct JniIds { constants.DATA_LOADER_UNRECOVERABLE = GetStaticIntFieldValueOrDie(env, listener, "DATA_LOADER_UNRECOVERABLE"); - CHECK(constants.DATA_LOADER_UNRECOVERABLE == DATA_LOADER_UNRECOVERABLE); - auto packageInstaller = (jclass)FindClassOrDie(env, "android/content/pm/PackageInstaller"); constants.DATA_LOADER_TYPE_NONE = @@ -516,12 +514,20 @@ public: } bool reportStatus(DataLoaderStatus status) { - if (status < DATA_LOADER_FIRST_STATUS || DATA_LOADER_LAST_STATUS < status) { - ALOGE("Unable to report invalid status. status=%d", status); - return false; - } JNIEnv* env = GetOrAttachJNIEnvironment(mJvm); - return reportStatusViaCallback(env, mListener, mStorageId, status); + const auto& jni = jniIds(env); + + jint osStatus; + switch (status) { + case DATA_LOADER_UNRECOVERABLE: + osStatus = jni.constants.DATA_LOADER_UNRECOVERABLE; + break; + default: { + ALOGE("Unable to report invalid status. status=%d", status); + return false; + } + } + return reportStatusViaCallback(env, mListener, mStorageId, osStatus); } bool checkAndClearJavaException(std::string_view method) const { diff --git a/libdataloader/include/dataloader_ndk.h b/libdataloader/include/dataloader_ndk.h index fd95a29..ea3a9b0 100644 --- a/libdataloader/include/dataloader_ndk.h +++ b/libdataloader/include/dataloader_ndk.h @@ -24,12 +24,8 @@ __BEGIN_DECLS #define DATALOADER_LIBRARY_NAME "libdataloader.so" -// Keep in sync with IDataLoaderStatusListener.aidl typedef enum { DATA_LOADER_UNRECOVERABLE = 8, - - DATA_LOADER_FIRST_STATUS = DATA_LOADER_UNRECOVERABLE, - DATA_LOADER_LAST_STATUS = DATA_LOADER_UNRECOVERABLE, } DataLoaderStatus; typedef enum { |