WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
Bug 92964
[EFL] Change return value of battey level
https://bugs.webkit.org/show_bug.cgi?id=92964
Summary
[EFL] Change return value of battey level
Kihong Kwon
Reported
2012-08-02 02:36:16 PDT
Battery level is defined like below, in the Battery Status API spec. ------------------------------------------------------------ level of type double, readonly Represents the current battery level scaled from 0 to 1.0. No exceptions. ------------------------------------------------------------ But EFL battery returns 0 ~ 100 level. Therefore we need to fix this to 0 ~ 1.0.
Attachments
Patch
(1.73 KB, patch)
2012-08-02 03:34 PDT
,
Kihong Kwon
no flags
Details
Formatted Diff
Diff
Patch
(1.84 KB, patch)
2012-08-02 03:54 PDT
,
Kihong Kwon
no flags
Details
Formatted Diff
Diff
Patch
(2.16 KB, patch)
2012-08-02 04:13 PDT
,
Kihong Kwon
no flags
Details
Formatted Diff
Diff
Patch
(1.95 KB, patch)
2012-08-02 05:39 PDT
,
Kihong Kwon
no flags
Details
Formatted Diff
Diff
Patch
(1.90 KB, patch)
2012-08-02 05:49 PDT
,
Kihong Kwon
no flags
Details
Formatted Diff
Diff
Show Obsolete
(4)
View All
Add attachment
proposed patch, testcase, etc.
Kihong Kwon
Comment 1
2012-08-02 03:34:41 PDT
Created
attachment 156027
[details]
Patch
Ryuan Choi
Comment 2
2012-08-02 03:50:00 PDT
Comment on
attachment 156027
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=156027&action=review
> Source/WebCore/platform/efl/BatteryProviderEfl.cpp:165 > levelChanged = true; > level = property->val.d; > > - WTF::RefPtr<BatteryStatus> batteryStatus = BatteryStatus::create(charging, chargingTime, dischargingTime, level); > + WTF::RefPtr<BatteryStatus> batteryStatus = BatteryStatus::create(charging, chargingTime, dischargingTime, level / 100);
If then, should we compare with clientBatteryStatus->level() * 100 and property->val.d ? IMO, you'd better to assign property->val.d / 100 to `level` to reduce confusion.
Kihong Kwon
Comment 3
2012-08-02 03:52:44 PDT
(In reply to
comment #2
)
> (From update of
attachment 156027
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=156027&action=review
> > > Source/WebCore/platform/efl/BatteryProviderEfl.cpp:165 > > levelChanged = true; > > level = property->val.d; > > > > - WTF::RefPtr<BatteryStatus> batteryStatus = BatteryStatus::create(charging, chargingTime, dischargingTime, level); > > + WTF::RefPtr<BatteryStatus> batteryStatus = BatteryStatus::create(charging, chargingTime, dischargingTime, level / 100); > > If then, should we compare with clientBatteryStatus->level() * 100 and property->val.d ? > > IMO, you'd better to assign property->val.d / 100 to `level` to reduce confusion.
You are right. It was my mistake.
Kihong Kwon
Comment 4
2012-08-02 03:54:48 PDT
Created
attachment 156032
[details]
Patch
Ryuan Choi
Comment 5
2012-08-02 04:09:19 PDT
Comment on
attachment 156032
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=156032&action=review
> Source/WebCore/platform/efl/BatteryProviderEfl.cpp:163 > - if (!clientBatteryStatus || clientBatteryStatus->level() != property->val.d) > + if (!clientBatteryStatus || clientBatteryStatus->level() != property->val.d / 100) > levelChanged = true; > - level = property->val.d; > + level = property->val.d / 100;
I am not sure why you use level, local variable. IMO, you can remove level variable or assign it before 161 line with declaration.
Kihong Kwon
Comment 6
2012-08-02 04:13:53 PDT
Created
attachment 156037
[details]
Patch
Kihong Kwon
Comment 7
2012-08-02 05:39:44 PDT
Created
attachment 156051
[details]
Patch
Ryuan Choi
Comment 8
2012-08-02 05:44:49 PDT
Comment on
attachment 156051
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=156051&action=review
> Source/WebCore/ChangeLog:11 > + No new tests, no behavior changed.
I think that this comment is wrong. This patch changes behavior but we can not make automated tests for this because we can not emulate E_Ukit.
> Source/WebCore/platform/efl/BatteryProviderEfl.cpp:155 > + double level = property->val.d / 100;
I think that property of "Percentage" is not assigned yet.
Kihong Kwon
Comment 9
2012-08-02 05:49:59 PDT
Created
attachment 156053
[details]
Patch
WebKit Review Bot
Comment 10
2012-08-02 06:46:00 PDT
Comment on
attachment 156053
[details]
Patch Clearing flags on attachment: 156053 Committed
r124450
: <
http://trac.webkit.org/changeset/124450
>
WebKit Review Bot
Comment 11
2012-08-02 06:46:05 PDT
All reviewed patches have been landed. Closing bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug