Merge change 4182 into donut

* changes:
  Add more data to reliability test report, includes min, max, std, run data.
diff --git a/libs/utils/BackupData.cpp b/libs/utils/BackupData.cpp
index 120f23d..8c9f875 100644
--- a/libs/utils/BackupData.cpp
+++ b/libs/utils/BackupData.cpp
@@ -327,7 +327,7 @@
     }
     size_t size = m_header.app.packageLen;
     char* buf = packageName->lockBuffer(size);
-    if (packageName == NULL) {
+    if (buf == NULL) {
         packageName->unlockBuffer();
         m_status = ENOMEM;
         return m_status;
diff --git a/vpn/java/android/net/vpn/L2tpIpsecProfile.java b/vpn/java/android/net/vpn/L2tpIpsecProfile.java
index 893afbe..181619d 100644
--- a/vpn/java/android/net/vpn/L2tpIpsecProfile.java
+++ b/vpn/java/android/net/vpn/L2tpIpsecProfile.java
@@ -22,7 +22,7 @@
  * The profile for L2TP-over-IPSec type of VPN.
  * {@hide}
  */
-public class L2tpIpsecProfile extends SingleServerProfile {
+public class L2tpIpsecProfile extends VpnProfile {
     private static final long serialVersionUID = 1L;
 
     private String mUserCertificate;
diff --git a/vpn/java/android/net/vpn/L2tpProfile.java b/vpn/java/android/net/vpn/L2tpProfile.java
index 559590f..59d4981 100644
--- a/vpn/java/android/net/vpn/L2tpProfile.java
+++ b/vpn/java/android/net/vpn/L2tpProfile.java
@@ -20,7 +20,7 @@
  * The profile for L2TP type of VPN.
  * {@hide}
  */
-public class L2tpProfile extends SingleServerProfile {
+public class L2tpProfile extends VpnProfile {
     private static final long serialVersionUID = 1L;
 
     @Override
diff --git a/vpn/java/android/net/vpn/SingleServerProfile.java b/vpn/java/android/net/vpn/SingleServerProfile.java
deleted file mode 100644
index 59b5a7b..0000000
--- a/vpn/java/android/net/vpn/SingleServerProfile.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright (C) 2007, The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.net.vpn;
-
-import android.os.Parcel;
-
-/**
- * The profile for single-server type of VPN.
- * {@hide}
- */
-public abstract class SingleServerProfile extends VpnProfile {
-    private String mServerName;
-
-    public void setServerName(String name) {
-        mServerName = name;
-    }
-
-    public String getServerName() {
-        return mServerName;
-    }
-
-    @Override
-    protected void readFromParcel(Parcel in) {
-        super.readFromParcel(in);
-        mServerName = in.readString();
-    }
-
-    @Override
-    public void writeToParcel(Parcel parcel, int flags) {
-        super.writeToParcel(parcel, flags);
-        parcel.writeString(mServerName);
-    }
-}
diff --git a/vpn/java/android/net/vpn/VpnProfile.java b/vpn/java/android/net/vpn/VpnProfile.java
index 1bfc102..9e24da4 100644
--- a/vpn/java/android/net/vpn/VpnProfile.java
+++ b/vpn/java/android/net/vpn/VpnProfile.java
@@ -31,8 +31,10 @@
     private static final long serialVersionUID = 1L;
     private String mName; // unique display name
     private String mId; // unique identifier
+    private String mServerName; // VPN server name
     private String mDomainSuffices; // space separated list
     private String mRouteList; // space separated list
+    private String mSavedUsername;
     private boolean mIsCustomized;
     private transient VpnState mState = VpnState.IDLE;
 
@@ -58,6 +60,17 @@
     }
 
     /**
+     * Sets the name of the VPN server. Used for DNS lookup.
+     */
+    public void setServerName(String name) {
+        mServerName = name;
+    }
+
+    public String getServerName() {
+        return mServerName;
+    }
+
+    /**
      * Sets the domain suffices for DNS resolution.
      *
      * @param entries a comma-separated list of domain suffices
@@ -84,6 +97,14 @@
         return mRouteList;
     }
 
+    public void setSavedUsername(String name) {
+        mSavedUsername = name;
+    }
+
+    public String getSavedUsername() {
+        return mSavedUsername;
+    }
+
     public void setState(VpnState state) {
         mState = state;
     }
@@ -116,8 +137,10 @@
     protected void readFromParcel(Parcel in) {
         mName = in.readString();
         mId = in.readString();
+        mServerName = in.readString();
         mDomainSuffices = in.readString();
         mRouteList = in.readString();
+        mSavedUsername = in.readString();
     }
 
     public static final Parcelable.Creator<VpnProfile> CREATOR =
@@ -142,8 +165,10 @@
         parcel.writeInt(mIsCustomized ? 1 : 0);
         parcel.writeString(mName);
         parcel.writeString(mId);
+        parcel.writeString(mServerName);
         parcel.writeString(mDomainSuffices);
         parcel.writeString(mRouteList);
+        parcel.writeString(mSavedUsername);
     }
 
     public int describeContents() {