Check SDK version before checking if context instanceof SandboxedSdkContext
Currently there are a few places where the code checks if the input context is an instance of SandboxedSdkContext, and casts it to that type if it is. On R/S, this type doesn't exist, therefore this check will result in a runtime exception. This change centralizes that check in a utilities class, and adds the SDK version check.
Bug: 263903808
Test: atest com.android.adservices.customaudience.CustomAudienceManagerTest com.android.adservices.tests.appsetid.AppSetIdManagerTest com.android.adservices.measurement.MeasurementManagerTest com.android.adservices.tests.cts.topics.TopicsManagerTest SandboxedSdkContextUtilsTest
Change-Id: I4712fc69c73338f86279f399882c73ffdd094fa5
8 files changed