@@ -25,7 +25,6 @@ import android.service.chooser.ChooserResult
25
25
import android.service.chooser.ChooserResult.CHOOSER_RESULT_COPY
26
26
import android.service.chooser.ChooserResult.CHOOSER_RESULT_EDIT
27
27
import android.service.chooser.ChooserResult.CHOOSER_RESULT_SELECTED_COMPONENT
28
- import android.service.chooser.ChooserResult.CHOOSER_RESULT_UNKNOWN
29
28
import android.util.Log
30
29
import androidx.annotation.RequiresApi
31
30
import androidx.core.content.IntentCompat
@@ -43,13 +42,12 @@ class ShareResultReceiver : BroadcastReceiver() {
43
42
Intent .EXTRA_CHOOSER_RESULT ,
44
43
ChooserResult ::class .java,
45
44
)
46
- if (chooserResult != null ) {
47
- Log .i(TAG , " isShortcut: ${chooserResult.isShortcut} " )
48
- Log .i(TAG , " type: ${typeToString(chooserResult.type)} " )
49
- Log .i(TAG , " componentName: ${chooserResult.selectedComponent} " )
50
- } else {
51
- Log .i(TAG , " chooserResult is null" )
52
- }
45
+ chooserResult?.let {
46
+ Log .i(
47
+ TAG ,
48
+ " Share callback: isShortcut: ${it.isShortcut} , type: ${typeToString(it.type)} , componentName: ${it.selectedComponent} " ,
49
+ )
50
+ } ? : Log .i(TAG , " chooserResult is null" )
53
51
} else {
54
52
// This ComponentName represents the Activity that has received the data we shared.
55
53
val componentName: ComponentName ? = IntentCompat .getParcelableExtra(
@@ -66,7 +64,6 @@ class ShareResultReceiver : BroadcastReceiver() {
66
64
CHOOSER_RESULT_SELECTED_COMPONENT -> " SELECTED_COMPONENT"
67
65
CHOOSER_RESULT_COPY -> " COPY"
68
66
CHOOSER_RESULT_EDIT -> " EDIT"
69
- CHOOSER_RESULT_UNKNOWN -> " UNKNOWN"
70
67
else -> " UNKNOWN"
71
68
}
72
69
}
0 commit comments