diff options
3 files changed, 36 insertions, 19 deletions
diff --git a/services/java/com/android/server/PackageManagerService.java b/services/java/com/android/server/PackageManagerService.java index 0d190cafcd4e..b85cf2cf2495 100644 --- a/services/java/com/android/server/PackageManagerService.java +++ b/services/java/com/android/server/PackageManagerService.java @@ -60,6 +60,7 @@ 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; @@ -2046,8 +2047,9 @@ class PackageManagerService extends IPackageManager.Stub { + suid.userId + "): packages=" + suid.packages); } } - - // Just create the setting, don't add it yet + + // Just create the setting, don't add it yet. For already existing packages + // the PkgSetting exists already and doesn't have to be created. pkgSetting = mSettings.getPackageLP(pkg, suid, destCodeFile, destResourceFile, pkg.applicationInfo.flags, true, false); if (pkgSetting == null) { @@ -2272,7 +2274,7 @@ class PackageManagerService extends IPackageManager.Stub { // Add the new setting to mSettings mSettings.insertPackageSettingLP(pkgSetting, pkg.packageName, suid); // Add the new setting to mPackages - mPackages.put(pkg.applicationInfo.packageName, pkg); + mPackages.put(pkg.applicationInfo.packageName, pkg); int N = pkg.providers.size(); StringBuilder r = null; int i; @@ -5422,10 +5424,10 @@ class PackageManagerService extends IPackageManager.Stub { */ static class PackageSettingBase extends GrantedPermissions { final String name; - final File codePath; - final String codePathString; - final File resourcePath; - final String resourcePathString; + File codePath; + String codePathString; + File resourcePath; + String resourcePathString; private long timeStamp; private String timeStampString = "0"; final int versionCode; @@ -5823,11 +5825,16 @@ class PackageManagerService extends IPackageManager.Stub { // and data partition. Just let the most recent version // take precedence. return p; - } else if ((p.pkg != null) && (p.pkg.applicationInfo != null)) { + } 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"); + + " 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, @@ -5851,6 +5858,7 @@ 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); } else { p.userId = FIRST_APPLICATION_UID; diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index c9dcd8b0dd2a..ba5c6e73680a 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -322,7 +322,9 @@ public class TelephonyManager { /** * Returns the alphabetic name of current registered operator. * <p> - * Availability: Only when user is registered to a network + * Availability: Only when user is registered to a network. Result may be + * unreliable on CDMA networks (use {@link #getPhoneType()} to determine if + * on a CDMA network). */ public String getNetworkOperatorName() { return SystemProperties.get(TelephonyProperties.PROPERTY_OPERATOR_ALPHA); @@ -331,7 +333,9 @@ public class TelephonyManager { /** * Returns the numeric name (MCC+MNC) of current registered operator. * <p> - * Availability: Only when user is registered to a network + * Availability: Only when user is registered to a network. Result may be + * unreliable on CDMA networks (use {@link #getPhoneType()} to determine if + * on a CDMA network). */ public String getNetworkOperator() { return SystemProperties.get(TelephonyProperties.PROPERTY_OPERATOR_NUMERIC); @@ -341,7 +345,7 @@ public class TelephonyManager { * Returns true if the device is considered roaming on the current * network, for GSM purposes. * <p> - * Availability: Only when user registered to a network + * Availability: Only when user registered to a network. */ public boolean isNetworkRoaming() { return "true".equals(SystemProperties.get(TelephonyProperties.PROPERTY_OPERATOR_ISROAMING)); @@ -351,7 +355,9 @@ public class TelephonyManager { * Returns the ISO country code equivilent of the current registered * operator's MCC (Mobile Country Code). * <p> - * Availability: Only when user is registered to a network + * Availability: Only when user is registered to a network. Result may be + * unreliable on CDMA networks (use {@link #getPhoneType()} to determine if + * on a CDMA network). */ public String getNetworkCountryIso() { return SystemProperties.get(TelephonyProperties.PROPERTY_OPERATOR_ISO_COUNTRY); diff --git a/telephony/java/com/android/internal/telephony/TelephonyProperties.java b/telephony/java/com/android/internal/telephony/TelephonyProperties.java index 290e1fc24b71..5ec4020d6fdc 100644 --- a/telephony/java/com/android/internal/telephony/TelephonyProperties.java +++ b/telephony/java/com/android/internal/telephony/TelephonyProperties.java @@ -40,14 +40,16 @@ public interface TelephonyProperties //****** Current Network - /** Alpha name of current registered operator. - * Availability: when registered to a network + /** Alpha name of current registered operator.<p> + * Availability: when registered to a network. Result may be unreliable on + * CDMA networks. */ static final String PROPERTY_OPERATOR_ALPHA = "gsm.operator.alpha"; //TODO: most of these proprieties are generic, substitute gsm. with phone. bug 1856959 - /** Numeric name (MCC+MNC) of current registered operator. - * Availability: when registered to a network + /** Numeric name (MCC+MNC) of current registered operator.<p> + * Availability: when registered to a network. Result may be unreliable on + * CDMA networks. */ static final String PROPERTY_OPERATOR_NUMERIC = "gsm.operator.numeric"; @@ -64,8 +66,9 @@ public interface TelephonyProperties static final String PROPERTY_OPERATOR_ISROAMING = "gsm.operator.isroaming"; /** The ISO country code equivalent of the current registered operator's - * MCC (Mobile Country Code) - * Availability: when registered to a network + * MCC (Mobile Country Code)<p> + * Availability: when registered to a network. Result may be unreliable on + * CDMA networks. */ static final String PROPERTY_OPERATOR_ISO_COUNTRY = "gsm.operator.iso-country"; |