summaryrefslogtreecommitdiffstats
path: root/src/com/android/browser/AutoFillProfileDatabase.java
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2010-10-08 12:41:33 +0100
committerBen Murdoch <benm@google.com>2010-10-13 11:33:39 +0100
commit0cb8189efd19242f4b2962378bf32de122dafde0 (patch)
tree8cc24b37605104865bfbfcaa212add0e98902d67 /src/com/android/browser/AutoFillProfileDatabase.java
parentfb951243cfc8b552939f69b6b8824564acad914b (diff)
downloadpackages_apps_browser-0cb8189efd19242f4b2962378bf32de122dafde0.zip
packages_apps_browser-0cb8189efd19242f4b2962378bf32de122dafde0.tar.gz
packages_apps_browser-0cb8189efd19242f4b2962378bf32de122dafde0.tar.bz2
Sync Autofill profile data native side
When the user adds or edits the AutoFill profile, sync that data to the native WebKit code through the BrowserSettings object. Also sync the profile data on startup if it is available. Change-Id: I6146a842cb765f8ed91c109537038baad6b547fb
Diffstat (limited to 'src/com/android/browser/AutoFillProfileDatabase.java')
-rw-r--r--src/com/android/browser/AutoFillProfileDatabase.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/com/android/browser/AutoFillProfileDatabase.java b/src/com/android/browser/AutoFillProfileDatabase.java
index e3d6ea2..5557aaf 100644
--- a/src/com/android/browser/AutoFillProfileDatabase.java
+++ b/src/com/android/browser/AutoFillProfileDatabase.java
@@ -22,6 +22,7 @@ import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.provider.BaseColumns;
import android.util.Log;
+import android.webkit.WebSettings.AutoFillProfile;
public class AutoFillProfileDatabase {
@@ -78,13 +79,13 @@ public class AutoFillProfileDatabase {
return writable ? mOpenHelper.getWritableDatabase() : mOpenHelper.getReadableDatabase();
}
- public void addOrUpdateProfile(final int id, final String fullName, final String email) {
+ public void addOrUpdateProfile(final int id, AutoFillProfile profile) {
final String SQL = "INSERT OR REPLACE INTO " + PROFILES_TABLE_NAME + " ("
+ Profiles._ID + ","
+ Profiles.FULL_NAME + ","
+ Profiles.EMAIL_ADDRESS
+ ") VALUES (?,?,?);";
- final Object[] PARAMS = {id, fullName, email};
+ final Object[] PARAMS = { id, profile.getFullName(), profile.getEmailAddress() };
getDatabase(true).execSQL(SQL, PARAMS);
}