Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
platform_frameworks_base-old
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Farzin Kazemzadeh
platform_frameworks_base-old
Commits
fe987179
Commit
fe987179
authored
2 years ago
by
Matt Buckley
Committed by
Android (Google) Code Review
2 years ago
Browse files
Options
Downloads
Plain Diff
Merge "Use "SessionHint" enum in ndk API"
parents
d57687df
9c64b1bc
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
native/android/performance_hint.cpp
+3
-3
3 additions, 3 deletions
native/android/performance_hint.cpp
native/android/tests/performance_hint/PerformanceHintNativeTest.cpp
+2
-2
2 additions, 2 deletions
...roid/tests/performance_hint/PerformanceHintNativeTest.cpp
with
5 additions
and
5 deletions
native/android/performance_hint.cpp
+
3
−
3
View file @
fe987179
...
...
@@ -69,7 +69,7 @@ public:
int
updateTargetWorkDuration
(
int64_t
targetDurationNanos
);
int
reportActualWorkDuration
(
int64_t
actualDurationNanos
);
int
sendHint
(
int32_
t
hint
);
int
sendHint
(
SessionHin
t
hint
);
int
setThreads
(
const
int32_t
*
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
;
}
int
APerformanceHintSession
::
sendHint
(
int32_
t
hint
)
{
int
APerformanceHintSession
::
sendHint
(
SessionHin
t
hint
)
{
if
(
hint
<
0
||
hint
>=
static_cast
<
int32_t
>
(
mLastHintSentTimestamp
.
size
()))
{
ALOGE
(
"%s: invalid session hint %d"
,
__FUNCTION__
,
hint
);
return
EINVAL
;
...
...
@@ -335,7 +335,7 @@ void APerformanceHint_closeSession(APerformanceHintSession* session) {
delete
session
;
}
int
APerformanceHint_sendHint
(
void
*
session
,
int32_
t
hint
)
{
int
APerformanceHint_sendHint
(
void
*
session
,
SessionHin
t
hint
)
{
return
reinterpret_cast
<
APerformanceHintSession
*>
(
session
)
->
sendHint
(
hint
);
}
...
...
This diff is collapsed.
Click to expand it.
native/android/tests/performance_hint/PerformanceHintNativeTest.cpp
+
2
−
2
View file @
fe987179
...
...
@@ -127,7 +127,7 @@ TEST_F(PerformanceHintTest, TestSession) {
result
=
APerformanceHint_reportActualWorkDuration
(
session
,
-
1L
);
EXPECT_EQ
(
EINVAL
,
result
);
int
hintId
=
2
;
SessionH
int
hintId
=
SessionHint
::
CPU_LOAD_RESET
;
EXPECT_CALL
(
*
iSession
,
sendHint
(
Eq
(
hintId
))).
Times
(
Exactly
(
1
));
result
=
APerformanceHint_sendHint
(
session
,
hintId
);
EXPECT_EQ
(
0
,
result
);
...
...
@@ -140,7 +140,7 @@ TEST_F(PerformanceHintTest, TestSession) {
result
=
APerformanceHint_sendHint
(
session
,
hintId
);
EXPECT_EQ
(
0
,
result
);
result
=
APerformanceHint_sendHint
(
session
,
-
1
);
result
=
APerformanceHint_sendHint
(
session
,
static_cast
<
SessionHint
>
(
-
1
)
)
;
EXPECT_EQ
(
EINVAL
,
result
);
EXPECT_CALL
(
*
iSession
,
close
()).
Times
(
Exactly
(
1
));
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment