mirror of
https://github.com/apache/cordova-android.git
synced 2025-01-19 07:02:51 +08:00
Fixin group storage
This commit is contained in:
parent
5ee34b58d7
commit
5fb6aa77b3
@ -163,20 +163,20 @@ public class ContactManager {
|
||||
if (all)
|
||||
mView.loadUrl("javascript:navigator.ContactManager.droidAddContact('" + name + "','" + phoneNumber + "','" + email +"')");
|
||||
else
|
||||
mView.loadUrl("javascript:navigator.Contacts.droidFoundContact('" + name + "','" + phoneNumber + "','" + email +"')");
|
||||
mView.loadUrl("javascript:navigator.contacts.droidFoundContact('" + name + "','" + phoneNumber + "','" + email +"')");
|
||||
|
||||
} while (cur.moveToNext());
|
||||
if (all)
|
||||
mView.loadUrl("javascript:navigator.ContactManager.droidDone()");
|
||||
else
|
||||
mView.loadUrl("javascript:navigator.Contacts.droidDone();");
|
||||
mView.loadUrl("javascript:navigator.contacts.droidDone();");
|
||||
}
|
||||
else
|
||||
{
|
||||
if(all)
|
||||
mView.loadUrl("javascript:navigator.ContactManager.fail()");
|
||||
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 +"')");
|
||||
}
|
||||
} while (cur.moveToNext());
|
||||
mView.loadUrl("javascript:navigator.Contacts.droidDoneContacts();");
|
||||
mView.loadUrl("javascript:navigator.contacts.droidDoneContacts();");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -29,6 +29,7 @@ import android.content.IntentFilter;
|
||||
import android.hardware.SensorManager;
|
||||
import android.net.Uri;
|
||||
import android.os.Vibrator;
|
||||
import android.provider.Settings;
|
||||
import android.telephony.TelephonyManager;
|
||||
import android.webkit.WebView;
|
||||
import android.media.Ringtone;
|
||||
@ -80,15 +81,12 @@ public class PhoneGap{
|
||||
|
||||
public String getUuid()
|
||||
{
|
||||
TelephonyManager operator = (TelephonyManager) mCtx.getSystemService(Context.TELEPHONY_SERVICE);
|
||||
String uuid = operator.getDeviceId();
|
||||
//TelephonyManager operator = (TelephonyManager) mCtx.getSystemService(Context.TELEPHONY_SERVICE);
|
||||
//String uuid = operator.getDeviceId();
|
||||
String uuid = Settings.Secure.getString(mCtx.getContentResolver(), android.provider.Settings.Secure.ANDROID_ID);
|
||||
return uuid;
|
||||
}
|
||||
|
||||
public void init()
|
||||
{
|
||||
mAppView.loadUrl("javascript:Device.setData('Android','" + version + "','" + this.getUuid() + "')");
|
||||
}
|
||||
|
||||
public String getModel()
|
||||
{
|
||||
@ -174,31 +172,7 @@ public class PhoneGap{
|
||||
|
||||
public int 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() {
|
||||
TimeZone tz = TimeZone.getDefault();
|
||||
|
@ -38,7 +38,7 @@ public class Storage {
|
||||
{
|
||||
Log.d(LOG_TAG, ex.getMessage());
|
||||
txid = "";
|
||||
//TODO: Call FAIL!
|
||||
appView.loadUrl("droiddb.fail(" + ex.getMessage() + "," + txid + ")");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -66,5 +66,5 @@ Contacts.prototype.droidDone = function()
|
||||
}
|
||||
|
||||
PhoneGap.addConstructor(function() {
|
||||
if(typeof navigator.Contacts == "undefined") navigator.Contacts = new Contacts();
|
||||
if(typeof navigator.contacts == "undefined") navigator.contacts = new Contacts();
|
||||
});
|
||||
|
@ -25,6 +25,12 @@ DroidDB.prototype.completeQuery = function(tx_id)
|
||||
tx.win(r);
|
||||
}
|
||||
|
||||
DroidDB.prototype.fail = function(reason, tx_id)
|
||||
{
|
||||
var tx = this.txQueue[tx_id];
|
||||
tx.fail(reason);
|
||||
}
|
||||
|
||||
var DatabaseShell = function()
|
||||
{
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user