diff options
author | Amith Yamasani <yamasani@google.com> | 2011-04-14 17:35:23 -0700 |
---|---|---|
committer | Amith Yamasani <yamasani@google.com> | 2011-04-15 15:15:27 -0700 |
commit | 0b285499db739ba50f2f839d633e763c70e67f96 (patch) | |
tree | 77e6ecb6572cefdfae2095dcf64c4388adae15c2 /services/tests | |
parent | 4123211637dcc0155091016f0c0987b80e56ab7b (diff) | |
download | frameworks_base-0b285499db739ba50f2f839d633e763c70e67f96.zip frameworks_base-0b285499db739ba50f2f839d633e763c70e67f96.tar.gz frameworks_base-0b285499db739ba50f2f839d633e763c70e67f96.tar.bz2 |
Plumbing in PackageManager and installd for multi-user support.
- Create /data/user directory and symlink /data/user/0 -> /data/data for
backward compatibility
- Create data directories for all packages for new user
- Remove data directories when removing a user
- Create data directories for all users when a package is created
- Clear / Remove data for multiple users
- Fixed a bug in verifying the location of a system app
- pm commands for createUser and removeUser (will be disabled later)
- symlink duplicate lib directories to the original lib directory
Change-Id: Id9fdfcf0e62406a8896aa811314dfc08d5f6ed95
Diffstat (limited to 'services/tests')
-rw-r--r-- | services/tests/servicestests/src/com/android/server/pm/UserManagerTest.java (renamed from services/tests/servicestests/src/com/android/server/pm/UserDetailsTest.java) | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/services/tests/servicestests/src/com/android/server/pm/UserDetailsTest.java b/services/tests/servicestests/src/com/android/server/pm/UserManagerTest.java index 7b77aac..e8188e7 100644 --- a/services/tests/servicestests/src/com/android/server/pm/UserDetailsTest.java +++ b/services/tests/servicestests/src/com/android/server/pm/UserManagerTest.java @@ -16,7 +16,7 @@ package com.android.server.pm; -import com.android.server.pm.UserDetails; +import com.android.server.pm.UserManager; import android.content.pm.UserInfo; import android.os.Debug; @@ -25,23 +25,24 @@ import android.test.AndroidTestCase; import java.util.List; -/** Test {@link UserDetails} functionality. */ -public class UserDetailsTest extends AndroidTestCase { +/** Test {@link UserManager} functionality. */ +public class UserManagerTest extends AndroidTestCase { - UserDetails mDetails = null; + UserManager mUserManager = null; @Override public void setUp() throws Exception { - mDetails = new UserDetails(Environment.getExternalStorageDirectory()); + mUserManager = new UserManager(Environment.getExternalStorageDirectory(), + Environment.getExternalStorageDirectory()); } @Override public void tearDown() throws Exception { - List<UserInfo> users = mDetails.getUsers(); + List<UserInfo> users = mUserManager.getUsers(); // Remove all except the primary user for (UserInfo user : users) { if (!user.isPrimary()) { - mDetails.removeUser(user.id); + mUserManager.removeUser(user.id); } } } @@ -51,9 +52,9 @@ public class UserDetailsTest extends AndroidTestCase { } public void testAddUser() throws Exception { - final UserDetails details = mDetails; + final UserManager details = mUserManager; - UserInfo userInfo = details.createUser("Guest 1", UserInfo.FLAG_GUEST); + UserInfo userInfo = details.createUser("Guest 1", UserInfo.FLAG_GUEST, null); assertTrue(userInfo != null); List<UserInfo> list = details.getUsers(); @@ -70,10 +71,10 @@ public class UserDetailsTest extends AndroidTestCase { } public void testAdd2Users() throws Exception { - final UserDetails details = mDetails; + final UserManager details = mUserManager; - UserInfo user1 = details.createUser("Guest 1", UserInfo.FLAG_GUEST); - UserInfo user2 = details.createUser("User 2", UserInfo.FLAG_ADMIN); + UserInfo user1 = details.createUser("Guest 1", UserInfo.FLAG_GUEST, null); + UserInfo user2 = details.createUser("User 2", UserInfo.FLAG_ADMIN, null); assertTrue(user1 != null); assertTrue(user2 != null); @@ -84,9 +85,9 @@ public class UserDetailsTest extends AndroidTestCase { } public void testRemoveUser() throws Exception { - final UserDetails details = mDetails; + final UserManager details = mUserManager; - UserInfo userInfo = details.createUser("Guest 1", UserInfo.FLAG_GUEST); + UserInfo userInfo = details.createUser("Guest 1", UserInfo.FLAG_GUEST, null); details.removeUser(userInfo.id); @@ -94,7 +95,7 @@ public class UserDetailsTest extends AndroidTestCase { } private boolean findUser(int id) { - List<UserInfo> list = mDetails.getUsers(); + List<UserInfo> list = mUserManager.getUsers(); for (UserInfo user : list) { if (user.id == id) { |