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

Commit 212b0f5c authored by Pragya Bajoria's avatar Pragya Bajoria
Browse files

Make DesktopWallpaperActivity aware of current user to support HSUM. (1/n)

Bug: 357060209
Flag: EXEMPT (minor refactor)
Change-Id: Id94a2470a738650ca9bf332d1ab555fb822cd36e
parent 15c3305a
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -32,7 +32,6 @@
            android:name=".desktopmode.DesktopWallpaperActivity"
            android:excludeFromRecents="true"
            android:launchMode="singleInstance"
            android:showForAllUsers="true"
            android:theme="@style/DesktopWallpaperTheme" />

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

    private fun addWallpaperActivity(wct: WindowContainerTransaction) {
        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 =
            ActivityOptions.makeBasic().apply {
                launchWindowingMode = WINDOWING_MODE_FULLSCREEN
@@ -1182,11 +1187,13 @@ class DesktopTasksController(
                    ActivityOptions.MODE_BACKGROUND_ACTIVITY_START_ALLOW_ALWAYS
            }
        val pendingIntent =
            PendingIntent.getActivity(
                context,
            PendingIntent.getActivityAsUser(
                userContext,
                /* requestCode= */ 0,
                intent,
                PendingIntent.FLAG_IMMUTABLE
                PendingIntent.FLAG_IMMUTABLE,
                /* bundle= */ null,
                userHandle
            )
        wct.sendPendingIntent(pendingIntent, intent, options.toBundle())
    }
+0 −1
Original line number Diff line number Diff line
@@ -36,7 +36,6 @@ import com.android.wm.shell.protolog.ShellProtoLogGroup.WM_SHELL_DESKTOP_MODE
class DesktopWallpaperActivity : Activity() {

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