@@ -25,7 +25,6 @@ import android.service.chooser.ChooserResult
2525import android.service.chooser.ChooserResult.CHOOSER_RESULT_COPY
2626import android.service.chooser.ChooserResult.CHOOSER_RESULT_EDIT
2727import android.service.chooser.ChooserResult.CHOOSER_RESULT_SELECTED_COMPONENT
28- import android.service.chooser.ChooserResult.CHOOSER_RESULT_UNKNOWN
2928import android.util.Log
3029import androidx.annotation.RequiresApi
3130import androidx.core.content.IntentCompat
@@ -43,13 +42,12 @@ class ShareResultReceiver : BroadcastReceiver() {
4342 Intent .EXTRA_CHOOSER_RESULT ,
4443 ChooserResult ::class .java,
4544 )
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" )
5351 } else {
5452 // This ComponentName represents the Activity that has received the data we shared.
5553 val componentName: ComponentName ? = IntentCompat .getParcelableExtra(
@@ -66,7 +64,6 @@ class ShareResultReceiver : BroadcastReceiver() {
6664 CHOOSER_RESULT_SELECTED_COMPONENT -> " SELECTED_COMPONENT"
6765 CHOOSER_RESULT_COPY -> " COPY"
6866 CHOOSER_RESULT_EDIT -> " EDIT"
69- CHOOSER_RESULT_UNKNOWN -> " UNKNOWN"
7067 else -> " UNKNOWN"
7168 }
7269 }
0 commit comments