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

Commit a589a858 authored by Massimo Carli's avatar Massimo Carli
Browse files

Add package information to user aspect ratio intent

Bug: 296564769
Test: Manual

Change-Id: I53248042c2907e29f7fd13859e2879e8e79a18ff
parent 1d9b476c
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -22,10 +22,13 @@ import android.annotation.NonNull;
import android.annotation.Nullable;
import android.app.TaskInfo;
import android.app.TaskInfo.CameraCompatControlState;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.res.Configuration;
import android.hardware.display.DisplayManager;
import android.net.Uri;
import android.os.UserHandle;
import android.provider.Settings;
import android.util.ArraySet;
import android.util.Log;
@@ -577,7 +580,13 @@ public class CompatUIController implements OnDisplaysChangedListener,
        final Intent intent = new Intent(Settings.ACTION_MANAGE_USER_ASPECT_RATIO_SETTINGS);
        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);
        mContext.startActivity(intent);
        final ComponentName appComponent = taskInfo.topActivity;
        if (appComponent != null) {
            final Uri packageUri = Uri.parse("package:" + appComponent.getPackageName());
            intent.setData(packageUri);
        }
        final UserHandle userHandle = UserHandle.of(taskInfo.userId);
        mContext.startActivityAsUser(intent, userHandle);
    }

    private void removeLayouts(int taskId) {