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

Commit 93d3e528 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 9673171 from 43e1ee6b to tm-qpr3-release

Change-Id: I2b80f78189cfc5c403d47e63064d1365f5340294
parents de7cc6e4 43e1ee6b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -107,7 +107,7 @@ public class DumpCommand extends Command {
                        DisplayManagerGlobal.getInstance().getRealDisplay(Display.DEFAULT_DISPLAY);
                int rotation = display.getRotation();
                Point size = new Point();
                display.getSize(size);
                display.getRealSize(size);
                AccessibilityNodeInfoDumper.dumpWindowToFile(info, dumpFile, rotation, size.x,
                        size.y);
            }
+1 −1
Original line number Diff line number Diff line
@@ -139,7 +139,7 @@ public class AccessibilityNodeInfoDumper {
                serializer.attribute("", "id", Integer.toString(displayId));
                int rotation = display.getRotation();
                Point size = new Point();
                display.getSize(size);
                display.getRealSize(size);
                for (int i = 0, n = windows.size(); i < n; ++i) {
                    dumpWindowRec(windows.get(i), serializer, i, size.x, size.y, rotation);
                }
+1 −1
Original line number Diff line number Diff line
@@ -767,7 +767,7 @@ public class UiDevice {
        if(root != null) {
            Display display = getAutomatorBridge().getDefaultDisplay();
            Point size = new Point();
            display.getSize(size);
            display.getRealSize(size);
            AccessibilityNodeInfoDumper.dumpWindowToFile(root,
                    new File(new File(Environment.getDataDirectory(), "local/tmp"), fileName),
                    display.getRotation(), size.x, size.y);
+33 −2
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ import static android.app.admin.DevicePolicyResources.Strings.Core.RESOLVER_CANT
import static android.app.admin.DevicePolicyResources.Strings.Core.RESOLVER_CANT_SHARE_WITH_PERSONAL;
import static android.app.admin.DevicePolicyResources.Strings.Core.RESOLVER_CANT_SHARE_WITH_WORK;
import static android.app.admin.DevicePolicyResources.Strings.Core.RESOLVER_CROSS_PROFILE_BLOCKED_TITLE;
import static android.content.ContentProvider.getUserIdFromUri;
import static android.stats.devicepolicy.DevicePolicyEnums.RESOLVER_EMPTY_STATE_NO_SHARING_TO_PERSONAL;
import static android.stats.devicepolicy.DevicePolicyEnums.RESOLVER_EMPTY_STATE_NO_SHARING_TO_WORK;

@@ -161,6 +162,7 @@ import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.function.Supplier;
import java.util.stream.Collectors;

/**
 * The Chooser Activity handles intent resolution specifically for sharing intents -
@@ -1424,7 +1426,11 @@ public class ChooserActivity extends ResolverActivity implements

        String action = targetIntent.getAction();
        if (Intent.ACTION_SEND.equals(action)) {
            Uri uri = targetIntent.getParcelableExtra(Intent.EXTRA_STREAM);
            Uri uri = targetIntent.getParcelableExtra(Intent.EXTRA_STREAM, android.net.Uri.class);
            if (!validForContentPreview(uri)) {
                contentPreviewLayout.setVisibility(View.GONE);
                return contentPreviewLayout;
            }
            imagePreview.findViewById(R.id.content_preview_image_1_large)
                    .setTransitionName(ChooserActivity.FIRST_IMAGE_PREVIEW_TRANSITION_NAME);
            mPreviewCoord.loadUriIntoView(R.id.content_preview_image_1_large, uri, 0);
@@ -1434,7 +1440,7 @@ public class ChooserActivity extends ResolverActivity implements
            List<Uri> uris = targetIntent.getParcelableArrayListExtra(Intent.EXTRA_STREAM);
            List<Uri> imageUris = new ArrayList<>();
            for (Uri uri : uris) {
                if (isImageType(resolver.getType(uri))) {
                if (validForContentPreview(uri) && isImageType(resolver.getType(uri))) {
                    imageUris.add(uri);
                }
            }
@@ -1544,9 +1550,16 @@ public class ChooserActivity extends ResolverActivity implements
        String action = targetIntent.getAction();
        if (Intent.ACTION_SEND.equals(action)) {
            Uri uri = targetIntent.getParcelableExtra(Intent.EXTRA_STREAM);
            if (!validForContentPreview(uri)) {
                contentPreviewLayout.setVisibility(View.GONE);
                return contentPreviewLayout;
            }
            loadFileUriIntoView(uri, contentPreviewLayout);
        } else {
            List<Uri> uris = targetIntent.getParcelableArrayListExtra(Intent.EXTRA_STREAM);
            uris = uris.stream()
                    .filter(ChooserActivity::validForContentPreview)
                    .collect(Collectors.toList());
            int uriCount = uris.size();

            if (uriCount == 0) {
@@ -1605,6 +1618,24 @@ public class ChooserActivity extends ResolverActivity implements
        }
    }

    /**
     * Indicate if the incoming content URI should be allowed.
     *
     * @param uri the uri to test
     * @return true if the URI is allowed for content preview
     */
    private static boolean validForContentPreview(Uri uri) throws SecurityException {
        if (uri == null) {
            return false;
        }
        int userId = getUserIdFromUri(uri, UserHandle.USER_CURRENT);
        if (userId != UserHandle.USER_CURRENT && userId != UserHandle.myUserId()) {
            Log.e(TAG, "dropped invalid content URI belonging to user " + userId);
            return false;
        }
        return true;
    }

    @VisibleForTesting
    protected boolean isImageType(String mimeType) {
        return mimeType != null && mimeType.startsWith("image/");
+1 −1
Original line number Diff line number Diff line
@@ -297,7 +297,7 @@
    <string name="safeMode" msgid="8974401416068943888">"حالت ایمن"</string>
    <string name="android_system_label" msgid="5974767339591067210">"سیستم Android"</string>
    <string name="user_owner_label" msgid="8628726904184471211">"جابه‌جا شدن به نمایه شخصی"</string>
    <string name="managed_profile_label" msgid="7316778766973512382">"جابه‌جا شدن به نمایه کاری"</string>
    <string name="managed_profile_label" msgid="7316778766973512382">"رفتن به نمایه کاری"</string>
    <string name="permgrouplab_contacts" msgid="4254143639307316920">"مخاطبین"</string>
    <string name="permgroupdesc_contacts" msgid="9163927941244182567">"دسترسی به مخاطبین شما"</string>
    <string name="permgrouplab_location" msgid="1858277002233964394">"مکان"</string>
Loading