Expose SharedLibraryInfo#getAllCodePaths as @TestApi.
The method is called by CTS helper app to list all java shared libraries present on the device. All classes present in the reported jar/apk files are then collected by a CTS/GTS EDI collector. Bug: 187823488 Test: m Change-Id: I750065112d70bc3ab45c8b6c6cc8aa4d429488a8
This commit is contained in:
@@ -537,6 +537,10 @@ package android.content.pm {
|
||||
field @NonNull public static final android.os.Parcelable.Creator<android.content.pm.ProviderInfoList> CREATOR;
|
||||
}
|
||||
|
||||
public final class SharedLibraryInfo implements android.os.Parcelable {
|
||||
method @NonNull public java.util.List<java.lang.String> getAllCodePaths();
|
||||
}
|
||||
|
||||
public final class ShortcutInfo implements android.os.Parcelable {
|
||||
method public boolean isVisibleToPublisher();
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ import android.annotation.IntDef;
|
||||
import android.annotation.IntRange;
|
||||
import android.annotation.NonNull;
|
||||
import android.annotation.Nullable;
|
||||
import android.annotation.TestApi;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
@@ -29,6 +30,7 @@ import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* This class provides information for a shared library. There are
|
||||
@@ -177,7 +179,8 @@ public final class SharedLibraryInfo implements Parcelable {
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
public List<String> getAllCodePaths() {
|
||||
@TestApi
|
||||
public @NonNull List<String> getAllCodePaths() {
|
||||
if (getPath() != null) {
|
||||
// Builtin library.
|
||||
ArrayList<String> list = new ArrayList<>();
|
||||
@@ -185,7 +188,7 @@ public final class SharedLibraryInfo implements Parcelable {
|
||||
return list;
|
||||
} else {
|
||||
// Static or dynamic library.
|
||||
return mCodePaths;
|
||||
return Objects.requireNonNull(mCodePaths);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user