Skip to content

Commit

Permalink
OMS: try harder not to update assets if nothing changed
Browse files Browse the repository at this point in the history
To ensure framework overlays [target="android"] are applied correctly
when an app is installed, OMSImpl.updateAllOverlaysForTarget checks for
the existance of enabled framework overlays. But this check leads to
unnecessary asset updates [defined as no change to the set of overlay
paths] if the OMS was triggered by e.g. the package manager enabling a
component in the android package. On the other hand, when the target
package is "android", the other checks in
OMSImpl.updateAllOverlaysForTarget are sufficient to determine if an
asset update should be scheduled.

Exclude the enabled framework overlays check if (and only if) the target
package happens to be "android".

Test: atest OverlayHostTests OverlayDeviceTests
Change-Id: I7334cbda5686587c0db97c458c09c3656b7eacc4
Signed-off-by: Harsh Shandilya <harsh@prjkt.io>
Signed-off-by: VenkatVishalV <venkatvishal124@gmail.com>
  • Loading branch information
amhk authored and VenkatVishalV committed Nov 10, 2018
1 parent 1e5a056 commit d2ec68f
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,9 @@ private boolean updateAllOverlaysForTarget(@NonNull final String targetPackageNa
}

// check for enabled framework overlays
modified = modified || !getEnabledOverlayPackageNames("android", userId).isEmpty();
if (!"android".equals(targetPackageName)) {
modified = modified || !getEnabledOverlayPackageNames("android", userId).isEmpty();
}

return modified;
}
Expand Down

0 comments on commit d2ec68f

Please sign in to comment.