package SHARK2.keymon.com.mx;

import anywheresoftware.b4a.BA;
import anywheresoftware.b4a.pc.*;

public class manageexternalstorage_subs_0 {


public static RemoteObject  _class_globals(RemoteObject __ref) throws Exception{
 //BA.debugLineNum = 3;BA.debugLine="Sub Class_Globals";
 //BA.debugLineNum = 4;BA.debugLine="Private ion As Object";
manageexternalstorage._ion = RemoteObject.createNew ("Object");__ref.setField("_ion",manageexternalstorage._ion);
 //BA.debugLineNum = 5;BA.debugLine="Private mCallback As Object";
manageexternalstorage._mcallback = RemoteObject.createNew ("Object");__ref.setField("_mcallback",manageexternalstorage._mcallback);
 //BA.debugLineNum = 6;BA.debugLine="Private mEventName As String";
manageexternalstorage._meventname = RemoteObject.createImmutable("");__ref.setField("_meventname",manageexternalstorage._meventname);
 //BA.debugLineNum = 8;BA.debugLine="End Sub";
return RemoteObject.createImmutable("");
}
public static RemoteObject  _getba(RemoteObject __ref) throws Exception{
try {
		Debug.PushSubsStack("GetBA (manageexternalstorage) ","manageexternalstorage",24,__ref.getField(false, "ba"),__ref,69);
if (RapidSub.canDelegate("getba")) { return __ref.runUserSub(false, "manageexternalstorage","getba", __ref);}
RemoteObject _jo = RemoteObject.declareNull("anywheresoftware.b4j.object.JavaObject");
 BA.debugLineNum = 69;BA.debugLine="Private Sub GetBA As Object";
Debug.ShouldStop(16);
 BA.debugLineNum = 70;BA.debugLine="Dim jo As JavaObject = Me";
Debug.ShouldStop(32);
_jo = RemoteObject.createNew ("anywheresoftware.b4j.object.JavaObject");
_jo = RemoteObject.declareNull("anywheresoftware.b4a.AbsObjectWrapper").runMethod(false, "ConvertToWrapper", RemoteObject.createNew("anywheresoftware.b4j.object.JavaObject"), __ref);Debug.locals.put("jo", _jo);Debug.locals.put("jo", _jo);
 BA.debugLineNum = 71;BA.debugLine="Return jo.RunMethod(\"getBA\", Null)";
Debug.ShouldStop(64);
if (true) return _jo.runMethod(false,"RunMethod",(Object)(BA.ObjectToString("getBA")),(Object)((manageexternalstorage.__c.getField(false,"Null"))));
 BA.debugLineNum = 72;BA.debugLine="End Sub";
Debug.ShouldStop(128);
return RemoteObject.createImmutable(null);
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _getpermission(RemoteObject __ref) throws Exception{
try {
		Debug.PushSubsStack("GetPermission (manageexternalstorage) ","manageexternalstorage",24,__ref.getField(false, "ba"),__ref,39);
if (RapidSub.canDelegate("getpermission")) { return __ref.runUserSub(false, "manageexternalstorage","getpermission", __ref);}
RemoteObject _in = RemoteObject.declareNull("anywheresoftware.b4a.objects.IntentWrapper");
 BA.debugLineNum = 39;BA.debugLine="Public Sub GetPermission";
Debug.ShouldStop(64);
 BA.debugLineNum = 40;BA.debugLine="If HasPermission Then";
Debug.ShouldStop(128);
if (__ref.runClassMethod (SHARK2.keymon.com.mx.manageexternalstorage.class, "_haspermission" /*RemoteObject*/ ).<Boolean>get().booleanValue()) { 
 BA.debugLineNum = 41;BA.debugLine="RaiseEvent";
Debug.ShouldStop(256);
__ref.runClassMethod (SHARK2.keymon.com.mx.manageexternalstorage.class, "_raiseevent" /*RemoteObject*/ );
 BA.debugLineNum = 42;BA.debugLine="Return";
Debug.ShouldStop(512);
if (true) return RemoteObject.createImmutable("");
 };
 BA.debugLineNum = 44;BA.debugLine="Dim in As Intent";
Debug.ShouldStop(2048);
_in = RemoteObject.createNew ("anywheresoftware.b4a.objects.IntentWrapper");Debug.locals.put("in", _in);
 BA.debugLineNum = 46;BA.debugLine="in.Initialize(\"android.settings.MANAGE_APP_ALL_FI";
Debug.ShouldStop(8192);
_in.runVoidMethod ("Initialize",(Object)(BA.ObjectToString("android.settings.MANAGE_APP_ALL_FILES_ACCESS_PERMISSION")),(Object)((RemoteObject.concat(RemoteObject.createImmutable("package:"),manageexternalstorage.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((manageexternalstorage.__c.getField(false,"Application").runMethod(true,"getPackageName")))),RemoteObject.createImmutable("")))));
 BA.debugLineNum = 47;BA.debugLine="StartActivityForResult(in)";
Debug.ShouldStop(16384);
__ref.runClassMethod (SHARK2.keymon.com.mx.manageexternalstorage.class, "_startactivityforresult" /*RemoteObject*/ ,(Object)(_in));
 BA.debugLineNum = 48;BA.debugLine="End Sub";
Debug.ShouldStop(32768);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _haspermission(RemoteObject __ref) throws Exception{
try {
		Debug.PushSubsStack("HasPermission (manageexternalstorage) ","manageexternalstorage",24,__ref.getField(false, "ba"),__ref,28);
if (RapidSub.canDelegate("haspermission")) { return __ref.runUserSub(false, "manageexternalstorage","haspermission", __ref);}
RemoteObject _has = RemoteObject.createImmutable(false);
RemoteObject _jo = RemoteObject.declareNull("anywheresoftware.b4j.object.JavaObject");
 BA.debugLineNum = 28;BA.debugLine="Public Sub HasPermission As Boolean";
Debug.ShouldStop(134217728);
 BA.debugLineNum = 29;BA.debugLine="Dim has As Boolean";
Debug.ShouldStop(268435456);
_has = RemoteObject.createImmutable(false);Debug.locals.put("has", _has);
 BA.debugLineNum = 30;BA.debugLine="Dim jo As JavaObject";
Debug.ShouldStop(536870912);
_jo = RemoteObject.createNew ("anywheresoftware.b4j.object.JavaObject");Debug.locals.put("jo", _jo);
 BA.debugLineNum = 31;BA.debugLine="jo.InitializeStatic(\"android.os.Environment\")";
Debug.ShouldStop(1073741824);
_jo.runVoidMethod ("InitializeStatic",(Object)(RemoteObject.createImmutable("android.os.Environment")));
 BA.debugLineNum = 32;BA.debugLine="has = jo.RunMethod(\"isExternalStorageManager\", Nu";
Debug.ShouldStop(-2147483648);
_has = BA.ObjectToBoolean(_jo.runMethod(false,"RunMethod",(Object)(BA.ObjectToString("isExternalStorageManager")),(Object)((manageexternalstorage.__c.getField(false,"Null")))));Debug.locals.put("has", _has);
 BA.debugLineNum = 33;BA.debugLine="Return has";
Debug.ShouldStop(1);
if (true) return _has;
 BA.debugLineNum = 34;BA.debugLine="End Sub";
Debug.ShouldStop(2);
return RemoteObject.createImmutable(false);
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _initialize(RemoteObject __ref,RemoteObject _ba,RemoteObject _callback,RemoteObject _eventname) throws Exception{
try {
		Debug.PushSubsStack("Initialize (manageexternalstorage) ","manageexternalstorage",24,__ref.getField(false, "ba"),__ref,20);
if (RapidSub.canDelegate("initialize")) { return __ref.runUserSub(false, "manageexternalstorage","initialize", __ref, _ba, _callback, _eventname);}
__ref.runVoidMethodAndSync("innerInitializeHelper", _ba);
Debug.locals.put("ba", _ba);
Debug.locals.put("Callback", _callback);
Debug.locals.put("EventName", _eventname);
 BA.debugLineNum = 20;BA.debugLine="Public Sub Initialize (Callback As Object, EventNa";
Debug.ShouldStop(524288);
 BA.debugLineNum = 21;BA.debugLine="mCallback = Callback";
Debug.ShouldStop(1048576);
__ref.setField ("_mcallback" /*RemoteObject*/ ,_callback);
 BA.debugLineNum = 22;BA.debugLine="mEventName = EventName";
Debug.ShouldStop(2097152);
__ref.setField ("_meventname" /*RemoteObject*/ ,_eventname);
 BA.debugLineNum = 23;BA.debugLine="End Sub";
Debug.ShouldStop(4194304);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _ion_event(RemoteObject __ref,RemoteObject _methodname,RemoteObject _args) throws Exception{
try {
		Debug.PushSubsStack("ion_Event (manageexternalstorage) ","manageexternalstorage",24,__ref.getField(false, "ba"),__ref,57);
if (RapidSub.canDelegate("ion_event")) { return __ref.runUserSub(false, "manageexternalstorage","ion_event", __ref, _methodname, _args);}
Debug.locals.put("MethodName", _methodname);
Debug.locals.put("Args", _args);
 BA.debugLineNum = 57;BA.debugLine="Private Sub ion_Event (MethodName As String, Args(";
Debug.ShouldStop(16777216);
 BA.debugLineNum = 58;BA.debugLine="RaiseEvent";
Debug.ShouldStop(33554432);
__ref.runClassMethod (SHARK2.keymon.com.mx.manageexternalstorage.class, "_raiseevent" /*RemoteObject*/ );
 BA.debugLineNum = 59;BA.debugLine="Return Null";
Debug.ShouldStop(67108864);
if (true) return manageexternalstorage.__c.getField(false,"Null");
 BA.debugLineNum = 60;BA.debugLine="End Sub";
Debug.ShouldStop(134217728);
return RemoteObject.createImmutable(null);
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _raiseevent(RemoteObject __ref) throws Exception{
try {
		Debug.PushSubsStack("RaiseEvent (manageexternalstorage) ","manageexternalstorage",24,__ref.getField(false, "ba"),__ref,51);
if (RapidSub.canDelegate("raiseevent")) { return __ref.runUserSub(false, "manageexternalstorage","raiseevent", __ref);}
 BA.debugLineNum = 51;BA.debugLine="Private Sub RaiseEvent";
Debug.ShouldStop(262144);
 BA.debugLineNum = 52;BA.debugLine="Log(\"Calling : \" &  mEventName & \"_StorageAvailab";
Debug.ShouldStop(524288);
manageexternalstorage.__c.runVoidMethod ("LogImpl","532833537",RemoteObject.concat(RemoteObject.createImmutable("Calling : "),__ref.getField(true,"_meventname" /*RemoteObject*/ ),RemoteObject.createImmutable("_StorageAvailable")),0);
 BA.debugLineNum = 53;BA.debugLine="CallSubDelayed(mCallback, mEventName & \"_StorageA";
Debug.ShouldStop(1048576);
manageexternalstorage.__c.runVoidMethod ("CallSubDelayed",__ref.getField(false, "ba"),(Object)(__ref.getField(false,"_mcallback" /*RemoteObject*/ )),(Object)(RemoteObject.concat(__ref.getField(true,"_meventname" /*RemoteObject*/ ),RemoteObject.createImmutable("_StorageAvailable"))));
 BA.debugLineNum = 54;BA.debugLine="End Sub";
Debug.ShouldStop(2097152);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _startactivityforresult(RemoteObject __ref,RemoteObject _i) throws Exception{
try {
		Debug.PushSubsStack("StartActivityForResult (manageexternalstorage) ","manageexternalstorage",24,__ref.getField(false, "ba"),__ref,63);
if (RapidSub.canDelegate("startactivityforresult")) { return __ref.runUserSub(false, "manageexternalstorage","startactivityforresult", __ref, _i);}
RemoteObject _jo = RemoteObject.declareNull("anywheresoftware.b4j.object.JavaObject");
Debug.locals.put("i", _i);
 BA.debugLineNum = 63;BA.debugLine="Private Sub StartActivityForResult(i As Intent)";
Debug.ShouldStop(1073741824);
 BA.debugLineNum = 64;BA.debugLine="Dim jo As JavaObject = GetBA";
Debug.ShouldStop(-2147483648);
_jo = RemoteObject.createNew ("anywheresoftware.b4j.object.JavaObject");
_jo = RemoteObject.declareNull("anywheresoftware.b4a.AbsObjectWrapper").runMethod(false, "ConvertToWrapper", RemoteObject.createNew("anywheresoftware.b4j.object.JavaObject"), __ref.runClassMethod (SHARK2.keymon.com.mx.manageexternalstorage.class, "_getba" /*RemoteObject*/ ));Debug.locals.put("jo", _jo);Debug.locals.put("jo", _jo);
 BA.debugLineNum = 65;BA.debugLine="ion = jo.CreateEvent(\"anywheresoftware.b4a.IOnAct";
Debug.ShouldStop(1);
__ref.setField ("_ion" /*RemoteObject*/ ,_jo.runMethod(false,"CreateEvent",__ref.getField(false, "ba"),(Object)(BA.ObjectToString("anywheresoftware.b4a.IOnActivityResult")),(Object)(BA.ObjectToString("ion")),(Object)(manageexternalstorage.__c.getField(false,"Null"))));
 BA.debugLineNum = 66;BA.debugLine="jo.RunMethod(\"startActivityForResult\", Array As O";
Debug.ShouldStop(2);
_jo.runVoidMethod ("RunMethod",(Object)(BA.ObjectToString("startActivityForResult")),(Object)(RemoteObject.createNewArray("Object",new int[] {2},new Object[] {__ref.getField(false,"_ion" /*RemoteObject*/ ),(_i.getObject())})));
 BA.debugLineNum = 67;BA.debugLine="End Sub";
Debug.ShouldStop(4);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
}