Loading android/app/src/com/android/bluetooth/Utils.java +4 −3 Original line number Diff line number Diff line Loading @@ -546,12 +546,13 @@ public final class Utils { // Suppressed since we're not actually enforcing here @SuppressLint("AndroidFrameworkRequiresPermission") public static boolean hasDisavowedLocationForScan( Context context, String packageName, AttributionSource attributionSource) { Context context, String packageName, AttributionSource attributionSource, boolean inTestMode) { // TODO(b/183625242): Handle multi-step attribution chains here. if (attributionSource.getRenouncedPermissions().contains(ACCESS_FINE_LOCATION) && context.checkCallingPermission(RENOUNCE_PERMISSIONS) == PackageManager.PERMISSION_GRANTED) { && (inTestMode || context.checkCallingPermission(RENOUNCE_PERMISSIONS) == PackageManager.PERMISSION_GRANTED)) { return true; } Loading android/app/src/com/android/bluetooth/btservice/AdapterService.java +5 −1 Original line number Diff line number Diff line Loading @@ -287,6 +287,8 @@ public class AdapterService extends Service { private HearingAidService mHearingAidService; private SapService mSapService; private boolean mTestModeEnabled; /** * Register a {@link ProfileService} with AdapterService. * Loading Loading @@ -2473,7 +2475,8 @@ public class AdapterService extends Service { mAppOps.checkPackage(Binder.getCallingUid(), callingPackage); boolean isQApp = Utils.isQApp(this, callingPackage); boolean hasDisavowedLocation = Utils.hasDisavowedLocationForScan(this, callingPackage, attributionSource); Utils.hasDisavowedLocationForScan(this, callingPackage, attributionSource, mTestModeEnabled); String permission = null; if (Utils.checkCallerHasNetworkSettingsPermission(this)) { permission = android.Manifest.permission.NETWORK_SETTINGS; Loading Loading @@ -3405,6 +3408,7 @@ public class AdapterService extends Service { for (ProfileService profile : mRunningProfiles) { profile.setTestModeEnabled(testModeEnabled); } mTestModeEnabled = true; return; } Loading android/app/src/com/android/bluetooth/gatt/GattService.java +4 −3 Original line number Diff line number Diff line Loading @@ -20,7 +20,6 @@ import static android.content.pm.PackageManager.PERMISSION_GRANTED; import android.annotation.RequiresPermission; import android.annotation.SuppressLint; import android.app.ActivityThread; import android.app.AppOpsManager; import android.app.PendingIntent; import android.app.Service; Loading Loading @@ -2270,7 +2269,8 @@ public class GattService extends ProfileService { callingPackage.equals(mExposureNotificationPackage); scanClient.hasDisavowedLocation = Utils.hasDisavowedLocationForScan(this, callingPackage, attributionSource); Utils.hasDisavowedLocationForScan(this, callingPackage, attributionSource, isTestModeEnabled()); scanClient.isQApp = Utils.isQApp(this, callingPackage); if (!scanClient.hasDisavowedLocation) { Loading Loading @@ -2343,7 +2343,8 @@ public class GattService extends ProfileService { callingPackage.equals(mExposureNotificationPackage); app.mHasDisavowedLocation = Utils.hasDisavowedLocationForScan(this, callingPackage, attributionSource); Utils.hasDisavowedLocationForScan(this, callingPackage, attributionSource, isTestModeEnabled()); app.mIsQApp = Utils.isQApp(this, callingPackage); if (!app.mHasDisavowedLocation) { Loading Loading
android/app/src/com/android/bluetooth/Utils.java +4 −3 Original line number Diff line number Diff line Loading @@ -546,12 +546,13 @@ public final class Utils { // Suppressed since we're not actually enforcing here @SuppressLint("AndroidFrameworkRequiresPermission") public static boolean hasDisavowedLocationForScan( Context context, String packageName, AttributionSource attributionSource) { Context context, String packageName, AttributionSource attributionSource, boolean inTestMode) { // TODO(b/183625242): Handle multi-step attribution chains here. if (attributionSource.getRenouncedPermissions().contains(ACCESS_FINE_LOCATION) && context.checkCallingPermission(RENOUNCE_PERMISSIONS) == PackageManager.PERMISSION_GRANTED) { && (inTestMode || context.checkCallingPermission(RENOUNCE_PERMISSIONS) == PackageManager.PERMISSION_GRANTED)) { return true; } Loading
android/app/src/com/android/bluetooth/btservice/AdapterService.java +5 −1 Original line number Diff line number Diff line Loading @@ -287,6 +287,8 @@ public class AdapterService extends Service { private HearingAidService mHearingAidService; private SapService mSapService; private boolean mTestModeEnabled; /** * Register a {@link ProfileService} with AdapterService. * Loading Loading @@ -2473,7 +2475,8 @@ public class AdapterService extends Service { mAppOps.checkPackage(Binder.getCallingUid(), callingPackage); boolean isQApp = Utils.isQApp(this, callingPackage); boolean hasDisavowedLocation = Utils.hasDisavowedLocationForScan(this, callingPackage, attributionSource); Utils.hasDisavowedLocationForScan(this, callingPackage, attributionSource, mTestModeEnabled); String permission = null; if (Utils.checkCallerHasNetworkSettingsPermission(this)) { permission = android.Manifest.permission.NETWORK_SETTINGS; Loading Loading @@ -3405,6 +3408,7 @@ public class AdapterService extends Service { for (ProfileService profile : mRunningProfiles) { profile.setTestModeEnabled(testModeEnabled); } mTestModeEnabled = true; return; } Loading
android/app/src/com/android/bluetooth/gatt/GattService.java +4 −3 Original line number Diff line number Diff line Loading @@ -20,7 +20,6 @@ import static android.content.pm.PackageManager.PERMISSION_GRANTED; import android.annotation.RequiresPermission; import android.annotation.SuppressLint; import android.app.ActivityThread; import android.app.AppOpsManager; import android.app.PendingIntent; import android.app.Service; Loading Loading @@ -2270,7 +2269,8 @@ public class GattService extends ProfileService { callingPackage.equals(mExposureNotificationPackage); scanClient.hasDisavowedLocation = Utils.hasDisavowedLocationForScan(this, callingPackage, attributionSource); Utils.hasDisavowedLocationForScan(this, callingPackage, attributionSource, isTestModeEnabled()); scanClient.isQApp = Utils.isQApp(this, callingPackage); if (!scanClient.hasDisavowedLocation) { Loading Loading @@ -2343,7 +2343,8 @@ public class GattService extends ProfileService { callingPackage.equals(mExposureNotificationPackage); app.mHasDisavowedLocation = Utils.hasDisavowedLocationForScan(this, callingPackage, attributionSource); Utils.hasDisavowedLocationForScan(this, callingPackage, attributionSource, isTestModeEnabled()); app.mIsQApp = Utils.isQApp(this, callingPackage); if (!app.mHasDisavowedLocation) { Loading