blob: ea86489abf5568a3f1a8375e836327bf484eea0a [file] [log] [blame]
import androidx.annotation.UiThread;
public class ThreadFlow {
@UiThread
public void myUiMethod() {
}
@UiThread
public void myRandomMethod() {
// Unconditional call: this method requires UI thread too
myUiMethod();
}
public void myOtherMethod1(int x) {
// Conditional call - won't infer UI thread
if (x > 5) {
myUiMethod();
}
}
public void myOtherMethod2(int x) {
// Conditional call - won't infer UI thread
if (x > 10) {
return;
}
myUiMethod();
}
}