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

Commit e733a401 authored by Victoria Lease's avatar Victoria Lease Committed by Elliott Hughes
Browse files

more locale-appropriate screenshot share text

The SimpleDateFormat version of this produces very poor results in
locales other than en_US. Trusting DateFormat to do its thing
produces more consistently-pleasing results across all locales.

(cherry-pick of e45e1f2e.)

Change-Id: I7f1714446bb50285d851e8e313e7f32a0a822bf2
parent b4d1ad29
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -61,6 +61,7 @@ import com.android.systemui.R;

import java.io.File;
import java.io.OutputStream;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;

@@ -211,8 +212,7 @@ class SaveImageInBackgroundTask extends AsyncTask<SaveImageInBackgroundData, Voi
            values.put(MediaStore.Images.ImageColumns.HEIGHT, mImageHeight);
            Uri uri = resolver.insert(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, values);

            String subjectDate = new SimpleDateFormat("hh:mma, MMM dd, yyyy")
                .format(new Date(mImageTime));
            String subjectDate = DateFormat.getDateTimeInstance().format(new Date(mImageTime));
            String subject = String.format(SCREENSHOT_SHARE_SUBJECT_TEMPLATE, subjectDate);
            Intent sharingIntent = new Intent(Intent.ACTION_SEND);
            sharingIntent.setType("image/png");