WiFiInstaller: catch exceptions on both delete paths

WiFiInstaller provides the ability to automatically
install a Passpoint configuration, if that configuration
is served using the 'application/x-wifi-config' MIME type.

Before installing the configuration, WiFiInstaller
reads the configuration data into memory, and then
attempts to delete the file.

If the file was provided using the DocumentsContract
API, then a failure to delete will be caught and logged.
The installation of the configuration can still succeed.

If, however, the file was provided using a ContentResolver,
then a deletion failure causes the install process to
fail.

When Chrome is used to download a Passpoint configuration
from a Passpoint provider, we see that the install reliably
fails. The failure occurs because the config file is
a) not provided using a DocumentsContract, and
b) can not be deleted.

To resolve the failure, we handle a failure to delete
a ContentResovler-provided config the same way that we
handle a failure to delete a DocumentsContract-provided
config. Namely: catch the exception, log the failure, and
continue to install the config.

We will work separately to determine why this problem is
only now surfacing. (We suspect some change in the way
that Chrome provides the file to WiFiInstaller.)

BUG: 66971720
Test: manual

Manual test
-----------
 1. flash build with changes onto device
 2. open passpoint.boingo.com in chrome
 3. scroll to bottom of page
 4. tap 'Create Profile'
 5. enter username and password from bug
 6. tap 'Download Profile'
 7. see 'Chrome needs storage access...' prompt
 8. tap 'CONTINUE'
 9. see 'Allow Chrome...' prompt
10. tap 'ALLOW'
11. see 'Install Wi-Fi credentials' prompt
12. tap 'INSTALL'
13. see 'Credentials installed' dialog
14. adb logcat -d | grep 'could not delete'
    10-12 17:23:23.759 17030 17030 E WifiInstaller: could not delete document content://com.android.chrome.FileProvider/downloads/BoingoPasspointProfile

(last step confirms that this patch was necessary)

Change-Id: I5cc4ac9cec8d6942f64ede696ccac3a6d9204922
1 file changed