summaryrefslogtreecommitdiffstats
path: root/cmds
diff options
context:
space:
mode:
authorJeff Sharkey <jsharkey@android.com>2015-07-20 16:26:19 -0700
committerJeff Sharkey <jsharkey@android.com>2015-07-20 16:26:22 -0700
commita2307aefd06f1310660ef1d35ce01bcfc72c9633 (patch)
tree3c10449babb90af5055c9f3db8ad1a06a29416ac /cmds
parent5f920c1a2cf12c0638c05fbddee8ff6c1193731c (diff)
downloadframeworks_native-a2307aefd06f1310660ef1d35ce01bcfc72c9633.zip
frameworks_native-a2307aefd06f1310660ef1d35ce01bcfc72c9633.tar.gz
frameworks_native-a2307aefd06f1310660ef1d35ce01bcfc72c9633.tar.bz2
Only restorecon_data once for all users.
restorecon_data already iterates across all found users internally, so we don't need to call it for each UID moved. In fact, this was a bug that caused data for the owner to be relabeled when moving apps back to internal storage. Bug: 21813384 Change-Id: I5ba76d4f30d129365864c8a25b665f344b99a6b4
Diffstat (limited to 'cmds')
-rw-r--r--cmds/installd/commands.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/cmds/installd/commands.cpp b/cmds/installd/commands.cpp
index 880877c..7090b36 100644
--- a/cmds/installd/commands.cpp
+++ b/cmds/installd/commands.cpp
@@ -257,11 +257,11 @@ int copy_complete_app(const char *from_uuid, const char *to_uuid,
<< ": status " << rc;
goto fail;
}
+ }
- if (restorecon_data(to_uuid, package_name, seinfo, uid) != 0) {
- LOG(ERROR) << "Failed to restorecon " << to;
- goto fail;
- }
+ if (restorecon_data(to_uuid, package_name, seinfo, multiuser_get_uid(0, appid)) != 0) {
+ LOG(ERROR) << "Failed to restorecon";
+ goto fail;
}
// We let the framework scan the new location and persist that before