OSDN Git Service

pm: ignore restorecon failure
authorChih-Wei Huang <cwhuang@linux.org.tw>
Thu, 18 Oct 2018 07:47:19 +0000 (15:47 +0800)
committerChih-Wei Huang <cwhuang@linux.org.tw>
Thu, 14 Nov 2019 04:55:30 +0000 (12:55 +0800)
On the 9p filesystem, restorecon won't work. It causes apk can't be
installed. Just ignore the errors to workaround it.

services/core/java/com/android/server/pm/PackageInstallerService.java
services/core/java/com/android/server/pm/PackageManagerService.java

index 0b32d1a..b1caf7d 100644 (file)
@@ -654,7 +654,7 @@ public class PackageInstallerService extends IPackageInstaller.Stub {
         }
 
         if (!SELinux.restorecon(stageDir)) {
-            throw new IOException("Failed to restorecon session dir: " + stageDir);
+            Slog.e(TAG, "Failed to restorecon session dir: " + stageDir);
         }
     }
 
index f1f3a14..b82b324 100644 (file)
@@ -15921,7 +15921,6 @@ public class PackageManagerService extends IPackageManager.Stub
 
             if (!SELinux.restoreconRecursive(afterCodeFile)) {
                 Slog.w(TAG, "Failed to restorecon");
-                return false;
             }
 
             // Reflect the rename internally