diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-07-29 22:36:57 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-07-29 22:36:57 +0000 |
commit | 53eadee33b587d0e969bd1a21cf909c54b9abfbb (patch) | |
tree | cd6cf4507b1a6aa77815d4b37341003afcc325fb | |
parent | bff944d05cd47d2b3b713565d3f00d512840d282 (diff) | |
parent | 9c2b2c7b2ca2d1eebea485d453460f3b7f9ccf68 (diff) | |
download | base-android13-s3-release.tar.gz |
Merge cherrypicks of [19136091, 19272069, 19065708, 19295566, 19416411, 19125209] into tm-release.android-13.0.0_r6android-13.0.0_r5android-13.0.0_r4android13-s3-releaseandroid13-s2-release
Change-Id: I4b2f2da6fe842cca13fa2da440adb6ce29c75ace
10 files changed, 62 insertions, 37 deletions
diff --git a/core/api/system-current.txt b/core/api/system-current.txt index ec4ad8b704c3..0126199add0c 100644 --- a/core/api/system-current.txt +++ b/core/api/system-current.txt @@ -5956,7 +5956,7 @@ package android.location { method public int getEphemerisSource(); method @FloatRange public double getIonoDelayMeters(); method @IntRange(from=0, to=1023) public int getIssueOfDataClock(); - method @IntRange(from=0, to=255) public int getIssueOfDataEphemeris(); + method @IntRange(from=0, to=1023) public int getIssueOfDataEphemeris(); method @Nullable public android.location.SatellitePvt.PositionEcef getPositionEcef(); method @IntRange(from=0) public long getTimeOfClockSeconds(); method @IntRange(from=0) public long getTimeOfEphemerisSeconds(); @@ -5984,7 +5984,7 @@ package android.location { method @NonNull public android.location.SatellitePvt.Builder setEphemerisSource(int); method @NonNull public android.location.SatellitePvt.Builder setIonoDelayMeters(@FloatRange(from=0.0f, to=100.0f) double); method @NonNull public android.location.SatellitePvt.Builder setIssueOfDataClock(@IntRange(from=0, to=1023) int); - method @NonNull public android.location.SatellitePvt.Builder setIssueOfDataEphemeris(@IntRange(from=0, to=255) int); + method @NonNull public android.location.SatellitePvt.Builder setIssueOfDataEphemeris(@IntRange(from=0, to=1023) int); method @NonNull public android.location.SatellitePvt.Builder setPositionEcef(@NonNull android.location.SatellitePvt.PositionEcef); method @NonNull public android.location.SatellitePvt.Builder setTimeOfClockSeconds(@IntRange(from=0) long); method @NonNull public android.location.SatellitePvt.Builder setTimeOfEphemerisSeconds(@IntRange(from=0) long); diff --git a/location/java/android/location/SatellitePvt.java b/location/java/android/location/SatellitePvt.java index f3e15084d730..2031929514f3 100644 --- a/location/java/android/location/SatellitePvt.java +++ b/location/java/android/location/SatellitePvt.java @@ -539,7 +539,7 @@ public final class SatellitePvt implements Parcelable { * * <p>This field is valid if {@link #hasIssueOfDataEphemeris()} is true. */ - @IntRange(from = 0, to = 255) + @IntRange(from = 0, to = 1023) public int getIssueOfDataEphemeris() { return mIssueOfDataEphemeris; } @@ -847,8 +847,8 @@ public final class SatellitePvt implements Parcelable { */ @NonNull public Builder setIssueOfDataEphemeris( - @IntRange(from = 0, to = 255) int issueOfDataEphemeris) { - Preconditions.checkArgumentInRange(issueOfDataEphemeris, 0, 255, + @IntRange(from = 0, to = 1023) int issueOfDataEphemeris) { + Preconditions.checkArgumentInRange(issueOfDataEphemeris, 0, 1023, "issueOfDataEphemeris"); mIssueOfDataEphemeris = issueOfDataEphemeris; mFlags = (byte) (mFlags | HAS_ISSUE_OF_DATA_EPHEMERIS); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelViewController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelViewController.java index 82ca842d48c9..5d417e0b59e2 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelViewController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelViewController.java @@ -599,9 +599,7 @@ public abstract class PanelViewController { float collapseSpeedUpFactor, boolean expandBecauseOfFalsing) { if (target == mExpandedHeight && mOverExpansion == 0.0f) { // We're at the target and didn't fling and there's no overshoot - endJankMonitoring(CUJ_NOTIFICATION_SHADE_EXPAND_COLLAPSE); - mKeyguardStateController.notifyPanelFlingEnd(); - notifyExpandingFinished(); + onFlingEnd(false /* cancelled */); return; } mIsFlinging = true; diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationPanelViewControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationPanelViewControllerTest.java index d47644f047a2..8900d8ff9fda 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationPanelViewControllerTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationPanelViewControllerTest.java @@ -986,6 +986,21 @@ public class NotificationPanelViewControllerTest extends SysuiTestCase { } @Test + public void testSwipe_exactlyToTarget_notifiesNssl() { + // No over-expansion + mNotificationPanelViewController.setOverExpansion(0f); + // Fling to a target that is equal to the current position (i.e. a no-op fling). + mNotificationPanelViewController.flingToHeight( + 0f, + true, + mNotificationPanelViewController.mExpandedHeight, + 1f, + false); + // Verify that the NSSL is notified that the panel is *not* flinging. + verify(mNotificationStackScrollLayoutController).setPanelFlinging(false); + } + + @Test public void testDoubleTapRequired_Keyguard() { FalsingManager.FalsingTapListener listener = getFalsingTapListener(); mStatusBarStateController.setState(KEYGUARD); diff --git a/services/appprediction/java/com/android/server/appprediction/AppPredictionPerUserService.java b/services/appprediction/java/com/android/server/appprediction/AppPredictionPerUserService.java index 1af8ad344190..84707a8d9c00 100644 --- a/services/appprediction/java/com/android/server/appprediction/AppPredictionPerUserService.java +++ b/services/appprediction/java/com/android/server/appprediction/AppPredictionPerUserService.java @@ -398,18 +398,7 @@ public class AppPredictionPerUserService extends final IBinder.DeathRecipient mDeathRecipient; private final RemoteCallbackList<IPredictionCallback> mCallbacks = - new RemoteCallbackList<IPredictionCallback>() { - @Override - public void onCallbackDied(IPredictionCallback callback) { - if (DEBUG) { - Slog.d(TAG, "Binder died for session Id=" + mSessionId - + " and callback=" + callback.asBinder()); - } - if (mCallbacks.getRegisteredCallbackCount() == 0) { - destroy(); - } - } - }; + new RemoteCallbackList<>(); AppPredictionSessionInfo( @NonNull final AppPredictionSessionId id, diff --git a/services/core/java/com/android/server/pm/AppsFilterBase.java b/services/core/java/com/android/server/pm/AppsFilterBase.java index 7ca1978b2031..5de7674a7422 100644 --- a/services/core/java/com/android/server/pm/AppsFilterBase.java +++ b/services/core/java/com/android/server/pm/AppsFilterBase.java @@ -323,7 +323,8 @@ public abstract class AppsFilterBase implements AppsFilterSnapshot { return false; } else if (Process.isSdkSandboxUid(callingAppId)) { // we only allow sdk sandbox processes access to forcequeryable packages - return !isForceQueryable(targetPkgSetting.getAppId()); + return !isForceQueryable(targetPkgSetting.getAppId()) + && !isImplicitlyQueryable(callingAppId, targetPkgSetting.getAppId()); } if (mCacheReady) { // use cache if (!shouldFilterApplicationUsingCache(callingUid, diff --git a/services/core/java/com/android/server/pm/InstallPackageHelper.java b/services/core/java/com/android/server/pm/InstallPackageHelper.java index e90a5db39d71..7da5f51bcbc2 100644 --- a/services/core/java/com/android/server/pm/InstallPackageHelper.java +++ b/services/core/java/com/android/server/pm/InstallPackageHelper.java @@ -3701,8 +3701,9 @@ final class InstallPackageHelper { parsedPackage.getPackageName()); boolean ignoreSharedUserId = false; - if (installedPkgSetting == null) { - // We can directly ignore sharedUserSetting for new installs + if (installedPkgSetting == null || !installedPkgSetting.hasSharedUser()) { + // Directly ignore sharedUserSetting for new installs, or if the app has + // already left shared UID ignoreSharedUserId = parsedPackage.isLeavingSharedUid(); } diff --git a/services/core/java/com/android/server/pm/pkg/component/ParsedPermissionUtils.java b/services/core/java/com/android/server/pm/pkg/component/ParsedPermissionUtils.java index 281e1bd2824d..1366de77af8b 100644 --- a/services/core/java/com/android/server/pm/pkg/component/ParsedPermissionUtils.java +++ b/services/core/java/com/android/server/pm/pkg/component/ParsedPermissionUtils.java @@ -313,8 +313,7 @@ public class ParsedPermissionUtils { final ParsedPermission perm = checkDuplicatePerm.get(name); if (isMalformedDuplicate(parsedPermission, perm)) { // Fix for b/213323615 - EventLog.writeEvent(0x534e4554, "213323615", - "The package " + pkg.getPackageName() + " seems malicious"); + EventLog.writeEvent(0x534e4554, "213323615"); return true; } checkDuplicatePerm.put(name, parsedPermission); diff --git a/services/smartspace/java/com/android/server/smartspace/SmartspacePerUserService.java b/services/smartspace/java/com/android/server/smartspace/SmartspacePerUserService.java index dcffc9e73c0e..f041fbd7bf90 100644 --- a/services/smartspace/java/com/android/server/smartspace/SmartspacePerUserService.java +++ b/services/smartspace/java/com/android/server/smartspace/SmartspacePerUserService.java @@ -334,18 +334,7 @@ public class SmartspacePerUserService extends @NonNull private final SmartspaceConfig mSmartspaceConfig; private final RemoteCallbackList<ISmartspaceCallback> mCallbacks = - new RemoteCallbackList<ISmartspaceCallback>() { - @Override - public void onCallbackDied(ISmartspaceCallback callback) { - if (DEBUG) { - Slog.d(TAG, "Binder died for session Id=" + mSessionId - + " and callback=" + callback.asBinder()); - } - if (mCallbacks.getRegisteredCallbackCount() == 0) { - destroy(); - } - } - }; + new RemoteCallbackList<>(); SmartspaceSessionInfo( @NonNull final SmartspaceSessionId id, diff --git a/services/tests/servicestests/src/com/android/server/pm/AppsFilterImplTest.java b/services/tests/servicestests/src/com/android/server/pm/AppsFilterImplTest.java index facbe80bde67..92443c51b37d 100644 --- a/services/tests/servicestests/src/com/android/server/pm/AppsFilterImplTest.java +++ b/services/tests/servicestests/src/com/android/server/pm/AppsFilterImplTest.java @@ -1376,6 +1376,39 @@ public class AppsFilterImplTest { null /* callingSetting */, target, SYSTEM_USER)); } + @Test + public void testSdkSandbox_implicitAccessGranted_canSeePackage() throws Exception { + final AppsFilterImpl appsFilter = + new AppsFilterImpl(mFeatureConfigMock, new String[]{}, false, null, + mMockHandler); + final WatchableTester watcher = new WatchableTester(appsFilter, "onChange"); + watcher.register(); + simulateAddBasicAndroid(appsFilter); + watcher.verifyChangeReported("addBasic"); + appsFilter.onSystemReady(mPmInternal); + watcher.verifyChangeReported("systemReady"); + + PackageSetting target = simulateAddPackage(appsFilter, + pkg("com.some.package"), DUMMY_TARGET_APPID, + setting -> setting.setPkgFlags(ApplicationInfo.FLAG_SYSTEM)); + + int callingUid = 20123; + assertTrue(Process.isSdkSandboxUid(callingUid)); + + // Without granting the implicit access the app shouldn't be visible to the sdk sandbox uid. + assertTrue( + appsFilter.shouldFilterApplication(mSnapshot, callingUid, + null /* callingSetting */, target, SYSTEM_USER)); + + appsFilter.grantImplicitAccess(callingUid, target.getAppId(), false /* retainOnUpdate */); + watcher.verifyChangeReported("grantImplicitAccess"); + + // After implicit access was granted the app should be visible to the sdk sandbox uid. + assertFalse( + appsFilter.shouldFilterApplication(mSnapshot, callingUid, + null /* callingSetting */, target, SYSTEM_USER)); + } + private List<Integer> toList(int[] array) { ArrayList<Integer> ret = new ArrayList<>(array.length); for (int i = 0; i < array.length; i++) { |