Loading src/java/com/android/internal/telephony/NetworkScanRequestTracker.java +10 −5 Original line number Diff line number Diff line Loading @@ -16,7 +16,6 @@ package com.android.internal.telephony; import static android.os.Binder.withCleanCallingIdentity; import static android.telephony.AccessNetworkConstants.AccessNetworkType.EUTRAN; import static android.telephony.AccessNetworkConstants.AccessNetworkType.GERAN; import static android.telephony.AccessNetworkConstants.AccessNetworkType.UTRAN; Loading @@ -24,6 +23,7 @@ import static android.telephony.AccessNetworkConstants.AccessNetworkType.UTRAN; import android.content.Context; import android.hardware.radio.V1_0.RadioError; import android.os.AsyncResult; import android.os.Binder; import android.os.Build; import android.os.Bundle; import android.os.Handler; Loading Loading @@ -178,10 +178,15 @@ public final class NetworkScanRequestTracker { * scan when scan results are restricted due to location privacy. */ public static Set<String> getAllowedMccMncsForLocationRestrictedScan(Context context) { return withCleanCallingIdentity(() -> SubscriptionController.getInstance() final long token = Binder.clearCallingIdentity(); try { return SubscriptionController.getInstance() .getAvailableSubscriptionInfoList(context.getOpPackageName()).stream() .flatMap(NetworkScanRequestTracker::getAllowableMccMncsFromSubscriptionInfo) .collect(Collectors.toSet())); .collect(Collectors.toSet()); } finally { Binder.restoreCallingIdentity(token); } } private static Stream<String> getAllowableMccMncsFromSubscriptionInfo(SubscriptionInfo info) { Loading src/java/com/android/internal/telephony/ims/RcsMessageController.java +12 −2 Original line number Diff line number Diff line Loading @@ -163,7 +163,12 @@ public class RcsMessageController extends IRcsMessage.Stub { */ private <T> T performWriteOperation(String callingPackage, ThrowingSupplier<T> fn) { RcsPermissions.checkWritePermissions(mContext, callingPackage); return Binder.withCleanCallingIdentity(fn); final long token = Binder.clearCallingIdentity(); try { return fn.get(); } finally { Binder.restoreCallingIdentity(token); } } /** Loading @@ -173,7 +178,12 @@ public class RcsMessageController extends IRcsMessage.Stub { */ private <T> T performReadOperation(String callingPackage, ThrowingSupplier<T> fn) { RcsPermissions.checkReadPermissions(mContext, callingPackage); return Binder.withCleanCallingIdentity(fn); final long token = Binder.clearCallingIdentity(); try { return fn.get(); } finally { Binder.restoreCallingIdentity(token); } } @VisibleForTesting Loading Loading
src/java/com/android/internal/telephony/NetworkScanRequestTracker.java +10 −5 Original line number Diff line number Diff line Loading @@ -16,7 +16,6 @@ package com.android.internal.telephony; import static android.os.Binder.withCleanCallingIdentity; import static android.telephony.AccessNetworkConstants.AccessNetworkType.EUTRAN; import static android.telephony.AccessNetworkConstants.AccessNetworkType.GERAN; import static android.telephony.AccessNetworkConstants.AccessNetworkType.UTRAN; Loading @@ -24,6 +23,7 @@ import static android.telephony.AccessNetworkConstants.AccessNetworkType.UTRAN; import android.content.Context; import android.hardware.radio.V1_0.RadioError; import android.os.AsyncResult; import android.os.Binder; import android.os.Build; import android.os.Bundle; import android.os.Handler; Loading Loading @@ -178,10 +178,15 @@ public final class NetworkScanRequestTracker { * scan when scan results are restricted due to location privacy. */ public static Set<String> getAllowedMccMncsForLocationRestrictedScan(Context context) { return withCleanCallingIdentity(() -> SubscriptionController.getInstance() final long token = Binder.clearCallingIdentity(); try { return SubscriptionController.getInstance() .getAvailableSubscriptionInfoList(context.getOpPackageName()).stream() .flatMap(NetworkScanRequestTracker::getAllowableMccMncsFromSubscriptionInfo) .collect(Collectors.toSet())); .collect(Collectors.toSet()); } finally { Binder.restoreCallingIdentity(token); } } private static Stream<String> getAllowableMccMncsFromSubscriptionInfo(SubscriptionInfo info) { Loading
src/java/com/android/internal/telephony/ims/RcsMessageController.java +12 −2 Original line number Diff line number Diff line Loading @@ -163,7 +163,12 @@ public class RcsMessageController extends IRcsMessage.Stub { */ private <T> T performWriteOperation(String callingPackage, ThrowingSupplier<T> fn) { RcsPermissions.checkWritePermissions(mContext, callingPackage); return Binder.withCleanCallingIdentity(fn); final long token = Binder.clearCallingIdentity(); try { return fn.get(); } finally { Binder.restoreCallingIdentity(token); } } /** Loading @@ -173,7 +178,12 @@ public class RcsMessageController extends IRcsMessage.Stub { */ private <T> T performReadOperation(String callingPackage, ThrowingSupplier<T> fn) { RcsPermissions.checkReadPermissions(mContext, callingPackage); return Binder.withCleanCallingIdentity(fn); final long token = Binder.clearCallingIdentity(); try { return fn.get(); } finally { Binder.restoreCallingIdentity(token); } } @VisibleForTesting Loading