Merge "Exposing setRecentsVisibility method and associated callbacks to the Recents components" into pi-dev

am: 9d5eb3453f

Change-Id: Ie8cf9c4a51fdc861371d6bb43bdc4b98a4c2fa56
This commit is contained in:
Sunny Goyal
2018-04-23 12:23:06 -07:00
committed by android-build-merger
2 changed files with 10 additions and 6 deletions

View File

@@ -123,4 +123,12 @@ public class WindowManagerWrapper {
Log.w(TAG, "Failed to set shelf height");
}
}
public void setRecentsVisibility(boolean visible) {
try {
WindowManagerGlobal.getWindowManagerService().setRecentsVisibility(visible);
} catch (RemoteException e) {
Log.w(TAG, "Failed to set recents visibility");
}
}
}

View File

@@ -5943,12 +5943,8 @@ public class WindowManagerService extends IWindowManager.Stub
@Override
public void setRecentsVisibility(boolean visible) {
if (mContext.checkCallingOrSelfPermission(android.Manifest.permission.STATUS_BAR)
!= PackageManager.PERMISSION_GRANTED) {
throw new SecurityException("Caller does not hold permission "
+ android.Manifest.permission.STATUS_BAR);
}
mAmInternal.enforceCallerIsRecentsOrHasPermission(android.Manifest.permission.STATUS_BAR,
"setRecentsVisibility()");
synchronized (mWindowMap) {
mPolicy.setRecentsVisibilityLw(visible);
}