Make root bypass all MediaProvider checks

It makes sense to allow root to do whatever it wants, like accessing
files in app specific dirs, reading unredacted images, etc...

This change makes root bypass all MediaProvider checks, from the native
level. This means that we don't even make JNI calls when FuseDaemon
receives calls from root. This required a change in FilePathAccessTest,
because previously we assumed root abides by the same MediaProvider
restrictions.

We previously had a debug flag that controls whether root
can read unredacted images. This change shifts this flag to control the
same behaviour for shell (not running as root). This could be useful for
debugging, tetsing and development.

Also added a flag for (unrooted) shell that allows it to bypass
MediaProvider checks.

Test: atest FuseDaemonTest
Test: adb unroot ;
adb shell setprop persist.sys.fuse.shell.redaction-needed true ;
adb pull <photo-with-location-metadata> # observe redaction
Test: adb root; adb shell touch /sdcard/foo #succeeds
Bug: 144361021

Change-Id: Ic1241ad395652e683b7b6e4e3ff3cdddd542980f
5 files changed