Merge "keyguardGoingAway wallpaperCommand" into udc-dev am: bf38e64981
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/22932676 Change-Id: Idb3ca6c8abc34401d6a2ecd076d1ffb060f1922f Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -230,6 +230,16 @@ public class WallpaperManager {
|
|||||||
*/
|
*/
|
||||||
public static final String COMMAND_WAKING_UP = "android.wallpaper.wakingup";
|
public static final String COMMAND_WAKING_UP = "android.wallpaper.wakingup";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Command for {@link #sendWallpaperCommand}: reported by System UI when the device keyguard
|
||||||
|
* starts going away.
|
||||||
|
* This command is triggered by {@link android.app.IActivityTaskManager#keyguardGoingAway(int)}.
|
||||||
|
*
|
||||||
|
* @hide
|
||||||
|
*/
|
||||||
|
public static final String COMMAND_KEYGUARD_GOING_AWAY =
|
||||||
|
"android.wallpaper.keyguardgoingaway";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Command for {@link #sendWallpaperCommand}: reported by System UI when the device is going to
|
* Command for {@link #sendWallpaperCommand}: reported by System UI when the device is going to
|
||||||
* sleep. The x and y arguments are a location (possibly very roughly) corresponding to the
|
* sleep. The x and y arguments are a location (possibly very roughly) corresponding to the
|
||||||
|
|||||||
@@ -33,4 +33,7 @@ public abstract class WallpaperManagerInternal {
|
|||||||
|
|
||||||
/** Notifies when the screen starts turning on and is not yet visible to the user. */
|
/** Notifies when the screen starts turning on and is not yet visible to the user. */
|
||||||
public abstract void onScreenTurningOn(int displayId);
|
public abstract void onScreenTurningOn(int displayId);
|
||||||
|
|
||||||
|
/** Notifies when the keyguard is going away. Sent right after the bouncer is gone. */
|
||||||
|
public abstract void onKeyguardGoingAway();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1617,6 +1617,11 @@ public class WallpaperManagerService extends IWallpaperManager.Stub
|
|||||||
public void onScreenTurningOn(int displayId) {
|
public void onScreenTurningOn(int displayId) {
|
||||||
notifyScreenTurningOn(displayId);
|
notifyScreenTurningOn(displayId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onKeyguardGoingAway() {
|
||||||
|
notifyKeyguardGoingAway();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void initialize() {
|
void initialize() {
|
||||||
@@ -2654,6 +2659,45 @@ public class WallpaperManagerService extends IWallpaperManager.Stub
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Propagate a keyguard going away event to the wallpaper engine.
|
||||||
|
*/
|
||||||
|
private void notifyKeyguardGoingAway() {
|
||||||
|
synchronized (mLock) {
|
||||||
|
if (mIsLockscreenLiveWallpaperEnabled) {
|
||||||
|
for (WallpaperData data : getActiveWallpapers()) {
|
||||||
|
data.connection.forEachDisplayConnector(displayConnector -> {
|
||||||
|
if (displayConnector.mEngine != null) {
|
||||||
|
try {
|
||||||
|
displayConnector.mEngine.dispatchWallpaperCommand(
|
||||||
|
WallpaperManager.COMMAND_KEYGUARD_GOING_AWAY,
|
||||||
|
-1, -1, -1, new Bundle());
|
||||||
|
} catch (RemoteException e) {
|
||||||
|
Slog.w(TAG, "Failed to notify that the keyguard is going away", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
final WallpaperData data = mWallpaperMap.get(mCurrentUserId);
|
||||||
|
if (data != null && data.connection != null) {
|
||||||
|
data.connection.forEachDisplayConnector(displayConnector -> {
|
||||||
|
if (displayConnector.mEngine != null) {
|
||||||
|
try {
|
||||||
|
displayConnector.mEngine.dispatchWallpaperCommand(
|
||||||
|
WallpaperManager.COMMAND_KEYGUARD_GOING_AWAY,
|
||||||
|
-1, -1, -1, new Bundle());
|
||||||
|
} catch (RemoteException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean setLockWallpaperCallback(IWallpaperManagerCallback cb) {
|
public boolean setLockWallpaperCallback(IWallpaperManagerCallback cb) {
|
||||||
checkPermission(android.Manifest.permission.INTERNAL_SYSTEM_WINDOW);
|
checkPermission(android.Manifest.permission.INTERNAL_SYSTEM_WINDOW);
|
||||||
|
|||||||
@@ -276,6 +276,7 @@ import com.android.server.sdksandbox.SdkSandboxManagerLocal;
|
|||||||
import com.android.server.statusbar.StatusBarManagerInternal;
|
import com.android.server.statusbar.StatusBarManagerInternal;
|
||||||
import com.android.server.uri.NeededUriGrants;
|
import com.android.server.uri.NeededUriGrants;
|
||||||
import com.android.server.uri.UriGrantsManagerInternal;
|
import com.android.server.uri.UriGrantsManagerInternal;
|
||||||
|
import com.android.server.wallpaper.WallpaperManagerInternal;
|
||||||
|
|
||||||
import java.io.BufferedReader;
|
import java.io.BufferedReader;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
@@ -365,6 +366,7 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
|
|||||||
private ComponentName mSysUiServiceComponent;
|
private ComponentName mSysUiServiceComponent;
|
||||||
private PermissionPolicyInternal mPermissionPolicyInternal;
|
private PermissionPolicyInternal mPermissionPolicyInternal;
|
||||||
private StatusBarManagerInternal mStatusBarManagerInternal;
|
private StatusBarManagerInternal mStatusBarManagerInternal;
|
||||||
|
private WallpaperManagerInternal mWallpaperManagerInternal;
|
||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
final ActivityTaskManagerInternal mInternal;
|
final ActivityTaskManagerInternal mInternal;
|
||||||
private PowerManagerInternal mPowerManagerInternal;
|
private PowerManagerInternal mPowerManagerInternal;
|
||||||
@@ -3553,6 +3555,7 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
|
|||||||
mRootWindowContainer.forAllDisplays(displayContent -> {
|
mRootWindowContainer.forAllDisplays(displayContent -> {
|
||||||
mKeyguardController.keyguardGoingAway(displayContent.getDisplayId(), flags);
|
mKeyguardController.keyguardGoingAway(displayContent.getDisplayId(), flags);
|
||||||
});
|
});
|
||||||
|
getWallpaperManagerInternal().onKeyguardGoingAway();
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
Binder.restoreCallingIdentity(token);
|
Binder.restoreCallingIdentity(token);
|
||||||
@@ -5232,6 +5235,13 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
|
|||||||
return mStatusBarManagerInternal;
|
return mStatusBarManagerInternal;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WallpaperManagerInternal getWallpaperManagerInternal() {
|
||||||
|
if (mWallpaperManagerInternal == null) {
|
||||||
|
mWallpaperManagerInternal = LocalServices.getService(WallpaperManagerInternal.class);
|
||||||
|
}
|
||||||
|
return mWallpaperManagerInternal;
|
||||||
|
}
|
||||||
|
|
||||||
AppWarnings getAppWarningsLocked() {
|
AppWarnings getAppWarningsLocked() {
|
||||||
return mAppWarnings;
|
return mAppWarnings;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user