Add Shell permission for CTS test.

Add Shell permission for new CTS tests to test the multi-display
functionality in WallpaperService/WallpaperManagerService.

Bug: 123707989
Test: atest WallpaperManagerMultiDisplayTests
Test: atest ActivityManagerMultiDisplayTests

Change-Id: Id97db050a0b9d1940c2dfaa793fbe526df578105
This commit is contained in:
wilsonshih
2019-02-20 23:08:45 +08:00
parent 2b11e525e3
commit 5db7b39dd8
6 changed files with 16 additions and 0 deletions

View File

@@ -352,6 +352,10 @@ package android.app {
method public boolean isUiModeLocked();
}
public class WallpaperManager {
method @RequiresPermission("android.permission.SET_WALLPAPER_COMPONENT") public boolean setWallpaperComponent(android.content.ComponentName);
}
public class WindowConfiguration implements java.lang.Comparable<android.app.WindowConfiguration> android.os.Parcelable {
ctor public WindowConfiguration();
method public int compareTo(android.app.WindowConfiguration);
@@ -600,6 +604,7 @@ package android.content {
public abstract class Context {
method public android.content.Context createPackageContextAsUser(String, int, android.os.UserHandle) throws android.content.pm.PackageManager.NameNotFoundException;
method public abstract android.view.Display getDisplay();
method public abstract int getDisplayId();
method public android.os.UserHandle getUser();
method public int getUserId();
method public void setAutofillOptions(@Nullable android.content.AutofillOptions);
@@ -610,6 +615,7 @@ package android.content {
public class ContextWrapper extends android.content.Context {
method public android.view.Display getDisplay();
method public int getDisplayId();
}
public class Intent implements java.lang.Cloneable android.os.Parcelable {

View File

@@ -25,6 +25,7 @@ import android.annotation.SdkConstant;
import android.annotation.SdkConstant.SdkConstantType;
import android.annotation.SystemApi;
import android.annotation.SystemService;
import android.annotation.TestApi;
import android.annotation.UnsupportedAppUsage;
import android.content.ComponentName;
import android.content.ContentResolver;
@@ -1666,6 +1667,7 @@ public class WallpaperManager {
*
* @hide
*/
@TestApi
@SystemApi
@RequiresPermission(android.Manifest.permission.SET_WALLPAPER_COMPONENT)
public boolean setWallpaperComponent(ComponentName name) {

View File

@@ -5322,6 +5322,7 @@ public abstract class Context {
* @return display ID associated with this {@link Context}.
* @hide
*/
@TestApi
public abstract int getDisplayId();
/**

View File

@@ -309,6 +309,8 @@ applications that come with the platform
<permission name="android.permission.STATUS_BAR_SERVICE"/>
<permission name="android.permission.REQUEST_INCIDENT_REPORT_APPROVAL"/>
<permission name="android.permission.CONTROL_KEYGUARD_SECURE_NOTIFICATIONS"/>
<permission name="android.permission.SET_WALLPAPER" />
<permission name="android.permission.SET_WALLPAPER_COMPONENT" />
</privapp-permissions>
<privapp-permissions package="com.android.statementservice">

View File

@@ -182,6 +182,10 @@
<!-- Permission needed to run keyguard manager tests in CTS -->
<uses-permission android:name="android.permission.CONTROL_KEYGUARD_SECURE_NOTIFICATIONS" />
<!-- Permission needed to test wallpaper component -->
<uses-permission android:name="android.permission.SET_WALLPAPER" />
<uses-permission android:name="android.permission.SET_WALLPAPER_COMPONENT" />
<application android:label="@string/app_label"
android:defaultToDeviceProtectedStorage="true"
android:directBootAware="true">

View File

@@ -3,6 +3,7 @@ package android.test.mock {
public class MockContext extends android.content.Context {
method public android.view.Display getDisplay();
method public int getDisplayId();
}
@Deprecated public class MockPackageManager extends android.content.pm.PackageManager {