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
8f150a68
Commit
8f150a68
authored
4 years ago
by
Treehugger Robot
Committed by
Gerrit Code Review
4 years ago
Browse files
Options
Downloads
Plain Diff
Merge "CEC : Add additional validator for message record status"
parents
97165aa0
73951a14
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
services/core/java/com/android/server/hdmi/HdmiCecMessageValidator.java
+22
-2
22 additions, 2 deletions
...java/com/android/server/hdmi/HdmiCecMessageValidator.java
with
22 additions
and
2 deletions
services/core/java/com/android/server/hdmi/HdmiCecMessageValidator.java
+
22
−
2
View file @
8f150a68
...
...
@@ -117,14 +117,15 @@ public class HdmiCecMessageValidator {
// TODO: Validate more than length for the following messages.
// Messages for the One Touch Record.
FixedLengthValidator
oneByteValidator
=
new
FixedLengthValidator
(
1
);
addValidationInfo
(
Constants
.
MESSAGE_RECORD_ON
,
new
VariableLengthValidator
(
1
,
8
),
DEST_DIRECT
);
addValidationInfo
(
Constants
.
MESSAGE_RECORD_STATUS
,
oneByteValidator
,
DEST_DIRECT
);
addValidationInfo
(
Constants
.
MESSAGE_RECORD_STATUS
,
new
RecordStatusInfoValidator
(),
DEST_DIRECT
);
// TODO: Handle messages for the Timer Programming.
// Messages for the System Information.
FixedLengthValidator
oneByteValidator
=
new
FixedLengthValidator
(
1
);
addValidationInfo
(
Constants
.
MESSAGE_CEC_VERSION
,
oneByteValidator
,
DEST_DIRECT
);
addValidationInfo
(
Constants
.
MESSAGE_SET_MENU_LANGUAGE
,
new
FixedLengthValidator
(
3
),
DEST_BROADCAST
);
...
...
@@ -339,4 +340,23 @@ public class HdmiCecMessageValidator {
isValidPhysicalAddress
(
params
,
0
)
&&
isValidPhysicalAddress
(
params
,
2
));
}
}
/**
* Check if the given record status message parameter is valid.
* A valid parameter should lie within the range description of Record Status Info defined in
* CEC 1.4 Specification : Operand Descriptions (Section 17)
*/
private
class
RecordStatusInfoValidator
implements
ParameterValidator
{
@Override
public
int
isValid
(
byte
[]
params
)
{
if
(
params
.
length
<
1
)
{
return
ERROR_PARAMETER_SHORT
;
}
return
toErrorCode
(
isWithinRange
(
params
[
0
],
0x01
,
0x07
)
||
isWithinRange
(
params
[
0
],
0x09
,
0x0E
)
||
isWithinRange
(
params
[
0
],
0x10
,
0x17
)
||
isWithinRange
(
params
[
0
],
0x1A
,
0x1B
)
||
params
[
0
]
==
0x1F
);
}
}
}
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