xamarin / XamarinCommunityToolkit

The Xamarin Community Toolkit is a collection of Animations, Behaviors, Converters, and Effects for mobile development with Xamarin.Forms. It simplifies and demonstrates common developer tasks building iOS, Android, and UWP apps with Xamarin.Forms.
MIT License
1.59k stars 474 forks source link

[Bug] MediaElement property KeepScreenOn=false not working on android when playing video #727

Open NebulaSleuth opened 3 years ago

NebulaSleuth commented 3 years ago

Description

When using KeepScreenOn property of MediaElement on android and playing video the device will never sleep during playback.

Steps to Reproduce

  1. Play a video using MediaElement on android and set the KeepScreenOn=false property.

Expected Behavior

Device will go to sleep just like if video is not playing

Actual Behavior

Device does not sleep during playback

Basic Information

Xamarin.Forms: v4.8.0.1821 Target Framework: 10 Minimum Android Version: 5.0

Environment

Microsoft Visual Studio Enterprise 2019 Version 16.8.3 VisualStudio.16.Release/16.8.3+30804.86 Microsoft .NET Framework Version 4.8.04084

Installed Version: Enterprise

Visual C++ 2019 00435-60000-00000-AA604 Microsoft Visual C++ 2019

ADL Tools Service Provider 1.0 This package contains services used by Data Lake tools

ASA Service Provider 1.0

ASP.NET and Web Tools 2019 16.8.554.20160 ASP.NET and Web Tools 2019

ASP.NET Core Razor Language Services 16.1.0.2052803+84e121f1403378489b842e1797df2f3f5a49ac3c Provides languages services for ASP.NET Core Razor.

ASP.NET Web Frameworks and Tools 2019 16.8.554.20160 For additional information, visit https://www.asp.net/

Azure App Service Tools v3.0.0 16.8.554.20160 Azure App Service Tools v3.0.0

Azure Data Lake Node 1.0 This package contains the Data Lake integration nodes for Server Explorer.

Azure Data Lake Tools for Visual Studio 2.6.1000.0 Microsoft Azure Data Lake Tools for Visual Studio

Azure Functions and Web Jobs Tools 16.8.554.20160 Azure Functions and Web Jobs Tools

Azure Stream Analytics Tools for Visual Studio 2.6.1000.0 Microsoft Azure Stream Analytics Tools for Visual Studio

Bundler & Minifier 3.2.451 Adds support for bundling and minifying JavaScript, CSS and HTML files in any project.

C# Tools 3.8.0-5.20604.10+9ed4b774d20940880de8df1ca8b07508aa01c8cd C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Common Azure Tools 1.10 Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

Cookiecutter 16.8.20241.2 Provides tools for finding, instantiating and customizing templates in cookiecutter format.

