what-the-bank/sources/com/baseflow/permissionhandler/MethodCallHandlerImpl.java

221 lines
9.1 KiB
Java

package com.baseflow.permissionhandler;
import android.app.Activity;
import android.content.Context;
import com.baseflow.permissionhandler.AppSettingsManager;
import com.baseflow.permissionhandler.PermissionManager;
import com.baseflow.permissionhandler.ServiceManager;
import io.flutter.plugin.common.MethodCall;
import io.flutter.plugin.common.MethodChannel;
import java.util.List;
import java.util.Map;
import java.util.Objects;
/* loaded from: classes.dex */
final class MethodCallHandlerImpl implements MethodChannel.MethodCallHandler {
private Activity activity;
private final AppSettingsManager appSettingsManager;
private final Context applicationContext;
private final PermissionManager permissionManager;
private final ServiceManager serviceManager;
/* JADX INFO: Access modifiers changed from: package-private */
public MethodCallHandlerImpl(Context context, AppSettingsManager appSettingsManager, PermissionManager permissionManager, ServiceManager serviceManager) {
this.applicationContext = context;
this.appSettingsManager = appSettingsManager;
this.permissionManager = permissionManager;
this.serviceManager = serviceManager;
}
/* JADX WARN: Can't fix incorrect switch cases order, some code will duplicate */
@Override // io.flutter.plugin.common.MethodChannel.MethodCallHandler
public final void onMethodCall(MethodCall methodCall, final MethodChannel.Result result) {
char c;
String str = methodCall.method;
str.hashCode();
switch (str.hashCode()) {
case -1544053025:
if (str.equals("checkServiceStatus")) {
c = 0;
break;
}
c = 65535;
break;
case -1017315255:
if (str.equals("shouldShowRequestPermissionRationale")) {
c = 1;
break;
}
c = 65535;
break;
case -576207927:
if (str.equals("checkPermissionStatus")) {
c = 2;
break;
}
c = 65535;
break;
case 347240634:
if (str.equals("openAppSettings")) {
c = 3;
break;
}
c = 65535;
break;
case 1669188213:
if (str.equals("requestPermissions")) {
c = 4;
break;
}
c = 65535;
break;
default:
c = 65535;
break;
}
if (c == 0) {
int parseInt = Integer.parseInt(methodCall.arguments.toString());
ServiceManager serviceManager = this.serviceManager;
Context context = this.applicationContext;
Objects.requireNonNull(result);
serviceManager.checkServiceStatus(parseInt, context, new ServiceManager.SuccessCallback(result) { // from class: com.baseflow.permissionhandler.MethodCallHandlerImpl$$ExternalSyntheticLambda0
public final MethodChannel.Result f$0;
@Override // com.baseflow.permissionhandler.ServiceManager.SuccessCallback
public final void onSuccess(int i) {
this.f$0.success(Integer.valueOf(i));
}
{
this.f$0 = result;
}
}, new ErrorCallback(result) { // from class: com.baseflow.permissionhandler.MethodCallHandlerImpl$$ExternalSyntheticLambda1
public final MethodChannel.Result f$0;
@Override // com.baseflow.permissionhandler.ErrorCallback
public final void onError(String str2, String str3) {
this.f$0.error(str2, str3, null);
}
{
this.f$0 = result;
}
});
return;
}
if (c == 1) {
int parseInt2 = Integer.parseInt(methodCall.arguments.toString());
PermissionManager permissionManager = this.permissionManager;
Activity activity = this.activity;
Objects.requireNonNull(result);
permissionManager.shouldShowRequestPermissionRationale(parseInt2, activity, new PermissionManager.ShouldShowRequestPermissionRationaleSuccessCallback(result) { // from class: com.baseflow.permissionhandler.MethodCallHandlerImpl$$ExternalSyntheticLambda5
public final MethodChannel.Result f$0;
@Override // com.baseflow.permissionhandler.PermissionManager.ShouldShowRequestPermissionRationaleSuccessCallback
public final void onSuccess(boolean z) {
this.f$0.success(Boolean.valueOf(z));
}
{
this.f$0 = result;
}
}, new ErrorCallback(result) { // from class: com.baseflow.permissionhandler.MethodCallHandlerImpl$$ExternalSyntheticLambda6
public final MethodChannel.Result f$0;
@Override // com.baseflow.permissionhandler.ErrorCallback
public final void onError(String str2, String str3) {
this.f$0.error(str2, str3, null);
}
{
this.f$0 = result;
}
});
return;
}
if (c == 2) {
int parseInt3 = Integer.parseInt(methodCall.arguments.toString());
PermissionManager permissionManager2 = this.permissionManager;
Context context2 = this.applicationContext;
Objects.requireNonNull(result);
permissionManager2.checkPermissionStatus(parseInt3, context2, new PermissionManager.CheckPermissionsSuccessCallback(result) { // from class: com.baseflow.permissionhandler.MethodCallHandlerImpl$$ExternalSyntheticLambda2
public final MethodChannel.Result f$0;
@Override // com.baseflow.permissionhandler.PermissionManager.CheckPermissionsSuccessCallback
public final void onSuccess(int i) {
this.f$0.success(Integer.valueOf(i));
}
{
this.f$0 = result;
}
});
return;
}
if (c == 3) {
AppSettingsManager appSettingsManager = this.appSettingsManager;
Context context3 = this.applicationContext;
Objects.requireNonNull(result);
appSettingsManager.openAppSettings(context3, new AppSettingsManager.OpenAppSettingsSuccessCallback(result) { // from class: com.baseflow.permissionhandler.MethodCallHandlerImpl$$ExternalSyntheticLambda7
public final MethodChannel.Result f$0;
@Override // com.baseflow.permissionhandler.AppSettingsManager.OpenAppSettingsSuccessCallback
public final void onSuccess(boolean z) {
this.f$0.success(Boolean.valueOf(z));
}
{
this.f$0 = result;
}
}, new ErrorCallback(result) { // from class: com.baseflow.permissionhandler.MethodCallHandlerImpl$$ExternalSyntheticLambda8
public final MethodChannel.Result f$0;
@Override // com.baseflow.permissionhandler.ErrorCallback
public final void onError(String str2, String str3) {
this.f$0.error(str2, str3, null);
}
{
this.f$0 = result;
}
});
return;
}
if (c == 4) {
List<Integer> list = (List) methodCall.arguments();
PermissionManager permissionManager3 = this.permissionManager;
Activity activity2 = this.activity;
Objects.requireNonNull(result);
permissionManager3.requestPermissions(list, activity2, new PermissionManager.RequestPermissionsSuccessCallback(result) { // from class: com.baseflow.permissionhandler.MethodCallHandlerImpl$$ExternalSyntheticLambda3
public final MethodChannel.Result f$0;
@Override // com.baseflow.permissionhandler.PermissionManager.RequestPermissionsSuccessCallback
public final void onSuccess(Map map) {
this.f$0.success(map);
}
{
this.f$0 = result;
}
}, new ErrorCallback(result) { // from class: com.baseflow.permissionhandler.MethodCallHandlerImpl$$ExternalSyntheticLambda4
public final MethodChannel.Result f$0;
@Override // com.baseflow.permissionhandler.ErrorCallback
public final void onError(String str2, String str3) {
this.f$0.error(str2, str3, null);
}
{
this.f$0 = result;
}
});
return;
}
result.notImplemented();
}
public final void setActivity(Activity activity) {
this.activity = activity;
}
}