Merge "Move condition check to ThemeDeviceActivity, minor refactoring"