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

Commit cce96e11 authored by Hai Zhang's avatar Hai Zhang
Browse files

Disallow launching the Settings activity for unavailable or hidden roles.

Bug: 124452117
Test: build
Change-Id: I2dcc8ede16df63b0936ec5a22c0113eb40594094
parent 88130c10
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -81,6 +81,11 @@ public class DefaultAppActivity extends FragmentActivity {
            finish();
            return;
        }
        if (!role.isVisibleAsUser(user, this)) {
            Log.e(LOG_TAG, "Role is invisible: " + roleName);
            finish();
            return;
        }

        if (savedInstanceState == null) {
            DefaultAppFragment fragment = DefaultAppFragment.newInstance(roleName, user);
+10 −0
Original line number Diff line number Diff line
@@ -65,6 +65,16 @@ public class SpecialAppAccessActivity extends FragmentActivity {
            finish();
            return;
        }
        if (!role.isAvailable(this)) {
            Log.e(LOG_TAG, "Role is unavailable: " + roleName);
            finish();
            return;
        }
        if (!role.isVisible(this)) {
            Log.e(LOG_TAG, "Role is invisible: " + roleName);
            finish();
            return;
        }

        if (savedInstanceState == null) {
            SpecialAppAccessFragment fragment = SpecialAppAccessFragment.newInstance(roleName);