Skip to content

Commit

Permalink
Merge pull request #13851 from brave/resolve_support_page
Browse files Browse the repository at this point in the history
Resolve vpn support
  • Loading branch information
deeppandya authored Jun 18, 2022
2 parents be30e15 + 691ecad commit d29abf4
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import org.chromium.base.Log;
import org.chromium.chrome.R;
import org.chromium.chrome.browser.InternetConnection;
import org.chromium.chrome.browser.customtabs.CustomTabActivity;
import org.chromium.chrome.browser.settings.BravePreferenceFragment;
import org.chromium.chrome.browser.vpn.BraveVpnNativeWorker;
import org.chromium.chrome.browser.vpn.BraveVpnObserver;
Expand Down Expand Up @@ -133,9 +134,7 @@ public boolean onPreferenceClick(Preference preference) {
.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
@Override
public boolean onPreferenceClick(Preference preference) {
Intent browserIntent =
new Intent(Intent.ACTION_VIEW, Uri.parse(VPN_SUPPORT_PAGE));
getActivity().startActivity(browserIntent);
CustomTabActivity.showInfoPage(getActivity(), VPN_SUPPORT_PAGE);
return true;
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,41 +89,48 @@ public void onCheckedChanged(RadioGroup group, int checkedId) {
btnContinueToEmail.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
StringBuilder bodyText = new StringBuilder(
"\n\n\n\n\n#### Please do not edit any information below ####\n");
StringBuilder bodyText =
new StringBuilder(getResources().getString(R.string.support_email_text));
if (vpnHostnameSwitch.isChecked()) {
bodyText.append("\n\nVPN Hostname\n" + BraveVpnPrefUtils.getHostname());
bodyText.append(String.format(getResources().getString(R.string.vpn_host_text),
BraveVpnPrefUtils.getHostname()));
}
if (subscriptionTypeSwitch.isChecked()) {
bodyText.append("\n\nSubscription Type\n" + BraveVpnPrefUtils.getProductId());
bodyText.append(
String.format(getResources().getString(R.string.subscription_type_text),
BraveVpnPrefUtils.getProductId()));
}
if (appReceiptSwitch.isChecked()) {
bodyText.append(
"\n\nPlay store token\n" + BraveVpnPrefUtils.getPurchaseToken());
String.format(getResources().getString(R.string.playstore_token_text),
BraveVpnPrefUtils.getPurchaseToken()));
}
if (appVersionSwitch.isChecked()) {
bodyText.append("\n\nApp Version\n"
+ AboutChromeSettings.getApplicationVersion(
BraveVpnSupportActivity.this,
AboutSettingsBridge.getApplicationVersion()));
bodyText.append(String.format(
getResources().getString(R.string.app_version_text),
AboutChromeSettings.getApplicationVersion(BraveVpnSupportActivity.this,
AboutSettingsBridge.getApplicationVersion())));
}
if (timezoneSwitch.isChecked()) {
bodyText.append("\n\nTimezone\n").append(TimeZone.getDefault().getID());
bodyText.append(getResources().getString(R.string.timezone_text))
.append(TimeZone.getDefault().getID());
}
if (networkTypeSwitch.isChecked()) {
bodyText.append("\n\nNetwork Type\n").append(getNetworkType());
bodyText.append(getResources().getString(R.string.network_type_text))
.append(getNetworkType());
}
if (cellularCarrierSwitch.isChecked()) {
bodyText.append("\n\nCellular Carrier\n").append(getCellularCarrier());
bodyText.append(getResources().getString(R.string.cellular_carrier_text))
.append(getCellularCarrier());
}

bodyText.append("\n\nOther Issue\n");
bodyText.append(getResources().getString(R.string.other_issue_text));
AppCompatRadioButton checkedRadioButton =
findViewById(otherIssuesRadioGroup.getCheckedRadioButtonId());
bodyText.append(checkedRadioButton.getText() + "\n");
bodyText.append("\n\nPlatform\n")
.append("Android"
+ "\n");
bodyText.append(checkedRadioButton.getText()).append("\n");
bodyText.append(getResources().getString(R.string.platform_text))
.append("Android")
.append("\n");

composeEmail(bodyText.toString());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@

public class BraveVpnApiResponseUtils {
public static void queryPurchaseFailed(Activity activity) {
BraveVpnPrefUtils.setPurchaseToken("");
BraveVpnPrefUtils.setProductId("");
BraveVpnPrefUtils.setPurchaseExpiry(0L);
BraveVpnPrefUtils.setSubscriptionPurchase(false);
Expand Down
30 changes: 30 additions & 0 deletions browser/ui/android/strings/android_brave_strings.grd
Original file line number Diff line number Diff line change
Expand Up @@ -3052,6 +3052,36 @@ If you don't accept this request, VPN will not reconnect and your internet conne
<message name="IDS_BRAVE_WALLET_SHOW_WEB3_NOTIFICATIONS" desc="Brave wallet show web3 notifications preference title text">
Display Web3 notifications
</message>
<message name="IDS_SUPPORT_EMAIL_TEXT" desc="Vpn support email text">
\n\n\n\n#### Brave doesn’t track you or know how you use our app, so we don’t know how you’ve set up VPN. Please share info about the issue you’re experiencing and we’ll do our best to resolve it as soon as we can. ####\n\n
</message>
<message name="IDS_VPN_HOST_TEXT" desc="Vpn support email text">
\n\nVPN Hostname\n <ph name="VALUE">%1$s</ph>
</message>
<message name="IDS_SUBSCRIPTION_TYPE_TEXT" desc="Vpn support email text">
\n\nSubscription Type\n <ph name="VALUE">%1$s</ph>
</message>
<message name="IDS_PLAYSTORE_TOKEN_TEXT" desc="Vpn support email text">
\n\nPlaystore Token\n <ph name="VALUE">%1$s</ph>
</message>
<message name="IDS_APP_VERSION_TEXT" desc="Vpn support email text">
\n\nApp Version\n <ph name="VALUE">%1$s</ph>
</message>
<message name="IDS_TIMEZONE_TEXT" desc="Vpn support email text">
\n\nTimezone\n
</message>
<message name="IDS_NETWORK_TYPE_TEXT" desc="Vpn support email text">
\n\nNetwork Type\n
</message>
<message name="IDS_CELLULAR_CARRIER_TEXT" desc="Vpn support email text">
\n\nCellular Carrier\n
</message>
<message name="IDS_OTHER_ISSUE_TEXT" desc="Vpn support email text">
\n\nOther Issue\n
</message>
<message name="IDS_PLATFORM_TEXT" desc="Vpn support email text">
\n\nPlatform\n
</message>
</messages>
</release>
</grit>

0 comments on commit d29abf4

Please sign in to comment.