Merge "Block the content scheme intent in AccountTypePreferenceLoader" into main
This commit is contained in:
@@ -30,8 +30,11 @@ import static org.mockito.Mockito.when;
|
||||
import android.accounts.Account;
|
||||
import android.accounts.AccountManager;
|
||||
import android.accounts.AuthenticatorDescription;
|
||||
import android.content.ClipData;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.net.Uri;
|
||||
import android.os.UserHandle;
|
||||
|
||||
import androidx.collection.ArraySet;
|
||||
@@ -250,4 +253,13 @@ public class AccountTypePreferenceLoaderTest {
|
||||
mPrefLoader.filterBlockedFragments(parent, Set.of("nomatch", "other"));
|
||||
verify(pref).setOnPreferenceClickListener(any());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void isSafeIntent_hasContextScheme_returnFalse() {
|
||||
Intent intent = new Intent();
|
||||
intent.setClipData(ClipData.newRawUri(null,
|
||||
Uri.parse("content://com.android.settings.files/my_cache/NOTICE.html")));
|
||||
|
||||
assertThat(mPrefLoader.isSafeIntent(mPackageManager, intent, mAccount.type)).isFalse();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user