summaryrefslogtreecommitdiffstats
path: root/test-runner
diff options
context:
space:
mode:
authorAmith Yamasani <yamasani@google.com>2011-03-31 12:38:53 -0700
committerAmith Yamasani <yamasani@google.com>2011-04-11 12:12:58 -0700
commit4b2e934928a2eb65927bd39197198c28c49efb94 (patch)
tree52dedcaa4ef165954e6c7ec9dcd98c5b13442842 /test-runner
parentd07f6a7934d229e91d7ca23e83c664101f472312 (diff)
downloadframeworks_base-4b2e934928a2eb65927bd39197198c28c49efb94.zip
frameworks_base-4b2e934928a2eb65927bd39197198c28c49efb94.tar.gz
frameworks_base-4b2e934928a2eb65927bd39197198c28c49efb94.tar.bz2
Package manager changes to store and update user information.
Some API stubs for managing users and storing their details. List of users is stored in an xml file. Each user's properties are stored in a separate xml file. Some unit tests for modifying the XML files. Change-Id: If2ce2420723111bd426f6762def3c2afc19a0ae5
Diffstat (limited to 'test-runner')
-rw-r--r--test-runner/src/android/test/mock/MockPackageManager.java76
1 files changed, 57 insertions, 19 deletions
diff --git a/test-runner/src/android/test/mock/MockPackageManager.java b/test-runner/src/android/test/mock/MockPackageManager.java
index 0d20496..d84f1e5 100644
--- a/test-runner/src/android/test/mock/MockPackageManager.java
+++ b/test-runner/src/android/test/mock/MockPackageManager.java
@@ -23,32 +23,30 @@ import android.content.IntentSender;
import android.content.pm.ActivityInfo;
import android.content.pm.ApplicationInfo;
import android.content.pm.FeatureInfo;
-import android.content.pm.IPackageDeleteObserver;
import android.content.pm.IPackageDataObserver;
+import android.content.pm.IPackageDeleteObserver;
import android.content.pm.IPackageInstallObserver;
import android.content.pm.IPackageMoveObserver;
import android.content.pm.IPackageStatsObserver;
import android.content.pm.InstrumentationInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
-import android.content.pm.PackageParser;
import android.content.pm.PermissionGroupInfo;
import android.content.pm.PermissionInfo;
import android.content.pm.ProviderInfo;
import android.content.pm.ResolveInfo;
import android.content.pm.ServiceInfo;
-import android.content.pm.PackageManager.NameNotFoundException;
+import android.content.pm.UserInfo;
import android.content.res.Resources;
import android.content.res.XmlResourceParser;
import android.graphics.drawable.Drawable;
import android.net.Uri;
-import android.os.RemoteException;
import java.util.List;
/**
* A mock {@link android.content.pm.PackageManager} class. All methods are non-functional and throw
- * {@link java.lang.UnsupportedOperationException}. Override it to provide the operations that you
+ * {@link java.lang.UnsupportedOperationException}. Override it to provide the operations that you
* need.
*/
public class MockPackageManager extends PackageManager {
@@ -63,12 +61,12 @@ public class MockPackageManager extends PackageManager {
public String[] currentToCanonicalPackageNames(String[] names) {
throw new UnsupportedOperationException();
}
-
+
@Override
public String[] canonicalToCurrentPackageNames(String[] names) {
throw new UnsupportedOperationException();
}
-
+
@Override
public Intent getLaunchIntentForPackage(String packageName) {
throw new UnsupportedOperationException();
@@ -101,7 +99,7 @@ public class MockPackageManager extends PackageManager {
public List<PermissionGroupInfo> getAllPermissionGroups(int flags) {
throw new UnsupportedOperationException();
}
-
+
@Override
public ApplicationInfo getApplicationInfo(String packageName, int flags)
throws NameNotFoundException {
@@ -176,7 +174,7 @@ public class MockPackageManager extends PackageManager {
public String getNameForUid(int uid) {
throw new UnsupportedOperationException();
}
-
+
/**
* @hide - to match hiding in superclass
*/
@@ -273,7 +271,7 @@ public class MockPackageManager extends PackageManager {
public Drawable getApplicationIcon(String packageName) throws NameNotFoundException {
throw new UnsupportedOperationException();
}
-
+
@Override
public Drawable getActivityLogo(ComponentName activityName) throws NameNotFoundException {
throw new UnsupportedOperationException();
@@ -354,7 +352,7 @@ public class MockPackageManager extends PackageManager {
public void movePackage(String packageName, IPackageMoveObserver observer, int flags) {
throw new UnsupportedOperationException();
}
-
+
@Override
public String getInstallerPackageName(String packageName) {
throw new UnsupportedOperationException();
@@ -368,7 +366,7 @@ public class MockPackageManager extends PackageManager {
String packageName, IPackageDataObserver observer) {
throw new UnsupportedOperationException();
}
-
+
/**
* @hide - to match hiding in superclass
*/
@@ -377,7 +375,7 @@ public class MockPackageManager extends PackageManager {
String packageName, IPackageDataObserver observer) {
throw new UnsupportedOperationException();
}
-
+
/**
* @hide - to match hiding in superclass
*/
@@ -435,7 +433,7 @@ public class MockPackageManager extends PackageManager {
public void setApplicationEnabledSetting(String packageName, int newState, int flags) {
throw new UnsupportedOperationException();
}
-
+
@Override
public int getApplicationEnabledSetting(String packageName) {
throw new UnsupportedOperationException();
@@ -446,7 +444,7 @@ public class MockPackageManager extends PackageManager {
int match, ComponentName[] set, ComponentName activity) {
throw new UnsupportedOperationException();
}
-
+
/**
* @hide - to match hiding in superclass
*/
@@ -475,24 +473,64 @@ public class MockPackageManager extends PackageManager {
List<ComponentName> outActivities, String packageName) {
throw new UnsupportedOperationException();
}
-
+
@Override
public String[] getSystemSharedLibraryNames() {
throw new UnsupportedOperationException();
}
-
+
@Override
public FeatureInfo[] getSystemAvailableFeatures() {
throw new UnsupportedOperationException();
}
-
+
@Override
public boolean hasSystemFeature(String name) {
throw new UnsupportedOperationException();
}
-
+
@Override
public boolean isSafeMode() {
throw new UnsupportedOperationException();
}
+
+ /**
+ * @hide
+ */
+ @Override
+ public UserInfo createUser(String name, int flags) {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * @hide
+ */
+ @Override
+ public List<UserInfo> getUsers() {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * @hide
+ */
+ @Override
+ public boolean removeUser(int id) {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * @hide
+ */
+ @Override
+ public void updateUserName(int id, String name) {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * @hide
+ */
+ @Override
+ public void updateUserFlags(int id, int flags) {
+ throw new UnsupportedOperationException();
+ }
}