From d9cdb0d92592321069a8701f067fc575e44a3cba Mon Sep 17 00:00:00 2001 From: Adrian Roos Date: Mon, 15 Jul 2019 12:05:54 +0200 Subject: AM: make isHighEndGfx TestApi Bug: 136784434 Test: n/a Change-Id: Ie26de8dcf64a02b7757d4f705485cdcb7470f511 --- api/test-current.txt | 1 + core/java/android/app/ActivityManager.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/api/test-current.txt b/api/test-current.txt index 6f0b6a809c9c..cb3674ba6706 100644 --- a/api/test-current.txt +++ b/api/test-current.txt @@ -54,6 +54,7 @@ package android.app { method @RequiresPermission(android.Manifest.permission.PACKAGE_USAGE_STATS) public int getPackageImportance(String); method public long getTotalRam(); method @RequiresPermission(android.Manifest.permission.PACKAGE_USAGE_STATS) public int getUidImportance(int); + method public static boolean isHighEndGfx(); method @RequiresPermission(android.Manifest.permission.PACKAGE_USAGE_STATS) public void removeOnUidImportanceListener(android.app.ActivityManager.OnUidImportanceListener); method public static void resumeAppSwitches() throws android.os.RemoteException; method @RequiresPermission(android.Manifest.permission.CHANGE_CONFIGURATION) public void scheduleApplicationInfoChanged(java.util.List, int); diff --git a/core/java/android/app/ActivityManager.java b/core/java/android/app/ActivityManager.java index 17368b789645..91b98c71a613 100644 --- a/core/java/android/app/ActivityManager.java +++ b/core/java/android/app/ActivityManager.java @@ -925,7 +925,7 @@ public class ActivityManager { * (which tends to consume a lot more RAM). * @hide */ - @UnsupportedAppUsage + @TestApi static public boolean isHighEndGfx() { return !isLowRamDeviceStatic() && !RoSystemProperties.CONFIG_AVOID_GFX_ACCEL -- cgit v1.2.3-59-g8ed1b From 36b4ca01e5bf3b7ef683b5f2e2543c47f93225e8 Mon Sep 17 00:00:00 2001 From: Varun Shah Date: Tue, 10 Sep 2019 14:41:00 -0400 Subject: Use language tags to store Configuration's locale list. Instead of storing each Locale within a Configuration object's locale list by its language, country, variant, and script to proto, store the entire locale list by its language tags representation which accurately describes each locale. Bug: 140197723 Test: atest ConfigurationTest Test: atest UsageStatsDatabaseTest Test: manually with bad data Merged-In: I53946ed4e31de0ffe9c84875c391a7dec6f5375a Change-Id: Idaae690f79a5c680ad0059a52be62160d9dfb5e7 --- core/java/android/content/res/Configuration.java | 11 ++- core/java/android/os/LocaleList.java | 22 ------ core/proto/android/content/configuration.proto | 3 +- core/proto/android/content/locale.proto | 1 + .../src/android/content/res/ConfigurationTest.java | 79 ++++++++++++++++++++++ 5 files changed, 92 insertions(+), 24 deletions(-) diff --git a/core/java/android/content/res/Configuration.java b/core/java/android/content/res/Configuration.java index 861ae7ba122e..1abfe7000221 100644 --- a/core/java/android/content/res/Configuration.java +++ b/core/java/android/content/res/Configuration.java @@ -23,6 +23,7 @@ import static android.content.ConfigurationProto.HARD_KEYBOARD_HIDDEN; import static android.content.ConfigurationProto.KEYBOARD; import static android.content.ConfigurationProto.KEYBOARD_HIDDEN; import static android.content.ConfigurationProto.LOCALES; +import static android.content.ConfigurationProto.LOCALE_LIST; import static android.content.ConfigurationProto.MCC; import static android.content.ConfigurationProto.MNC; import static android.content.ConfigurationProto.NAVIGATION; @@ -1111,7 +1112,7 @@ public final class Configuration implements Parcelable, Comparable Date: Mon, 30 Dec 2019 18:46:25 +0000 Subject: Revert "Use language tags to store Configuration's locale list." This reverts commit 36b4ca01e5bf3b7ef683b5f2e2543c47f93225e8. Reason for revert: b/146167276 Change-Id: Id13579ba2282eedecadb84411408b76efea3d4fa --- core/java/android/content/res/Configuration.java | 11 +-- core/java/android/os/LocaleList.java | 22 ++++++ core/proto/android/content/configuration.proto | 3 +- core/proto/android/content/locale.proto | 1 - .../src/android/content/res/ConfigurationTest.java | 79 ---------------------- 5 files changed, 24 insertions(+), 92 deletions(-) diff --git a/core/java/android/content/res/Configuration.java b/core/java/android/content/res/Configuration.java index 1abfe7000221..861ae7ba122e 100644 --- a/core/java/android/content/res/Configuration.java +++ b/core/java/android/content/res/Configuration.java @@ -23,7 +23,6 @@ import static android.content.ConfigurationProto.HARD_KEYBOARD_HIDDEN; import static android.content.ConfigurationProto.KEYBOARD; import static android.content.ConfigurationProto.KEYBOARD_HIDDEN; import static android.content.ConfigurationProto.LOCALES; -import static android.content.ConfigurationProto.LOCALE_LIST; import static android.content.ConfigurationProto.MCC; import static android.content.ConfigurationProto.MNC; import static android.content.ConfigurationProto.NAVIGATION; @@ -1112,7 +1111,7 @@ public final class Configuration implements Parcelable, Comparable Date: Fri, 20 Dec 2019 16:33:46 +0900 Subject: Add minOccurs="0" For privapp-permissions and oem-permissions elements, some xml files don't need to permission and deny-permission properties. So add the minOccurs="0" for these elements. Test: vts-tradefed run vts -m VtsValidatePermission Bug: 143251304 Change-Id: Ib93a40e646f9c65bd62d23396c12ea31f2d735d8 Merged-In: Ib93a40e646f9c65bd62d23396c12ea31f2d735d8 (cherry picked from commit 33bca5b12b4df831cbd787374cf7d6be7fc362a9) --- core/xsd/permission.xsd | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/xsd/permission.xsd b/core/xsd/permission.xsd index 9520db767350..cc01a31224bc 100644 --- a/core/xsd/permission.xsd +++ b/core/xsd/permission.xsd @@ -126,12 +126,12 @@ - + - + @@ -141,12 +141,12 @@ - + - + -- cgit v1.2.3-59-g8ed1b From 61fbb72c8f2cbd9fa0611ae54749666debc99923 Mon Sep 17 00:00:00 2001 From: Mark Hong Date: Fri, 10 Jan 2020 10:20:45 -0800 Subject: Apply proper displayCutout rotation in density 480 dpi and 270 degrees rotation. In case device has 480 dpi and rotating the degrees then shortSizeDp value is less than 480 because of diaplay cutout. So ScreenLayoutSize will not be properly set and there is difference in between expectedScreenLayout and actualScreenLayout. In order to fix this issue, displayCutout should also be rotated while in calculating reduceConfigLayout. Bug: b/147473991 Test: run cts-on-gsi -m CtsDpiTestCases -t android.dpi.cts.ConfigurationScreenLayyoutTest#testScreenLayout Change-Id: Ie3d615e494cb3fd21f4388e969e5e637860b86ac Signed-off-by: Mark Hong --- .../java/com/android/server/wm/DisplayContent.java | 45 +++++++++++----------- 1 file changed, 23 insertions(+), 22 deletions(-) mode change 100644 => 100755 services/core/java/com/android/server/wm/DisplayContent.java diff --git a/services/core/java/com/android/server/wm/DisplayContent.java b/services/core/java/com/android/server/wm/DisplayContent.java old mode 100644 new mode 100755 index b837d9ec874b..771fb12cc0fb --- a/services/core/java/com/android/server/wm/DisplayContent.java +++ b/services/core/java/com/android/server/wm/DisplayContent.java @@ -338,7 +338,7 @@ class DisplayContent extends WindowContainer Date: Thu, 28 Nov 2019 16:33:39 +0200 Subject: Fix CtsShortcutHostTestCases#testSecondaryUser This patch uses Instrumentation parameter inside getDefaultLauncher function to obtain user ID from it and get default launcher namely for that user as setDefaultLauncher function sets launcher for the user from Instrumentation context. This fixes incorrect launcher settings for the cases that use two sequential calls to get/set default launcher. Bug: 145774461 Test: run cts -m CtsShortcutHostTestCases -t \ android.content.pm.cts.shortcuthost.ShortcutManagerMultiuserTest#testSecondaryUser Signed-off-by: Sergii Iegorov Change-Id: I8941f5648ad783c7681fdb56677e855756db957d --- .../server/pm/shortcutmanagertest/ShortcutManagerTestUtils.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/services/tests/shortcutmanagerutils/src/com/android/server/pm/shortcutmanagertest/ShortcutManagerTestUtils.java b/services/tests/shortcutmanagerutils/src/com/android/server/pm/shortcutmanagertest/ShortcutManagerTestUtils.java index 2077ecb2799e..96c69af036b6 100644 --- a/services/tests/shortcutmanagerutils/src/com/android/server/pm/shortcutmanagertest/ShortcutManagerTestUtils.java +++ b/services/tests/shortcutmanagerutils/src/com/android/server/pm/shortcutmanagertest/ShortcutManagerTestUtils.java @@ -197,7 +197,8 @@ public class ShortcutManagerTestUtils { final String PREFIX = "Launcher: ComponentInfo{"; final String POSTFIX = "}"; final List result = runShortcutCommandForSuccess( - instrumentation, "get-default-launcher"); + instrumentation, "get-default-launcher --user " + + instrumentation.getContext().getUserId()); for (String s : result) { if (s.startsWith(PREFIX) && s.endsWith(POSTFIX)) { return s.substring(PREFIX.length(), s.length() - POSTFIX.length()); -- cgit v1.2.3-59-g8ed1b From ab50cb425adac7e4e461dcc43840c32185e0457f Mon Sep 17 00:00:00 2001 From: Remi NGUYEN VAN Date: Wed, 23 Sep 2020 17:03:33 +0900 Subject: Remove unused testutils lib from tethering tests frameworks-base-testutils is unused in tethering integration tests, so the dependency can be removed. That test library also contains test classes, so removing the dependency allows tethering tests to stop running the associated tests. Also add jarjar rules to the unit tests to zap (remove) the test classes from the output APK. Ideally the unit tests should stop depending on that library too (TestableLooper can be used instead of TestLooper), or the frameworks-base-testutils library should stop including test classes. Bug: 167968946 Test: m CtsTetheringTest TetheringTests Change-Id: Ie950ce5b6181e388a7f71da430fd2dd8ada32e49 (cherry picked from commit daed646e47b2095941318da4cbd92befad77e991) --- packages/Tethering/tests/integration/Android.bp | 1 - packages/Tethering/tests/unit/jarjar-rules.txt | 5 +++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/Tethering/tests/integration/Android.bp b/packages/Tethering/tests/integration/Android.bp index ed69b7d63cb4..02bab9ba353e 100644 --- a/packages/Tethering/tests/integration/Android.bp +++ b/packages/Tethering/tests/integration/Android.bp @@ -22,7 +22,6 @@ java_defaults { static_libs: [ "NetworkStackApiStableLib", "androidx.test.rules", - "frameworks-base-testutils", "mockito-target-extended-minus-junit4", "net-tests-utils", "testables", diff --git a/packages/Tethering/tests/unit/jarjar-rules.txt b/packages/Tethering/tests/unit/jarjar-rules.txt index ec2d2b02004e..7ed89632a861 100644 --- a/packages/Tethering/tests/unit/jarjar-rules.txt +++ b/packages/Tethering/tests/unit/jarjar-rules.txt @@ -9,3 +9,8 @@ rule com.android.internal.util.StateMachine* com.android.networkstack.tethering. rule com.android.internal.util.TrafficStatsConstants* com.android.networkstack.tethering.util.TrafficStatsConstants@1 rule android.util.LocalLog* com.android.networkstack.tethering.util.LocalLog@1 + +# TODO: either stop using frameworks-base-testutils or remove the unit test classes it contains. +# TestableLooper from "testables" can be used instead of TestLooper from frameworks-base-testutils. +zap android.os.test.TestLooperTest* +zap com.android.test.filters.SelectTestTests* \ No newline at end of file -- cgit v1.2.3-59-g8ed1b From a0ad166be6c2b13e419a151fd57d90e9de2ed13a Mon Sep 17 00:00:00 2001 From: Rahul Sabnis Date: Mon, 21 Sep 2020 20:50:10 -0700 Subject: Move all BluetoothCodecConfig and BluetoothCodecStatus APIs moved from the non-SDK API list to the blocklist in Android 11 back to the non-SDK API list. Tag: #feature Bug: 168812851 Test: atest BluetoothHostTest#testCodecMethodsAccessible Merged-In: I29983284b1a1c271d983c99b286e204604abdc72 Change-Id: I29983284b1a1c271d983c99b286e204604abdc72 --- .../android/bluetooth/BluetoothCodecConfig.java | 32 +++++++++++++++++++++- .../android/bluetooth/BluetoothCodecStatus.java | 5 ++++ 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/core/java/android/bluetooth/BluetoothCodecConfig.java b/core/java/android/bluetooth/BluetoothCodecConfig.java index d2a15357aa1f..735980beebb1 100644 --- a/core/java/android/bluetooth/BluetoothCodecConfig.java +++ b/core/java/android/bluetooth/BluetoothCodecConfig.java @@ -51,19 +51,25 @@ public final class BluetoothCodecConfig implements Parcelable { @Retention(RetentionPolicy.SOURCE) public @interface SourceCodecType {} + @UnsupportedAppUsage public static final int SOURCE_CODEC_TYPE_SBC = 0; + @UnsupportedAppUsage public static final int SOURCE_CODEC_TYPE_AAC = 1; + @UnsupportedAppUsage public static final int SOURCE_CODEC_TYPE_APTX = 2; + @UnsupportedAppUsage public static final int SOURCE_CODEC_TYPE_APTX_HD = 3; + @UnsupportedAppUsage public static final int SOURCE_CODEC_TYPE_LDAC = 4; + @UnsupportedAppUsage public static final int SOURCE_CODEC_TYPE_MAX = 5; - + @UnsupportedAppUsage public static final int SOURCE_CODEC_TYPE_INVALID = 1000 * 1000; /** @hide */ @@ -75,10 +81,13 @@ public final class BluetoothCodecConfig implements Parcelable { @Retention(RetentionPolicy.SOURCE) public @interface CodecPriority {} + @UnsupportedAppUsage public static final int CODEC_PRIORITY_DISABLED = -1; + @UnsupportedAppUsage public static final int CODEC_PRIORITY_DEFAULT = 0; + @UnsupportedAppUsage public static final int CODEC_PRIORITY_HIGHEST = 1000 * 1000; @@ -95,18 +104,25 @@ public final class BluetoothCodecConfig implements Parcelable { @Retention(RetentionPolicy.SOURCE) public @interface SampleRate {} + @UnsupportedAppUsage public static final int SAMPLE_RATE_NONE = 0; + @UnsupportedAppUsage public static final int SAMPLE_RATE_44100 = 0x1 << 0; + @UnsupportedAppUsage public static final int SAMPLE_RATE_48000 = 0x1 << 1; + @UnsupportedAppUsage public static final int SAMPLE_RATE_88200 = 0x1 << 2; + @UnsupportedAppUsage public static final int SAMPLE_RATE_96000 = 0x1 << 3; + @UnsupportedAppUsage public static final int SAMPLE_RATE_176400 = 0x1 << 4; + @UnsupportedAppUsage public static final int SAMPLE_RATE_192000 = 0x1 << 5; @@ -120,12 +136,16 @@ public final class BluetoothCodecConfig implements Parcelable { @Retention(RetentionPolicy.SOURCE) public @interface BitsPerSample {} + @UnsupportedAppUsage public static final int BITS_PER_SAMPLE_NONE = 0; + @UnsupportedAppUsage public static final int BITS_PER_SAMPLE_16 = 0x1 << 0; + @UnsupportedAppUsage public static final int BITS_PER_SAMPLE_24 = 0x1 << 1; + @UnsupportedAppUsage public static final int BITS_PER_SAMPLE_32 = 0x1 << 2; @@ -138,10 +158,13 @@ public final class BluetoothCodecConfig implements Parcelable { @Retention(RetentionPolicy.SOURCE) public @interface ChannelMode {} + @UnsupportedAppUsage public static final int CHANNEL_MODE_NONE = 0; + @UnsupportedAppUsage public static final int CHANNEL_MODE_MONO = 0x1 << 0; + @UnsupportedAppUsage public static final int CHANNEL_MODE_STEREO = 0x1 << 1; private final @SourceCodecType int mCodecType; @@ -154,6 +177,7 @@ public final class BluetoothCodecConfig implements Parcelable { private final long mCodecSpecific3; private final long mCodecSpecific4; + @UnsupportedAppUsage public BluetoothCodecConfig(@SourceCodecType int codecType, @CodecPriority int codecPriority, @SampleRate int sampleRate, @BitsPerSample int bitsPerSample, @ChannelMode int channelMode, long codecSpecific1, @@ -170,6 +194,7 @@ public final class BluetoothCodecConfig implements Parcelable { mCodecSpecific4 = codecSpecific4; } + @UnsupportedAppUsage public BluetoothCodecConfig(@SourceCodecType int codecType) { mCodecType = codecType; mCodecPriority = BluetoothCodecConfig.CODEC_PRIORITY_DEFAULT; @@ -391,6 +416,7 @@ public final class BluetoothCodecConfig implements Parcelable { * * @return the codec type */ + @UnsupportedAppUsage public @SourceCodecType int getCodecType() { return mCodecType; } @@ -411,6 +437,7 @@ public final class BluetoothCodecConfig implements Parcelable { * * @return the codec priority */ + @UnsupportedAppUsage public @CodecPriority int getCodecPriority() { return mCodecPriority; } @@ -441,6 +468,7 @@ public final class BluetoothCodecConfig implements Parcelable { * * @return the codec sample rate */ + @UnsupportedAppUsage public @SampleRate int getSampleRate() { return mSampleRate; } @@ -455,6 +483,7 @@ public final class BluetoothCodecConfig implements Parcelable { * * @return the codec bits per sample */ + @UnsupportedAppUsage public @BitsPerSample int getBitsPerSample() { return mBitsPerSample; } @@ -479,6 +508,7 @@ public final class BluetoothCodecConfig implements Parcelable { * * @return a codec specific value1. */ + @UnsupportedAppUsage public long getCodecSpecific1() { return mCodecSpecific1; } diff --git a/core/java/android/bluetooth/BluetoothCodecStatus.java b/core/java/android/bluetooth/BluetoothCodecStatus.java index 1e394b830d51..7b567b4098e7 100644 --- a/core/java/android/bluetooth/BluetoothCodecStatus.java +++ b/core/java/android/bluetooth/BluetoothCodecStatus.java @@ -17,6 +17,7 @@ package android.bluetooth; import android.annotation.Nullable; +import android.compat.annotation.UnsupportedAppUsage; import android.os.Parcel; import android.os.Parcelable; @@ -38,6 +39,7 @@ public final class BluetoothCodecStatus implements Parcelable { * This extra represents the current codec status of the A2DP * profile. */ + @UnsupportedAppUsage public static final String EXTRA_CODEC_STATUS = "android.bluetooth.extra.CODEC_STATUS"; @@ -196,6 +198,7 @@ public final class BluetoothCodecStatus implements Parcelable { * * @return the current codec configuration */ + @UnsupportedAppUsage public @Nullable BluetoothCodecConfig getCodecConfig() { return mCodecConfig; } @@ -205,6 +208,7 @@ public final class BluetoothCodecStatus implements Parcelable { * * @return an array with the codecs local capabilities */ + @UnsupportedAppUsage public @Nullable BluetoothCodecConfig[] getCodecsLocalCapabilities() { return mCodecsLocalCapabilities; } @@ -214,6 +218,7 @@ public final class BluetoothCodecStatus implements Parcelable { * * @return an array with the codecs selectable capabilities */ + @UnsupportedAppUsage public @Nullable BluetoothCodecConfig[] getCodecsSelectableCapabilities() { return mCodecsSelectableCapabilities; } -- cgit v1.2.3-59-g8ed1b From 04ad6171ca9ad2d81fb0e04329b697d3af55fe39 Mon Sep 17 00:00:00 2001 From: Rahul Sabnis Date: Mon, 5 Oct 2020 18:35:54 +0000 Subject: Revert "Move all BluetoothCodecConfig and BluetoothCodecStatus APIs moved from" This reverts commit a0ad166be6c2b13e419a151fd57d90e9de2ed13a. Reason for revert: Causes CTS failures (hidden api list) Change-Id: I6612173e25ac81d3324155aacdb749ea461d5c9b --- .../android/bluetooth/BluetoothCodecConfig.java | 32 +--------------------- .../android/bluetooth/BluetoothCodecStatus.java | 5 ---- 2 files changed, 1 insertion(+), 36 deletions(-) diff --git a/core/java/android/bluetooth/BluetoothCodecConfig.java b/core/java/android/bluetooth/BluetoothCodecConfig.java index 735980beebb1..d2a15357aa1f 100644 --- a/core/java/android/bluetooth/BluetoothCodecConfig.java +++ b/core/java/android/bluetooth/BluetoothCodecConfig.java @@ -51,25 +51,19 @@ public final class BluetoothCodecConfig implements Parcelable { @Retention(RetentionPolicy.SOURCE) public @interface SourceCodecType {} - @UnsupportedAppUsage public static final int SOURCE_CODEC_TYPE_SBC = 0; - @UnsupportedAppUsage public static final int SOURCE_CODEC_TYPE_AAC = 1; - @UnsupportedAppUsage public static final int SOURCE_CODEC_TYPE_APTX = 2; - @UnsupportedAppUsage public static final int SOURCE_CODEC_TYPE_APTX_HD = 3; - @UnsupportedAppUsage public static final int SOURCE_CODEC_TYPE_LDAC = 4; - @UnsupportedAppUsage public static final int SOURCE_CODEC_TYPE_MAX = 5; - @UnsupportedAppUsage + public static final int SOURCE_CODEC_TYPE_INVALID = 1000 * 1000; /** @hide */ @@ -81,13 +75,10 @@ public final class BluetoothCodecConfig implements Parcelable { @Retention(RetentionPolicy.SOURCE) public @interface CodecPriority {} - @UnsupportedAppUsage public static final int CODEC_PRIORITY_DISABLED = -1; - @UnsupportedAppUsage public static final int CODEC_PRIORITY_DEFAULT = 0; - @UnsupportedAppUsage public static final int CODEC_PRIORITY_HIGHEST = 1000 * 1000; @@ -104,25 +95,18 @@ public final class BluetoothCodecConfig implements Parcelable { @Retention(RetentionPolicy.SOURCE) public @interface SampleRate {} - @UnsupportedAppUsage public static final int SAMPLE_RATE_NONE = 0; - @UnsupportedAppUsage public static final int SAMPLE_RATE_44100 = 0x1 << 0; - @UnsupportedAppUsage public static final int SAMPLE_RATE_48000 = 0x1 << 1; - @UnsupportedAppUsage public static final int SAMPLE_RATE_88200 = 0x1 << 2; - @UnsupportedAppUsage public static final int SAMPLE_RATE_96000 = 0x1 << 3; - @UnsupportedAppUsage public static final int SAMPLE_RATE_176400 = 0x1 << 4; - @UnsupportedAppUsage public static final int SAMPLE_RATE_192000 = 0x1 << 5; @@ -136,16 +120,12 @@ public final class BluetoothCodecConfig implements Parcelable { @Retention(RetentionPolicy.SOURCE) public @interface BitsPerSample {} - @UnsupportedAppUsage public static final int BITS_PER_SAMPLE_NONE = 0; - @UnsupportedAppUsage public static final int BITS_PER_SAMPLE_16 = 0x1 << 0; - @UnsupportedAppUsage public static final int BITS_PER_SAMPLE_24 = 0x1 << 1; - @UnsupportedAppUsage public static final int BITS_PER_SAMPLE_32 = 0x1 << 2; @@ -158,13 +138,10 @@ public final class BluetoothCodecConfig implements Parcelable { @Retention(RetentionPolicy.SOURCE) public @interface ChannelMode {} - @UnsupportedAppUsage public static final int CHANNEL_MODE_NONE = 0; - @UnsupportedAppUsage public static final int CHANNEL_MODE_MONO = 0x1 << 0; - @UnsupportedAppUsage public static final int CHANNEL_MODE_STEREO = 0x1 << 1; private final @SourceCodecType int mCodecType; @@ -177,7 +154,6 @@ public final class BluetoothCodecConfig implements Parcelable { private final long mCodecSpecific3; private final long mCodecSpecific4; - @UnsupportedAppUsage public BluetoothCodecConfig(@SourceCodecType int codecType, @CodecPriority int codecPriority, @SampleRate int sampleRate, @BitsPerSample int bitsPerSample, @ChannelMode int channelMode, long codecSpecific1, @@ -194,7 +170,6 @@ public final class BluetoothCodecConfig implements Parcelable { mCodecSpecific4 = codecSpecific4; } - @UnsupportedAppUsage public BluetoothCodecConfig(@SourceCodecType int codecType) { mCodecType = codecType; mCodecPriority = BluetoothCodecConfig.CODEC_PRIORITY_DEFAULT; @@ -416,7 +391,6 @@ public final class BluetoothCodecConfig implements Parcelable { * * @return the codec type */ - @UnsupportedAppUsage public @SourceCodecType int getCodecType() { return mCodecType; } @@ -437,7 +411,6 @@ public final class BluetoothCodecConfig implements Parcelable { * * @return the codec priority */ - @UnsupportedAppUsage public @CodecPriority int getCodecPriority() { return mCodecPriority; } @@ -468,7 +441,6 @@ public final class BluetoothCodecConfig implements Parcelable { * * @return the codec sample rate */ - @UnsupportedAppUsage public @SampleRate int getSampleRate() { return mSampleRate; } @@ -483,7 +455,6 @@ public final class BluetoothCodecConfig implements Parcelable { * * @return the codec bits per sample */ - @UnsupportedAppUsage public @BitsPerSample int getBitsPerSample() { return mBitsPerSample; } @@ -508,7 +479,6 @@ public final class BluetoothCodecConfig implements Parcelable { * * @return a codec specific value1. */ - @UnsupportedAppUsage public long getCodecSpecific1() { return mCodecSpecific1; } diff --git a/core/java/android/bluetooth/BluetoothCodecStatus.java b/core/java/android/bluetooth/BluetoothCodecStatus.java index 7b567b4098e7..1e394b830d51 100644 --- a/core/java/android/bluetooth/BluetoothCodecStatus.java +++ b/core/java/android/bluetooth/BluetoothCodecStatus.java @@ -17,7 +17,6 @@ package android.bluetooth; import android.annotation.Nullable; -import android.compat.annotation.UnsupportedAppUsage; import android.os.Parcel; import android.os.Parcelable; @@ -39,7 +38,6 @@ public final class BluetoothCodecStatus implements Parcelable { * This extra represents the current codec status of the A2DP * profile. */ - @UnsupportedAppUsage public static final String EXTRA_CODEC_STATUS = "android.bluetooth.extra.CODEC_STATUS"; @@ -198,7 +196,6 @@ public final class BluetoothCodecStatus implements Parcelable { * * @return the current codec configuration */ - @UnsupportedAppUsage public @Nullable BluetoothCodecConfig getCodecConfig() { return mCodecConfig; } @@ -208,7 +205,6 @@ public final class BluetoothCodecStatus implements Parcelable { * * @return an array with the codecs local capabilities */ - @UnsupportedAppUsage public @Nullable BluetoothCodecConfig[] getCodecsLocalCapabilities() { return mCodecsLocalCapabilities; } @@ -218,7 +214,6 @@ public final class BluetoothCodecStatus implements Parcelable { * * @return an array with the codecs selectable capabilities */ - @UnsupportedAppUsage public @Nullable BluetoothCodecConfig[] getCodecsSelectableCapabilities() { return mCodecsSelectableCapabilities; } -- cgit v1.2.3-59-g8ed1b From a777944a5eb8fc8bd783ad51001a76420333df39 Mon Sep 17 00:00:00 2001 From: Charles Lin Date: Mon, 28 Dec 2020 09:11:27 +0000 Subject: mkdir .incomplete in backing storage to fix CTS/GTS failures Linux kernel included a commit 17efe505a4c3df88d3e13051f421d27d7178d47f that creates .incomplete folder on mounting incfs. However .incomplete folder is only accessible for root with 0700 permission. So system_server has no permission to access it. By creating .incomplete folder with 0777 permission in system_server, incfs won't have to create incomplete folder implicitly. Bug: 176400491 Test: CtsIncrementalInstallHostTestCases CtsContentTestCases android.content.pm.cts.PackageManagerShellCommandIncrementalTest CtsStatsdHostTestCases android.cts.statsd.atom.UidAtomTests#testPackageInstallerV2MetricsReported GtsIncrementalInstallProxyHostTestCases Change-Id: Icb7babe3b482a089019f981fe149de7d619ce87e --- services/incremental/IncrementalService.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/services/incremental/IncrementalService.cpp b/services/incremental/IncrementalService.cpp index a5f0d045948c..338ede283e1a 100644 --- a/services/incremental/IncrementalService.cpp +++ b/services/incremental/IncrementalService.cpp @@ -476,6 +476,9 @@ StorageId IncrementalService::createStorage(std::string_view mountPoint, if (!mkdirOrLog(path::join(backing, ".index"), 0777)) { return kInvalidStorageId; } + if (!mkdirOrLog(path::join(backing, ".incomplete"), 0777)) { + return kInvalidStorageId; + } auto status = mVold->mountIncFs(backing, mountTarget, 0, &controlParcel); if (!status.isOk()) { LOG(ERROR) << "Vold::mountIncFs() failed: " << status.toString8(); -- cgit v1.2.3-59-g8ed1b From e7ddd1650d811638cd8f12b6c73e3734ecc7e835 Mon Sep 17 00:00:00 2001 From: N Harish Date: Mon, 25 Jan 2021 17:22:33 +0530 Subject: Fix for TestDirectBootEmulated testcase In case of emulated FBE the secrets are empty hence add this exception to prevent from unlocking userkey. Bug: 177617301 Test: android.appsecurity.cts.DirectBootHostTest#testDirectBootEmulated Change-Id: I5be2ceb61d9ef47219862e75cc8ec03ab5513426 --- services/core/java/com/android/server/StorageManagerService.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/services/core/java/com/android/server/StorageManagerService.java b/services/core/java/com/android/server/StorageManagerService.java index 678387c540ed..42b821226c49 100644 --- a/services/core/java/com/android/server/StorageManagerService.java +++ b/services/core/java/com/android/server/StorageManagerService.java @@ -3294,6 +3294,12 @@ class StorageManagerService extends IStorageManager.Stub enforcePermission(android.Manifest.permission.STORAGE_INTERNAL); if (isFsEncrypted) { + // When a user has secure lock screen, require secret to actually unlock. + // This check is mostly in place for emulation mode. + if (StorageManager.isFileEncryptedEmulatedOnly() && + mLockPatternUtils.isSecure(userId) && ArrayUtils.isEmpty(secret)) { + throw new IllegalStateException("Secret required to unlock secure user " + userId); + } try { mVold.unlockUserKey(userId, serialNumber, encodeBytes(token), encodeBytes(secret)); -- cgit v1.2.3-59-g8ed1b From eea1d5bd5887b2b92a72e66c62d89bb8f2eb04cc Mon Sep 17 00:00:00 2001 From: Jeffrey Huang Date: Wed, 4 Aug 2021 13:33:34 -0700 Subject: [DO NOT MERGE]Update stats_log.proto for cts backfill This change is necessary to build the new tests Bug: 193167534 Test: atest CtsStatsdHostTestCases Change-Id: I25096ca878976a781aca66ee6dbfce2a0ea9dd12 --- cmds/statsd/src/stats_log.proto | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/cmds/statsd/src/stats_log.proto b/cmds/statsd/src/stats_log.proto index ddd2725c9cb9..fcc6b653387e 100644 --- a/cmds/statsd/src/stats_log.proto +++ b/cmds/statsd/src/stats_log.proto @@ -50,12 +50,20 @@ message StateValue { } } +message AggregatedAtomInfo { + optional Atom atom = 1; + + repeated int64 elapsed_timestamp_nanos = 2; +} + message EventMetricData { optional int64 elapsed_timestamp_nanos = 1; optional Atom atom = 2; optional int64 wall_clock_timestamp_nanos = 3 [deprecated = true]; + + optional AggregatedAtomInfo aggregated_atom_info = 4; } message CountBucketInfo { @@ -176,6 +184,8 @@ message GaugeBucketInfo { optional int64 start_bucket_elapsed_millis = 7; optional int64 end_bucket_elapsed_millis = 8; + + repeated AggregatedAtomInfo aggregated_atom_info = 9; } message GaugeMetricData { -- cgit v1.2.3-59-g8ed1b From 8b7d0353dd401703e98c0a7ac2326aab5d4bd4fb Mon Sep 17 00:00:00 2001 From: Tej Singh Date: Fri, 3 Sep 2021 16:55:05 -0700 Subject: [RESTRICT AUTOMERGE] Proto changes to update app upgade CTS Updates statsd config proto to have the new fields to split buckets for app ugprade. This is only needed to make CTS compile. Test: TH Bug: 195601319 Change-Id: I7efe20ec0bab1cf48223beca11f44d1653758603 --- cmds/statsd/src/statsd_config.proto | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cmds/statsd/src/statsd_config.proto b/cmds/statsd/src/statsd_config.proto index acdffd3d4712..d3279715ad35 100644 --- a/cmds/statsd/src/statsd_config.proto +++ b/cmds/statsd/src/statsd_config.proto @@ -220,6 +220,8 @@ message CountMetric { repeated MetricStateLink state_link = 9; + optional bool split_bucket_for_app_upgrade = 11; + optional FieldMatcher dimensions_in_condition = 7 [deprecated = true]; reserved 100; @@ -250,6 +252,8 @@ message DurationMetric { optional TimeUnit bucket = 7; + optional bool split_bucket_for_app_upgrade = 12; + optional FieldMatcher dimensions_in_condition = 8 [deprecated = true]; reserved 100; @@ -289,7 +293,7 @@ message GaugeMetric { optional int32 max_pull_delay_sec = 13 [default = 30]; - optional bool split_bucket_for_app_upgrade = 14 [default = true]; + optional bool split_bucket_for_app_upgrade = 14; reserved 100; reserved 101; @@ -342,7 +346,7 @@ message ValueMetric { optional int32 max_pull_delay_sec = 16 [default = 30]; - optional bool split_bucket_for_app_upgrade = 17 [default = true]; + optional bool split_bucket_for_app_upgrade = 17; optional FieldMatcher dimensions_in_condition = 9 [deprecated = true]; -- cgit v1.2.3-59-g8ed1b From 9079767fca154f9d15644d22f41dd9d2a33423b3 Mon Sep 17 00:00:00 2001 From: Tej Singh Date: Tue, 14 Sep 2021 19:12:03 -0700 Subject: [RESTRICT AUTOMERGE] Revert split bucket app upgrade default to true On r and s-based branches, the default should be true. Bug: 199806881 Test: TH Change-Id: I4958d6b845b278e4865e087536c2089b028603ca --- cmds/statsd/src/statsd_config.proto | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cmds/statsd/src/statsd_config.proto b/cmds/statsd/src/statsd_config.proto index d3279715ad35..d19147dab1d4 100644 --- a/cmds/statsd/src/statsd_config.proto +++ b/cmds/statsd/src/statsd_config.proto @@ -220,7 +220,7 @@ message CountMetric { repeated MetricStateLink state_link = 9; - optional bool split_bucket_for_app_upgrade = 11; + optional bool split_bucket_for_app_upgrade = 11 [default = true]; optional FieldMatcher dimensions_in_condition = 7 [deprecated = true]; @@ -252,7 +252,7 @@ message DurationMetric { optional TimeUnit bucket = 7; - optional bool split_bucket_for_app_upgrade = 12; + optional bool split_bucket_for_app_upgrade = 12 [default = true]; optional FieldMatcher dimensions_in_condition = 8 [deprecated = true]; @@ -293,7 +293,7 @@ message GaugeMetric { optional int32 max_pull_delay_sec = 13 [default = 30]; - optional bool split_bucket_for_app_upgrade = 14; + optional bool split_bucket_for_app_upgrade = 14 [default = true]; reserved 100; reserved 101; @@ -346,7 +346,7 @@ message ValueMetric { optional int32 max_pull_delay_sec = 16 [default = 30]; - optional bool split_bucket_for_app_upgrade = 17; + optional bool split_bucket_for_app_upgrade = 17 [default = true]; optional FieldMatcher dimensions_in_condition = 9 [deprecated = true]; -- cgit v1.2.3-59-g8ed1b From 7b9c7427b0eb08baa0bf0186e0a1388e5de064c4 Mon Sep 17 00:00:00 2001 From: tomnatan Date: Tue, 19 Oct 2021 13:16:47 +0000 Subject: Add the min aspect ratio to ActivityRecordProto and populate it This is needed for CompatChangeTests to verify that the min aspect ratio is applied directly by checking the min aspect ratio. Bug: 203541827 Test: N/A Change-Id: I1736cd4a2c4a1c5857796fa9772def7b7d94ba33 Merged-In: I1736cd4a2c4a1c5857796fa9772def7b7d94ba33 --- core/proto/android/server/windowmanagerservice.proto | 1 + services/core/java/com/android/server/wm/ActivityRecord.java | 2 ++ 2 files changed, 3 insertions(+) diff --git a/core/proto/android/server/windowmanagerservice.proto b/core/proto/android/server/windowmanagerservice.proto index fa1e9d4afcdf..a62ddd084aab 100644 --- a/core/proto/android/server/windowmanagerservice.proto +++ b/core/proto/android/server/windowmanagerservice.proto @@ -351,6 +351,7 @@ message ActivityRecordProto { optional bool translucent = 30; optional bool pip_auto_enter_enabled = 31; optional bool in_size_compat_mode = 32; + optional float min_aspect_ratio = 33; } /* represents WindowToken */ diff --git a/services/core/java/com/android/server/wm/ActivityRecord.java b/services/core/java/com/android/server/wm/ActivityRecord.java index 308df2f4e9a0..c12721080740 100644 --- a/services/core/java/com/android/server/wm/ActivityRecord.java +++ b/services/core/java/com/android/server/wm/ActivityRecord.java @@ -140,6 +140,7 @@ import static com.android.server.wm.ActivityRecordProto.IS_ANIMATING; import static com.android.server.wm.ActivityRecordProto.IS_WAITING_FOR_TRANSITION_START; import static com.android.server.wm.ActivityRecordProto.LAST_ALL_DRAWN; import static com.android.server.wm.ActivityRecordProto.LAST_SURFACE_SHOWING; +import static com.android.server.wm.ActivityRecordProto.MIN_ASPECT_RATIO; import static com.android.server.wm.ActivityRecordProto.NAME; import static com.android.server.wm.ActivityRecordProto.NUM_DRAWN_WINDOWS; import static com.android.server.wm.ActivityRecordProto.NUM_INTERESTING_WINDOWS; @@ -8641,6 +8642,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A } proto.write(PIP_AUTO_ENTER_ENABLED, pictureInPictureArgs.isAutoEnterEnabled()); proto.write(IN_SIZE_COMPAT_MODE, inSizeCompatMode()); + proto.write(MIN_ASPECT_RATIO, info.getMinAspectRatio()); } @Override -- cgit v1.2.3-59-g8ed1b From d22dc839f9000edf81c76424ea1a11d17c3de430 Mon Sep 17 00:00:00 2001 From: Tom Natan Date: Thu, 11 Nov 2021 11:32:49 +0000 Subject: Revert "Add the min aspect ratio to ActivityRecordProto and popu..." Revert submission 1876197-propagate_min_aspect_ratio Reason for revert: can't cherry pick framework change to this branch Reverted Changes: I023989da5:Use the min aspect ratio from ActivityRecordProto ... I1736cd4a2:Add the min aspect ratio to ActivityRecordProto an... Change-Id: I5840267bd2cf71234597da4dad09f7a7dd8e7a2c --- core/proto/android/server/windowmanagerservice.proto | 1 - services/core/java/com/android/server/wm/ActivityRecord.java | 2 -- 2 files changed, 3 deletions(-) diff --git a/core/proto/android/server/windowmanagerservice.proto b/core/proto/android/server/windowmanagerservice.proto index a62ddd084aab..fa1e9d4afcdf 100644 --- a/core/proto/android/server/windowmanagerservice.proto +++ b/core/proto/android/server/windowmanagerservice.proto @@ -351,7 +351,6 @@ message ActivityRecordProto { optional bool translucent = 30; optional bool pip_auto_enter_enabled = 31; optional bool in_size_compat_mode = 32; - optional float min_aspect_ratio = 33; } /* represents WindowToken */ diff --git a/services/core/java/com/android/server/wm/ActivityRecord.java b/services/core/java/com/android/server/wm/ActivityRecord.java index c12721080740..308df2f4e9a0 100644 --- a/services/core/java/com/android/server/wm/ActivityRecord.java +++ b/services/core/java/com/android/server/wm/ActivityRecord.java @@ -140,7 +140,6 @@ import static com.android.server.wm.ActivityRecordProto.IS_ANIMATING; import static com.android.server.wm.ActivityRecordProto.IS_WAITING_FOR_TRANSITION_START; import static com.android.server.wm.ActivityRecordProto.LAST_ALL_DRAWN; import static com.android.server.wm.ActivityRecordProto.LAST_SURFACE_SHOWING; -import static com.android.server.wm.ActivityRecordProto.MIN_ASPECT_RATIO; import static com.android.server.wm.ActivityRecordProto.NAME; import static com.android.server.wm.ActivityRecordProto.NUM_DRAWN_WINDOWS; import static com.android.server.wm.ActivityRecordProto.NUM_INTERESTING_WINDOWS; @@ -8642,7 +8641,6 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A } proto.write(PIP_AUTO_ENTER_ENABLED, pictureInPictureArgs.isAutoEnterEnabled()); proto.write(IN_SIZE_COMPAT_MODE, inSizeCompatMode()); - proto.write(MIN_ASPECT_RATIO, info.getMinAspectRatio()); } @Override -- cgit v1.2.3-59-g8ed1b From 269f49d9b852fd4ed6762dec16bdf8af9f751b96 Mon Sep 17 00:00:00 2001 From: JianYang Liu Date: Fri, 26 Jun 2020 14:18:11 -0700 Subject: Added systemui controller to control system bars. When config_remoteInsetsControllerControlsSystemBars is true, DisplaySystemBarsController provides its own policy of how system bars are displayed for specific packages. Currently limited to only auto versions of Android. Bug: 149585273 Test: Manual, atest BarControlPolicyTest, atest InsetsPolicyTest, atest DisplaySystemBarsControllerTest Change-Id: Ie6b1cc3e2760cbc9e48d62dfbd8bc3e23ffca20c Merged-In: Ie6b1cc3e2760cbc9e48d62dfbd8bc3e23ffca20c --- api/test-current.txt | 1 + .../view/IDisplayWindowInsetsController.aidl | 7 + core/java/android/view/IWindowManager.aidl | 10 - core/res/res/values/config.xml | 15 +- core/res/res/values/public.xml | 2 + core/res/res/values/symbols.xml | 2 +- .../com/android/systemui/CarSystemUIModule.java | 6 + .../com/android/systemui/wm/BarControlPolicy.java | 250 +++++++++++++++++++++ .../systemui/wm/DisplaySystemBarsController.java | 168 ++++++++++++++ .../wm/DisplaySystemBarsInsetsControllerHost.java | 173 ++++++++++++++ .../android/systemui/wm/BarControlPolicyTest.java | 195 ++++++++++++++++ .../wm/DisplaySystemBarsControllerTest.java | 111 +++++++++ .../android/systemui/wm/DisplayImeController.java | 5 + .../java/com/android/server/wm/DisplayContent.java | 13 ++ .../java/com/android/server/wm/DisplayPolicy.java | 24 +- .../java/com/android/server/wm/InsetsPolicy.java | 58 ++++- .../android/server/wm/WindowManagerService.java | 21 -- .../com/android/server/wm/DisplayContentTests.java | 25 --- .../server/wm/DisplayPolicyLayoutTests.java | 22 -- .../com/android/server/wm/InsetsPolicyTest.java | 5 +- .../server/wm/WindowManagerServiceTests.java | 18 -- .../src/com/android/server/wm/WindowTestsBase.java | 32 ++- 22 files changed, 1034 insertions(+), 129 deletions(-) create mode 100644 packages/CarSystemUI/src/com/android/systemui/wm/BarControlPolicy.java create mode 100644 packages/CarSystemUI/src/com/android/systemui/wm/DisplaySystemBarsController.java create mode 100644 packages/CarSystemUI/src/com/android/systemui/wm/DisplaySystemBarsInsetsControllerHost.java create mode 100644 packages/CarSystemUI/tests/src/com/android/systemui/wm/BarControlPolicyTest.java create mode 100644 packages/CarSystemUI/tests/src/com/android/systemui/wm/DisplaySystemBarsControllerTest.java diff --git a/api/test-current.txt b/api/test-current.txt index 3838bad57aa7..cf97b848e80b 100644 --- a/api/test-current.txt +++ b/api/test-current.txt @@ -34,6 +34,7 @@ package android { public static final class R.bool { field public static final int config_assistantOnTopOfDream = 17891333; // 0x1110005 field public static final int config_perDisplayFocusEnabled = 17891332; // 0x1110004 + field public static final int config_remoteInsetsControllerControlsSystemBars = 17891334; // 0x1110006 } public static final class R.string { diff --git a/core/java/android/view/IDisplayWindowInsetsController.aidl b/core/java/android/view/IDisplayWindowInsetsController.aidl index 429c3aeba9b3..a0d4a6587bcf 100644 --- a/core/java/android/view/IDisplayWindowInsetsController.aidl +++ b/core/java/android/view/IDisplayWindowInsetsController.aidl @@ -26,6 +26,13 @@ import android.view.InsetsState; */ oneway interface IDisplayWindowInsetsController { + /** + * Called when top focused window changes to determine whether or not to take over insets + * control. Won't be called if config_remoteInsetsControllerControlsSystemBars is false. + * @param packageName: Passes the top package name + */ + void topFocusedWindowChanged(String packageName); + /** * @see IWindow#insetsChanged */ diff --git a/core/java/android/view/IWindowManager.aidl b/core/java/android/view/IWindowManager.aidl index 58597cf3fb6d..00fc67214f75 100644 --- a/core/java/android/view/IWindowManager.aidl +++ b/core/java/android/view/IWindowManager.aidl @@ -387,16 +387,6 @@ interface IWindowManager */ oneway void hideTransientBars(int displayId); - /** - * When set to {@code true} the system bars will always be shown. This is true even if an app - * requests to be fullscreen by setting the system ui visibility flags. The - * functionality was added for the automotive case as a way to guarantee required content stays - * on screen at all times. - * - * @hide - */ - oneway void setForceShowSystemBars(boolean show); - /** * Called by System UI to notify of changes to the visibility of Recents. */ diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml index 39d20bbff3ba..2bb63f1ca8df 100644 --- a/core/res/res/values/config.xml +++ b/core/res/res/values/config.xml @@ -712,10 +712,17 @@ case, this can be disabled (set to false). --> true - - false + + false diff --git a/core/res/res/values/public.xml b/core/res/res/values/public.xml index e2fbbf46608f..e00aff1af37b 100644 --- a/core/res/res/values/public.xml +++ b/core/res/res/values/public.xml @@ -3024,6 +3024,8 @@ + +