* constant starts at the high bits.
*/
public static final int CONFIG_FONT_SCALE = 0x40000000;
- /**
- * Bit in {@link #configChanges} that indicates that the activity
- * can itself handle changes to the rotation. Set from the
- * {@link android.R.attr#configChanges} attribute. This is
- * not a core resource configuration, but a higher-level value, so its
- * constant starts at the high bits.
- * @hide We do not want apps to handle this. It will eventually be moved out of
- * {@link Configuration}.
- */
- public static final int CONFIG_ROTATION = 0x20000000;
- /**
- * Bit in {@link #configChanges} that indicates that the activity
- * can itself handle changes to the app bounds. Set from the
- * {@link android.R.attr#configChanges} attribute. This is
- * not a core resource configuration, but a higher-level value, so its
- * constant starts at the high bits.
- * @hide We do not want apps to handle this. It will eventually be moved out of
- * {@link Configuration}.
- */
- public static final int CONFIG_APP_BOUNDS = 0x10000000;
/** @hide
* Unfortunately the constants for config changes in native code are
import java.util.ArrayList;
import java.util.Locale;
-import static android.view.Surface.ROTATION_0;
-import static android.view.Surface.ROTATION_UNDEFINED;
/**
* This class describes all device configuration information that can
*/
public int orientation;
- /**
- * The mRotation used at the time orientation was determined.
- * TODO(b/36812336): Move mRotation out of {@link Configuration}.
- * {@hide}
- */
- private int mRotation;
-
/** Constant for {@link #uiMode}: bits that encode the mode type. */
public static final int UI_MODE_TYPE_MASK = 0x0f;
/** Constant for {@link #uiMode}: a {@link #UI_MODE_TYPE_MASK}
navigation = o.navigation;
navigationHidden = o.navigationHidden;
orientation = o.orientation;
- mRotation = o.mRotation;
screenLayout = o.screenLayout;
colorMode = o.colorMode;
uiMode = o.uiMode;
navigation = NAVIGATION_UNDEFINED;
navigationHidden = NAVIGATIONHIDDEN_UNDEFINED;
orientation = ORIENTATION_UNDEFINED;
- mRotation = ROTATION_UNDEFINED;
screenLayout = SCREENLAYOUT_UNDEFINED;
colorMode = COLOR_MODE_UNDEFINED;
uiMode = UI_MODE_TYPE_UNDEFINED;
changed |= ActivityInfo.CONFIG_ORIENTATION;
orientation = delta.orientation;
}
- if (delta.mRotation != ROTATION_UNDEFINED
- && mRotation != delta.mRotation) {
- changed |= ActivityInfo.CONFIG_ORIENTATION;
- mRotation = delta.mRotation;
- }
if (((delta.screenLayout & SCREENLAYOUT_SIZE_MASK) != SCREENLAYOUT_SIZE_UNDEFINED)
&& (delta.screenLayout & SCREENLAYOUT_SIZE_MASK)
&& orientation != delta.orientation) {
changed |= ActivityInfo.CONFIG_ORIENTATION;
}
- if ((compareUndefined || delta.mRotation != ROTATION_UNDEFINED)
- && mRotation != delta.mRotation) {
- changed |= ActivityInfo.CONFIG_ROTATION;
- }
if ((compareUndefined || getScreenLayoutNoDirection(delta.screenLayout) !=
(SCREENLAYOUT_SIZE_UNDEFINED | SCREENLAYOUT_LONG_UNDEFINED))
&& getScreenLayoutNoDirection(screenLayout) !=
if ((compareUndefined || delta.appBounds != null)
&& appBounds != delta.appBounds
&& (appBounds == null || !appBounds.equals(delta.appBounds))) {
- changed |= ActivityInfo.CONFIG_APP_BOUNDS;
+ changed |= ActivityInfo.CONFIG_SCREEN_SIZE;
}
return changed;
dest.writeInt(navigation);
dest.writeInt(navigationHidden);
dest.writeInt(orientation);
- dest.writeInt(mRotation);
dest.writeInt(screenLayout);
dest.writeInt(colorMode);
dest.writeInt(uiMode);
navigation = source.readInt();
navigationHidden = source.readInt();
orientation = source.readInt();
- mRotation = source.readInt();
screenLayout = source.readInt();
colorMode = source.readInt();
uiMode = source.readInt();
if (n != 0) return n;
n = this.orientation - that.orientation;
if (n != 0) return n;
- n = this.mRotation - that.mRotation;
- if (n != 0) return n;
n = this.colorMode - that.colorMode;
if (n != 0) return n;
n = this.screenLayout - that.screenLayout;
/**
* @hide
*
- * Setter for orientation converts from {@link Surface} values to internal representation.
- */
- public void setRotation(int rotation) {
- this.mRotation = rotation;
- }
-
- /**
- * @hide
- *
- * Getter for orientation. Converts from internal representation to {@link Surface} values.
- */
- public int getRotation() {
- return mRotation != ROTATION_UNDEFINED ? mRotation : ROTATION_0;
- }
-
- /**
- * @hide
- *
* Clears the locale without changing layout direction.
*/
public void clearLocales() {
delta.orientation = change.orientation;
}
- if (base.mRotation != change.mRotation) {
- base.mRotation = change.mRotation;
- }
-
if ((base.screenLayout & SCREENLAYOUT_SIZE_MASK) !=
(change.screenLayout & SCREENLAYOUT_SIZE_MASK)) {
delta.screenLayout |= change.screenLayout & SCREENLAYOUT_SIZE_MASK;
DENSITY_DPI_UNDEFINED);
configOut.appBounds =
Rect.unflattenFromString(XmlUtils.readStringAttribute(parser, XML_ATTR_APP_BOUNDS));
- configOut.mRotation = XmlUtils.readIntAttribute(parser, XML_ATTR_ROTATION,
- ROTATION_UNDEFINED);
// For persistence, we don't care about assetsSeq, so do not read it out.
}
config.appBounds.flattenToString());
}
- if (config.mRotation != ROTATION_UNDEFINED) {
- XmlUtils.writeIntAttribute(xml, XML_ATTR_ROTATION, config.mRotation);
- }
-
// For persistence, we do not care about assetsSeq, so do not write it out.
}
}