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
This commit is contained in:
@@ -101,4 +101,19 @@ public class DevicePolicyManagerWrapperImpl implements DevicePolicyManagerWrappe
|
||||
public List<String> getOwnerInstalledCaCerts(@NonNull UserHandle user) {
|
||||
return mDpm.getOwnerInstalledCaCerts(user);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDeviceOwnerAppOnAnyUser(String packageName) {
|
||||
return mDpm.isDeviceOwnerAppOnAnyUser(packageName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean packageHasActiveAdmins(String packageName) {
|
||||
return mDpm.packageHasActiveAdmins(packageName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUninstallInQueue(String packageName) {
|
||||
return mDpm.isUninstallInQueue(packageName);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user