Merge "ui: join only if joinable." am: 2454b2493a

am: ccff03d196

Change-Id: I6752eaf96637a9263eb49caa5322a815a6208ef5
This commit is contained in:
Tao Bao
2018-06-06 11:07:02 -07:00
committed by android-build-merger
3 changed files with 11 additions and 2 deletions
+3 -1
View File
@@ -173,7 +173,9 @@ ScreenRecoveryUI::ScreenRecoveryUI(bool scrollable_menu)
ScreenRecoveryUI::~ScreenRecoveryUI() {
progress_thread_stopped_ = true;
progress_thread_.join();
if (progress_thread_.joinable()) {
progress_thread_.join();
}
}
GRSurface* ScreenRecoveryUI::GetCurrentFrame() const {
+5
View File
@@ -293,6 +293,11 @@ TEST_F(ScreenRecoveryUITest, Init) {
ASSERT_FALSE(ui_->WasTextEverVisible());
}
TEST_F(ScreenRecoveryUITest, dtor_NotCallingInit) {
ui_.reset();
ASSERT_FALSE(ui_);
}
TEST_F(ScreenRecoveryUITest, ShowText) {
ASSERT_TRUE(ui_->Init(kTestLocale));
ASSERT_FALSE(ui_->IsTextVisible());
+3 -1
View File
@@ -78,7 +78,9 @@ RecoveryUI::RecoveryUI()
RecoveryUI::~RecoveryUI() {
ev_exit();
input_thread_stopped_ = true;
input_thread_.join();
if (input_thread_.joinable()) {
input_thread_.join();
}
}
void RecoveryUI::OnKeyDetected(int key_code) {