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

Unverified Commit fdc567ff authored by Tommy Webb's avatar Tommy Webb Committed by Michael Bestas
Browse files

Do not run POLICY_REJECT_ALL migration in Restore

The Restore process does not expect or need to do a migration of UID
policies, and in fact, doing so causes problems; after a Restore,
the policies are already set as expected, so do not mess with them.

Issue: calyxos#2638
Change-Id: I50fca8f76c143d90821535df9c79746672e35447
parent 6c4fd32f
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -3107,9 +3107,9 @@ public class NetworkPolicyManagerService extends INetworkPolicyManager.Stub {
            }
        }

        // There is nothing to migrate if coming from pre-12 or from nothing.
        // There is nothing to migrate if coming from pre-12, from nothing, or from a restore.
        final boolean isMigratingFromAtLeastAndroid12 = version >= VERSION_SUPPORTED_CARRIER_USAGE;
        if (lineageVersion < LINEAGE_VERSION_REINSTATED_POLICY_REJECT_ALL
        if (!forRestore && lineageVersion < LINEAGE_VERSION_REINSTATED_POLICY_REJECT_ALL
                && isMigratingFromAtLeastAndroid12) {
            migrateToPolicyRejectAll();
        }