mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-15 17:49:25 +02:00
* Since Android 8 the net.dnsX properties can't be read. Use Google Public DNS servers.
git-svn-id: trunk@40472 -
This commit is contained in:
parent
fd609fe19c
commit
44facc15fa
@ -478,6 +478,17 @@ var
|
|||||||
s: string;
|
s: string;
|
||||||
H : THostAddr;
|
H : THostAddr;
|
||||||
begin
|
begin
|
||||||
|
if SystemApiLevel >= 26 then
|
||||||
|
begin
|
||||||
|
// Since Android 8 the net.dnsX properties can't be read.
|
||||||
|
// Use Google Public DNS servers
|
||||||
|
Result:=2;
|
||||||
|
SetLength(DNSServers, Result);
|
||||||
|
DNSServers[0]:=StrToNetAddr('8.8.8.8');
|
||||||
|
DNSServers[1]:=StrToNetAddr('8.8.4.4');
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
|
||||||
Result:=0;
|
Result:=0;
|
||||||
SetLength(DNSServers, 9);
|
SetLength(DNSServers, 9);
|
||||||
for i:=1 to 9 do
|
for i:=1 to 9 do
|
||||||
@ -504,6 +515,13 @@ var
|
|||||||
begin
|
begin
|
||||||
if not CheckResolveFileAge then
|
if not CheckResolveFileAge then
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
|
if (Length(DNSServers) = 0) and (SystemApiLevel >= 26) then
|
||||||
|
begin
|
||||||
|
GetDNSServers;
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
|
||||||
n:=GetSystemProperty('net.change');
|
n:=GetSystemProperty('net.change');
|
||||||
if n <> '' then
|
if n <> '' then
|
||||||
v:=GetSystemProperty(PAnsiChar(n))
|
v:=GetSystemProperty(PAnsiChar(n))
|
||||||
|
Loading…
Reference in New Issue
Block a user