Remove chmod(0644) for finished downloads.
Jeff Sharkey [Mon, 21 Mar 2016 23:12:39 +0000 (17:12 -0600)]
Now that PackageInstaller can read APKs from content:// Uris, we
don't need to make downloads world-readable.  This is mostly just
cleanup, since our top-level private data directory is no longer
o+x, so other apps can't traverse in anyway.

Bug: 5464052
Change-Id: I45de6a40c28b85c64d5afbc13068fe3ae8341d93

src/com/android/providers/downloads/DownloadThread.java

index 325b4ee..65142db 100644 (file)
@@ -624,12 +624,6 @@ public class DownloadThread implements Runnable {
         } else if (Downloads.Impl.isStatusSuccess(mInfoDelta.mStatus)) {
             // When success, open access if local file
             if (mInfoDelta.mFileName != null) {
-                try {
-                    // TODO: remove this once PackageInstaller works with content://
-                    Os.chmod(mInfoDelta.mFileName, 0644);
-                } catch (ErrnoException ignored) {
-                }
-
                 if (mInfo.mDestination != Downloads.Impl.DESTINATION_FILE_URI) {
                     try {
                         // Move into final resting place, if needed