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

Commit 46d1d28a authored by Julia Reynolds's avatar Julia Reynolds Committed by Automerger Merge Worker
Browse files

Always return the same result code in access screens am: 1aff9c72 am: e21284e8 am: eba8afd3

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/15908133

Change-Id: I62c0fb6dce6e2d7d0254868cabe009d5acf4a4fb
parents f60ba12e eba8afd3
Loading
Loading
Loading
Loading
+2 −10
Original line number Diff line number Diff line
@@ -173,7 +173,7 @@ public class NotificationAccessDetails extends DashboardFragment {
                getActivity(), UserManager.DISALLOW_APPS_CONTROL, mUserId);

        if (!refreshUi()) {
            setIntentAndFinish(true /* appChanged */);
            finish();
        }
        Preference apps = getPreferenceScreen().findPreference(
                use(BridgedAppsLinkPreferenceController.class).getPreferenceKey());
@@ -197,14 +197,6 @@ public class NotificationAccessDetails extends DashboardFragment {
        }
    }

    protected void setIntentAndFinish(boolean appChanged) {
        Log.i(TAG, "appChanged=" + appChanged);
        Intent intent = new Intent();
        intent.putExtra(ManageApplications.APP_CHG, appChanged);
        SettingsActivity sa = (SettingsActivity) getActivity();
        sa.finishPreferencePanel(Activity.RESULT_OK, intent);
    }

    protected void retrieveAppEntry() {
        final Bundle args = getArguments();
        mPackageName = (args != null) ? args.getString(ARG_PACKAGE_NAME) : null;
@@ -228,7 +220,7 @@ public class NotificationAccessDetails extends DashboardFragment {
                            PackageManager.GET_SIGNING_CERTIFICATES |
                            PackageManager.GET_PERMISSIONS, mUserId);
        } catch (PackageManager.NameNotFoundException e) {
            Log.e(TAG, "Exception when retrieving package:" + mPackageName, e);
            // oh well
        }
    }

+4 −3
Original line number Diff line number Diff line
@@ -53,10 +53,11 @@ public class ZenAccessDetails extends AppInfoWithHeader implements
        // If this app didn't declare this permission in their manifest, don't bother showing UI.
        final Set<String> needAccessApps =
                ZenAccessController.getPackagesRequestingNotificationPolicyAccess();
        if (!needAccessApps.contains(mPackageName)) {
            return false;
        }
        if (needAccessApps.contains(mPackageName)) {
            updatePreference(context, findPreference(SWITCH_PREF_KEY));
        } else {
            finish();
        }
        return true;
    }