private void refreshOrientationState() {
    boolean isTablet = getResources().getBoolean(R.bool.isTablet);
    if (!isTablet && (getAccountCount() == 0 || firstAccountAddedNoticeDisplayRequired)) {
      // Lock to portrait mode.
      setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_USER_PORTRAIT);
    } else {
      setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_USER);
    }
  }
On non-tablet devices, we lock the screen to portrait mode in case we are showing the begin
screen (i.e. no account) or showing the notice for first account added. On tablet devices, we
accept both portrait and landscape mode.
java/com/google/android/apps/authenticator/AuthenticatorActivity.java