Skip to content

Fix issue 504 #512

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Apr 12, 2022
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,37 @@ public partial class RequestMultiplePermissions // : global::AndroidX.Activity.R
}
}

}
}
}

namespace AndroidX.Activity.Result.Contract
{
// Metadata.xml XPath class reference: path="/api/package[@name='androidx.activity.result.contract']/class[@name='ActivityResultContracts']"
// [global::Android.Runtime.Register ("androidx/activity/result/contract/ActivityResultContracts", DoNotGenerateAcw=true)]
public sealed partial class ActivityResultContracts //: global::Java.Lang.Object
{
public partial class CreateDocument
{
// Metadata.xml XPath method reference: path="/api/package[@name='androidx.activity.result.contract']/class[@name='ActivityResultContracts.CreateDocument']/method[@name='createIntent' and count(parameter)=2 and parameter[1][@type='android.content.Context'] and parameter[2][@type='java.lang.String']]"
[Register ("createIntent", "(Landroid/content/Context;Ljava/lang/String;)Landroid/content/Intent;", "GetCreateIntent_Landroid_content_Context_Ljava_lang_String_Handler")]
public override unsafe global::Android.Content.Intent CreateIntent (global::Android.Content.Context context, global::Java.Lang.Object input)
{
const string __id = "createIntent.(Landroid/content/Context;Ljava/lang/String;)Landroid/content/Intent;";
IntPtr native_input = JNIEnv.NewString ((string) input);
try {
JniArgumentValue* __args = stackalloc JniArgumentValue [2];
__args [0] = new JniArgumentValue ((context == null) ? IntPtr.Zero : ((global::Java.Lang.Object) context).Handle);
__args [1] = new JniArgumentValue (native_input);
var __rm = _members.InstanceMethods.InvokeVirtualObjectMethod (__id, this, __args);
return global::Java.Lang.Object.GetObject<global::Android.Content.Intent> (__rm.Handle, JniHandleOwnership.TransferLocalRef);
} finally {
JNIEnv.DeleteLocalRef (native_input);
global::System.GC.KeepAlive (context);
global::System.GC.KeepAlive (input);
}
}
}
}
}
}

10 changes: 7 additions & 3 deletions source/androidx.activity/activity/Transforms/Metadata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -214,19 +214,23 @@
Java.Lang.Object
</attr>


<!--
<attr
path="/api/package[@name='androidx.activity.result.contract']/class[@name='ActivityResultContracts.CreateDocument']/method[@name='createIntent' and count(parameter)=2 and parameter[1][@type='android.content.Context'] and parameter[2][@type='java.lang.String']]/parameter[2]"
name="type"
name="managedType"
>
java.lang.Object
Java.Lang.Object
</attr>
<attr
path="/api/package[@name='androidx.activity.result.contract']/class[@name='ActivityResultContracts.CreateDocument']/method[@name='createIntent' and count(parameter)=2 and parameter[1][@type='android.content.Context'] and parameter[2][@type='java.lang.String']]"
name="managedReturn"
>
Android.Content.Intent
</attr>
-->
<remove-node
path="/api/package[@name='androidx.activity.result.contract']/class[@name='ActivityResultContracts.CreateDocument']/method[@name='createIntent' and count(parameter)=2 and parameter[1][@type='android.content.Context'] and parameter[2][@type='java.lang.String']]"
/>
<attr
path="/api/package[@name='androidx.activity.result.contract']/class[@name='ActivityResultContracts.CreateDocument']/method[@name='parseResult' and count(parameter)=2 and parameter[1][@type='int'] and parameter[2][@type='android.content.Intent']]"
name="managedReturn"
Expand Down