summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Aditya <adityasngh@google.com> 2024-06-05 09:36:49 +0000
committer Aditya <adityasngh@google.com> 2024-06-05 09:55:36 +0000
commitd6eae13b5238ce6dc05a2054facc0b95c9965461 (patch)
tree62ea26893ce547780e0e03d1ce8b0113af549bd1
parent674ace67fcad7e28ea8e8923e988907ea5c9a911 (diff)
Add SdkLevel V check in onProfileActionStatusChange.
Bug: 344827852 Test: Manual Change-Id: Idbd7ec7edb516c2c11d255f35579d0760ba9a496
-rw-r--r--src/com/android/documentsui/DocumentsApplication.java2
-rw-r--r--src/com/android/documentsui/UserManagerState.java1
2 files changed, 2 insertions, 1 deletions
diff --git a/src/com/android/documentsui/DocumentsApplication.java b/src/com/android/documentsui/DocumentsApplication.java
index 809ef9876..f006e0334 100644
--- a/src/com/android/documentsui/DocumentsApplication.java
+++ b/src/com/android/documentsui/DocumentsApplication.java
@@ -265,7 +265,7 @@ public class DocumentsApplication extends Application {
} else if (PROFILE_FILTER_ACTIONS.contains(action)) {
// Make the changes to UserManagerState object before calling providers updateAsync
// so that providers for all the users are loaded
- if (getConfigStore().isPrivateSpaceInDocsUIEnabled() && SdkLevel.isAtLeastS()) {
+ if (getConfigStore().isPrivateSpaceInDocsUIEnabled() && SdkLevel.isAtLeastV()) {
UserHandle userHandle = intent.getParcelableExtra(Intent.EXTRA_USER);
UserId userId = UserId.of(userHandle);
getUserManagerState(context).onProfileActionStatusChange(action, userId);
diff --git a/src/com/android/documentsui/UserManagerState.java b/src/com/android/documentsui/UserManagerState.java
index 9bb9ee92a..b1c1a0d59 100644
--- a/src/com/android/documentsui/UserManagerState.java
+++ b/src/com/android/documentsui/UserManagerState.java
@@ -235,6 +235,7 @@ public interface UserManagerState {
@Override
@SuppressLint("NewApi")
public void onProfileActionStatusChange(String action, UserId userId) {
+ if (!SdkLevel.isAtLeastV()) return;
UserProperties userProperties = mUserManager.getUserProperties(
UserHandle.of(userId.getIdentifier()));
if (userProperties.getShowInQuietMode() != UserProperties.SHOW_IN_QUIET_MODE_HIDDEN) {