c2841ec7fe
For testing we often need to run shell commands. This can be done today via running a shell command from an instrumentation test started from the shell. However, this requires adding shell commands which are not in the API contract, involve boilerplate code, require string parsing, etc. This change allows an instrumentation started from the shell to adopt the shell UID permission state. As a result one can call APIs protected by permissions normal apps cannot get by are granted to the shell. This enables adding dedicated test APIs protected by signatures permissions granted to the shell. Test: cts-tradefed run cts-dev -m CtsUiAutomationTestCases -t android.app.uiautomation.cts.UiAutomationTest#testAdoptShellPermissions bug:80415658 Merged-In: I4bfd4b475225125512abf80ea98cd8fcacb6a1be Change-Id: I4bfd4b475225125512abf80ea98cd8fcacb6a1be
20 lines
1005 B
Plaintext
20 lines
1005 B
Plaintext
// Signature format: 2.0
|
|
package android.test.mock {
|
|
|
|
@Deprecated public class MockPackageManager extends android.content.pm.PackageManager {
|
|
method public String getDefaultBrowserPackageNameAsUser(int);
|
|
method public int getInstallReason(String, android.os.UserHandle);
|
|
method public java.util.List<android.content.pm.ApplicationInfo> getInstalledApplicationsAsUser(int, int);
|
|
method public java.util.List<android.content.pm.PackageInfo> getInstalledPackagesAsUser(int, int);
|
|
method public String[] getNamesForUids(int[]);
|
|
method public String getPermissionControllerPackageName();
|
|
method @NonNull public String getServicesSystemSharedLibraryPackageName();
|
|
method @NonNull public String getSharedSystemSharedLibraryPackageName();
|
|
method public void grantRuntimePermission(String, String, android.os.UserHandle);
|
|
method public boolean isPermissionReviewModeEnabled();
|
|
method public void revokeRuntimePermission(String, String, android.os.UserHandle);
|
|
}
|
|
|
|
}
|
|
|