Merge "Merge TP1A.220905.004 to aosp-master - DO NOT MERGE"

This commit is contained in:
Bill Yi 2022-09-12 17:59:03 +00:00 committed by Gerrit Code Review
commit 9f510b1618
10 changed files with 62 additions and 37 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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;

View File

@ -985,6 +985,21 @@ public class NotificationPanelViewControllerTest extends SysuiTestCase {
verify(mKeyguardStateController).notifyPanelFlingEnd();
}
@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();

View File

@ -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,

View File

@ -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,

View File

@ -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();
}

View File

@ -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);

View File

@ -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,

View File

@ -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++) {