diff options
| -rw-r--r-- | apct-tests/perftests/OWNERS | 1 | ||||
| -rw-r--r-- | apct-tests/perftests/core/OWNERS | 1 | ||||
| -rw-r--r-- | cmds/idmap2/include/idmap2/SysTrace.h | 15 | ||||
| -rw-r--r-- | cmds/idmap2/libidmap2/SysTrace.cpp | 36 | ||||
| -rw-r--r-- | cmds/screencap/OWNERS | 2 | ||||
| -rw-r--r-- | core/java/android/app/TEST_MAPPING | 3 | ||||
| -rw-r--r-- | core/java/android/content/TEST_MAPPING | 3 | ||||
| -rw-r--r-- | core/java/android/credentials/OWNERS | 5 | ||||
| -rw-r--r-- | core/java/android/service/credentials/OWNERS | 1 | ||||
| -rw-r--r-- | core/java/android/view/TEST_MAPPING | 3 | ||||
| -rw-r--r-- | packages/SystemUI/OWNERS | 2 | ||||
| -rw-r--r-- | services/core/java/com/android/server/connectivity/Vpn.java | 68 | ||||
| -rw-r--r-- | services/credentials/OWNERS | 1 | ||||
| -rw-r--r-- | telephony/java/android/telephony/SubscriptionManager.java | 15 |
14 files changed, 104 insertions, 52 deletions
diff --git a/apct-tests/perftests/OWNERS b/apct-tests/perftests/OWNERS index 7e7feafdc5a5..4c57e640c141 100644 --- a/apct-tests/perftests/OWNERS +++ b/apct-tests/perftests/OWNERS @@ -4,6 +4,7 @@ cfijalkovich@google.com dualli@google.com edgararriaga@google.com jpakaravoor@google.com +jreck@google.com #{LAST_RESORT_SUGGESTION} kevinjeon@google.com philipcuadra@google.com shombert@google.com diff --git a/apct-tests/perftests/core/OWNERS b/apct-tests/perftests/core/OWNERS index 2b3564eead31..8fb057ddcbce 100644 --- a/apct-tests/perftests/core/OWNERS +++ b/apct-tests/perftests/core/OWNERS @@ -1,3 +1,4 @@ +include /graphics/java/android/graphics/OWNERS include /graphics/java/android/graphics/fonts/OWNERS # Bug component: 568761 diff --git a/cmds/idmap2/include/idmap2/SysTrace.h b/cmds/idmap2/include/idmap2/SysTrace.h index 19b4353def18..fcadf96a497f 100644 --- a/cmds/idmap2/include/idmap2/SysTrace.h +++ b/cmds/idmap2/include/idmap2/SysTrace.h @@ -17,8 +17,6 @@ #ifndef IDMAP2_INCLUDE_IDMAP2_SYSTRACE_H_ #define IDMAP2_INCLUDE_IDMAP2_SYSTRACE_H_ -#define ATRACE_TAG ATRACE_TAG_RRO - #include <sstream> #include <vector> @@ -29,16 +27,12 @@ namespace android::idmap2::utils { class ScopedTraceNoStart { public: - ~ScopedTraceNoStart() { - ATRACE_END(); - } + ~ScopedTraceNoStart(); }; class ScopedTraceMessageHelper { public: - ~ScopedTraceMessageHelper() { - ATRACE_BEGIN(buffer_.str().c_str()); - } + ~ScopedTraceMessageHelper(); std::ostream& stream() { return buffer_; @@ -48,9 +42,12 @@ class ScopedTraceMessageHelper { std::ostringstream buffer_; }; +bool atrace_enabled(); + #define SYSTRACE \ android::idmap2::utils::ScopedTraceNoStart _trace##__LINE__; \ - (ATRACE_ENABLED()) && android::idmap2::utils::ScopedTraceMessageHelper().stream() + android::idmap2::utils::atrace_enabled() \ + && android::idmap2::utils::ScopedTraceMessageHelper().stream() #else diff --git a/cmds/idmap2/libidmap2/SysTrace.cpp b/cmds/idmap2/libidmap2/SysTrace.cpp new file mode 100644 index 000000000000..55d45b775ffa --- /dev/null +++ b/cmds/idmap2/libidmap2/SysTrace.cpp @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#define ATRACE_TAG ATRACE_TAG_RRO + +#include "idmap2/SysTrace.h" + +#ifdef __ANDROID__ +namespace android::idmap2::utils { + +ScopedTraceNoStart::~ScopedTraceNoStart() { + ATRACE_END(); +}; + +ScopedTraceMessageHelper::~ScopedTraceMessageHelper() { + ATRACE_BEGIN(buffer_.str().c_str()); +} + +bool atrace_enabled() { + return ATRACE_ENABLED(); +} +} // namespace android::idmap2::utils +#endif diff --git a/cmds/screencap/OWNERS b/cmds/screencap/OWNERS new file mode 100644 index 000000000000..89f117782844 --- /dev/null +++ b/cmds/screencap/OWNERS @@ -0,0 +1,2 @@ +include /graphics/java/android/graphics/OWNERS +include /services/core/java/com/android/server/wm/OWNERS diff --git a/core/java/android/app/TEST_MAPPING b/core/java/android/app/TEST_MAPPING index 32207af22dc1..a2e42398b437 100644 --- a/core/java/android/app/TEST_MAPPING +++ b/core/java/android/app/TEST_MAPPING @@ -121,6 +121,9 @@ "include-annotation": "android.platform.test.annotations.Presubmit" }, { + "exclude-annotation": "android.platform.test.annotations.LargeTest" + }, + { "exclude-annotation": "androidx.test.filters.FlakyTest" }, { diff --git a/core/java/android/content/TEST_MAPPING b/core/java/android/content/TEST_MAPPING index 5bb845d5a1a1..dac79e7124bd 100644 --- a/core/java/android/content/TEST_MAPPING +++ b/core/java/android/content/TEST_MAPPING @@ -7,6 +7,9 @@ "include-annotation": "android.platform.test.annotations.Presubmit" }, { + "exclude-annotation": "android.platform.test.annotations.LargeTest" + }, + { "exclude-annotation": "androidx.test.filters.FlakyTest" }, { diff --git a/core/java/android/credentials/OWNERS b/core/java/android/credentials/OWNERS new file mode 100644 index 000000000000..e8f393e7e3f1 --- /dev/null +++ b/core/java/android/credentials/OWNERS @@ -0,0 +1,5 @@ +reemabajwa@google.com +helenqin@google.com +sgjerry@google.com +leecam@google.com +akaphle@google.com diff --git a/core/java/android/service/credentials/OWNERS b/core/java/android/service/credentials/OWNERS new file mode 100644 index 000000000000..f3b43c171025 --- /dev/null +++ b/core/java/android/service/credentials/OWNERS @@ -0,0 +1 @@ +include /core/java/android/credentials/OWNERS diff --git a/core/java/android/view/TEST_MAPPING b/core/java/android/view/TEST_MAPPING index 50d69f78688a..ecb98f9ce801 100644 --- a/core/java/android/view/TEST_MAPPING +++ b/core/java/android/view/TEST_MAPPING @@ -10,6 +10,9 @@ "include-annotation": "android.platform.test.annotations.Presubmit" }, { + "exclude-annotation": "android.platform.test.annotations.LargeTest" + }, + { "exclude-annotation": "androidx.test.filters.FlakyTest" }, { diff --git a/packages/SystemUI/OWNERS b/packages/SystemUI/OWNERS index 7076ad91a00c..9ef772ec95ec 100644 --- a/packages/SystemUI/OWNERS +++ b/packages/SystemUI/OWNERS @@ -13,7 +13,7 @@ beverlyt@google.com brockman@google.com brzezinski@google.com brycelee@google.com -ccassidy@google.com +caitlinshk@google.com chrisgollner@google.com dupin@google.com ethibodeau@google.com diff --git a/services/core/java/com/android/server/connectivity/Vpn.java b/services/core/java/com/android/server/connectivity/Vpn.java index b4e91b586b40..9cb1f1dafed8 100644 --- a/services/core/java/com/android/server/connectivity/Vpn.java +++ b/services/core/java/com/android/server/connectivity/Vpn.java @@ -756,6 +756,8 @@ public class Vpn { int errorCode, @NonNull final String packageName, @Nullable final String sessionKey, @NonNull final VpnProfileState profileState, @Nullable final Network underlyingNetwork, @Nullable final NetworkCapabilities nc, @Nullable final LinkProperties lp) { + // Add log for debugging flaky test. b/242833779 + Log.d(TAG, "buildVpnManagerEventIntent: sessionKey = " + sessionKey); final Intent intent = new Intent(VpnManager.ACTION_VPN_MANAGER_EVENT); intent.setPackage(packageName); intent.addCategory(category); @@ -1196,25 +1198,7 @@ public class Vpn { mContext.unbindService(mConnection); cleanupVpnStateLocked(); } else if (mVpnRunner != null) { - // Build intent first because the sessionKey will be reset after performing - // VpnRunner.exit(). Also, cache mOwnerUID even if ownerUID will not be changed in - // VpnRunner.exit() to prevent design being changed in the future. - // TODO(b/230548427): Remove SDK check once VPN related stuff are decoupled from - // ConnectivityServiceTest. - final int ownerUid = mOwnerUID; - Intent intent = null; - if (SdkLevel.isAtLeastT() && isVpnApp(mPackage)) { - intent = buildVpnManagerEventIntent( - VpnManager.CATEGORY_EVENT_DEACTIVATED_BY_USER, - -1 /* errorClass */, -1 /* errorCode*/, mPackage, - getSessionKeyLocked(), makeVpnProfileStateLocked(), - null /* underlyingNetwork */, null /* nc */, null /* lp */); - } - // cleanupVpnStateLocked() is called from mVpnRunner.exit() - mVpnRunner.exit(); - if (intent != null && isVpnApp(mPackage)) { - notifyVpnManagerVpnStopped(mPackage, ownerUid, intent); - } + stopVpnRunnerAndNotifyAppLocked(mPackage); } try { @@ -2774,6 +2758,8 @@ public class Vpn { mIpSecManager = (IpSecManager) mContext.getSystemService(Context.IPSEC_SERVICE); mNetworkCallback = new VpnIkev2Utils.Ikev2VpnNetworkCallback(TAG, this, mExecutor); mSessionKey = UUID.randomUUID().toString(); + // Add log for debugging flaky test. b/242833779 + Log.d(TAG, "Generate session key = " + mSessionKey); // Set the policy so that cancelled tasks will be removed from the work queue mExecutor.setRemoveOnCancelPolicy(true); @@ -3966,7 +3952,13 @@ public class Vpn { @GuardedBy("this") @Nullable private String getSessionKeyLocked() { - return isIkev2VpnRunner() ? ((IkeV2VpnRunner) mVpnRunner).mSessionKey : null; + // Add log for debugging flaky test. b/242833779 + final boolean isIkev2VpnRunner = isIkev2VpnRunner(); + final String sessionKey = + isIkev2VpnRunner ? ((IkeV2VpnRunner) mVpnRunner).mSessionKey : null; + Log.d(TAG, "getSessionKeyLocked: isIkev2VpnRunner = " + isIkev2VpnRunner + + ", sessionKey = " + sessionKey); + return sessionKey; } /** @@ -4068,6 +4060,29 @@ public class Vpn { } } + @GuardedBy("this") + private void stopVpnRunnerAndNotifyAppLocked(@NonNull String packageName) { + // Build intent first because the sessionKey will be reset after performing + // VpnRunner.exit(). Also, cache mOwnerUID even if ownerUID will not be changed in + // VpnRunner.exit() to prevent design being changed in the future. + // TODO(b/230548427): Remove SDK check once VPN related stuff are decoupled from + // ConnectivityServiceTest. + final int ownerUid = mOwnerUID; + Intent intent = null; + if (SdkLevel.isAtLeastT() && isVpnApp(packageName)) { + intent = buildVpnManagerEventIntent( + VpnManager.CATEGORY_EVENT_DEACTIVATED_BY_USER, + -1 /* errorClass */, -1 /* errorCode*/, packageName, + getSessionKeyLocked(), makeVpnProfileStateLocked(), + null /* underlyingNetwork */, null /* nc */, null /* lp */); + } + // cleanupVpnStateLocked() is called from mVpnRunner.exit() + mVpnRunner.exit(); + if (intent != null && isVpnApp(packageName)) { + notifyVpnManagerVpnStopped(packageName, ownerUid, intent); + } + } + /** * Stops an already running VPN Profile for the given package. * @@ -4084,18 +4099,7 @@ public class Vpn { // To stop the VPN profile, the caller must be the current prepared package and must be // running an Ikev2VpnProfile. if (isCurrentIkev2VpnLocked(packageName)) { - // Build intent first because the sessionKey will be reset after performing - // VpnRunner.exit(). Also, cache mOwnerUID even if ownerUID will not be changed in - // VpnRunner.exit() to prevent design being changed in the future. - final int ownerUid = mOwnerUID; - final Intent intent = buildVpnManagerEventIntent( - VpnManager.CATEGORY_EVENT_DEACTIVATED_BY_USER, - -1 /* errorClass */, -1 /* errorCode*/, packageName, - getSessionKeyLocked(), makeVpnProfileStateLocked(), - null /* underlyingNetwork */, null /* nc */, null /* lp */); - - mVpnRunner.exit(); - notifyVpnManagerVpnStopped(packageName, ownerUid, intent); + stopVpnRunnerAndNotifyAppLocked(packageName); } } diff --git a/services/credentials/OWNERS b/services/credentials/OWNERS new file mode 100644 index 000000000000..f3b43c171025 --- /dev/null +++ b/services/credentials/OWNERS @@ -0,0 +1 @@ +include /core/java/android/credentials/OWNERS diff --git a/telephony/java/android/telephony/SubscriptionManager.java b/telephony/java/android/telephony/SubscriptionManager.java index 70f1639ae50d..5ed6cb9ea2fb 100644 --- a/telephony/java/android/telephony/SubscriptionManager.java +++ b/telephony/java/android/telephony/SubscriptionManager.java @@ -139,24 +139,19 @@ public class SubscriptionManager { @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) public static final Uri CONTENT_URI = SimInfo.CONTENT_URI; - /** @hide */ - public static final String CACHE_KEY_DEFAULT_SUB_ID_PROPERTY = + private static final String CACHE_KEY_DEFAULT_SUB_ID_PROPERTY = "cache_key.telephony.get_default_sub_id"; - /** @hide */ - public static final String CACHE_KEY_DEFAULT_DATA_SUB_ID_PROPERTY = + private static final String CACHE_KEY_DEFAULT_DATA_SUB_ID_PROPERTY = "cache_key.telephony.get_default_data_sub_id"; - /** @hide */ - public static final String CACHE_KEY_DEFAULT_SMS_SUB_ID_PROPERTY = + private static final String CACHE_KEY_DEFAULT_SMS_SUB_ID_PROPERTY = "cache_key.telephony.get_default_sms_sub_id"; - /** @hide */ - public static final String CACHE_KEY_ACTIVE_DATA_SUB_ID_PROPERTY = + private static final String CACHE_KEY_ACTIVE_DATA_SUB_ID_PROPERTY = "cache_key.telephony.get_active_data_sub_id"; - /** @hide */ - public static final String CACHE_KEY_SLOT_INDEX_PROPERTY = + private static final String CACHE_KEY_SLOT_INDEX_PROPERTY = "cache_key.telephony.get_slot_index"; /** @hide */ |