From 769349c65d09a89bca9e2a16c5c1dfe9f50404b1 Mon Sep 17 00:00:00 2001 From: Norbel AMBANUMBEN Date: Wed, 15 Jan 2025 18:27:08 +0100 Subject: [PATCH] chore: add email extra to mail intent (#875) Closes https://github.com/ooni/probe/issues/2832 --- .../ooniprobe/fragment/PreferenceFragment.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/openobservatory/ooniprobe/fragment/PreferenceFragment.java b/app/src/main/java/org/openobservatory/ooniprobe/fragment/PreferenceFragment.java index 8eb2aecac..eaacff588 100644 --- a/app/src/main/java/org/openobservatory/ooniprobe/fragment/PreferenceFragment.java +++ b/app/src/main/java/org/openobservatory/ooniprobe/fragment/PreferenceFragment.java @@ -107,7 +107,9 @@ public void onResume() { Preference pref = findPreference(getString(R.string.send_email)); if (pref != null) pref.setOnPreferenceClickListener(preference -> { - Intent emailIntent = new Intent(Intent.ACTION_SENDTO, Uri.parse(getString(R.string.shareEmailTo))); + Uri uri = Uri.parse(getString(R.string.shareEmailTo)); + Intent emailIntent = new Intent(Intent.ACTION_SENDTO, uri); + emailIntent.putExtra(Intent.EXTRA_EMAIL, new String[]{getString(R.string.shareEmailTo).replace("mailto:", "")}); emailIntent.putExtra(Intent.EXTRA_SUBJECT, getString(R.string.shareSubject, BuildConfig.VERSION_NAME)); emailIntent.putExtra(Intent.EXTRA_TEXT, getString(R.string.Settings_SendEmail_Message) + "\n\n\nMANUFACTURER: " + Build.MANUFACTURER + "\nMODEL: " + Build.MODEL + "\nBOARD: " + Build.BOARD + "\nTIME: " + Build.TIME);