From 6829841745b4f39cd450c68ab3c212c2d78338b5 Mon Sep 17 00:00:00 2001 From: Felka Chang <felkachang@google.com> Date: Wed, 13 Oct 2021 15:15:10 +0800 Subject: [PATCH] Fix Configuration.diff documentation. By using ActivityInfo.Config to annotate the return type of Configuration.diff, it not only solves the wrong document but also makes the documentation of Configuration.diff consist with the documentation of Configuration.updateFrom. The final result is the following. ``` Returns a bit mask indicating which configuration values have changed. Value is either 0 or a combination of ActivityInfo.CONFIG_MCC, ActivityInfo.CONFIG_MNC, ActivityInfo.CONFIG_LOCALE, ActivityInfo.CONFIG_TOUCHSCREEN, ActivityInfo.CONFIG_KEYBOARD, ActivityInfo.CONFIG_KEYBOARD_HIDDEN, ActivityInfo.CONFIG_NAVIGATION, ActivityInfo.CONFIG_ORIENTATION, ActivityInfo.CONFIG_SCREEN_LAYOUT, ActivityInfo.CONFIG_UI_MODE, ActivityInfo.CONFIG_SCREEN_SIZE, ActivityInfo.CONFIG_SMALLEST_SCREEN_SIZE, ActivityInfo.CONFIG_DENSITY, ActivityInfo.CONFIG_LAYOUT_DIRECTION, ActivityInfo.CONFIG_COLOR_MODE, and ActivityInfo.CONFIG_FONT_SCALE ``` Test: make docs Test: review reference/android/content/res/Configuration.html in out/target/common/docs/online-sdk-docs-docs.zip Fixes: 171738297 Bug: 171716892 Change-Id: Iaa2ac25bc1269e4a9a625cce386f51984ffff923 --- .../android/content/res/Configuration.java | 32 ++----------------- 1 file changed, 3 insertions(+), 29 deletions(-) diff --git a/core/java/android/content/res/Configuration.java b/core/java/android/content/res/Configuration.java index b66f048b829d..755114e0ac67 100644 --- a/core/java/android/content/res/Configuration.java +++ b/core/java/android/content/res/Configuration.java @@ -1736,35 +1736,9 @@ public final class Configuration implements Parcelable, Comparable<Configuration * object and the given one. Does not change the values of either. Any * undefined fields in <var>delta</var> are ignored. * @return Returns a bit mask indicating which configuration - * values has changed, containing any combination of - * {@link android.content.pm.ActivityInfo#CONFIG_FONT_SCALE - * PackageManager.ActivityInfo.CONFIG_FONT_SCALE}, - * {@link android.content.pm.ActivityInfo#CONFIG_MCC - * PackageManager.ActivityInfo.CONFIG_MCC}, - * {@link android.content.pm.ActivityInfo#CONFIG_MNC - * PackageManager.ActivityInfo.CONFIG_MNC}, - * {@link android.content.pm.ActivityInfo#CONFIG_LOCALE - * PackageManager.ActivityInfo.CONFIG_LOCALE}, - * {@link android.content.pm.ActivityInfo#CONFIG_TOUCHSCREEN - * PackageManager.ActivityInfo.CONFIG_TOUCHSCREEN}, - * {@link android.content.pm.ActivityInfo#CONFIG_KEYBOARD - * PackageManager.ActivityInfo.CONFIG_KEYBOARD}, - * {@link android.content.pm.ActivityInfo#CONFIG_NAVIGATION - * PackageManager.ActivityInfo.CONFIG_NAVIGATION}, - * {@link android.content.pm.ActivityInfo#CONFIG_ORIENTATION - * PackageManager.ActivityInfo.CONFIG_ORIENTATION}, - * {@link android.content.pm.ActivityInfo#CONFIG_SCREEN_LAYOUT - * PackageManager.ActivityInfo.CONFIG_SCREEN_LAYOUT}, or - * {@link android.content.pm.ActivityInfo#CONFIG_SCREEN_SIZE - * PackageManager.ActivityInfo.CONFIG_SCREEN_SIZE}, or - * {@link android.content.pm.ActivityInfo#CONFIG_SMALLEST_SCREEN_SIZE - * PackageManager.ActivityInfo.CONFIG_SMALLEST_SCREEN_SIZE}. - * {@link android.content.pm.ActivityInfo#CONFIG_LAYOUT_DIRECTION - * PackageManager.ActivityInfo.CONFIG_LAYOUT_DIRECTION}. - * {@link android.content.pm.ActivityInfo#CONFIG_FONT_WEIGHT_ADJUSTMENT - * PackageManager.ActivityInfo.CONFIG_FONT_WEIGHT_ADJUSTMENT. - */ - public int diff(Configuration delta) { + * values have changed. + */ + public @Config int diff(Configuration delta) { return diff(delta, false /* compareUndefined */, false /* publicOnly */); } -- GitLab