|
|
@ -23,6 +23,7 @@ import android.Manifest;
|
|
|
|
import android.app.Activity;
|
|
|
|
import android.app.Activity;
|
|
|
|
import android.app.KeyguardManager;
|
|
|
|
import android.app.KeyguardManager;
|
|
|
|
import android.content.ActivityNotFoundException;
|
|
|
|
import android.content.ActivityNotFoundException;
|
|
|
|
|
|
|
|
import android.content.ComponentName;
|
|
|
|
import android.content.Context;
|
|
|
|
import android.content.Context;
|
|
|
|
import android.content.DialogInterface;
|
|
|
|
import android.content.DialogInterface;
|
|
|
|
import android.content.Intent;
|
|
|
|
import android.content.Intent;
|
|
|
@ -75,7 +76,9 @@ import androidx.annotation.Nullable;
|
|
|
|
import androidx.appcompat.app.AlertDialog;
|
|
|
|
import androidx.appcompat.app.AlertDialog;
|
|
|
|
import androidx.biometric.BiometricManager;
|
|
|
|
import androidx.biometric.BiometricManager;
|
|
|
|
import androidx.biometric.BiometricPrompt;
|
|
|
|
import androidx.biometric.BiometricPrompt;
|
|
|
|
|
|
|
|
import androidx.browser.customtabs.CustomTabsClient;
|
|
|
|
import androidx.browser.customtabs.CustomTabsIntent;
|
|
|
|
import androidx.browser.customtabs.CustomTabsIntent;
|
|
|
|
|
|
|
|
import androidx.browser.customtabs.CustomTabsServiceConnection;
|
|
|
|
import androidx.constraintlayout.widget.ConstraintLayout;
|
|
|
|
import androidx.constraintlayout.widget.ConstraintLayout;
|
|
|
|
import androidx.core.content.ContextCompat;
|
|
|
|
import androidx.core.content.ContextCompat;
|
|
|
|
import androidx.core.content.FileProvider;
|
|
|
|
import androidx.core.content.FileProvider;
|
|
|
@ -451,6 +454,29 @@ public class Helper {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void customTabsWarmup(Context context) {
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
CustomTabsClient.bindCustomTabsService(context, "com.android.chrome", new CustomTabsServiceConnection() {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public void onCustomTabsServiceConnected(@NonNull ComponentName name, @NonNull CustomTabsClient client) {
|
|
|
|
|
|
|
|
Log.i("Warning up custom tabs");
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
client.warmup(0);
|
|
|
|
|
|
|
|
} catch (Throwable ex) {
|
|
|
|
|
|
|
|
Log.w(ex);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public void onServiceDisconnected(ComponentName name) {
|
|
|
|
|
|
|
|
// Do nothing
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
} catch (Throwable ex) {
|
|
|
|
|
|
|
|
Log.w(ex);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void viewFAQ(Context context, int question) {
|
|
|
|
static void viewFAQ(Context context, int question) {
|
|
|
|
if (question == 0)
|
|
|
|
if (question == 0)
|
|
|
|
view(context, Uri.parse(FAQ_URI), false);
|
|
|
|
view(context, Uri.parse(FAQ_URI), false);
|
|
|
|