Change WeaverConfig data types to int

also prefix return error codes

Bug: 179432365
Change-Id: I435fb261b1162e9b2f56c434f2defccc1505c842
This commit is contained in:
ChengYou Ho
2021-03-23 18:00:06 +08:00
committed by Chengyou Ho
parent cab97a7d3e
commit c9945ab2b4
6 changed files with 17 additions and 14 deletions

View File

@@ -12,7 +12,8 @@
* 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.
*////////////////////////////////////////////////////////////////////////////////
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
@@ -37,6 +38,6 @@ interface IWeaver {
android.hardware.weaver.WeaverReadResponse read(in int slotId, in byte[] key);
void write(in int slotId, in byte[] key, in byte[] value);
const int STATUS_FAILED = 1;
const int INCORRECT_KEY = 2;
const int THROTTLE = 3;
const int STATUS_INCORRECT_KEY = 2;
const int STATUS_THROTTLE = 3;
}

View File

@@ -12,7 +12,8 @@
* 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.
*////////////////////////////////////////////////////////////////////////////////
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
@@ -33,7 +34,7 @@
package android.hardware.weaver;
@VintfStability
parcelable WeaverConfig {
long slots;
long keySize;
long valueSize;
int slots;
int keySize;
int valueSize;
}

View File

@@ -12,7 +12,8 @@
* 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.
*////////////////////////////////////////////////////////////////////////////////
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////

View File

@@ -46,8 +46,8 @@ interface IWeaver {
* Read binder calls may return a ServiceSpecificException with the following error codes.
*/
const int STATUS_FAILED = 1;
const int INCORRECT_KEY = 2;
const int THROTTLE = 3;
const int STATUS_INCORRECT_KEY = 2;
const int STATUS_THROTTLE = 3;
/**
* Attempts to retrieve the value stored in the identified slot.

View File

@@ -21,14 +21,14 @@ parcelable WeaverConfig {
/**
* The number of slots available.
*/
long slots;
int slots;
/**
* The number of bytes used for a key.
*/
long keySize;
int keySize;
/**
* The number of bytes used for a value.
*/
long valueSize;
int valueSize;
}

View File

@@ -156,7 +156,7 @@ TEST_P(WeaverAidlTest, WriteFollowedByReadWithWrongKeyDoesNotGiveTheValue) {
ASSERT_FALSE(readRet.isOk());
ASSERT_EQ(EX_SERVICE_SPECIFIC, readRet.getExceptionCode());
ASSERT_EQ(IWeaver::INCORRECT_KEY, readRet.getServiceSpecificError());
ASSERT_EQ(IWeaver::STATUS_INCORRECT_KEY, readRet.getServiceSpecificError());
EXPECT_TRUE(readValue.empty());
}