Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit eb700490 authored by Atneya Nair's avatar Atneya Nair
Browse files

[audio] Don't filter package intents by extras

For maintaining UID/package correspondences in audioserver, don't filter
package intents by replacing/archiving, since installing an app as
archived will have archiving set to true and un-archiving a package will
have replacing set to true, leading to a failure to add the package.

This changes the behavior to: whenever a package is added, including if
it is added as archived, dispatch the package added callback. Since we
aren't removing packages on removal, and it doesn't matter if we keep
track of an archived package before it is actually added, this works for
our purposes.

Fixes: 410883334
Test: compiles
Flag: EXEMPT bugfix
Change-Id: I81a1b372e23fd3fef80c66bfe4aa19be7b837d59
parent 5e659e32
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -13225,8 +13225,10 @@ public class AudioService extends IAudioService.Stub
                String action = intent.getAction();
                String pkgName = intent.getData().getEncodedSchemeSpecificPart();
                int uid = intent.getIntExtra(Intent.EXTRA_UID, Process.INVALID_UID);
                if (intent.getBooleanExtra(EXTRA_REPLACING, false) ||
                        intent.getBooleanExtra(EXTRA_ARCHIVAL, false)) return;
                Slog.d(TAG, "received " + action + " replacing: " +
                    intent.getBooleanExtra(EXTRA_REPLACING, false) + " archival: " +
                    intent.getBooleanExtra(EXTRA_ARCHIVAL, false) + " for package " +
                    pkgName + " with uid " + uid);
                if (ACTION_PACKAGE_ADDED.equals(action)) {
                    audioserverExecutor.execute(() ->
                            provider.onModifyPackageState(uid, pkgName, false /* isRemoved */));