Fixed
Status Update
Comments
dn...@google.com <dn...@google.com> #2
Can you please share a sample project to reproduce this issue.
dn...@google.com <dn...@google.com> #4
This seems to be a significant bug in UAST.
Given a test file like this:
package test.pkg
import android.widget.TextView
class Test : android.app.Activity {
private suspend fun setUi() {
val x = R.string.hello
}
}
if I remove the "suspend" keyword, I get the following UAST tree:
UFile (package = test.pkg)
UImportStatement (isOnDemand = false)
UClass (name = Test)
UAnnotationMethod (name = setUi)
UBlockExpression
UDeclarationsExpression
ULocalVariable (name = x)
UQualifiedReferenceExpression
UQualifiedReferenceExpression
USimpleNameReferenceExpression (identifier = R)
USimpleNameReferenceExpression (identifier = string)
USimpleNameReferenceExpression (identifier = hello)
UAnnotationMethod (name = Test)
However, if I add the suspend keyword back in, I end up with this:
UFile (package = test.pkg)
UImportStatement (isOnDemand = false)
UClass (name = Test)
UAnnotationMethod (name = Test)
Notice how the body of the method is completely missing. I'll file a bug against UAST for this.
Given a test file like this:
package test.pkg
import android.widget.TextView
class Test : android.app.Activity {
private suspend fun setUi() {
val x = R.string.hello
}
}
if I remove the "suspend" keyword, I get the following UAST tree:
UFile (package = test.pkg)
UImportStatement (isOnDemand = false)
UClass (name = Test)
UAnnotationMethod (name = setUi)
UBlockExpression
UDeclarationsExpression
ULocalVariable (name = x)
UQualifiedReferenceExpression
UQualifiedReferenceExpression
USimpleNameReferenceExpression (identifier = R)
USimpleNameReferenceExpression (identifier = string)
USimpleNameReferenceExpression (identifier = hello)
UAnnotationMethod (name = Test)
However, if I add the suspend keyword back in, I end up with this:
UFile (package = test.pkg)
UImportStatement (isOnDemand = false)
UClass (name = Test)
UAnnotationMethod (name = Test)
Notice how the body of the method is completely missing. I'll file a bug against UAST for this.
Description
>> When I create a simple intent for this purpose it's throwing exception
>> But when I use Intent with createChooser(), platform is listing different email clients available in the device and allowing me to choose an email client. When I choose Gmail, it's opening properly with proper information and a message is being displayed saying permission denied for attachment. But not throwing any exception.
versions :: targetSDKVersion : 24 run on Android 5x device with Android 7.0 OS.
Steps to Reproduce :: (android app zip file attached for reference)
>> Create an application where we create a file in cache directory from a file in assets directory.
>> In the app we have two buttons, first button try to send the cache directory file using normal intent like
"startActivity(intent);"
When we click this button, we can observe in logs that it's throwing exception FileUriExposedException.
>> In the app on second button click we are using intent with chooser like
"startActivity(Intent.createChooser(intent,"Choose"));"
When we click this button, there is no exception in the logs.
What should have happened ::
>> When we pass file:// uri with normal itnent or intent with chooser FileUriExposedException should be thrown.
Please someone explain me what is causing this discrepancy when we use chooser along with intent.