OSDN Git Service

Release the media player when the video preference is not visible.
authorRaff Tsai <rafftsai@google.com>
Wed, 2 Jan 2019 09:07:22 +0000 (17:07 +0800)
committerRaff Tsai <rafftsai@google.com>
Thu, 3 Jan 2019 04:12:51 +0000 (12:12 +0800)
commit2831b14048920fde614657aad8813064855248fd
tree9daa5094b5d07b7aacf87d8f0a075e9754f8a913
parentcc8212edf6542e078f24a542c14630b2302f72f8
Release the media player when the video preference is not visible.

Mediaplayer is not released when the device is paused, and hence it
keep consuming battery.

Fixes: 120945749
Test: adb root && watch -n 0.5 -d "adb shell cat /sys/kernel/debug/msm_vidc/core0/inst*/info\|egrep -i \"height\|width\|instance\|fps\|name\""
      Use above command to check if any decoder instance exists.

Change-Id: Ia0edbba0c2fd3c70753bc36d23d82c0770f95672
src/com/android/settings/widget/VideoPreference.java
tests/robotests/src/com/android/settings/widget/VideoPreferenceTest.java