summaryrefslogtreecommitdiffstats
path: root/services/java/com
diff options
context:
space:
mode:
authorJean-Baptiste Queru <jbq@google.com>2009-07-31 17:38:20 -0700
committerJean-Baptiste Queru <jbq@google.com>2009-07-31 17:38:20 -0700
commit5c1207be90fdf296c1b83034b7c68915e1749284 (patch)
treee5679f6183458d8179821d5615dabafcb959704d /services/java/com
parenta8675f67e33bc7337d148358783b0fd138b501ff (diff)
downloadframeworks_base-5c1207be90fdf296c1b83034b7c68915e1749284.zip
frameworks_base-5c1207be90fdf296c1b83034b7c68915e1749284.tar.gz
frameworks_base-5c1207be90fdf296c1b83034b7c68915e1749284.tar.bz2
donut snapshot
Diffstat (limited to 'services/java/com')
-rw-r--r--services/java/com/android/server/AccessibilityManagerService.java23
-rw-r--r--services/java/com/android/server/NotificationManagerService.java13
-rw-r--r--services/java/com/android/server/PackageManagerService.java175
-rw-r--r--services/java/com/android/server/WifiService.java11
-rw-r--r--services/java/com/android/server/WindowManagerService.java8
-rw-r--r--services/java/com/android/server/am/ActivityManagerService.java63
6 files changed, 239 insertions, 54 deletions
diff --git a/services/java/com/android/server/AccessibilityManagerService.java b/services/java/com/android/server/AccessibilityManagerService.java
index c205fc0..55007ba 100644
--- a/services/java/com/android/server/AccessibilityManagerService.java
+++ b/services/java/com/android/server/AccessibilityManagerService.java
@@ -323,15 +323,22 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub
*/
private void notifyAccessibilityServicesDelayedLocked(AccessibilityEvent event,
boolean isDefault) {
- for (int i = 0, count = mServices.size(); i < count; i++) {
- Service service = mServices.get(i);
+ try {
+ for (int i = 0, count = mServices.size(); i < count; i++) {
+ Service service = mServices.get(i);
- if (service.mIsDefault == isDefault) {
- if (canDispathEventLocked(service, event, mHandledFeedbackTypes)) {
- mHandledFeedbackTypes |= service.mFeedbackType;
- notifyAccessibilityServiceDelayedLocked(service, event);
+ if (service.mIsDefault == isDefault) {
+ if (canDispathEventLocked(service, event, mHandledFeedbackTypes)) {
+ mHandledFeedbackTypes |= service.mFeedbackType;
+ notifyAccessibilityServiceDelayedLocked(service, event);
+ }
}
}
+ } catch (IndexOutOfBoundsException oobe) {
+ // An out of bounds exception can happen if services are going away
+ // as the for loop is running. If that happens, just bail because
+ // there are no more services to notify.
+ return;
}
}
@@ -368,6 +375,9 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub
* @param event The event.
*/
private void tryRecycleLocked(AccessibilityEvent event) {
+ if (event == null) {
+ return;
+ }
int eventType = event.getEventType();
List<Service> services = mServices;
@@ -378,7 +388,6 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub
return;
}
}
-
event.recycle();
}
diff --git a/services/java/com/android/server/NotificationManagerService.java b/services/java/com/android/server/NotificationManagerService.java
index 38fb7c9..aac7124 100644
--- a/services/java/com/android/server/NotificationManagerService.java
+++ b/services/java/com/android/server/NotificationManagerService.java
@@ -90,7 +90,7 @@ class NotificationManagerService extends INotificationManager.Stub
private NotificationRecord mSoundNotification;
private AsyncPlayer mSound;
private boolean mSystemReady;
- private int mDisabledNotifications = StatusBarManager.DISABLE_NOTIFICATION_ALERTS;
+ private int mDisabledNotifications;
private NotificationRecord mVibrateNotification;
private Vibrator mVibrator = new Vibrator();
@@ -368,6 +368,15 @@ class NotificationManagerService extends INotificationManager.Stub
mStatusBarService = statusBar;
statusBar.setNotificationCallbacks(mNotificationCallbacks);
+ // Don't start allowing notifications until the setup wizard has run once.
+ // After that, including subsequent boots, init with notifications turned on.
+ // This works on the first boot because the setup wizard will toggle this
+ // flag at least once and we'll go back to 0 after that.
+ if (0 == Settings.Secure.getInt(mContext.getContentResolver(),
+ Settings.Secure.DEVICE_PROVISIONED, 0)) {
+ mDisabledNotifications = StatusBarManager.DISABLE_NOTIFICATION_ALERTS;
+ }
+
// register for battery changed notifications
IntentFilter filter = new IntentFilter();
filter.addAction(Intent.ACTION_BATTERY_CHANGED);
@@ -1049,6 +1058,8 @@ class NotificationManagerService extends INotificationManager.Stub
pw.println(" mSoundNotification=" + mSoundNotification);
pw.println(" mSound=" + mSound);
pw.println(" mVibrateNotification=" + mVibrateNotification);
+ pw.println(" mDisabledNotifications=0x" + Integer.toHexString(mDisabledNotifications));
+ pw.println(" mSystemReady=" + mSystemReady);
}
}
}
diff --git a/services/java/com/android/server/PackageManagerService.java b/services/java/com/android/server/PackageManagerService.java
index ee53274..bd79d1d 100644
--- a/services/java/com/android/server/PackageManagerService.java
+++ b/services/java/com/android/server/PackageManagerService.java
@@ -60,7 +60,6 @@ import android.net.Uri;
import android.os.Binder;
import android.os.Build;
import android.os.Bundle;
-import android.os.Debug;
import android.os.HandlerThread;
import android.os.Parcel;
import android.os.RemoteException;
@@ -495,7 +494,7 @@ class PackageManagerService extends IPackageManager.Stub {
mDrmAppInstallObserver = new AppDirObserver(
mDrmAppPrivateInstallDir.getPath(), OBSERVER_EVENTS, false);
mDrmAppInstallObserver.startWatching();
- scanDirLI(mDrmAppPrivateInstallDir, 0, scanMode);
+ scanDirLI(mDrmAppPrivateInstallDir, 0, scanMode | SCAN_FORWARD_LOCKED);
EventLog.writeEvent(LOG_BOOT_PROGRESS_PMS_SCAN_END,
SystemClock.uptimeMillis());
@@ -1764,7 +1763,12 @@ class PackageManagerService extends IPackageManager.Stub {
int i;
for (i=0; i<files.length; i++) {
File file = new File(dir, files[i]);
- PackageParser.Package pkg = scanPackageLI(file, file, file,
+ File resFile = file;
+ // Pick up the resource path from settings for fwd locked apps
+ if ((scanMode & SCAN_FORWARD_LOCKED) != 0) {
+ resFile = null;
+ }
+ PackageParser.Package pkg = scanPackageLI(file, file, resFile,
flags|PackageParser.PARSE_MUST_BE_APK, scanMode);
}
}
@@ -1826,6 +1830,11 @@ class PackageManagerService extends IPackageManager.Stub {
ps = mSettings.peekPackageLP(pkg.packageName);
updatedPkg = mSettings.mDisabledSysPackages.get(pkg.packageName);
}
+ // Verify certificates first
+ if (!collectCertificatesLI(pp, ps, pkg, scanFile, parseFlags)) {
+ Log.i(TAG, "Failed verifying certificates for package:" + pkg.packageName);
+ return null;
+ }
if (updatedPkg != null) {
// An updated system app will not have the PARSE_IS_SYSTEM flag set initially
parseFlags |= PackageParser.PARSE_IS_SYSTEM;
@@ -1843,23 +1852,30 @@ class PackageManagerService extends IPackageManager.Stub {
return null;
} else {
// Delete the older apk pointed to by ps
+ // At this point, its safely assumed that package installation for
+ // apps in system partition will go through. If not there won't be a working
+ // version of the app
+ synchronized (mPackages) {
+ // Just remove the loaded entries from package lists.
+ mPackages.remove(ps.name);
+ }
deletePackageResourcesLI(ps.name, ps.codePathString, ps.resourcePathString);
mSettings.enableSystemPackageLP(ps.name);
}
}
}
}
- if (!collectCertificatesLI(pp, ps, pkg, scanFile, parseFlags)) {
- Log.i(TAG, "Failed verifying certificates for package:" + pkg.packageName);
- return null;
- }
// The apk is forward locked (not public) if its code and resources
// are kept in different files.
if (ps != null && !ps.codePath.equals(ps.resourcePath)) {
scanMode |= SCAN_FORWARD_LOCKED;
}
+ File resFile = destResourceFile;
+ if ((scanMode & SCAN_FORWARD_LOCKED) != 0) {
+ resFile = getFwdLockedResource(ps.name);
+ }
// Note that we invoke the following method only if we are about to unpack an application
- return scanPackageLI(scanFile, destCodeFile, destResourceFile,
+ return scanPackageLI(scanFile, destCodeFile, resFile,
pkg, parseFlags, scanMode | SCAN_UPDATE_SIGNATURE);
}
@@ -2132,7 +2148,7 @@ class PackageManagerService extends IPackageManager.Stub {
pkg.applicationInfo.packageName,
pkg.applicationInfo.processName,
pkg.applicationInfo.uid);
- pkg.applicationInfo.publicSourceDir = pkgSetting.resourcePathString;
+ pkg.applicationInfo.publicSourceDir = destResourceFile.toString();
File dataPath;
if (mPlatformPackage == pkg) {
@@ -2259,15 +2275,26 @@ class PackageManagerService extends IPackageManager.Stub {
pkg.applicationInfo.flags |= ApplicationInfo.FLAG_FACTORY_TEST;
}
+ // We don't expect installation to fail beyond this point,
if ((scanMode&SCAN_MONITOR) != 0) {
pkg.mPath = destCodeFile.getAbsolutePath();
mAppDirs.put(pkg.mPath, pkg);
}
+ // Request the ActivityManager to kill the process(only for existing packages)
+ // so that we do not end up in a confused state while the user is still using the older
+ // version of the application while the new one gets installed.
+ IActivityManager am = ActivityManagerNative.getDefault();
+ if ((am != null) && ((parseFlags & PackageManager.INSTALL_REPLACE_EXISTING ) != 0)) {
+ try {
+ am.killApplicationWithUid(pkg.applicationInfo.packageName,
+ pkg.applicationInfo.uid);
+ } catch (RemoteException e) {
+ }
+ }
synchronized (mPackages) {
- // We don't expect installation to fail beyond this point
// Add the new setting to mSettings
- mSettings.insertPackageSettingLP(pkgSetting, pkg.packageName, suid);
+ mSettings.insertPackageSettingLP(pkgSetting, pkg, destCodeFile, destResourceFile);
// Add the new setting to mPackages
mPackages.put(pkg.applicationInfo.packageName, pkg);
int N = pkg.providers.size();
@@ -2955,7 +2982,8 @@ class PackageManagerService extends IPackageManager.Stub {
}
if ((addedPermission || replace) && !ps.permissionsFixed &&
- (ps.pkgFlags&ApplicationInfo.FLAG_SYSTEM) == 0) {
+ ((ps.pkgFlags&ApplicationInfo.FLAG_SYSTEM) == 0) ||
+ ((ps.pkgFlags & ApplicationInfo.FLAG_UPDATED_SYSTEM_APP) != 0)){
// This is the first that we have heard about this package, so the
// permissions we have now selected are fixed until explicitly
// changed.
@@ -3789,6 +3817,11 @@ class PackageManagerService extends IPackageManager.Stub {
}
}
+ private File getFwdLockedResource(String pkgName) {
+ final String publicZipFileName = pkgName + ".zip";
+ return new File(mAppInstallDir, publicZipFileName);
+ }
+
private PackageInstalledInfo installPackageLI(Uri pPackageURI,
int pFlags, boolean newInstall, String installerPackageName) {
File tmpPackageFile = null;
@@ -3868,8 +3901,7 @@ class PackageManagerService extends IPackageManager.Stub {
final String destFilePath = destPackageFile.getAbsolutePath();
File destResourceFile;
if ((pFlags&PackageManager.INSTALL_FORWARD_LOCK) != 0) {
- final String publicZipFileName = pkgName + ".zip";
- destResourceFile = new File(mAppInstallDir, publicZipFileName);
+ destResourceFile = getFwdLockedResource(pkgName);
forwardLocked = true;
} else {
destResourceFile = destPackageFile;
@@ -4156,7 +4188,9 @@ class PackageManagerService extends IPackageManager.Stub {
private void removePackageDataLI(PackageParser.Package p, PackageRemovedInfo outInfo,
int flags) {
String packageName = p.packageName;
- outInfo.removedPackage = packageName;
+ if (outInfo != null) {
+ outInfo.removedPackage = packageName;
+ }
removePackageLI(p, true);
// Retrieve object to delete permissions for shared user later on
PackageSetting deletedPs;
@@ -4178,7 +4212,9 @@ class PackageManagerService extends IPackageManager.Stub {
dataDir.delete();
}
synchronized (mPackages) {
- outInfo.removedUid = mSettings.removePackageLP(packageName);
+ if (outInfo != null) {
+ outInfo.removedUid = mSettings.removePackageLP(packageName);
+ }
}
}
synchronized (mPackages) {
@@ -4253,7 +4289,7 @@ class PackageManagerService extends IPackageManager.Stub {
}
return true;
}
-
+
private void deletePackageResourcesLI(String packageName,
String sourceDir, String publicSourceDir) {
File sourceFile = new File(sourceDir);
@@ -4283,7 +4319,9 @@ class PackageManagerService extends IPackageManager.Stub {
Log.w(TAG, "Package " + p.packageName + " has no applicationInfo.");
return false;
}
- outInfo.uid = applicationInfo.uid;
+ if (outInfo != null) {
+ outInfo.uid = applicationInfo.uid;
+ }
// Delete package data from internal structures and also remove data if flag is set
removePackageDataLI(p, outInfo, flags);
@@ -4902,26 +4940,40 @@ class PackageManagerService extends IPackageManager.Stub {
if (ps.pkg != null) {
pw.print(" dataDir="); pw.println(ps.pkg.applicationInfo.dataDir);
pw.print(" targetSdk="); pw.println(ps.pkg.applicationInfo.targetSdkVersion);
- pw.print(" densities="); pw.println(ps.pkg.supportsDensityList);
- ArrayList<String> screens = new ArrayList<String>();
+ pw.print(" supportsScreens=[");
+ boolean first = true;
if ((ps.pkg.applicationInfo.flags &
ApplicationInfo.FLAG_SUPPORTS_NORMAL_SCREENS) != 0) {
- screens.add("medium");
+ if (!first) pw.print(", ");
+ first = false;
+ pw.print("medium");
}
if ((ps.pkg.applicationInfo.flags &
ApplicationInfo.FLAG_SUPPORTS_LARGE_SCREENS) != 0) {
- screens.add("large");
+ if (!first) pw.print(", ");
+ first = false;
+ pw.print("large");
}
if ((ps.pkg.applicationInfo.flags &
ApplicationInfo.FLAG_SUPPORTS_SMALL_SCREENS) != 0) {
- screens.add("small,");
+ if (!first) pw.print(", ");
+ first = false;
+ pw.print("small");
}
if ((ps.pkg.applicationInfo.flags &
ApplicationInfo.FLAG_RESIZEABLE_FOR_SCREENS) != 0) {
- screens.add("resizeable,");
+ if (!first) pw.print(", ");
+ first = false;
+ pw.print("resizeable");
+ }
+ if ((ps.pkg.applicationInfo.flags &
+ ApplicationInfo.FLAG_SUPPORTS_SCREEN_DENSITIES) != 0) {
+ if (!first) pw.print(", ");
+ first = false;
+ pw.print("anyDensity");
}
- pw.print(" supportsScreens="); pw.println(screens);
}
+ pw.println("]");
pw.print(" timeStamp="); pw.println(ps.getTimeStampStr());
pw.print(" signatures="); pw.println(ps.signatures);
pw.print(" permissionsFixed="); pw.print(ps.permissionsFixed);
@@ -5446,7 +5498,7 @@ class PackageManagerService extends IPackageManager.Stub {
String resourcePathString;
private long timeStamp;
private String timeStampString = "0";
- final int versionCode;
+ int versionCode;
PackageSignatures signatures = new PackageSignatures();
@@ -5684,10 +5736,6 @@ class PackageManagerService extends IPackageManager.Stub {
final String name = pkg.packageName;
PackageSetting p = getPackageLP(name, sharedUser, codePath,
resourcePath, pkg.mVersionCode, pkgFlags, create, add);
-
- if (p != null) {
- p.pkg = pkg;
- }
return p;
}
@@ -5835,22 +5883,18 @@ class PackageManagerService extends IPackageManager.Stub {
if (p != null) {
if (!p.codePath.equals(codePath)) {
// Check to see if its a disabled system app
- PackageSetting ps = mDisabledSysPackages.get(name);
- if((ps != null) && ((ps.pkgFlags & ApplicationInfo.FLAG_SYSTEM) != 0)) {
+ if((p != null) && ((p.pkgFlags & ApplicationInfo.FLAG_SYSTEM) != 0)) {
// This is an updated system app with versions in both system
// and data partition. Just let the most recent version
// take precedence.
- return p;
+ Log.w(TAG, "Trying to update system app code path from " +
+ p.codePathString + " to " + codePath.toString());
} else {
// Let the app continue with previous uid if code path changes.
reportSettingsProblem(Log.WARN,
"Package " + name + " codePath changed from " + p.codePath
+ " to " + codePath + "; Retaining data and using new code from " +
codePath);
- p.codePath = codePath;
- p.resourcePath = resourcePath;
- p.codePathString = codePath.toString();
- p.resourcePathString = resourcePath.toString();
}
} else if (p.sharedUser != sharedUser) {
reportSettingsProblem(Log.WARN,
@@ -5874,8 +5918,29 @@ class PackageManagerService extends IPackageManager.Stub {
if (sharedUser != null) {
p.userId = sharedUser.userId;
} else if (MULTIPLE_APPLICATION_UIDS) {
- // Assign new user id
- p.userId = newUserIdLP(p);
+ // Clone the setting here for disabled system packages
+ PackageSetting dis = mDisabledSysPackages.get(name);
+ if (dis != null) {
+ // For disabled packages a new setting is created
+ // from the existing user id. This still has to be
+ // added to list of user id's
+ // Copy signatures from previous setting
+ if (dis.signatures.mSignatures != null) {
+ p.signatures.mSignatures = dis.signatures.mSignatures.clone();
+ }
+ p.userId = dis.userId;
+ // Clone permissions
+ p.grantedPermissions = new HashSet<String>(dis.grantedPermissions);
+ p.loadedPermissions = new HashSet<String>(dis.loadedPermissions);
+ // Clone component info
+ p.disabledComponents = new HashSet<String>(dis.disabledComponents);
+ p.enabledComponents = new HashSet<String>(dis.enabledComponents);
+ // Add new setting to list of user ids
+ addUserIdLP(p.userId, p, name);
+ } else {
+ // Assign new user id
+ p.userId = newUserIdLP(p);
+ }
} else {
p.userId = FIRST_APPLICATION_UID;
}
@@ -5887,15 +5952,39 @@ class PackageManagerService extends IPackageManager.Stub {
if (add) {
// Finish adding new package by adding it and updating shared
// user preferences
- insertPackageSettingLP(p, name, sharedUser);
+ addPackageSettingLP(p, name, sharedUser);
}
}
return p;
}
-
+
+ private void insertPackageSettingLP(PackageSetting p, PackageParser.Package pkg,
+ File codePath, File resourcePath) {
+ p.pkg = pkg;
+ // Update code path if needed
+ if (!codePath.toString().equalsIgnoreCase(p.codePathString)) {
+ Log.w(TAG, "Code path for pkg : " + p.pkg.packageName +
+ " changing form " + p.codePathString + " to " + codePath);
+ p.codePath = codePath;
+ p.codePathString = codePath.toString();
+ }
+ //Update resource path if needed
+ if (!resourcePath.toString().equalsIgnoreCase(p.resourcePathString)) {
+ Log.w(TAG, "Resource path for pkg : " + p.pkg.packageName +
+ " changing form " + p.resourcePathString + " to " + resourcePath);
+ p.resourcePath = resourcePath;
+ p.resourcePathString = resourcePath.toString();
+ }
+ // Update version code if needed
+ if (pkg.mVersionCode != p.versionCode) {
+ p.versionCode = pkg.mVersionCode;
+ }
+ addPackageSettingLP(p, pkg.packageName, p.sharedUser);
+ }
+
// Utility method that adds a PackageSetting to mPackages and
// completes updating the shared user attributes
- private void insertPackageSettingLP(PackageSetting p, String name,
+ private void addPackageSettingLP(PackageSetting p, String name,
SharedUserSetting sharedUser) {
mPackages.put(name, p);
if (sharedUser != null) {
@@ -5988,7 +6077,7 @@ class PackageManagerService extends IPackageManager.Stub {
}
if (mUserIds.get(index) != null) {
reportSettingsProblem(Log.ERROR,
- "Adding duplicate shared id: " + uid
+ "Adding duplicate user id: " + uid
+ " name=" + name);
return false;
}
diff --git a/services/java/com/android/server/WifiService.java b/services/java/com/android/server/WifiService.java
index b4754b6..394ed3a 100644
--- a/services/java/com/android/server/WifiService.java
+++ b/services/java/com/android/server/WifiService.java
@@ -1075,6 +1075,17 @@ public class WifiService extends IWifiManager.Stub {
break setVariables;
}
+ if ((config.phase2 != null) && !WifiNative.setNetworkVariableCommand(
+ netId,
+ WifiConfiguration.phase2VarName,
+ config.phase2)) {
+ if (DBG) {
+ Log.d(TAG, config.SSID + ": failed to set phase2: "+
+ config.phase2);
+ }
+ break setVariables;
+ }
+
if ((config.identity != null) && !WifiNative.setNetworkVariableCommand(
netId,
WifiConfiguration.identityVarName,
diff --git a/services/java/com/android/server/WindowManagerService.java b/services/java/com/android/server/WindowManagerService.java
index 0be8417..5a02c4d 100644
--- a/services/java/com/android/server/WindowManagerService.java
+++ b/services/java/com/android/server/WindowManagerService.java
@@ -6837,6 +6837,10 @@ public class WindowManagerService extends IWindowManager.Stub implements Watchdo
pw.print(mOrientationChanging);
pw.print(" mAppFreezing="); pw.println(mAppFreezing);
}
+ if (mHScale != 1 || mVScale != 1) {
+ pw.print(prefix); pw.print("mHScale="); pw.print(mHScale);
+ pw.print(" mVScale="); pw.println(mVScale);
+ }
}
@Override
@@ -8175,7 +8179,9 @@ public class WindowManagerService extends IWindowManager.Stub implements Watchdo
// This has changed the visibility of windows, so perform
// a new layout to get them all up-to-date.
mLayoutNeeded = true;
- moveInputMethodWindowsIfNeededLocked(true);
+ if (!moveInputMethodWindowsIfNeededLocked(true)) {
+ assignLayersLocked();
+ }
performLayoutLockedInner();
updateFocusedWindowLocked(UPDATE_FOCUS_PLACING_SURFACES);
diff --git a/services/java/com/android/server/am/ActivityManagerService.java b/services/java/com/android/server/am/ActivityManagerService.java
index d9c40ec..51ee41a 100644
--- a/services/java/com/android/server/am/ActivityManagerService.java
+++ b/services/java/com/android/server/am/ActivityManagerService.java
@@ -184,8 +184,7 @@ public final class ActivityManagerService extends ActivityManagerNative implemen
static final int LOG_BOOT_PROGRESS_ENABLE_SCREEN = 3050;
// The flags that are set for all calls we make to the package manager.
- static final int STOCK_PM_FLAGS = PackageManager.GET_SHARED_LIBRARY_FILES
- | PackageManager.GET_SUPPORTS_DENSITIES;
+ static final int STOCK_PM_FLAGS = PackageManager.GET_SHARED_LIBRARY_FILES;
private static final String SYSTEM_SECURE = "ro.secure";
@@ -724,6 +723,11 @@ public final class ActivityManagerService extends ActivityManagerNative implemen
Configuration mConfiguration = new Configuration();
/**
+ * Hardware-reported OpenGLES version.
+ */
+ final int GL_ES_VERSION;
+
+ /**
* List of initialization arguments to pass to all processes when binding applications to them.
* For example, references to the commonly used services.
*/
@@ -1396,6 +1400,9 @@ public final class ActivityManagerService extends ActivityManagerNative implemen
mUsageStatsService = new UsageStatsService( new File(
systemDir, "usagestats").toString());
+ GL_ES_VERSION = SystemProperties.getInt("ro.opengles.version",
+ ConfigurationInfo.GL_ES_VERSION_UNDEFINED);
+
mConfiguration.makeDefault();
mProcessStats.init();
@@ -4729,6 +4736,57 @@ public final class ActivityManagerService extends ActivityManagerNative implemen
Binder.restoreCallingIdentity(callingId);
}
}
+
+ /*
+ * The pkg name and uid have to be specified.
+ * @see android.app.IActivityManager#killApplicationWithUid(java.lang.String, int)
+ */
+ public void killApplicationWithUid(String pkg, int uid) {
+ if (pkg == null) {
+ return;
+ }
+ // Make sure the uid is valid.
+ if (uid < 0) {
+ Log.w(TAG, "Invalid uid specified for pkg : " + pkg);
+ return;
+ }
+ int callerUid = Binder.getCallingUid();
+ // Only the system server can kill an application
+ if (callerUid == Process.SYSTEM_UID) {
+ uninstallPackageLocked(pkg, uid, false);
+ } else {
+ throw new SecurityException(callerUid + " cannot kill pkg: " +
+ pkg);
+ }
+ }
+
+ public void closeSystemDialogs(String reason) {
+ Intent intent = new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS);
+ if (reason != null) {
+ intent.putExtra("reason", reason);
+ }
+
+ final int uid = Binder.getCallingUid();
+ final long origId = Binder.clearCallingIdentity();
+ synchronized (this) {
+ int i = mWatchers.beginBroadcast();
+ while (i > 0) {
+ i--;
+ IActivityWatcher w = mWatchers.getBroadcastItem(i);
+ if (w != null) {
+ try {
+ w.closingSystemDialogs(reason);
+ } catch (RemoteException e) {
+ }
+ }
+ }
+ mWatchers.finishBroadcast();
+
+ broadcastIntentLocked(null, null, intent, null,
+ null, 0, null, null, null, false, false, -1, uid);
+ }
+ Binder.restoreCallingIdentity(origId);
+ }
private void restartPackageLocked(final String packageName, int uid) {
uninstallPackageLocked(packageName, uid, false);
@@ -11847,6 +11905,7 @@ public final class ActivityManagerService extends ActivityManagerNative implemen
&& mConfiguration.keyboard != Configuration.KEYBOARD_NOKEYS) {
config.reqInputFeatures |= ConfigurationInfo.INPUT_FEATURE_HARD_KEYBOARD;
}
+ config.reqGlEsVersion = GL_ES_VERSION;
}
return config;
}