From 0cb8189efd19242f4b2962378bf32de122dafde0 Mon Sep 17 00:00:00 2001 From: Ben Murdoch Date: Fri, 8 Oct 2010 12:41:33 +0100 Subject: 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 --- src/com/android/browser/AutoFillProfileDatabase.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/com/android/browser/AutoFillProfileDatabase.java') diff --git a/src/com/android/browser/AutoFillProfileDatabase.java b/src/com/android/browser/AutoFillProfileDatabase.java index e3d6ea221..5557aafff 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); } -- cgit v1.2.3