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

Commit a129baf1 authored by Ashish Kumar Gaurav's avatar Ashish Kumar Gaurav Committed by Android (Google) Code Review
Browse files

Merge "Fixes type resolving in ActivityManagerShellCommand" into udc-dev

parents f80ef935 0567baa7
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -839,6 +839,8 @@
    <uses-permission android:name="android.permission.LAUNCH_CREDENTIAL_SELECTOR" />
    <!-- Permission required for CTS test IntentRedirectionTest -->
    <uses-permission android:name="android.permission.QUERY_CLONED_APPS" />
    <!-- Permission required for accessing all content provider mime types -->
    <uses-permission android:name="android.permission.GET_ANY_PROVIDER_TYPE" />

    <application
        android:label="@string/app_label"
+4 −13
Original line number Diff line number Diff line
@@ -149,7 +149,6 @@ import java.util.Locale;
import java.util.Set;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicReference;

import javax.microedition.khronos.egl.EGL10;
import javax.microedition.khronos.egl.EGLConfig;
@@ -609,15 +608,7 @@ final class ActivityManagerShellCommand extends ShellCommand {
            return 1;
        }

        AtomicReference<String> mimeType = new AtomicReference<>(intent.getType());

        if (mimeType.get() == null && intent.getData() != null
                && "content".equals(intent.getData().getScheme())) {
            mInterface.getMimeTypeFilterAsync(intent.getData(), mUserId,
                    new RemoteCallback(result -> {
                        mimeType.set(result.getPairValue());
                    }));
        }
        final String mimeType = intent.resolveType(mInternal.mContext);

        do {
            if (mStopOption) {
@@ -629,7 +620,7 @@ final class ActivityManagerShellCommand extends ShellCommand {
                    int userIdForQuery = mInternal.mUserController.handleIncomingUser(
                            Binder.getCallingPid(), Binder.getCallingUid(), mUserId, false,
                            ALLOW_NON_FULL, "ActivityManagerShellCommand", null);
                    List<ResolveInfo> activities = mPm.queryIntentActivities(intent, mimeType.get(),
                    List<ResolveInfo> activities = mPm.queryIntentActivities(intent, mimeType,
                            0, userIdForQuery).getList();
                    if (activities == null || activities.size() <= 0) {
                        getErrPrintWriter().println("Error: Intent does not match any activities: "
@@ -726,12 +717,12 @@ final class ActivityManagerShellCommand extends ShellCommand {
            }
            if (mWaitOption) {
                result = mInternal.startActivityAndWait(null, SHELL_PACKAGE_NAME, null, intent,
                        mimeType.get(), null, null, 0, mStartFlags, profilerInfo,
                        mimeType, null, null, 0, mStartFlags, profilerInfo,
                        options != null ? options.toBundle() : null, mUserId);
                res = result.result;
            } else {
                res = mInternal.startActivityAsUserWithFeature(null, SHELL_PACKAGE_NAME, null,
                        intent, mimeType.get(), null, null, 0, mStartFlags, profilerInfo,
                        intent, mimeType, null, null, 0, mStartFlags, profilerInfo,
                        options != null ? options.toBundle() : null, mUserId);
            }
            final long endTime = SystemClock.uptimeMillis();