am dba90626: am a3618092: Merge "Remove "unlinklib" command from installd" into jb-mr1-dev

* commit 'dba90626d3e8e0a9993bbc9d30094a0764dc3f55':
  Remove "unlinklib" command from installd
This commit is contained in:
Kenny Root
2012-09-12 15:13:57 -07:00
committed by Android Git Automerger
5 changed files with 39 additions and 142 deletions

View File

@@ -369,10 +369,10 @@ class Installer {
*/
public int linkNativeLibraryDirectory(String dataPath, String nativeLibPath) {
if (dataPath == null) {
Slog.e(TAG, "unlinkNativeLibraryDirectory dataPath is null");
Slog.e(TAG, "linkNativeLibraryDirectory dataPath is null");
return -1;
} else if (nativeLibPath == null) {
Slog.e(TAG, "unlinkNativeLibraryDirectory nativeLibPath is null");
Slog.e(TAG, "linkNativeLibraryDirectory nativeLibPath is null");
return -1;
}
@@ -383,16 +383,4 @@ class Installer {
return execute(builder.toString());
}
public int unlinkNativeLibraryDirectory(String dataPath) {
if (dataPath == null) {
Slog.e(TAG, "unlinkNativeLibraryDirectory dataPath is null");
return -1;
}
StringBuilder builder = new StringBuilder("unlinklib ");
builder.append(dataPath);
return execute(builder.toString());
}
}

View File

@@ -4468,9 +4468,11 @@ public class PackageManagerService extends IPackageManager.Stub {
throws IOException {
if (!nativeLibraryDir.isDirectory()) {
nativeLibraryDir.delete();
if (!nativeLibraryDir.mkdir()) {
throw new IOException("Cannot create " + nativeLibraryDir.getPath());
}
try {
Libcore.os.chmod(nativeLibraryDir.getPath(), S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH
| S_IXOTH);
@@ -4478,6 +4480,8 @@ public class PackageManagerService extends IPackageManager.Stub {
throw new IOException("Cannot chmod native library directory "
+ nativeLibraryDir.getPath(), e);
}
} else if (!SELinux.restorecon(nativeLibraryDir)) {
throw new IOException("Cannot set SELinux context for " + nativeLibraryDir.getPath());
}
/*