Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c6fe9cc3 authored by Amith Yamasani's avatar Amith Yamasani
Browse files

Allow space management for device admins

If an active device admin has a space management UI, enable the button
to manage space.

Bug: 10527304

Change-Id: I1d03eec6d766b49b1c3d9bb30151db4cad7e84e8
parent 8b4cdbeb
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -242,10 +242,14 @@ public class InstalledAppDetails extends Fragment
    }
    
    private void initDataButtons() {
        if ((mAppEntry.info.flags&(ApplicationInfo.FLAG_SYSTEM
        // If the app doesn't have its own space management UI
        // And it's a system app that doesn't allow clearing user data or is an active admin
        // Then disable the Clear Data button.
        if (mAppEntry.info.manageSpaceActivityName == null
                && ((mAppEntry.info.flags&(ApplicationInfo.FLAG_SYSTEM
                        | ApplicationInfo.FLAG_ALLOW_CLEAR_USER_DATA))
                        == ApplicationInfo.FLAG_SYSTEM
                || mDpm.packageHasActiveAdmins(mPackageInfo.packageName)) {
                        || mDpm.packageHasActiveAdmins(mPackageInfo.packageName))) {
            mClearDataButton.setText(R.string.clear_user_data_text);
            mClearDataButton.setEnabled(false);
            mCanClearData = false;