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

Commit 3b426a8c authored by Suprabh Shukla's avatar Suprabh Shukla Committed by Android (Google) Code Review
Browse files

Merge "Clear dns cache when restoring network access" into main

parents 00481176 c431def1
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -4076,6 +4076,13 @@ public final class ActivityThread extends ClientTransactionHandler
                    ActivityManager.getService().waitForNetworkStateUpdate(mNetworkBlockSeq);
                    mNetworkBlockSeq = INVALID_PROC_STATE_SEQ;
                } catch (RemoteException ignored) {}
                if (Flags.clearDnsCacheOnNetworkRulesUpdate()) {
                    // InetAddress will cache UnknownHostException failures. If the rules got
                    // updated and the app has network access now, we need to clear the negative
                    // cache to ensure valid dns queries can work immediately.
                    // TODO: b/329133769 - Clear only the negative cache once it is available.
                    InetAddress.clearDnsCache();
                }
            }
        }
    }
+11 −0
Original line number Diff line number Diff line
package: "android.app"

flag {
     namespace: "backstage_power"
     name: "clear_dns_cache_on_network_rules_update"
     description: "Clears the DNS cache when the network rules update"
     bug: "237556596"
     metadata {
       purpose: PURPOSE_BUGFIX
     }
}
 No newline at end of file