Merge "Convert native changing config flags to Java flags"
This commit is contained in:
committed by
Android (Google) Code Review
commit
0ee455a899
@@ -21,6 +21,7 @@ import android.annotation.ArrayRes;
|
||||
import android.annotation.NonNull;
|
||||
import android.annotation.Nullable;
|
||||
import android.annotation.StringRes;
|
||||
import android.content.pm.ActivityInfo;
|
||||
import android.content.res.Configuration.NativeConfig;
|
||||
import android.os.ParcelFileDescriptor;
|
||||
import android.util.Log;
|
||||
@@ -183,6 +184,11 @@ public final class AssetManager implements AutoCloseable {
|
||||
if (block < 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// Convert the changing configurations flags populated by native code.
|
||||
outValue.changingConfigurations = ActivityInfo.activityInfoConfigNativeToJava(
|
||||
outValue.changingConfigurations);
|
||||
|
||||
if (outValue.type == TypedValue.TYPE_STRING) {
|
||||
return mStringBlocks[block].get(outValue.data);
|
||||
}
|
||||
@@ -220,6 +226,11 @@ public final class AssetManager implements AutoCloseable {
|
||||
if (block < 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Convert the changing configurations flags populated by native code.
|
||||
outValue.changingConfigurations = ActivityInfo.activityInfoConfigNativeToJava(
|
||||
outValue.changingConfigurations);
|
||||
|
||||
if (outValue.type == TypedValue.TYPE_STRING) {
|
||||
outValue.string = mStringBlocks[block].get(outValue.data);
|
||||
}
|
||||
@@ -266,6 +277,11 @@ public final class AssetManager implements AutoCloseable {
|
||||
if (block < 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Convert the changing configurations flags populated by native code.
|
||||
outValue.changingConfigurations = ActivityInfo.activityInfoConfigNativeToJava(
|
||||
outValue.changingConfigurations);
|
||||
|
||||
if (outValue.type == TypedValue.TYPE_STRING) {
|
||||
final StringBlock[] blocks = ensureStringBlocks();
|
||||
outValue.string = blocks[block].get(outValue.data);
|
||||
|
||||
@@ -39,6 +39,7 @@ import android.annotation.StyleRes;
|
||||
import android.annotation.StyleableRes;
|
||||
import android.annotation.XmlRes;
|
||||
import android.content.pm.ActivityInfo;
|
||||
import android.content.pm.ActivityInfo.Config;
|
||||
import android.graphics.Movie;
|
||||
import android.graphics.Typeface;
|
||||
import android.graphics.drawable.Drawable;
|
||||
@@ -1604,7 +1605,7 @@ public class Resources {
|
||||
* {@link ActivityInfo}
|
||||
* @see ActivityInfo
|
||||
*/
|
||||
public int getChangingConfigurations() {
|
||||
public @Config int getChangingConfigurations() {
|
||||
return mThemeImpl.getChangingConfigurations();
|
||||
}
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@ import android.annotation.StyleRes;
|
||||
import android.annotation.StyleableRes;
|
||||
import android.content.pm.ActivityInfo;
|
||||
import android.content.pm.ActivityInfo.Config;
|
||||
import android.content.res.Configuration.NativeConfig;
|
||||
import android.content.res.Resources.NotFoundException;
|
||||
import android.graphics.Typeface;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
@@ -1197,7 +1198,7 @@ public class ResourcesImpl {
|
||||
|
||||
@Config int getChangingConfigurations() {
|
||||
synchronized (mKey) {
|
||||
final int nativeChangingConfig =
|
||||
final @NativeConfig int nativeChangingConfig =
|
||||
AssetManager.getThemeChangingConfigurations(mTheme);
|
||||
return ActivityInfo.activityInfoConfigNativeToJava(nativeChangingConfig);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user