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

Commit 8342578f authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 6453963 from 07634907 to rvc-release

Change-Id: Ibf28b8093fc8b3af9afc3b7e4c7a763d705a7dc0
parents 2edcbb1f 07634907
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@

<resources xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
    <string name="files_label" msgid="771781190045103748">"Files"</string>
    <string name="files_label" msgid="771781190045103748">"فایل‌ها"</string>
    <string name="downloads_label" msgid="5462789470049501103">"بارگیری‌ها"</string>
    <!-- no translation found for app_label (8089292432455111409) -->
    <skip />
+1 −1
Original line number Diff line number Diff line
@@ -541,5 +541,5 @@

    <!-- Snackbar shown when users drag and drop files from another app
    to DocumentsUI. [CHAR_LIMIT=100] -->
    <string name="drag_from_another_app">Drag from another app not allowed.</string>
    <string name="drag_from_another_app">You can\u2019t move files from another app.</string>
</resources>
+8 −0
Original line number Diff line number Diff line
@@ -341,6 +341,14 @@ public final class Metrics {
                getSearchMode(isKeywordSearch, isChipsSearch));
    }

    /**
     * Logs drag initiated from which app, documentsUI or another app.
     */
    public static void logDragInitiated(boolean isDragInitatedFromDocsUI) {
        DocumentsStatsLog.write(DocumentsStatsLog.DOCS_UI_DRAG_AND_DROP_REPORTED,
                isDragInitatedFromDocsUI);
    }

    public static void logPickResult(PickResult result) {
        DocumentsStatsLog.write(
                DocumentsStatsLog.DOCS_UI_PICK_RESULT_REPORTED,
+4 −1
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@ import com.android.documentsui.AbstractActionHandler;
import com.android.documentsui.AbstractDragHost;
import com.android.documentsui.ActionHandler;
import com.android.documentsui.DragAndDropManager;
import com.android.documentsui.Metrics;
import com.android.documentsui.R;
import com.android.documentsui.base.DocumentInfo;
import com.android.documentsui.base.DocumentStack;
@@ -110,7 +111,9 @@ class DragHost<T extends Activity & AbstractActionHandler.CommonAddons> extends

    @Override
    public boolean canHandleDragEvent(View v) {
        if (!mDragAndDropManager.isDragFromSameApp()) {
        boolean dragInitiatedFromDocsUI = mDragAndDropManager.isDragFromSameApp();
        Metrics.logDragInitiated(dragInitiatedFromDocsUI);
        if (!dragInitiatedFromDocsUI) {
            Snackbar.make(
                    v, R.string.drag_from_another_app, Snackbar.LENGTH_SHORT).show();
            return false;
+5 −1
Original line number Diff line number Diff line
@@ -3,7 +3,6 @@ package com.android.documentsui;
import android.content.Intent;
import android.net.Uri;

import androidx.test.InstrumentationRegistry;
import androidx.test.filters.SmallTest;
import androidx.test.runner.AndroidJUnit4;

@@ -36,4 +35,9 @@ public class MetricsTest {
        state.action = State.ACTION_BROWSE;
        Metrics.logActivityLaunch(state, intent);
    }

    @Test
    public void logDragInitiated_shouldNotCrash() {
        Metrics.logDragInitiated(true);
    }
}