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

Commit 58cd9743 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Contacts: Fix security exception when export to .vcf file"

parents cd6ebba9 9fe15c48
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -209,7 +209,7 @@ public class ExportProcessor extends ProcessorBase {
            mService.updateMediaScanner(request.destUri.getPath());

            successful = true;
            final String filename = ExportVCardActivity.getOpenableUriDisplayName(mService, uri);
            final String filename = request.displayName;
            // If it is a local file (i.e. not a file from Drive), we need to allow user to share
            // the file by pressing the notification; otherwise, it would be a file in Drive, we
            // don't need to enable this action in notification since the file is already uploaded.
+7 −0
Original line number Diff line number Diff line
@@ -24,12 +24,19 @@ public class ExportRequest {
     */
    public final String exportType;

    public final String displayName;

    public ExportRequest(Uri destUri) {
        this(destUri, null);
    }

    public ExportRequest(Uri destUri, String exportType) {
        this(destUri, exportType, null);
    }

    public ExportRequest(Uri destUri, String exportType, String displayName) {
        this.destUri = destUri;
        this.exportType = exportType;
        this.displayName = displayName;
    }
}
+2 −1
Original line number Diff line number Diff line
@@ -136,7 +136,8 @@ public class ExportVCardActivity extends Activity implements ServiceConnection,
                    data != null && data.getData() != null) {
                final Uri targetFileName = data.getData();
                if (DEBUG) Log.d(LOG_TAG, "exporting to " + targetFileName);
                final ExportRequest request = new ExportRequest(targetFileName);
                final String displayName = getOpenableUriDisplayName(this, targetFileName);
                final ExportRequest request = new ExportRequest(targetFileName, null, displayName);
                // The connection object will call finish().
                mService.handleExportRequest(request, new NotificationImportExportListener(
                        ExportVCardActivity.this));
+1 −2
Original line number Diff line number Diff line
@@ -158,8 +158,7 @@ public class NotificationImportExportListener implements VCardImportExportListen

    @Override
    public Notification onExportProcessed(ExportRequest request, int jobId) {
        final String displayName = ExportVCardActivity.getOpenableUriDisplayName(mContext,
                request.destUri);
        final String displayName = request.displayName;
        final String message = mContext.getString(R.string.contacts_export_will_start_message);

        mHandler.obtainMessage(0, message).sendToTarget();
+1 −1
Original line number Diff line number Diff line
@@ -60,7 +60,7 @@ public class ShareVCardActivity extends ExportVCardActivity {
                getString(R.string.contacts_file_provider_authority), file);
        if (DEBUG) Log.d(LOG_TAG, "exporting to " + contentUri);

        final ExportRequest request = new ExportRequest(contentUri);
        final ExportRequest request = new ExportRequest(contentUri, null, file.getName());
        // The connection object will call finish().
        mService.handleExportRequest(request, new NotificationImportExportListener(
                ShareVCardActivity.this));