Ensure ownership validation in downloadprovider insert method

Earlier, apps could access any file in Downloads by invoking the insert method in Downloadprovider. Now, it includes a check to ensure no existing record is present in Mediaprovider. If a record exists, the method validates the ownerPackageName before proceeding with the insert operation

Bug: 304497167
Test: manual
Flag: EXEMPT, fix only
(cherry picked from commit bf66a79ddcd8d93f502bf908621469893f513780)
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:a2e3e8c7bec2b51f9192ca44757f170c0bde34a5)
Merged-In: I8b2d24974cdf3ae8a9e5680c22cf422bce396940
Change-Id: I8b2d24974cdf3ae8a9e5680c22cf422bce396940
1 file changed