Merge "ui: join only if joinable."

am: 2454b2493a

Change-Id: I84d7bb6be8dbf35d0161237902a7b7e076200e10
This commit is contained in:
Tao Bao
2018-06-06 10:08:15 -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() { ScreenRecoveryUI::~ScreenRecoveryUI() {
progress_thread_stopped_ = true; progress_thread_stopped_ = true;
progress_thread_.join(); if (progress_thread_.joinable()) {
progress_thread_.join();
}
} }
GRSurface* ScreenRecoveryUI::GetCurrentFrame() const { GRSurface* ScreenRecoveryUI::GetCurrentFrame() const {
+5
View File
@@ -293,6 +293,11 @@ TEST_F(ScreenRecoveryUITest, Init) {
ASSERT_FALSE(ui_->WasTextEverVisible()); ASSERT_FALSE(ui_->WasTextEverVisible());
} }
TEST_F(ScreenRecoveryUITest, dtor_NotCallingInit) {
ui_.reset();
ASSERT_FALSE(ui_);
}
TEST_F(ScreenRecoveryUITest, ShowText) { TEST_F(ScreenRecoveryUITest, ShowText) {
ASSERT_TRUE(ui_->Init(kTestLocale)); ASSERT_TRUE(ui_->Init(kTestLocale));
ASSERT_FALSE(ui_->IsTextVisible()); ASSERT_FALSE(ui_->IsTextVisible());
+3 -1
View File
@@ -78,7 +78,9 @@ RecoveryUI::RecoveryUI()
RecoveryUI::~RecoveryUI() { RecoveryUI::~RecoveryUI() {
ev_exit(); ev_exit();
input_thread_stopped_ = true; input_thread_stopped_ = true;
input_thread_.join(); if (input_thread_.joinable()) {
input_thread_.join();
}
} }
void RecoveryUI::OnKeyDetected(int key_code) { void RecoveryUI::OnKeyDetected(int key_code) {