Fixin group storage

This commit is contained in:
Joe Bowser 2009-12-15 10:38:38 -08:00
parent 5ee34b58d7
commit 5fb6aa77b3
5 changed files with 17 additions and 37 deletions

View File

@ -163,20 +163,20 @@ public class ContactManager {
if (all) if (all)
mView.loadUrl("javascript:navigator.ContactManager.droidAddContact('" + name + "','" + phoneNumber + "','" + email +"')"); mView.loadUrl("javascript:navigator.ContactManager.droidAddContact('" + name + "','" + phoneNumber + "','" + email +"')");
else else
mView.loadUrl("javascript:navigator.Contacts.droidFoundContact('" + name + "','" + phoneNumber + "','" + email +"')"); mView.loadUrl("javascript:navigator.contacts.droidFoundContact('" + name + "','" + phoneNumber + "','" + email +"')");
} while (cur.moveToNext()); } while (cur.moveToNext());
if (all) if (all)
mView.loadUrl("javascript:navigator.ContactManager.droidDone()"); mView.loadUrl("javascript:navigator.ContactManager.droidDone()");
else else
mView.loadUrl("javascript:navigator.Contacts.droidDone();"); mView.loadUrl("javascript:navigator.contacts.droidDone();");
} }
else else
{ {
if(all) if(all)
mView.loadUrl("javascript:navigator.ContactManager.fail()"); mView.loadUrl("javascript:navigator.ContactManager.fail()");
else else
mView.loadUrl("javascript:navigator.Contacts.fail('None found!')"); mView.loadUrl("javascript:navigator.contacts.fail('None found!')");
} }
} }
@ -202,7 +202,7 @@ public class ContactManager {
mView.loadUrl("javascript:navigator.Contacts.droidFoundContact('" + data.name + "','" + data.phone + "','" + data.email +"')"); mView.loadUrl("javascript:navigator.Contacts.droidFoundContact('" + data.name + "','" + data.phone + "','" + data.email +"')");
} }
} while (cur.moveToNext()); } while (cur.moveToNext());
mView.loadUrl("javascript:navigator.Contacts.droidDoneContacts();"); mView.loadUrl("javascript:navigator.contacts.droidDoneContacts();");
} }
} }

View File

@ -29,6 +29,7 @@ import android.content.IntentFilter;
import android.hardware.SensorManager; import android.hardware.SensorManager;
import android.net.Uri; import android.net.Uri;
import android.os.Vibrator; import android.os.Vibrator;
import android.provider.Settings;
import android.telephony.TelephonyManager; import android.telephony.TelephonyManager;
import android.webkit.WebView; import android.webkit.WebView;
import android.media.Ringtone; import android.media.Ringtone;
@ -80,15 +81,12 @@ public class PhoneGap{
public String getUuid() public String getUuid()
{ {
TelephonyManager operator = (TelephonyManager) mCtx.getSystemService(Context.TELEPHONY_SERVICE); //TelephonyManager operator = (TelephonyManager) mCtx.getSystemService(Context.TELEPHONY_SERVICE);
String uuid = operator.getDeviceId(); //String uuid = operator.getDeviceId();
String uuid = Settings.Secure.getString(mCtx.getContentResolver(), android.provider.Settings.Secure.ANDROID_ID);
return uuid; return uuid;
} }
public void init()
{
mAppView.loadUrl("javascript:Device.setData('Android','" + version + "','" + this.getUuid() + "')");
}
public String getModel() public String getModel()
{ {
@ -176,30 +174,6 @@ public class PhoneGap{
return audio.getAudioOutputDevice(); return audio.getAudioOutputDevice();
} }
public String getLine1Number() {
TelephonyManager tm =
(TelephonyManager)mCtx.getSystemService(Context.TELEPHONY_SERVICE);
return(tm.getLine1Number());
}
public String getVoiceMailNumber() {
TelephonyManager tm =
(TelephonyManager)mCtx.getSystemService(Context.TELEPHONY_SERVICE);
return(tm.getVoiceMailNumber());
}
public String getNetworkOperatorName(){
TelephonyManager tm =
(TelephonyManager)mCtx.getSystemService(Context.TELEPHONY_SERVICE);
return(tm.getNetworkOperatorName());
}
public String getSimCountryIso(){
TelephonyManager tm =
(TelephonyManager)mCtx.getSystemService(Context.TELEPHONY_SERVICE);
return(tm.getSimCountryIso());
}
public String getTimeZoneID() { public String getTimeZoneID() {
TimeZone tz = TimeZone.getDefault(); TimeZone tz = TimeZone.getDefault();
return(tz.getID()); return(tz.getID());

View File

@ -38,7 +38,7 @@ public class Storage {
{ {
Log.d(LOG_TAG, ex.getMessage()); Log.d(LOG_TAG, ex.getMessage());
txid = ""; txid = "";
//TODO: Call FAIL! appView.loadUrl("droiddb.fail(" + ex.getMessage() + "," + txid + ")");
} }
} }

View File

@ -66,5 +66,5 @@ Contacts.prototype.droidDone = function()
} }
PhoneGap.addConstructor(function() { PhoneGap.addConstructor(function() {
if(typeof navigator.Contacts == "undefined") navigator.Contacts = new Contacts(); if(typeof navigator.contacts == "undefined") navigator.contacts = new Contacts();
}); });

View File

@ -25,6 +25,12 @@ DroidDB.prototype.completeQuery = function(tx_id)
tx.win(r); tx.win(r);
} }
DroidDB.prototype.fail = function(reason, tx_id)
{
var tx = this.txQueue[tx_id];
tx.fail(reason);
}
var DatabaseShell = function() var DatabaseShell = function()
{ {