File tree 2 files changed +7
-6
lines changed
android/java/org/chromium/chrome/browser
2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -238,9 +238,7 @@ public void onMenuDismissed() {
238
238
mMenu .removeItem (R .id .brave_playlist_id );
239
239
mMenu .removeItem (R .id .brave_speedreader_id );
240
240
mMenu .removeItem (R .id .exit_id );
241
- if (BraveVpnUtils .isVpnFeatureSupported (mContext )) {
242
- mMenu .removeItem (R .id .request_brave_vpn_row_menu_id );
243
- }
241
+ mMenu .removeItem (R .id .request_brave_vpn_row_menu_id );
244
242
}
245
243
246
244
@ Override
Original file line number Diff line number Diff line change @@ -248,9 +248,11 @@ public <T extends Preference> T findPreference(CharSequence key) {
248
248
private void rearrangePreferenceOrders () {
249
249
int firstSectionOrder = 0 ;
250
250
251
- if (BraveVpnPrefUtils .shouldShowCallout () && !BraveVpnPrefUtils .isSubscriptionPurchase ()
251
+ if (getActivity () != null && !getActivity ().isFinishing ()
252
+ && BraveVpnPrefUtils .shouldShowCallout ()
253
+ && !BraveVpnPrefUtils .isSubscriptionPurchase ()
252
254
&& BraveVpnUtils .isVpnFeatureSupported (getActivity ())) {
253
- if (getActivity () != null && mVpnCalloutPreference == null ) {
255
+ if (mVpnCalloutPreference == null ) {
254
256
mVpnCalloutPreference = new VpnCalloutPreference (getActivity ());
255
257
}
256
258
if (mVpnCalloutPreference != null ) {
@@ -277,7 +279,8 @@ private void rearrangePreferenceOrders() {
277
279
removePreferenceIfPresent (PREF_BRAVE_PLAYLIST );
278
280
}
279
281
280
- if (BraveVpnUtils .isVpnFeatureSupported (getActivity ())) {
282
+ if (getActivity () != null && !getActivity ().isFinishing ()
283
+ && BraveVpnUtils .isVpnFeatureSupported (getActivity ())) {
281
284
findPreference (PREF_BRAVE_VPN ).setOrder (++firstSectionOrder );
282
285
} else {
283
286
removePreferenceIfPresent (PREF_BRAVE_VPN );
You can’t perform that action at this time.
0 commit comments