Merge "Enable overlays that are pending creation" into sc-dev am: 715ab39149
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15350330 Change-Id: I3793c6e9a815563287dfbea5d6a77427b3622f6d
This commit is contained in:
@@ -197,8 +197,10 @@ public class ThemeOverlayApplier implements Dumpable {
|
||||
.collect(Collectors.toList());
|
||||
|
||||
OverlayManagerTransaction.Builder transaction = getTransactionBuilder();
|
||||
HashSet<OverlayIdentifier> identifiersPending = new HashSet<>();
|
||||
if (pendingCreation != null) {
|
||||
for (FabricatedOverlay overlay : pendingCreation) {
|
||||
identifiersPending.add(overlay.getIdentifier());
|
||||
transaction.registerFabricatedOverlay(overlay);
|
||||
}
|
||||
}
|
||||
@@ -206,14 +208,14 @@ public class ThemeOverlayApplier implements Dumpable {
|
||||
for (Pair<String, String> packageToDisable : overlaysToDisable) {
|
||||
OverlayIdentifier overlayInfo = new OverlayIdentifier(packageToDisable.second);
|
||||
setEnabled(transaction, overlayInfo, packageToDisable.first, currentUser,
|
||||
managedProfiles, false);
|
||||
managedProfiles, false, identifiersPending.contains(overlayInfo));
|
||||
}
|
||||
|
||||
for (String category : THEME_CATEGORIES) {
|
||||
if (categoryToPackage.containsKey(category)) {
|
||||
OverlayIdentifier overlayInfo = categoryToPackage.get(category);
|
||||
setEnabled(transaction, overlayInfo, category, currentUser, managedProfiles,
|
||||
true);
|
||||
true, identifiersPending.contains(overlayInfo));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -233,7 +235,7 @@ public class ThemeOverlayApplier implements Dumpable {
|
||||
@AnyThread
|
||||
private void setEnabled(OverlayManagerTransaction.Builder transaction,
|
||||
OverlayIdentifier identifier, String category, int currentUser,
|
||||
Set<UserHandle> managedProfiles, boolean enabled) {
|
||||
Set<UserHandle> managedProfiles, boolean enabled, boolean pendingCreation) {
|
||||
if (DEBUG) {
|
||||
Log.d(TAG, "setEnabled: " + identifier.getPackageName() + " category: "
|
||||
+ category + ": " + enabled);
|
||||
@@ -241,7 +243,7 @@ public class ThemeOverlayApplier implements Dumpable {
|
||||
|
||||
OverlayInfo overlayInfo = mOverlayManager.getOverlayInfo(identifier,
|
||||
UserHandle.of(currentUser));
|
||||
if (overlayInfo == null) {
|
||||
if (overlayInfo == null && !pendingCreation) {
|
||||
Log.i(TAG, "Won't enable " + identifier + ", it doesn't exist for user"
|
||||
+ currentUser);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user