Added locale to support URI

This commit is contained in:
M66B 2021-08-23 15:20:07 +02:00
parent e0bab3e77c
commit 473cb3a4b4
4 changed files with 12 additions and 4 deletions

View File

@ -226,7 +226,7 @@ public class ActivityBilling extends ActivityBase implements PurchasingListener,
private void onPurchaseError(Intent intent) {
String message = intent.getStringExtra("message");
Uri uri = Uri.parse(Helper.SUPPORT_URI);
Uri uri = Helper.getSupportUri(this);
if (!TextUtils.isEmpty(message))
uri = uri.buildUpon().appendQueryParameter("message", "IAB: " + message).build();
Helper.view(this, uri, true);

View File

@ -277,7 +277,7 @@ public class ActivityBilling extends ActivityBase implements /*PurchasesUpdatedL
private void onPurchaseError(Intent intent) {
String message = intent.getStringExtra("message");
Uri uri = Uri.parse(Helper.SUPPORT_URI);
Uri uri = Helper.getSupportUri(this);
if (!TextUtils.isEmpty(message))
uri = uri.buildUpon().appendQueryParameter("message", "IAB: " + message).build();
Helper.view(this, uri, true);

View File

@ -156,7 +156,7 @@ public class Helper {
static final String PRIVACY_URI = "https://email.faircode.eu/privacy/";
static final String XDA_URI = "https://forum.xda-developers.com/showthread.php?t=3824168";
static final String SUPPORT_URI = "https://contact.faircode.eu/?product=fairemailsupport&version=" + BuildConfig.VERSION_NAME;
static final String SUPPORT_URI = "https://contact.faircode.eu/";
static final String TEST_URI = "https://play.google.com/apps/testing/" + BuildConfig.APPLICATION_ID;
static final String BIMI_PRIVACY_URI = "https://datatracker.ietf.org/doc/html/draft-brotman-ietf-bimi-guidance-03#section-7.4";
static final String FAVICON_PRIVACY_URI = "https://en.wikipedia.org/wiki/Favicon";
@ -803,8 +803,16 @@ public class Helper {
}
static Uri getSupportUri(Context context) {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
String language = prefs.getString("language", null);
Locale slocale = Resources.getSystem().getConfiguration().locale;
return Uri.parse(SUPPORT_URI)
.buildUpon()
.appendQueryParameter("product", "fairemailsupport")
.appendQueryParameter("version", BuildConfig.VERSION_NAME)
.appendQueryParameter("locale", slocale.toString())
.appendQueryParameter("language", language == null ? "" : language)
.appendQueryParameter("installed", Helper.hasValidFingerprint(context) ? "" : "Other")
.build();
}

View File

@ -278,7 +278,7 @@ public class ActivityBilling extends ActivityBase implements PurchasesUpdatedLis
private void onPurchaseError(Intent intent) {
String message = intent.getStringExtra("message");
Uri uri = Uri.parse(Helper.SUPPORT_URI);
Uri uri = Helper.getSupportUri(this);
if (!TextUtils.isEmpty(message))
uri = uri.buildUpon().appendQueryParameter("message", "IAB: " + message).build();
Helper.view(this, uri, true);