Debugging Tools for Windows 10.0.19030.1000 Integrates the Windows Debugger functionality (http://go.microsoft.com/fwlink/?linkid=223405) in Visual Studio.

Extensibility Message Bus 1.2.6 (master@34d6af2) Provides common messaging-based MEF services for loosely coupled Visual Studio extension components communication and integration.

Fabric.DiagnosticEvents 1.0 Fabric Diagnostic Events

GitHub.VisualStudio 2.11.106.19330 A Visual Studio Extension that brings the GitHub Flow into Visual Studio.

IncrediBuild Build Acceleration 1.5.0.13 IncrediBuild effectively reduces compilation and development times by up to 90%.

IntelliCode Extension 1.0 IntelliCode Visual Studio Extension Detailed Info

Microsoft Azure HDInsight Azure Node 2.6.1000.0 HDInsight Node under Azure Node

Microsoft Azure Hive Query Language Service 2.6.1000.0 Language service for Hive query

Microsoft Azure Service Fabric Tools for Visual Studio 16.0 Microsoft Azure Service Fabric Tools for Visual Studio

Microsoft Azure Stream Analytics Language Service 2.6.1000.0 Language service for Azure Stream Analytics

Microsoft Azure Stream Analytics Node 1.0 Azure Stream Analytics Node under Azure Node

Microsoft Azure Tools 2.9 Microsoft Azure Tools for Microsoft Visual Studio 2019 - v2.9.30924.1

Microsoft Continuous Delivery Tools for Visual Studio 0.4 Simplifying the configuration of Azure DevOps pipelines from within the Visual Studio IDE.

Microsoft JVM Debugger 1.0 Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines

Microsoft Library Manager 2.1.113+g422d40002e.RR Install client-side libraries easily to any web project

Microsoft MI-Based Debugger 1.0 Provides support for connecting Visual Studio to MI compatible debuggers

Microsoft Visual C++ Wizards 1.0 Microsoft Visual C++ Wizards

Microsoft Visual Studio Tools for Containers 1.1 Develop, run, validate your ASP.NET Core applications in the target environment. F5 your application directly into a container with debugging, or CTRL + F5 to edit & refresh your app without having to rebuild the container.

Microsoft Visual Studio VC Package 1.0 Microsoft Visual Studio VC Package

Mono Debugging for Visual Studio 16.8.43 (00471f8) Support for debugging Mono processes with Visual Studio.

Node.js Tools 1.5.20902.1 Commit Hash:b474efcb6f92db52a8f8e2e6a8cb9648476885cc Adds support for developing and debugging Node.js apps in Visual Studio

NuGet Package Manager 5.8.0 NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/

ProjectServicesPackage Extension 1.0 ProjectServicesPackage Visual Studio Extension Detailed Info

Python 16.8.20241.2 Provides IntelliSense, projects, templates, debugging, interactive windows, and other support for Python developers.

Python - Conda support 16.8.20241.2 Conda support for Python projects.

Python - Django support 16.8.20241.2 Provides templates and integration for the Django web framework.

Python - IronPython support 16.8.20241.2 Provides templates and integration for IronPython-based projects.

Python - Profiling support 16.8.20241.2 Profiling support for Python projects.

Snapshot Debugging Extension 1.0 Snapshot Debugging Visual Studio Extension Detailed Info

SQL Server Data Tools 16.0.62010.06180 Microsoft SQL Server Data Tools

Test Adapter for Boost.Test 1.0 Enables Visual Studio's testing tools with unit tests written for Boost.Test. The use terms and Third Party Notices are available in the extension installation directory.

Test Adapter for Google Test 1.0 Enables Visual Studio's testing tools with unit tests written for Google Test. The use terms and Third Party Notices are available in the extension installation directory.

ToolWindowHostedEditor 1.0 Hosting json editor into a tool window

TypeScript Tools 16.0.21016.2001 TypeScript Tools for Microsoft Visual Studio

Visual Basic Tools 3.8.0-5.20604.10+9ed4b774d20940880de8df1ca8b07508aa01c8cd Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Visual C++ for Cross Platform Mobile Development (Android) 16.0.30608.117 Visual C++ for Cross Platform Mobile Development (Android)

Visual C++ for Cross Platform Mobile Development (iOS) 16.0.30608.117 Visual C++ for Cross Platform Mobile Development (iOS)

Visual C++ for Linux Development 1.0.9.30608 Visual C++ for Linux Development

Visual F# Tools 16.8.0-beta.20507.4+da6be68280c89131cdba2045525b80890401defd Microsoft Visual F# Tools

Visual Studio Code Debug Adapter Host Package 1.0 Interop layer for hosting Visual Studio Code debug adapters in Visual Studio

Visual Studio Container Tools Extensions 1.0 View, manage, and diagnose containers within Visual Studio.

Visual Studio Tools for CMake 1.0 Visual Studio Tools for CMake

Visual Studio Tools for Containers 1.0 Visual Studio Tools for Containers

Visual Studio Tools for Kubernetes 1.0 Visual Studio Tools for Kubernetes

Visual Studio Tools for Unity 4.8.2.0 Visual Studio Tools for Unity

VisualStudio.DeviceLog 1.0 Information about my package

VisualStudio.Foo 1.0 Information about my package

VisualStudio.Mac 1.0 Mac Extension for Visual Studio

Windows Driver Kit 10.0.19030.1000 Headers, libraries, and tools needed to develop, debug, and test Windows drivers (msdn.microsoft.com/en-us/windows/hardware/gg487428.aspx)

Xamarin 16.8.000.260 (d16-8@fd405a2) Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin Designer 16.8.0.507 (remotes/origin/d16-8@e87b24884) Visual Studio extension to enable Xamarin Designer tools in Visual Studio.

Xamarin Templates 16.8.112 (86385a3) Templates for building iOS, Android, and Windows apps with Xamarin and Xamarin.Forms.

Xamarin.Android SDK 11.1.0.17 (d16-8/c0e2b8e) Xamarin.Android Reference Assemblies and MSBuild support. Mono: be2226b Java.Interop: xamarin/java.interop/d16-8@79d9533 ProGuard: Guardsquare/proguard/proguard6.2.2@ebe9000 SQLite: xamarin/sqlite/3.32.1@1a3276b Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-8@2fb1cbc

Xamarin.iOS and Xamarin.Mac SDK 14.6.0.15 (87a1b18d8) Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.


adb shell dumpsys power OUTPUT DURING PLAYBACK (Note 2 wakelocks):

POWER MANAGER (dumpsys power)

Power Manager State: Settings power_manager_constants: no_cached_wake_locks=true mDirty=0x0 mWakefulness=Awake mWakefulnessChanging=false mIsPowered=true mPlugType=0 mBatteryLevel=42 mBatteryLevelWhenDreamStarted=0 mDockState=0 mStayOn=false mProximityPositive=false mBootCompleted=true mSystemReady=true mHalAutoSuspendModeEnabled=false mHalInteractiveModeEnabled=true mWakeLockSummary=0x23 mNotifyLongScheduled=+29s54ms mNotifyLongDispatched=-30s945ms mNotifyLongNextCheck=+29s54ms mUserActivitySummary=0x1 mRequestWaitForNegativeProximity=false mSandmanScheduled=false mSandmanSummoned=false mBatteryLevelLow=false mLightDeviceIdleMode=false mDeviceIdleMode=false mDeviceIdleWhitelist=[2000, 10008, 10065] mDeviceIdleTempWhitelist=[] mLastWakeTime=85038150 (231680 ms ago) mLastSleepTime=84314519 (955311 ms ago) mLastUserActivityTime=85197353 (72477 ms ago) mLastUserActivityTimeNoChangeLights=85197493 (72337 ms ago) mLastInteractivePowerHintTime=85197493 (72337 ms ago) mLastScreenBrightnessBoostTime=0 (85269830 ms ago) mScreenBrightnessBoostInProgress=false mDisplayReady=true mHoldingWakeLockSuspendBlocker=true mHoldingDisplaySuspendBlocker=true

Settings and Configuration: mDecoupleHalAutoSuspendModeFromDisplayConfig=false mDecoupleHalInteractiveModeFromDisplayConfig=false mWakeUpWhenPluggedOrUnpluggedConfig=false mWakeUpWhenPluggedOrUnpluggedInTheaterModeConfig=false mTheaterModeEnabled=false mSuspendWhenScreenOffDueToProximityConfig=false mDreamsSupportedConfig=true mDreamsEnabledByDefaultConfig=true mDreamsActivatedOnSleepByDefaultConfig=true mDreamsActivatedOnDockByDefaultConfig=true mDreamsEnabledOnBatteryConfig=false mDreamsBatteryLevelMinimumWhenPoweredConfig=-1 mDreamsBatteryLevelMinimumWhenNotPoweredConfig=15 mDreamsBatteryLevelDrainCutoffConfig=5 mDreamsEnabledSetting=false mDreamsActivateOnSleepSetting=true mDreamsActivateOnDockSetting=true mDozeAfterScreenOff=false mMinimumScreenOffTimeoutConfig=10000 mMaximumScreenDimDurationConfig=7000 mMaximumScreenDimRatioConfig=0.20000005 mScreenOffTimeoutSetting=120000 mSleepTimeoutSetting=-1 mMaximumScreenOffTimeoutFromDeviceAdmin=9223372036854775807 (enforced=false) mStayOnWhilePluggedInSetting=0 mScreenBrightnessSetting=0 mScreenBrightnessModeSetting=0 mScreenBrightnessOverrideFromWindowManager=-1 mUserActivityTimeoutOverrideFromWindowManager=-1 mUserInactiveOverrideFromWindowManager=false mDozeScreenStateOverrideFromDreamManager=0 mDrawWakeLockOverrideFromSidekick=false mDozeScreenBrightnessOverrideFromDreamManager=-1 mScreenBrightnessSettingMinimum=10 mScreenBrightnessSettingMaximum=255 mScreenBrightnessSettingDefault=102 mDoubleTapWakeEnabled=false mIsVrModeEnabled=false mForegroundProfile=0

Sleep timeout: -1 ms Screen off timeout: 120000 ms Screen dim duration: 7000 ms

UID states (changing=false changed=false): UID 1000: ACTIVE count=1 state=0 UID 1001: ACTIVE count=0 state=0 UID 1002: ACTIVE count=0 state=0 UID 1041: INACTIVE count=1 state=19 UID 1068: ACTIVE count=0 state=0 UID u0a4: ACTIVE count=0 state=4 UID u0a24: INACTIVE count=0 state=18 UID u0a28: ACTIVE count=0 state=0 UID u0a39: INACTIVE count=0 state=18 UID u0a54: ACTIVE count=0 state=5 UID u0a60: ACTIVE count=0 state=6 UID u0a62: INACTIVE count=0 state=18 UID u0a65: ACTIVE count=0 state=4 UID u0a66: INACTIVE count=0 state=18 UID u0a68: INACTIVE count=0 state=18 UID u0a71: ACTIVE count=0 state=2 UID u0a73: INACTIVE count=0 state=18 UID u0a76: INACTIVE count=0 state=18

Looper state: Looper (PowerManagerService, tid 30) {a112ba7} Message 0: { when=+29s53ms what=4 target=com.android.server.power.PowerManagerService$PowerManagerHandler } Message 1: { when=+40s522ms what=1 target=com.android.server.power.PowerManagerService$PowerManagerHandler } (Total messages: 2, polling=true, quitting=false)

Wake Locks: size=2 SCREEN_BRIGHT_WAKE_LOCK 'WindowManager' ON_AFTER_RELEASE ACQ=-9s755ms (uid=1000 pid=3209 ws=WorkSource{10071}) PARTIAL_WAKE_LOCK 'AudioMix' ACQ=-9s729ms (uid=1041 ws=WorkSource{10071})

Suspend Blockers: size=4 PowerManagerService.WakeLocks: ref count=1 PowerManagerService.Display: ref count=1 PowerManagerService.Broadcasts: ref count=0 PowerManagerService.WirelessChargerDetector: ref count=0

Display Power: state=ON

Battery saving stats: Battery Saver is currently: OFF Last OFF time: 2020-12-21 15:06:33.552 -23h40m57s395ms Times enabled: 0

Drain stats: Battery saver OFF ON NonDoze NonIntr: 995m 0mAh( 0%) 0.0mAh/h 0m 0mAh( 0%) 0.0mAh/h Intr: 421m 0mAh( 0%) 0.0mAh/h 0m 0mAh( 0%) 0.0mAh/h Deep NonIntr: 0m 0mAh( 0%) 0.0mAh/h 0m 0mAh( 0%) 0.0mAh/h Intr: 0m 0mAh( 0%) 0.0mAh/h 0m 0mAh( 0%) 0.0mAh/h Light NonIntr: 0m 0mAh( 0%) 0.0mAh/h 0m 0mAh( 0%) 0.0mAh/h Intr: 0m 0mAh( 0%) 0.0mAh/h 0m 0mAh( 0%) 0.0mAh/h

Battery saver policy (NOTE they only apply when battery saver is ON): Settings: battery_saver_constants value: null Settings: (overlay) value:

mAccessibilityEnabled=false vibration_disabled:config=true vibration_disabled:effective=true animation_disabled=false fullbackup_deferred=true keyvaluebackup_deferred=true firewall_disabled=false datasaver_disabled=true launch_boost_disabled=true adjust_brightness_disabled=true adjust_brightness_factor=0.5 gps_mode=2 force_all_apps_standby=true force_background_check=true optional_sensors_disabled=true aod_disabled=true send_tron_log=false

Interactive File values:

Noninteractive File values:

Battery saver state machine: Enabled=false mLastChangedIntReason=0 mLastChangedStrReason=null mBootCompleted=true mSettingsLoaded=true mBatteryStatusSet=true mBatterySaverSnoozing=false mIsPowered=true mBatteryLevel=42 mIsBatteryLevelLow=false mSettingBatterySaverEnabled=false mSettingBatterySaverEnabledSticky=false mSettingBatterySaverTriggerThreshold=0

Profile power states: size=0

Wireless Charger Detector State: mGravitySensor=null mPoweredWirelessly=false mAtRest=false mRestX=0.0, mRestY=0.0, mRestZ=0.0 mDetectionInProgress=false mDetectionStartTime=0 (never) mMustUpdateRestPosition=false mTotalSamples=0 mMovingSamples=0 mFirstSampleX=0.0, mFirstSampleY=0.0, mFirstSampleZ=0.0 mLastSampleX=0.0, mLastSampleY=0.0, mLastSampleZ=0.0


adb shell dumpsys power OUTPUT NOT DURING PLAYBACK (Note Missing wakelocks):

POWER MANAGER (dumpsys power)

Power Manager State: Settings power_manager_constants: no_cached_wake_locks=true mDirty=0x0 mWakefulness=Awake mWakefulnessChanging=false mIsPowered=true mPlugType=0 mBatteryLevel=42 mBatteryLevelWhenDreamStarted=0 mDockState=0 mStayOn=false mProximityPositive=false mBootCompleted=true mSystemReady=true mHalAutoSuspendModeEnabled=false mHalInteractiveModeEnabled=true mWakeLockSummary=0x0 mNotifyLongScheduled=+10s780ms mNotifyLongDispatched=-39s829ms mNotifyLongNextCheck=+10s780ms mUserActivitySummary=0x1 mRequestWaitForNegativeProximity=false mSandmanScheduled=false mSandmanSummoned=false mBatteryLevelLow=false mLightDeviceIdleMode=false mDeviceIdleMode=false mDeviceIdleWhitelist=[2000, 10008, 10065] mDeviceIdleTempWhitelist=[] mLastWakeTime=87057238 (48267 ms ago) mLastSleepTime=85928229 (1177276 ms ago) mLastUserActivityTime=87067993 (37512 ms ago) mLastUserActivityTimeNoChangeLights=85808218 (1297287 ms ago) mLastInteractivePowerHintTime=87067993 (37512 ms ago) mLastScreenBrightnessBoostTime=0 (87105505 ms ago) mScreenBrightnessBoostInProgress=false mDisplayReady=true mHoldingWakeLockSuspendBlocker=false mHoldingDisplaySuspendBlocker=true

Settings and Configuration: mDecoupleHalAutoSuspendModeFromDisplayConfig=false mDecoupleHalInteractiveModeFromDisplayConfig=false mWakeUpWhenPluggedOrUnpluggedConfig=false mWakeUpWhenPluggedOrUnpluggedInTheaterModeConfig=false mTheaterModeEnabled=false mSuspendWhenScreenOffDueToProximityConfig=false mDreamsSupportedConfig=true mDreamsEnabledByDefaultConfig=true mDreamsActivatedOnSleepByDefaultConfig=true mDreamsActivatedOnDockByDefaultConfig=true mDreamsEnabledOnBatteryConfig=false mDreamsBatteryLevelMinimumWhenPoweredConfig=-1 mDreamsBatteryLevelMinimumWhenNotPoweredConfig=15 mDreamsBatteryLevelDrainCutoffConfig=5 mDreamsEnabledSetting=false mDreamsActivateOnSleepSetting=true mDreamsActivateOnDockSetting=true mDozeAfterScreenOff=false mMinimumScreenOffTimeoutConfig=10000 mMaximumScreenDimDurationConfig=7000 mMaximumScreenDimRatioConfig=0.20000005 mScreenOffTimeoutSetting=120000 mSleepTimeoutSetting=-1 mMaximumScreenOffTimeoutFromDeviceAdmin=9223372036854775807 (enforced=false) mStayOnWhilePluggedInSetting=0 mScreenBrightnessSetting=0 mScreenBrightnessModeSetting=0 mScreenBrightnessOverrideFromWindowManager=-1 mUserActivityTimeoutOverrideFromWindowManager=-1 mUserInactiveOverrideFromWindowManager=false mDozeScreenStateOverrideFromDreamManager=0 mDrawWakeLockOverrideFromSidekick=false mDozeScreenBrightnessOverrideFromDreamManager=-1 mScreenBrightnessSettingMinimum=10 mScreenBrightnessSettingMaximum=255 mScreenBrightnessSettingDefault=102 mDoubleTapWakeEnabled=false mIsVrModeEnabled=false mForegroundProfile=0

Sleep timeout: -1 ms Screen off timeout: 120000 ms Screen dim duration: 7000 ms

UID states (changing=false changed=false): UID 1000: ACTIVE count=0 state=0 UID 1001: ACTIVE count=0 state=0 UID 1002: ACTIVE count=0 state=0 UID 1068: ACTIVE count=0 state=0 UID u0a4: ACTIVE count=0 state=4 UID u0a5: INACTIVE count=0 state=18 UID u0a8: INACTIVE count=0 state=18 UID u0a28: ACTIVE count=0 state=0 UID u0a54: ACTIVE count=0 state=5 UID u0a60: ACTIVE count=0 state=6 UID u0a62: INACTIVE count=0 state=18 UID u0a65: ACTIVE count=0 state=4 UID u0a66: INACTIVE count=0 state=18 UID u0a68: INACTIVE count=0 state=18 UID u0a71: ACTIVE count=0 state=2 UID u0a76: ACTIVE count=0 state=18

Looper state: Looper (PowerManagerService, tid 30) {a112ba7} Message 0: { when=+10s780ms what=4 target=com.android.server.power.PowerManagerService$PowerManagerHandler } Message 1: { when=+1m15s488ms what=1 target=com.android.server.power.PowerManagerService$PowerManagerHandler } (Total messages: 2, polling=true, quitting=false)

Wake Locks: size=0

Suspend Blockers: size=4 PowerManagerService.WakeLocks: ref count=0 PowerManagerService.Display: ref count=1 PowerManagerService.Broadcasts: ref count=0 PowerManagerService.WirelessChargerDetector: ref count=0

Display Power: state=ON

Battery saving stats: Battery Saver is currently: OFF Last OFF time: 2020-12-21 15:06:33.552 -1d0h11m33s69ms Times enabled: 0

Drain stats: Battery saver OFF ON NonDoze NonIntr: 1014m 0mAh( 0%) 0.0mAh/h 0m 0mAh( 0%) 0.0mAh/h Intr: 436m 0mAh( 0%) 0.0mAh/h 0m 0mAh( 0%) 0.0mAh/h Deep NonIntr: 0m 0mAh( 0%) 0.0mAh/h 0m 0mAh( 0%) 0.0mAh/h Intr: 0m 0mAh( 0%) 0.0mAh/h 0m 0mAh( 0%) 0.0mAh/h Light NonIntr: 0m 0mAh( 0%) 0.0mAh/h 0m 0mAh( 0%) 0.0mAh/h Intr: 0m 0mAh( 0%) 0.0mAh/h 0m 0mAh( 0%) 0.0mAh/h

Battery saver policy (NOTE they only apply when battery saver is ON): Settings: battery_saver_constants value: null Settings: (overlay) value:

mAccessibilityEnabled=false vibration_disabled:config=true vibration_disabled:effective=true animation_disabled=false fullbackup_deferred=true keyvaluebackup_deferred=true firewall_disabled=false datasaver_disabled=true launch_boost_disabled=true adjust_brightness_disabled=true adjust_brightness_factor=0.5 gps_mode=2 force_all_apps_standby=true force_background_check=true optional_sensors_disabled=true aod_disabled=true send_tron_log=false

Interactive File values:

Noninteractive File values:

Battery saver state machine: Enabled=false mLastChangedIntReason=0 mLastChangedStrReason=null mBootCompleted=true mSettingsLoaded=true mBatteryStatusSet=true mBatterySaverSnoozing=false mIsPowered=true mBatteryLevel=42 mIsBatteryLevelLow=false mSettingBatterySaverEnabled=false mSettingBatterySaverEnabledSticky=false mSettingBatterySaverTriggerThreshold=0

Profile power states: size=0

Wireless Charger Detector State: mGravitySensor=null mPoweredWirelessly=false mAtRest=false mRestX=0.0, mRestY=0.0, mRestZ=0.0 mDetectionInProgress=false mDetectionStartTime=0 (never) mMustUpdateRestPosition=false mTotalSamples=0 mMovingSamples=0 mFirstSampleX=0.0, mFirstSampleY=0.0, mFirstSampleZ=0.0 mLastSampleX=0.0, mLastSampleY=0.0, mLastSampleZ=0.0

pictos commented 3 years ago

@NebulaSleuth can you try to use the media element on XCT?

peterfoot commented 3 years ago

The whole purpose of that property is to prevent the device from sleeping. What is behaving incorrectly? Is it not resetting when the video has stopped?

NebulaSleuth commented 3 years ago

Well, it does prevent sleeping. Only that it ALWAYS prevents sleeping regardless of the setting. So the device will never sleep even if set as KeepScreenOn=false. So if you are playing a video, the device will stay awake until the video, however long, is completed.

I would expect that if the setting is off/false, the device would be allowed to go to sleep.