Merge "Revert^2 "Use "SessionHint" enum in ndk API"" into udc-dev
This commit is contained in:
@@ -69,7 +69,7 @@ public:
|
|||||||
|
|
||||||
int updateTargetWorkDuration(int64_t targetDurationNanos);
|
int updateTargetWorkDuration(int64_t targetDurationNanos);
|
||||||
int reportActualWorkDuration(int64_t actualDurationNanos);
|
int reportActualWorkDuration(int64_t actualDurationNanos);
|
||||||
int sendHint(int32_t hint);
|
int sendHint(SessionHint hint);
|
||||||
int setThreads(const int32_t* threadIds, size_t size);
|
int setThreads(const int32_t* threadIds, size_t size);
|
||||||
int getThreadIds(int32_t* const threadIds, size_t* size);
|
int getThreadIds(int32_t* const threadIds, size_t* size);
|
||||||
|
|
||||||
@@ -243,7 +243,7 @@ int APerformanceHintSession::reportActualWorkDuration(int64_t actualDurationNano
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int APerformanceHintSession::sendHint(int32_t hint) {
|
int APerformanceHintSession::sendHint(SessionHint hint) {
|
||||||
if (hint < 0 || hint >= static_cast<int32_t>(mLastHintSentTimestamp.size())) {
|
if (hint < 0 || hint >= static_cast<int32_t>(mLastHintSentTimestamp.size())) {
|
||||||
ALOGE("%s: invalid session hint %d", __FUNCTION__, hint);
|
ALOGE("%s: invalid session hint %d", __FUNCTION__, hint);
|
||||||
return EINVAL;
|
return EINVAL;
|
||||||
@@ -335,7 +335,7 @@ void APerformanceHint_closeSession(APerformanceHintSession* session) {
|
|||||||
delete session;
|
delete session;
|
||||||
}
|
}
|
||||||
|
|
||||||
int APerformanceHint_sendHint(void* session, int32_t hint) {
|
int APerformanceHint_sendHint(void* session, SessionHint hint) {
|
||||||
return reinterpret_cast<APerformanceHintSession*>(session)->sendHint(hint);
|
return reinterpret_cast<APerformanceHintSession*>(session)->sendHint(hint);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -127,7 +127,7 @@ TEST_F(PerformanceHintTest, TestSession) {
|
|||||||
result = APerformanceHint_reportActualWorkDuration(session, -1L);
|
result = APerformanceHint_reportActualWorkDuration(session, -1L);
|
||||||
EXPECT_EQ(EINVAL, result);
|
EXPECT_EQ(EINVAL, result);
|
||||||
|
|
||||||
int hintId = 2;
|
SessionHint hintId = SessionHint::CPU_LOAD_RESET;
|
||||||
EXPECT_CALL(*iSession, sendHint(Eq(hintId))).Times(Exactly(1));
|
EXPECT_CALL(*iSession, sendHint(Eq(hintId))).Times(Exactly(1));
|
||||||
result = APerformanceHint_sendHint(session, hintId);
|
result = APerformanceHint_sendHint(session, hintId);
|
||||||
EXPECT_EQ(0, result);
|
EXPECT_EQ(0, result);
|
||||||
@@ -140,7 +140,7 @@ TEST_F(PerformanceHintTest, TestSession) {
|
|||||||
result = APerformanceHint_sendHint(session, hintId);
|
result = APerformanceHint_sendHint(session, hintId);
|
||||||
EXPECT_EQ(0, result);
|
EXPECT_EQ(0, result);
|
||||||
|
|
||||||
result = APerformanceHint_sendHint(session, -1);
|
result = APerformanceHint_sendHint(session, static_cast<SessionHint>(-1));
|
||||||
EXPECT_EQ(EINVAL, result);
|
EXPECT_EQ(EINVAL, result);
|
||||||
|
|
||||||
EXPECT_CALL(*iSession, close()).Times(Exactly(1));
|
EXPECT_CALL(*iSession, close()).Times(Exactly(1));
|
||||||
|
|||||||
Reference in New Issue
Block a user