summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Android Build Coastguard Worker <android-build-coastguard-worker@google.com> 2024-07-19 20:04:55 +0000
committer Android Build Coastguard Worker <android-build-coastguard-worker@google.com> 2024-07-19 20:04:55 +0000
commit90ccb6f13c37f076fef0dbc8a02c6a9f023f69c6 (patch)
tree2554d296b5a3a59090b149b620df849d5c624580
parent8fa0f2122111831d242e21ab2153803e50ffbcff (diff)
parentb509340748e9ed15b7d3e380e4d8b8e7e9d07ae7 (diff)
Merge cherrypicks of ['googleplex-android-review.googlesource.com/27953195', 'googleplex-android-review.googlesource.com/28003910', 'googleplex-android-review.googlesource.com/28218141', 'googleplex-android-review.googlesource.com/28211352', 'googleplex-android-review.googlesource.com/28337565', 'googleplex-android-review.googlesource.com/28342320'] into 24Q3-release.
Change-Id: I2413d66c10a982965325f97c5229f18853e5bb10
-rw-r--r--packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java20
-rw-r--r--packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java7
-rw-r--r--packages/SettingsProvider/src/com/android/providers/settings/device_config_service.aconfig11
-rw-r--r--packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/domain/interactor/FromAlternateBouncerTransitionInteractorTest.kt4
-rw-r--r--packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromAlternateBouncerTransitionInteractor.kt5
-rw-r--r--services/autofill/java/com/android/server/autofill/PresentationStatsEventLogger.java12
-rw-r--r--services/autofill/java/com/android/server/autofill/Session.java5
-rw-r--r--services/core/java/com/android/server/display/DisplayManagerService.java4
-rw-r--r--services/core/java/com/android/server/display/LogicalDisplayMapper.java4
-rw-r--r--services/core/java/com/android/server/location/contexthub/ContextHubClientBroker.java2
-rw-r--r--services/core/java/com/android/server/location/contexthub/ContextHubService.java9
-rw-r--r--services/core/java/com/android/server/pm/LauncherAppsService.java9
12 files changed, 67 insertions, 25 deletions
diff --git a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
index d54236e60dd7..00a7826aa8e8 100644
--- a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
+++ b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
@@ -44,6 +44,7 @@ import static com.android.providers.settings.SettingsState.isSystemSettingsKey;
import static com.android.providers.settings.SettingsState.makeKey;
import android.Manifest;
+import android.aconfigd.AconfigdFlagInfo;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.app.ActivityManager;
@@ -1369,10 +1370,27 @@ public class SettingsProvider extends ContentProvider {
}
}
+ Map<String, AconfigdFlagInfo> aconfigFlagInfos =
+ settingsState.getAconfigDefaultFlags();
+
for (int i = 0; i < nameCount; i++) {
String name = names.get(i);
Setting setting = settingsState.getSettingLocked(name);
- if (prefix == null || setting.getName().startsWith(prefix)) {
+ if (prefix == null || name.startsWith(prefix)) {
+ if (Flags.ignoreXmlForReadOnlyFlags()) {
+ int slashIndex = name.indexOf("/");
+ boolean validSlashIndex = slashIndex != -1
+ && slashIndex != 0
+ && slashIndex != name.length();
+ if (validSlashIndex) {
+ String flagName = name.substring(slashIndex + 1);
+ AconfigdFlagInfo flagInfo = aconfigFlagInfos.get(flagName);
+ if (flagInfo != null && !flagInfo.getIsReadWrite()) {
+ continue;
+ }
+ }
+ }
+
flagsToValues.put(setting.getName(), setting.getValue());
}
}
diff --git a/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java b/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
index 05eb0449495f..d3d30dfcea3a 100644
--- a/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
+++ b/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
@@ -765,6 +765,13 @@ final class SettingsState {
}
}
+ @NonNull
+ public Map<String, AconfigdFlagInfo> getAconfigDefaultFlags() {
+ synchronized (mLock) {
+ return mAconfigDefaultFlags;
+ }
+ }
+
// The settings provider must hold its lock when calling here.
public Setting getSettingLocked(String name) {
if (TextUtils.isEmpty(name)) {
diff --git a/packages/SettingsProvider/src/com/android/providers/settings/device_config_service.aconfig b/packages/SettingsProvider/src/com/android/providers/settings/device_config_service.aconfig
index d20fbf591a25..4f5955b1c6ca 100644
--- a/packages/SettingsProvider/src/com/android/providers/settings/device_config_service.aconfig
+++ b/packages/SettingsProvider/src/com/android/providers/settings/device_config_service.aconfig
@@ -41,3 +41,14 @@ flag {
description: "If this flag is detected as true on boot, writes a logfile to track storage migration correctness."
bug: "328444881"
}
+
+flag {
+ name: "ignore_xml_for_read_only_flags"
+ namespace: "core_experiments_team_internal"
+ description: "When enabled, ignore any flag in the SettingsProvider XML for RO flags."
+ bug: "345007098"
+ is_fixed_read_only: true
+ metadata {
+ purpose: PURPOSE_BUGFIX
+ }
+}
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/domain/interactor/FromAlternateBouncerTransitionInteractorTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/domain/interactor/FromAlternateBouncerTransitionInteractorTest.kt
index d20fec44d60f..5115f5af94f0 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/domain/interactor/FromAlternateBouncerTransitionInteractorTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/domain/interactor/FromAlternateBouncerTransitionInteractorTest.kt
@@ -90,7 +90,11 @@ class FromAlternateBouncerTransitionInteractorTest : SysuiTestCase() {
)
reset(transitionRepository)
+ kosmos.fakeKeyguardBouncerRepository.setKeyguardAuthenticatedBiometrics(null)
kosmos.fakeKeyguardRepository.setKeyguardOccluded(true)
+ runCurrent()
+ assertThat(transitionRepository).noTransitionsStarted()
+
kosmos.fakeKeyguardBouncerRepository.setKeyguardAuthenticatedBiometrics(true)
runCurrent()
kosmos.fakeKeyguardBouncerRepository.setKeyguardAuthenticatedBiometrics(null)
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromAlternateBouncerTransitionInteractor.kt b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromAlternateBouncerTransitionInteractor.kt
index 49d00af61a24..5573f0d5f644 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromAlternateBouncerTransitionInteractor.kt
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromAlternateBouncerTransitionInteractor.kt
@@ -40,6 +40,7 @@ import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.delay
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.distinctUntilChanged
+import kotlinx.coroutines.flow.drop
import kotlinx.coroutines.flow.emptyFlow
import kotlinx.coroutines.flow.filter
import kotlinx.coroutines.flow.flatMapLatest
@@ -168,7 +169,9 @@ constructor(
keyguardInteractor.isKeyguardGoingAway.filter { it }.map {}, // map to Unit
keyguardInteractor.isKeyguardOccluded.flatMapLatest { keyguardOccluded ->
if (keyguardOccluded) {
- primaryBouncerInteractor.keyguardAuthenticatedBiometricsHandled
+ primaryBouncerInteractor.keyguardAuthenticatedBiometricsHandled.drop(
+ 1
+ ) // drop the initial state
} else {
emptyFlow()
}
diff --git a/services/autofill/java/com/android/server/autofill/PresentationStatsEventLogger.java b/services/autofill/java/com/android/server/autofill/PresentationStatsEventLogger.java
index d7da2f0052d3..443bb745ad84 100644
--- a/services/autofill/java/com/android/server/autofill/PresentationStatsEventLogger.java
+++ b/services/autofill/java/com/android/server/autofill/PresentationStatsEventLogger.java
@@ -685,15 +685,6 @@ public final class PresentationStatsEventLogger {
}
/**
- * Set how many views are filtered from fill because they are not in current session
- */
- public void maybeSetFilteredFillableViewsCount(int filteredViewsCount) {
- mEventInternal.ifPresent(event -> {
- event.mFilteredFillabaleViewCount = filteredViewsCount;
- });
- }
-
- /**
* Set views_filled_failure_count using failure count as long as mEventInternal
* presents.
*/
@@ -789,7 +780,6 @@ public final class PresentationStatsEventLogger {
+ " mAppPackageUid=" + mCallingAppUid
+ " mIsCredentialRequest=" + event.mIsCredentialRequest
+ " mWebviewRequestedCredential=" + event.mWebviewRequestedCredential
- + " mFilteredFillabaleViewCount=" + event.mFilteredFillabaleViewCount
+ " mViewFillableTotalCount=" + event.mViewFillableTotalCount
+ " mViewFillFailureCount=" + event.mViewFillFailureCount
+ " mFocusedId=" + event.mFocusedId
@@ -846,7 +836,6 @@ public final class PresentationStatsEventLogger {
mCallingAppUid,
event.mIsCredentialRequest,
event.mWebviewRequestedCredential,
- event.mFilteredFillabaleViewCount,
event.mViewFillableTotalCount,
event.mViewFillFailureCount,
event.mFocusedId,
@@ -895,7 +884,6 @@ public final class PresentationStatsEventLogger {
int mFieldClassificationRequestId = DEFAULT_VALUE_INT;
boolean mIsCredentialRequest = false;
boolean mWebviewRequestedCredential = false;
- int mFilteredFillabaleViewCount = DEFAULT_VALUE_INT;
int mViewFillableTotalCount = DEFAULT_VALUE_INT;
int mViewFillFailureCount = DEFAULT_VALUE_INT;
int mFocusedId = DEFAULT_VALUE_INT;
diff --git a/services/autofill/java/com/android/server/autofill/Session.java b/services/autofill/java/com/android/server/autofill/Session.java
index c6ddc16211bc..4852478281d8 100644
--- a/services/autofill/java/com/android/server/autofill/Session.java
+++ b/services/autofill/java/com/android/server/autofill/Session.java
@@ -6641,8 +6641,6 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState
boolean waitingDatasetAuth = false;
boolean hideHighlight = (entryCount == 1
&& dataset.getFieldIds().get(0).equals(mCurrentViewId));
- // Count how many views are filtered because they are not in current session
- int numOfViewsFiltered = 0;
for (int i = 0; i < entryCount; i++) {
if (dataset.getFieldValues().get(i) == null) {
continue;
@@ -6655,7 +6653,6 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState
Slog.v(TAG, "Skipping filling view: " +
viewId + " as it isn't part of the current session: " + id);
}
- numOfViewsFiltered += 1;
continue;
}
ids.add(viewId);
@@ -6669,8 +6666,6 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState
viewState.resetState(ViewState.STATE_WAITING_DATASET_AUTH);
}
}
- mPresentationStatsEventLogger.maybeSetFilteredFillableViewsCount(
- numOfViewsFiltered);
if (!ids.isEmpty()) {
if (waitingDatasetAuth) {
mUi.hideFillUi(this);
diff --git a/services/core/java/com/android/server/display/DisplayManagerService.java b/services/core/java/com/android/server/display/DisplayManagerService.java
index 2d5f38e2dd8c..670d59c09e06 100644
--- a/services/core/java/com/android/server/display/DisplayManagerService.java
+++ b/services/core/java/com/android/server/display/DisplayManagerService.java
@@ -4782,6 +4782,8 @@ public final class DisplayManagerService extends SystemService {
}
final int[] supportedStates =
mDeviceStateManager.getSupportedStateIdentifiers();
+ // TODO(b/352019542): remove the log once b/345960547 is fixed.
+ Slog.d(TAG, "supportedStates=" + Arrays.toString(supportedStates));
DisplayInfo displayInfo;
for (int state : supportedStates) {
displayInfo = mLogicalDisplayMapper.getDisplayInfoForStateLocked(state,
@@ -4790,6 +4792,8 @@ public final class DisplayManagerService extends SystemService {
possibleInfo.add(displayInfo);
}
}
+ // TODO(b/352019542): remove the log once b/345960547 is fixed.
+ Slog.d(TAG, "possibleInfos=" + possibleInfo);
return possibleInfo;
}
}
diff --git a/services/core/java/com/android/server/display/LogicalDisplayMapper.java b/services/core/java/com/android/server/display/LogicalDisplayMapper.java
index e645e98c215c..4791cd1403e2 100644
--- a/services/core/java/com/android/server/display/LogicalDisplayMapper.java
+++ b/services/core/java/com/android/server/display/LogicalDisplayMapper.java
@@ -389,11 +389,15 @@ class LogicalDisplayMapper implements DisplayDeviceRepository.Listener {
// Retrieve the layout for this particular state.
final Layout layout = mDeviceStateToLayoutMap.get(deviceState);
if (layout == null) {
+ // TODO(b/352019542): remove the log once b/345960547 is fixed.
+ Slog.d(TAG, "Cannot get layout for given state:" + deviceState);
return null;
}
// Retrieve the details of the given display within this layout.
Layout.Display display = layout.getById(displayId);
if (display == null) {
+ // TODO(b/352019542): remove the log once b/345960547 is fixed.
+ Slog.d(TAG, "Cannot get display for given layout:" + layout);
return null;
}
// Retrieve the display info for the display that matches the display id.
diff --git a/services/core/java/com/android/server/location/contexthub/ContextHubClientBroker.java b/services/core/java/com/android/server/location/contexthub/ContextHubClientBroker.java
index 363a4a7be3db..91a4d6f1707f 100644
--- a/services/core/java/com/android/server/location/contexthub/ContextHubClientBroker.java
+++ b/services/core/java/com/android/server/location/contexthub/ContextHubClientBroker.java
@@ -1126,7 +1126,7 @@ public class ContextHubClientBroker extends IContextHubClient.Stub
}
}
- private void sendHostEndpointConnectedEvent() {
+ void sendHostEndpointConnectedEvent() {
HostEndpointInfo info = new HostEndpointInfo();
info.hostEndpointId = (char) mHostEndPointId;
info.packageName = mPackage;
diff --git a/services/core/java/com/android/server/location/contexthub/ContextHubService.java b/services/core/java/com/android/server/location/contexthub/ContextHubService.java
index b3fb147a318b..309dbed30d53 100644
--- a/services/core/java/com/android/server/location/contexthub/ContextHubService.java
+++ b/services/core/java/com/android/server/location/contexthub/ContextHubService.java
@@ -242,10 +242,14 @@ public class ContextHubService extends IContextHubService.Stub {
@Override
public void handleServiceRestart() {
- Log.i(TAG, "Starting Context Hub Service restart");
+ Log.i(TAG, "Recovering from Context Hub HAL restart...");
initExistingCallbacks();
resetSettings();
- Log.i(TAG, "Finished Context Hub Service restart");
+ if (Flags.reconnectHostEndpointsAfterHalRestart()) {
+ mClientManager.forEachClientOfHub(mContextHubId,
+ ContextHubClientBroker::sendHostEndpointConnectedEvent);
+ }
+ Log.i(TAG, "Finished recovering from Context Hub HAL restart");
}
@Override
@@ -536,6 +540,7 @@ public class ContextHubService extends IContextHubService.Stub {
for (int contextHubId : mContextHubIdToInfoMap.keySet()) {
try {
mContextHubWrapper.registerExistingCallback(contextHubId);
+ Log.i(TAG, "Re-registered callback to context hub " + contextHubId);
} catch (RemoteException e) {
Log.e(TAG, "RemoteException while registering existing service callback for hub "
+ "(ID = " + contextHubId + ")", e);
diff --git a/services/core/java/com/android/server/pm/LauncherAppsService.java b/services/core/java/com/android/server/pm/LauncherAppsService.java
index 563cfa4d0ecd..023f7655c7a8 100644
--- a/services/core/java/com/android/server/pm/LauncherAppsService.java
+++ b/services/core/java/com/android/server/pm/LauncherAppsService.java
@@ -71,6 +71,7 @@ import android.content.pm.IPackageInstallerCallback;
import android.content.pm.IPackageManager;
import android.content.pm.IShortcutChangeCallback;
import android.content.pm.IncrementalStatesInfo;
+import android.content.pm.InstallSourceInfo;
import android.content.pm.LauncherActivityInfoInternal;
import android.content.pm.LauncherApps;
import android.content.pm.LauncherApps.ShortcutQuery;
@@ -1856,9 +1857,11 @@ public class LauncherAppsService extends SystemService {
private String getInstallerPackage(@NonNull String packageName, int callingUserId) {
String installerPackageName = null;
try {
- installerPackageName =
- mIPM.getInstallSourceInfo(packageName, callingUserId)
- .getInstallingPackageName();
+ InstallSourceInfo info = mIPM.getInstallSourceInfo(packageName, callingUserId);
+ if (info == null) {
+ return installerPackageName;
+ }
+ installerPackageName = info.getInstallingPackageName();
} catch (RemoteException re) {
Slog.e(TAG, "Couldn't find installer for " + packageName, re);
}