Commit a744a76
committed
I've fixed some incorrect return statements in
I replaced `return@launch` statements within the `content` block's lambda
with a boolean flag to control processing flow. This resolves a
compilation error where returns were used in an invalid scope.
The `reason` function in `PhotoReasoningViewModel.kt` was modified to:
- Initialize a `shouldContinueProcessing` flag to `true`.
- Inside the `content` builder, if `currentReasoningJob` is inactive,
this flag is set to `false` instead of an invalid `return@launch`.
- Loops and conditional blocks within `content` now check this flag
and `break` or skip processing if it's false.
- After the `content` block, if `shouldContinueProcessing` is `false`,
the coroutine now correctly returns using `return@launch`.
Note: I observed further build issues related to SDK location,
but I believe these are unrelated to these specific code changes.PhotoReasoningViewModel.1 parent 3eeea2b commit a744a76
2 files changed
Lines changed: 33 additions & 9 deletions
File tree
- app/src/main/kotlin/com/google/ai/sample/feature/multimodal
Lines changed: 32 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
| 134 | + | |
134 | 135 | | |
135 | 136 | | |
136 | 137 | | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
142 | 141 | | |
143 | | - | |
144 | | - | |
145 | | - | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
146 | 170 | | |
147 | 171 | | |
148 | 172 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
0 commit comments