Avoid calling protected File field

bug: 58333
Change-Id: I0bd4a5fe9687c4261ca0f57e30f723e8bf2589ac
(cherry picked from commit 8bd386e3680808d1ae1166140ef6917f0498ef3a)