mirror of
https://github.com/apache/cordova-android.git
synced 2025-05-14 07:10:40 +08:00
Calling the Quota method over and over is bad, use the estimated size
This commit is contained in:
parent
b18657cf72
commit
f15555ee34
@ -254,11 +254,11 @@ public class DroidGap extends Activity {
|
|||||||
long totalUsedQuota, WebStorage.QuotaUpdater quotaUpdater)
|
long totalUsedQuota, WebStorage.QuotaUpdater quotaUpdater)
|
||||||
{
|
{
|
||||||
Log.d(TAG, "event raised onExceededDatabaseQuota estimatedSize: " + Long.toString(estimatedSize) + " currentQuota: " + Long.toString(currentQuota) + " totalUsedQuota: " + Long.toString(totalUsedQuota));
|
Log.d(TAG, "event raised onExceededDatabaseQuota estimatedSize: " + Long.toString(estimatedSize) + " currentQuota: " + Long.toString(currentQuota) + " totalUsedQuota: " + Long.toString(totalUsedQuota));
|
||||||
|
|
||||||
if( estimatedSize < MAX_QUOTA)
|
if( estimatedSize < MAX_QUOTA)
|
||||||
{
|
{
|
||||||
//increase for 1Mb
|
//increase for 1Mb
|
||||||
long newQuota = currentQuota + 1024*1024;
|
long newQuota = estimatedSize;
|
||||||
Log.d(TAG, "calling quotaUpdater.updateQuota newQuota: " + Long.toString(newQuota) );
|
Log.d(TAG, "calling quotaUpdater.updateQuota newQuota: " + Long.toString(newQuota) );
|
||||||
quotaUpdater.updateQuota(newQuota);
|
quotaUpdater.updateQuota(newQuota);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user