mirror of
https://github.com/apache/cordova-android.git
synced 2025-01-19 15:12:51 +08:00
Fixin group storage
This commit is contained in:
parent
5ee34b58d7
commit
5fb6aa77b3
@ -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();");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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());
|
||||||
|
@ -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 + ")");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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();
|
||||||
});
|
});
|
||||||
|
@ -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()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user