Closed
Bug 717841
Opened 12 years ago
Closed 12 years ago
Replace Date().getTime() calls with SystemClock.uptimeMillis() or System.currentTimeMillis()
Categories
(Firefox for Android Graveyard :: General, defect)
Tracking
(firefox11 fixed, firefox12 fixed, fennec11+)
RESOLVED
FIXED
Firefox 12
People
(Reporter: cpeterson, Assigned: cpeterson)
Details
(Whiteboard: [qa-])
Attachments
(2 files, 3 obsolete files)
1.23 KB,
patch
|
cpeterson
:
review+
akeybl
:
approval-mozilla-aurora+
|
Details | Diff | Splinter Review |
19.31 KB,
patch
|
cpeterson
:
review+
akeybl
:
approval-mozilla-aurora+
|
Details | Diff | Splinter Review |
1. Date().getTime() is inappropriate for measuring time durations because the "wall clock" can be changed by the user, the cell network, or DST. Google recommends using SystemClock.uptimeMillis() for measuring time durations. 2. new Date().getTime() is also inappropriate for getting the current system time_t because the caller must allocate a new Date object every call. System.currentTimeMillis() will return the same time value directly.
Assignee | ||
Comment 1•12 years ago
|
||
Attachment #588280 -
Flags: review?(bugmail.mozilla)
Attachment #588280 -
Flags: feedback?(doug.turner)
Assignee | ||
Comment 2•12 years ago
|
||
Fix AwesomeBarTabs.getSectionForTime() date range checks to properly handle exact midnight 00:00:00:0000. Also remove some redundant range checks and else statements.
Attachment #588282 -
Flags: review?(lucasr.at.mozilla)
Attachment #588282 -
Flags: feedback?(doug.turner)
Comment 3•12 years ago
|
||
Comment on attachment 588280 [details] [diff] [review] bug-717841-part-1-replace-Date-getTime-calls.patch Review of attachment 588280 [details] [diff] [review]: ----------------------------------------------------------------- r=me with changes ::: mobile/android/base/GeckoBatteryManager.java @@ +109,5 @@ > sRemainingTime = 0.0; > } else if (sLevel != previousLevel) { > // Estimate remaining time. > + if (sLastLevelChange != 0) { > + long currentTime = SystemClock.uptimeMillis(); I think for this one you should use SystemClock.elapsedRealtime() because it might span periods of device sleep. @@ +132,5 @@ > > sLastLevelChange = currentTime; > } else { > // That's the first time we got an update, we can't do anything. > + sLastLevelChange = SystemClock.uptimeMillis(); Ditto.
Attachment #588280 -
Flags: review?(bugmail.mozilla) → review+
Updated•12 years ago
|
Attachment #588282 -
Flags: review?(lucasr.at.mozilla) → review+
Assignee | ||
Comment 4•12 years ago
|
||
Changed GeckoBatteryManager calls to elapsedRealtime() and rebased patch. r=kats
Attachment #588280 -
Attachment is obsolete: true
Attachment #588280 -
Flags: feedback?(doug.turner)
Attachment #588501 -
Flags: review+
Assignee | ||
Comment 5•12 years ago
|
||
Rebased patch. r=lucasr
Attachment #588282 -
Attachment is obsolete: true
Attachment #588282 -
Flags: feedback?(doug.turner)
Attachment #588502 -
Flags: review+
Assignee | ||
Updated•12 years ago
|
Keywords: checkin-needed
Assignee | ||
Updated•12 years ago
|
Assignee: nobody → cpeterson
Status: NEW → ASSIGNED
Assignee | ||
Updated•12 years ago
|
Keywords: checkin-needed
Assignee | ||
Comment 6•12 years ago
|
||
Rebased patch. r=kats
Attachment #588501 -
Attachment is obsolete: true
Assignee | ||
Comment 7•12 years ago
|
||
Comment on attachment 589244 [details] [diff] [review] bug-717841-part-1-replace-Date-getTime-calls-v2-rebased.patch r=kats
Attachment #589244 -
Flags: review+
Comment 9•12 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/46328da0936d https://hg.mozilla.org/integration/mozilla-inbound/rev/e312a306ed01
Keywords: checkin-needed
Comment 10•12 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/46328da0936d https://hg.mozilla.org/mozilla-central/rev/e312a306ed01
Target Milestone: --- → Firefox 12
Updated•12 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Updated•12 years ago
|
tracking-fennec: --- → ?
status-firefox12:
--- → fixed
Assignee | ||
Comment 11•12 years ago
|
||
Comment on attachment 589244 [details] [diff] [review] bug-717841-part-1-replace-Date-getTime-calls-v2-rebased.patch [Approval Request Comment] Regression caused by (bug #): None User impact if declined: Trivial reduction in memory usage. Testing completed (on m-c, etc.): Merged to m-c yesterday. Risk to taking this patch (and alternatives if risky): Unlikely date/time bugs in bookmarks.
Attachment #589244 -
Flags: approval-mozilla-aurora?
Assignee | ||
Comment 12•12 years ago
|
||
Comment on attachment 588502 [details] [diff] [review] bug-717841-part-2-fix-HistoryQuery-day-checks-v1-rebased.patch [Approval Request Comment] Regression caused by (bug #): None User impact if declined: Bookmarks created at midnight will be miscategorized. Testing completed (on m-c, etc.): Merged to m-c yesterday. Risk to taking this patch (and alternatives if risky): Unlikely date/time bugs in bookmarks.
Attachment #588502 -
Flags: approval-mozilla-aurora?
Comment 13•12 years ago
|
||
I pushed https://hg.mozilla.org/releases/mozilla-aurora/rev/9f53cb953f31 because it had a=dougt in the commit message in the landing queue. But I see now it didn't have approval.
Assignee | ||
Comment 14•12 years ago
|
||
Sorry! I think my patch's "a=dougt" message was leftover from m-c checkin issue, not approval-mozilla-aurora. I will check my other patches for premature a= messages.
Comment 15•12 years ago
|
||
Generally you don't need a= for m-c/m-i checkins, unless there's something like a tree closure.
Comment 16•12 years ago
|
||
Comment on attachment 588502 [details] [diff] [review] bug-717841-part-2-fix-HistoryQuery-day-checks-v1-rebased.patch [Triage Comment] Mobile only - approved for Aurora.
Attachment #588502 -
Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Updated•12 years ago
|
Attachment #589244 -
Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Comment 17•12 years ago
|
||
https://hg.mozilla.org/releases/mozilla-aurora/rev/5f71567515b5
tracking-fennec: ? → 11+
status-firefox11:
--- → fixed
Updated•3 years ago
|
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•