blob: 33d4b0b20ccdce716a51f76eebf81fe126af6341 [file]
/*
* Copyright (C) 2026 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.intentresolver
import android.annotation.UserIdInt
import android.content.ContentResolver
import android.content.Intent
/**
* A [CrossProfileIntentsChecker] that always returns true, it is used to test the cross
* profile intent policy bypass.
* To be used in a case when the blocked cross-profile intents has been vetted
* elsewhere.
*/
class AlwaysTrueCrossProfileIntentsChecker(contentResolver: ContentResolver) :
AbstractMultiProfilePagerAdapter.CrossProfileIntentsChecker(contentResolver) {
override fun hasCrossProfileIntents(
intents: List<Intent>,
@UserIdInt source: Int,
@UserIdInt target: Int,
) = intents.isNotEmpty()
}