Added remark about Edge

master
M66B 1 month ago
parent a2ffa778ee
commit a33fa3142f

@ -123,6 +123,7 @@ public class FragmentOAuth extends FragmentBase {
private CheckBox cbPop;
private CheckBox cbRecent;
private CheckBox cbUpdate;
private TextView tvEdge;
private TextView tvBrave;
private Button btnOAuth;
private ContentLoadingProgressBar pbOAuth;
@ -185,6 +186,7 @@ public class FragmentOAuth extends FragmentBase {
cbPop = view.findViewById(R.id.cbPop);
cbRecent = view.findViewById(R.id.cbRecent);
cbUpdate = view.findViewById(R.id.cbUpdate);
tvEdge = view.findViewById(R.id.tvEdge);
tvBrave = view.findViewById(R.id.tvBrave);
btnOAuth = view.findViewById(R.id.btnOAuth);
pbOAuth = view.findViewById(R.id.pbOAuth);
@ -259,6 +261,7 @@ public class FragmentOAuth extends FragmentBase {
}
boolean edge = false;
boolean brave = false;
try {
PackageManager pm = getContext().getPackageManager();
@ -268,16 +271,17 @@ public class FragmentOAuth extends FragmentBase {
int flags = (Build.VERSION.SDK_INT < Build.VERSION_CODES.M ? 0 : PackageManager.MATCH_ALL);
List<ResolveInfo> browsers = pm.queryIntentActivities(intent, flags);
for (ResolveInfo browser : browsers)
if (browser.activityInfo.packageName.startsWith("com.brave.browser")) {
// _beta _nightly
if (TextUtils.isEmpty(browser.activityInfo.packageName))
continue;
else if (browser.activityInfo.packageName.startsWith("com.brave.browser")) // _beta _nightly
brave = true;
break;
}
else if (browser.activityInfo.packageName.startsWith("com.microsoft.emmx")) // .beta .canary .dev
edge = true;
} catch (Throwable ex) {
Log.e(ex);
brave = true;
}
tvEdge.setVisibility(edge ? View.VISIBLE : View.GONE);
tvBrave.setVisibility(brave ? View.VISIBLE : View.GONE);
btnOAuth.setOnClickListener(new View.OnClickListener() {
@ -511,6 +515,11 @@ public class FragmentOAuth extends FragmentBase {
@Override
public boolean matches(@NonNull BrowserDescriptor descriptor) {
if (BuildConfig.DEBUG) {
boolean edge = "com.microsoft.emmx".equals(descriptor.packageName);
Log.i("MMM " + descriptor.packageName + "=" + edge);
return edge;
}
boolean accept = !(SBROWSER.matches(descriptor) || SBROWSER_TAB.matches(descriptor));
if (descriptor.useCustomTab && !tabs)

@ -145,6 +145,18 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/cbRecent" />
<TextView
android:id="@+id/tvEdge"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/title_setup_oauth_edge"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textColor="?colorWarning"
android:textStyle="bold|italic"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/cbUpdate" />
<TextView
android:id="@+id/tvBrave"
android:layout_width="wrap_content"
@ -155,7 +167,7 @@
android:textColor="?colorWarning"
android:textStyle="bold|italic"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/cbUpdate" />
app:layout_constraintTop_toBottomOf="@id/tvEdge" />
<TextView
android:id="@+id/tvBrowser"

@ -257,6 +257,7 @@
<string name="title_setup_oauth_rationale">Authorize access to your %1$s account</string>
<string name="title_setup_oauth_update">Authorize an existing account again (otherwise create a new account)</string>
<string name="title_setup_oauth_updated">Account authorization was updated</string>
<string name="title_setup_oauth_edge">When using Edge browser, make sure that \'Block opening external apps\' in the \'Privacy, security and services\' settings is off</string>
<string name="title_setup_oauth_brave">When using Brave browser, you must enable the option in Brave\'s settings to allow app links to open in apps outside of Brave</string>
<string name="title_setup_oauth_browser">Authorization requires a working browser</string>
<string name="title_setup_oauth_authorize">Authorize</string>

Loading…
Cancel
Save