We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 383b0f8 + 54289b8 commit 2036a94Copy full SHA for 2036a94
5 files changed
cmds/installd/commands.c
@@ -271,11 +271,11 @@ int clone_persona_data(uid_t src_persona, uid_t target_persona, int copy)
271
return 0;
272
}
273
274
-int delete_cache(const char *pkgname)
+int delete_cache(const char *pkgname, uid_t persona)
275
{
276
char cachedir[PKG_PATH_MAX];
277
278
- if (create_pkg_path(cachedir, pkgname, CACHE_DIR_POSTFIX, 0))
+ if (create_pkg_path(cachedir, pkgname, CACHE_DIR_POSTFIX, persona))
279
return -1;
280
281
/* delete contents, not the directory, no exceptions */
cmds/installd/installd.c
@@ -72,7 +72,7 @@ static int do_free_cache(char **arg, char reply[REPLY_MAX]) /* TODO int:free_siz
72
73
static int do_rm_cache(char **arg, char reply[REPLY_MAX])
74
75
- return delete_cache(arg[0]); /* pkgname */
+ return delete_cache(arg[0], atoi(arg[1])); /* pkgname, userid */
76
77
78
static int do_get_size(char **arg, char reply[REPLY_MAX])
@@ -142,7 +142,7 @@ struct cmdinfo cmds[] = {
142
{ "rename", 2, do_rename },
143
{ "fixuid", 3, do_fixuid },
144
{ "freecache", 1, do_free_cache },
145
- { "rmcache", 1, do_rm_cache },
+ { "rmcache", 2, do_rm_cache },
146
{ "getsize", 5, do_get_size },
147
{ "rmuserdata", 2, do_rm_user_data },
148
{ "movefiles", 0, do_movefiles },
cmds/installd/installd.h
@@ -199,7 +199,7 @@ int delete_user_data(const char *pkgname, uid_t persona);
199
int make_user_data(const char *pkgname, uid_t uid, uid_t persona);
200
int delete_persona(uid_t persona);
201
int clone_persona_data(uid_t src_persona, uid_t target_persona, int copy);
202
-int delete_cache(const char *pkgname);
+int delete_cache(const char *pkgname, uid_t persona);
203
int move_dex(const char *src, const char *dst);
204
int rm_dex(const char *path);
205
int protect(char *pkgname, gid_t gid);
services/java/com/android/server/pm/Installer.java
@@ -254,10 +254,12 @@ public int fixUid(String name, int uid, int gid) {
254
return execute(builder.toString());
255
256
257
- public int deleteCacheFiles(String name) {
+ public int deleteCacheFiles(String name, int userId) {
258
StringBuilder builder = new StringBuilder("rmcache");
259
builder.append(' ');
260
builder.append(name);
261
+ builder.append(' ');
262
+ builder.append(userId);
263
264
265
services/java/com/android/server/pm/PackageManagerService.java
@@ -8540,11 +8540,10 @@ private boolean deleteApplicationCacheFilesLI(String packageName, int userId) {
8540
Slog.w(TAG, "Package " + packageName + " has no applicationInfo.");
8541
return false;
8542
8543
- // TODO: Pass userId to deleteCacheFiles
8544
- int retCode = mInstaller.deleteCacheFiles(packageName);
+ int retCode = mInstaller.deleteCacheFiles(packageName, userId);
8545
if (retCode < 0) {
8546
Slog.w(TAG, "Couldn't remove cache files for package: "
8547
- + packageName);
+ + packageName + " u" + userId);
8548
8549
8550
return true;
0 commit comments