Loading core/java/android/app/ContextImpl.java +20 −3 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package android.app; import static android.content.pm.PackageManager.PERMISSION_DENIED; import static android.content.pm.PackageManager.PERMISSION_GRANTED; import static android.os.StrictMode.vmIncorrectContextUseEnabled; import static android.permission.flags.Flags.shouldRegisterAttributionSource; import static android.view.WindowManager.LayoutParams.WindowType; import android.annotation.CallbackExecutor; Loading Loading @@ -3094,7 +3095,8 @@ class ContextImpl extends Context { int deviceId = vdm.getDeviceIdForDisplayId(displayId); if (deviceId != mDeviceId) { mDeviceId = deviceId; mAttributionSource = mAttributionSource.withDeviceId(mDeviceId); mAttributionSource = createAttributionSourceWithDeviceId(mAttributionSource, mDeviceId); notifyOnDeviceChangedListeners(mDeviceId); } } Loading @@ -3117,6 +3119,7 @@ class ContextImpl extends Context { if (mDeviceId != updatedDeviceId) { mDeviceId = updatedDeviceId; mAttributionSource = createAttributionSourceWithDeviceId(mAttributionSource, mDeviceId); notifyOnDeviceChangedListeners(updatedDeviceId); } } Loading Loading @@ -3485,8 +3488,22 @@ class ContextImpl extends Context { deviceId, nextAttributionSource); // If we want to access protected data on behalf of another app we need to // tell the OS that we opt in to participate in the attribution chain. if (nextAttributionSource != null || shouldRegister) { attributionSource = getSystemService(PermissionManager.class) return registerAttributionSourceIfNeeded(attributionSource, shouldRegister); } private @NonNull AttributionSource createAttributionSourceWithDeviceId( @NonNull AttributionSource oldSource, int deviceId) { boolean shouldRegister = false; if (shouldRegisterAttributionSource()) { shouldRegister = mParams.shouldRegisterAttributionSource(); } return registerAttributionSourceIfNeeded(oldSource.withDeviceId(deviceId), shouldRegister); } private @NonNull AttributionSource registerAttributionSourceIfNeeded( @NonNull AttributionSource attributionSource, boolean shouldRegister) { if (shouldRegister || attributionSource.getNext() != null) { return getSystemService(PermissionManager.class) .registerAttributionSource(attributionSource); } return attributionSource; Loading Loading
core/java/android/app/ContextImpl.java +20 −3 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package android.app; import static android.content.pm.PackageManager.PERMISSION_DENIED; import static android.content.pm.PackageManager.PERMISSION_GRANTED; import static android.os.StrictMode.vmIncorrectContextUseEnabled; import static android.permission.flags.Flags.shouldRegisterAttributionSource; import static android.view.WindowManager.LayoutParams.WindowType; import android.annotation.CallbackExecutor; Loading Loading @@ -3094,7 +3095,8 @@ class ContextImpl extends Context { int deviceId = vdm.getDeviceIdForDisplayId(displayId); if (deviceId != mDeviceId) { mDeviceId = deviceId; mAttributionSource = mAttributionSource.withDeviceId(mDeviceId); mAttributionSource = createAttributionSourceWithDeviceId(mAttributionSource, mDeviceId); notifyOnDeviceChangedListeners(mDeviceId); } } Loading @@ -3117,6 +3119,7 @@ class ContextImpl extends Context { if (mDeviceId != updatedDeviceId) { mDeviceId = updatedDeviceId; mAttributionSource = createAttributionSourceWithDeviceId(mAttributionSource, mDeviceId); notifyOnDeviceChangedListeners(updatedDeviceId); } } Loading Loading @@ -3485,8 +3488,22 @@ class ContextImpl extends Context { deviceId, nextAttributionSource); // If we want to access protected data on behalf of another app we need to // tell the OS that we opt in to participate in the attribution chain. if (nextAttributionSource != null || shouldRegister) { attributionSource = getSystemService(PermissionManager.class) return registerAttributionSourceIfNeeded(attributionSource, shouldRegister); } private @NonNull AttributionSource createAttributionSourceWithDeviceId( @NonNull AttributionSource oldSource, int deviceId) { boolean shouldRegister = false; if (shouldRegisterAttributionSource()) { shouldRegister = mParams.shouldRegisterAttributionSource(); } return registerAttributionSourceIfNeeded(oldSource.withDeviceId(deviceId), shouldRegister); } private @NonNull AttributionSource registerAttributionSourceIfNeeded( @NonNull AttributionSource attributionSource, boolean shouldRegister) { if (shouldRegister || attributionSource.getNext() != null) { return getSystemService(PermissionManager.class) .registerAttributionSource(attributionSource); } return attributionSource; Loading