OSDN Git Service

Create Controller for app buttons
authorjackqdyulei <jackqdyulei@google.com>
Wed, 15 Mar 2017 22:13:10 +0000 (15:13 -0700)
committerLei Yu <jackqdyulei@google.com>
Wed, 29 Mar 2017 20:21:37 +0000 (20:21 +0000)
commit31b8de1e215f6f0dcd694024c617f9f185e510ae
treedfb7c14468ed328a334bd470526701ec19d4c44b
parenta48cb8d9786cb7596d5d63e4909cf10794d30644
Create Controller for app buttons

These two buttons(uninstall + forcestop) are used in both battery page
and app page, we should move the logic for these two buttons into one
place.

This cl creates the AppButtonsPreferenceController for the above
purpose. This cl only copies the logic to controller but hasn't make
InstalledAppDetails use this controller.

Since DialogFragment could not use function in controller directly,
the controller expose DialogListener and all the fragments must
implement this interface. Then they can delegate the method call
to controller directly.

The following cl will:
1. Make the InstalledAppDetails be compatible to controller
2. Make the InstalledAppDetails use this controller.

Bug: 35810915
Test: RunSettingsRoboTests
Change-Id: Ie2aa8064bcec3003233896c18be772825b12930a
(cherry picked from commit 82d07983b46b4c6a1b7a3c431c57ff45e84e72be)
src/com/android/settings/enterprise/DevicePolicyManagerWrapper.java
src/com/android/settings/enterprise/DevicePolicyManagerWrapperImpl.java
src/com/android/settings/fuelgauge/AdvancedPowerUsageDetail.java
src/com/android/settings/fuelgauge/AppButtonsPreferenceController.java
src/com/android/settings/fuelgauge/ButtonActionDialogFragment.java [new file with mode: 0644]
tests/robotests/src/com/android/settings/fuelgauge/AppButtonsPreferenceControllerTest.java [new file with mode: 0644]
tests/robotests/src/com/android/settings/fuelgauge/ButtonActionDialogFragmentTest.java [new file with mode: 0644]