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

Commit dcd7ff48 authored by Joel Galenson's avatar Joel Galenson
Browse files

Show message when no apps/permissions are allowed/denied.

Instead of showing an empty allowed/denied header, we now show a
message saying that nothing is there.

Change-Id: I6e8ccd31c4af9f9ef6a0f699bc91fd7fd732e52b
Fixes: 120675937
Test: See messages when no apps/permissions are allowed/denied.
Test: Ensure message appears/disappears as I toggle permissions.
parent 6ee518f5
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -395,6 +395,18 @@
    <!-- Permission justification string when not all justfications are defined [CHAR LIMIT=none] -->
    <string name="permission_justification_undefined">The app developer did not specify how the app uses your data.</string>

    <!-- Label when app has been granted no permissions [CHAR LIMIT=none] -->
    <string name="no_permissions_allowed">No permissions allowed</string>

    <!-- Label when app has been denied no permissions [CHAR LIMIT=none] -->
    <string name="no_permissions_denied">No permissions denied</string>

    <!-- Label when no apps have been granted a given permission [CHAR LIMIT=none] -->
    <string name="no_apps_allowed">No apps allowed</string>

    <!-- Label when no apps have been denied a given permission [CHAR LIMIT=none] -->
    <string name="no_apps_denied">No apps denied</string>

    <!-- Title for page of managing default apps. [CHAR LIMIT=30] -->
    <string name="default_apps">Default apps</string>

+11 −0
Original line number Diff line number Diff line
@@ -270,6 +270,17 @@ public final class AppPermissionsFragment extends SettingsWithHeader {
            category.addPreference(extraPerms);
        }

        if (allowed.getPreferenceCount() == 0) {
            Preference empty = new Preference(context);
            empty.setTitle(getString(R.string.no_permissions_allowed));
            allowed.addPreference(empty);
        }
        if (denied.getPreferenceCount() == 0) {
            Preference empty = new Preference(context);
            empty.setTitle(getString(R.string.no_permissions_denied));
            denied.addPreference(empty);
        }

        setLoading(false /* loading */, true /* animate */);
    }

+11 −0
Original line number Diff line number Diff line
@@ -317,6 +317,17 @@ public final class PermissionAppsFragment extends PermissionsFrameFragment imple
                    grantedCount, mExtraScreen.getPreferenceCount()));
        }

        if (allowed.getPreferenceCount() == 0) {
            Preference empty = new Preference(context);
            empty.setTitle(getString(R.string.no_apps_allowed));
            allowed.addPreference(empty);
        }
        if (denied.getPreferenceCount() == 0) {
            Preference empty = new Preference(context);
            empty.setTitle(getString(R.string.no_apps_denied));
            denied.addPreference(empty);
        }

        setLoading(false /* loading */, true /* animate */);

        if (mOnPermissionsLoadedListener != null) {