mirror of
https://github.com/Divested-Mobile/DivestOS-Build.git
synced 2024-09-08 02:22:16 +00:00
5e1521700f
Some patches were ported from 12 to 10/11 Some patches from 11 were ported to 10 This 10/11 port should be very close to 12 BOUNS: 16.0 patches, disabled Signed-off-by: Tad <tad@spotco.us>
32 lines
1.7 KiB
Diff
32 lines
1.7 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Dmitry Muhomor <muhomor.dmitry@gmail.com>
|
|
Date: Tue, 14 Dec 2021 21:10:51 +0200
|
|
Subject: [PATCH] don't throw SecurityException when INTERNET permission is
|
|
revoked
|
|
|
|
---
|
|
ojluni/src/main/java/java/net/Inet6AddressImpl.java | 10 +---------
|
|
1 file changed, 1 insertion(+), 9 deletions(-)
|
|
|
|
diff --git a/ojluni/src/main/java/java/net/Inet6AddressImpl.java b/ojluni/src/main/java/java/net/Inet6AddressImpl.java
|
|
index 1edfe344ce..2176973b44 100644
|
|
--- a/ojluni/src/main/java/java/net/Inet6AddressImpl.java
|
|
+++ b/ojluni/src/main/java/java/net/Inet6AddressImpl.java
|
|
@@ -143,15 +143,7 @@ class Inet6AddressImpl implements InetAddressImpl {
|
|
addressCache.put(host, netId, addresses);
|
|
return addresses;
|
|
} catch (GaiException gaiException) {
|
|
- // If the failure appears to have been a lack of INTERNET permission, throw a clear
|
|
- // SecurityException to aid in debugging this common mistake.
|
|
- // http://code.google.com/p/android/issues/detail?id=15722
|
|
- if (gaiException.getCause() instanceof ErrnoException) {
|
|
- if (((ErrnoException) gaiException.getCause()).errno == EACCES) {
|
|
- throw new SecurityException("Permission denied (missing INTERNET permission?)", gaiException);
|
|
- }
|
|
- }
|
|
- // Otherwise, throw an UnknownHostException.
|
|
+ // Throw an UnknownHostException.
|
|
String detailMessage = "Unable to resolve host \"" + host + "\": " + Libcore.os.gai_strerror(gaiException.error);
|
|
addressCache.putUnknownHost(host, netId, detailMessage);
|
|
throw gaiException.rethrowAsUnknownHostException(detailMessage);
|