On off. You can get information about automatic rotation. Using Settings.System.ACCELEROMETER_ROTATION as:
if (android.provider.Settings.System.getInt(getContentResolver(),Settings.System.ACCELEROMETER_ROTATION, 0) == 1){ Toast.makeText(Rotation.this, "Rotation ON", Toast.LENGTH_SHORT).show(); } else{ Toast.makeText(Rotation.this, "Rotation OFF", Toast.LENGTH_SHORT).show(); }
source share