Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
platform_frameworks_base
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
Dhina17
platform_frameworks_base
Commits
bdc46599
Commit
bdc46599
authored
5 years ago
by
Yifan Hong
Committed by
Gerrit Code Review
5 years ago
Browse files
Options
Downloads
Plain Diff
Merge "Delete VINTF compatibility checks during OTA."
parents
63bf3e4d
12ebf362
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
core/java/android/os/VintfObject.java
+27
-3
27 additions, 3 deletions
core/java/android/os/VintfObject.java
core/jni/android_os_VintfObject.cpp
+1
-21
1 addition, 21 deletions
core/jni/android_os_VintfObject.cpp
with
28 additions
and
24 deletions
core/java/android/os/VintfObject.java
+
27
−
3
View file @
bdc46599
...
...
@@ -17,6 +17,7 @@
package
android.os
;
import
android.annotation.TestApi
;
import
android.util.Slog
;
import
java.util.Map
;
...
...
@@ -28,6 +29,8 @@ import java.util.Map;
@TestApi
public
class
VintfObject
{
private
static
final
String
LOG_TAG
=
"VintfObject"
;
/**
* Slurps all device information (both manifests and both matrices)
* and report them.
...
...
@@ -46,12 +49,33 @@ public class VintfObject {
* @param packageInfo a list of serialized form of HalManifest's /
* CompatibilityMatri'ces (XML).
* @return = 0 if success (compatible)
* > 0 if incompatible
* < 0 if any error (mount partition fails, illformed XML, etc.)
* > 0 if incompatible
* < 0 if any error (mount partition fails, illformed XML, etc.)
*
* @deprecated Checking compatibility against an OTA package is no longer
* supported because the format of VINTF metadata in the OTA package may not
* be recognized by the current system.
*
* <p>
* <ul>
* <li>This function always returns 0 for non-empty {@code packageInfo}.
* </li>
* <li>This function returns the result of {@link #verifyWithoutAvb} for
* null or empty {@code packageInfo}.</li>
* </ul>
*
* @hide
*/
public
static
native
int
verify
(
String
[]
packageInfo
);
@Deprecated
public
static
int
verify
(
String
[]
packageInfo
)
{
if
(
packageInfo
!=
null
&&
packageInfo
.
length
>
0
)
{
Slog
.
w
(
LOG_TAG
,
"VintfObject.verify() with non-empty packageInfo is deprecated. "
+
"Skipping compatibility checks for update package."
);
return
0
;
}
Slog
.
w
(
LOG_TAG
,
"VintfObject.verify() is deprecated. Call verifyWithoutAvb() instead."
);
return
verifyWithoutAvb
();
}
/**
* Verify Vintf compatibility on the device without checking AVB
...
...
This diff is collapsed.
Click to expand it.
core/jni/android_os_VintfObject.cpp
+
1
−
21
View file @
bdc46599
...
...
@@ -96,28 +96,9 @@ static jobjectArray android_os_VintfObject_report(JNIEnv* env, jclass)
return
toJavaStringArray
(
env
,
cStrings
);
}
static
jint
android_os_VintfObject_verify
(
JNIEnv
*
env
,
jclass
,
jobjectArray
packageInfo
)
{
std
::
vector
<
std
::
string
>
cPackageInfo
;
if
(
packageInfo
)
{
size_t
count
=
env
->
GetArrayLength
(
packageInfo
);
cPackageInfo
.
resize
(
count
);
for
(
size_t
i
=
0
;
i
<
count
;
++
i
)
{
jstring
element
=
(
jstring
)
env
->
GetObjectArrayElement
(
packageInfo
,
i
);
const
char
*
cString
=
env
->
GetStringUTFChars
(
element
,
NULL
/* isCopy */
);
cPackageInfo
[
i
]
=
cString
;
env
->
ReleaseStringUTFChars
(
element
,
cString
);
}
}
std
::
string
error
;
int32_t
status
=
VintfObject
::
CheckCompatibility
(
cPackageInfo
,
&
error
);
if
(
status
)
LOG
(
WARNING
)
<<
"VintfObject.verify() returns "
<<
status
<<
": "
<<
error
;
return
status
;
}
static
jint
android_os_VintfObject_verifyWithoutAvb
(
JNIEnv
*
env
,
jclass
)
{
std
::
string
error
;
int32_t
status
=
VintfObject
::
C
heckCompatibility
(
{},
&
error
,
int32_t
status
=
VintfObject
::
GetInstance
()
->
c
heckCompatibility
(
&
error
,
::
android
::
vintf
::
CheckFlags
::
DISABLE_AVB_CHECK
);
if
(
status
)
LOG
(
WARNING
)
<<
"VintfObject.verifyWithoutAvb() returns "
<<
status
<<
": "
<<
error
;
...
...
@@ -170,7 +151,6 @@ static jobject android_os_VintfObject_getTargetFrameworkCompatibilityMatrixVersi
static
const
JNINativeMethod
gVintfObjectMethods
[]
=
{
{
"report"
,
"()[Ljava/lang/String;"
,
(
void
*
)
android_os_VintfObject_report
},
{
"verify"
,
"([Ljava/lang/String;)I"
,
(
void
*
)
android_os_VintfObject_verify
},
{
"verifyWithoutAvb"
,
"()I"
,
(
void
*
)
android_os_VintfObject_verifyWithoutAvb
},
{
"getHalNamesAndVersions"
,
"()[Ljava/lang/String;"
,
(
void
*
)
android_os_VintfObject_getHalNamesAndVersions
},
{
"getSepolicyVersion"
,
"()Ljava/lang/String;"
,
(
void
*
)
android_os_VintfObject_getSepolicyVersion
},
...
...
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