Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 38404c43 authored by Pragya Bajoria's avatar Pragya Bajoria Committed by Android (Google) Code Review
Browse files

Merge "Make DesktopWallpaperActivity aware of current user to support HSUM. (1/n)" into main

parents 287a1e2d 212b0f5c
Loading
Loading
Loading
Loading
+0 −1
Original line number Original line Diff line number Diff line
@@ -32,7 +32,6 @@
            android:name=".desktopmode.DesktopWallpaperActivity"
            android:name=".desktopmode.DesktopWallpaperActivity"
            android:excludeFromRecents="true"
            android:excludeFromRecents="true"
            android:launchMode="singleInstance"
            android:launchMode="singleInstance"
            android:showForAllUsers="true"
            android:theme="@style/DesktopWallpaperTheme" />
            android:theme="@style/DesktopWallpaperTheme" />


        <activity
        <activity
+12 −5
Original line number Original line Diff line number Diff line
@@ -42,6 +42,7 @@ import android.os.Binder
import android.os.Handler
import android.os.Handler
import android.os.IBinder
import android.os.IBinder
import android.os.SystemProperties
import android.os.SystemProperties
import android.os.UserHandle
import android.util.Size
import android.util.Size
import android.view.Display.DEFAULT_DISPLAY
import android.view.Display.DEFAULT_DISPLAY
import android.view.DragEvent
import android.view.DragEvent
@@ -1174,7 +1175,11 @@ class DesktopTasksController(


    private fun addWallpaperActivity(wct: WindowContainerTransaction) {
    private fun addWallpaperActivity(wct: WindowContainerTransaction) {
        logV("addWallpaperActivity")
        logV("addWallpaperActivity")
        val intent = Intent(context, DesktopWallpaperActivity::class.java)
        val userHandle = UserHandle.of(userId)
        val userContext =
            context.createContextAsUser(userHandle, /* flags= */ 0)
        val intent = Intent(userContext, DesktopWallpaperActivity::class.java)
        intent.putExtra(Intent.EXTRA_USER_HANDLE, userId);
        val options =
        val options =
            ActivityOptions.makeBasic().apply {
            ActivityOptions.makeBasic().apply {
                launchWindowingMode = WINDOWING_MODE_FULLSCREEN
                launchWindowingMode = WINDOWING_MODE_FULLSCREEN
@@ -1182,11 +1187,13 @@ class DesktopTasksController(
                    ActivityOptions.MODE_BACKGROUND_ACTIVITY_START_ALLOW_ALWAYS
                    ActivityOptions.MODE_BACKGROUND_ACTIVITY_START_ALLOW_ALWAYS
            }
            }
        val pendingIntent =
        val pendingIntent =
            PendingIntent.getActivity(
            PendingIntent.getActivityAsUser(
                context,
                userContext,
                /* requestCode= */ 0,
                /* requestCode= */ 0,
                intent,
                intent,
                PendingIntent.FLAG_IMMUTABLE
                PendingIntent.FLAG_IMMUTABLE,
                /* bundle= */ null,
                userHandle
            )
            )
        wct.sendPendingIntent(pendingIntent, intent, options.toBundle())
        wct.sendPendingIntent(pendingIntent, intent, options.toBundle())
    }
    }
+0 −1
Original line number Original line Diff line number Diff line
@@ -36,7 +36,6 @@ import com.android.wm.shell.protolog.ShellProtoLogGroup.WM_SHELL_DESKTOP_MODE
class DesktopWallpaperActivity : Activity() {
class DesktopWallpaperActivity : Activity() {


    override fun onCreate(savedInstanceState: Bundle?) {
    override fun onCreate(savedInstanceState: Bundle?) {
        ProtoLog.d(WM_SHELL_DESKTOP_MODE, "DesktopWallpaperActivity: onCreate")
        super.onCreate(savedInstanceState)
        super.onCreate(savedInstanceState)
        window.addFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE)
        window.addFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE)
    }
    }