cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CB-8929) battery-status on Windows fails to work on Windows 10, thinks a Phone is a Desktop device
Date Tue, 08 Nov 2016 08:30:58 GMT

    [ https://issues.apache.org/jira/browse/CB-8929?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15646897#comment-15646897
] 

ASF GitHub Bot commented on CB-8929:
------------------------------------

Github user daserge commented on a diff in the pull request:

    https://github.com/apache/cordova-plugin-battery-status/pull/42#discussion_r86942697
  
    --- Diff: src/windows/BatteryProxy.js ---
    @@ -19,7 +19,38 @@
      *
      */
     
    -/* global WinJS, BatteryStatus */
    +/* global Windows, WinJS, BatteryStatus */
    +
    +var PowerManager = Windows && Windows.System &&
    +    Windows.System.Power && Windows.System.Power.PowerManager;
    +
    +if (PowerManager) {
    +    var BatteryWin10 = {
    +        start: function (win, fail) {
    +
    +            function reportStatus() {
    +                win({
    +                    level: PowerManager.remainingChargePercent,
    +                    isPlugged: PowerManager.powerSupplyStatus !== Windows.System.Power.PowerSupplyStatus.notPresent
    +                }, { keepCallback: true });
    +            }
    +
    +            PowerManager.onremainingchargepercentchanged = reportStatus;
    --- End diff --
    
    Would not it be better to use add/remove event listener here instead to avoid overriding
a listener which might be set in an app code?


> battery-status on Windows fails to work on Windows 10, thinks a Phone is a Desktop device
> -----------------------------------------------------------------------------------------
>
>                 Key: CB-8929
>                 URL: https://issues.apache.org/jira/browse/CB-8929
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Plugin Battery Status, Windows
>            Reporter: Rob Paveza
>            Priority: Minor
>
> On a Windows 10 phone, the Battery Status responds that Battery Status isn't available
on a Windows Desktop device.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


Mime
View raw message