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

Commit 4a2e1fd8 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Don't get textView from null View" into rvc-dev

parents e6164804 fc0d6327
Loading
Loading
Loading
Loading
+12 −9
Original line number Diff line number Diff line
@@ -228,13 +228,6 @@ public class AppPermissionFragment extends SettingsWithLargeHeader
        footer2Link.setText(context.getString(R.string.app_permission_footer_permission_apps_link));
        setBottomLinkState(footer2Link, caller, Intent.ACTION_MANAGE_PERMISSION_APPS);

        if (mViewModel.getFullStorageStateLiveData().isInitialized() && mIsStorageGroup) {
            setSpecialStorageState(mViewModel.getFullStorageStateLiveData().getValue(), root);
        } else {
            TextView storageFooter = root.requireViewById(R.id.footer_storage_special_app_access);
            storageFooter.setVisibility(View.GONE);
        }

        mAllowButton = root.requireViewById(R.id.allow_radio_button);
        mAllowAlwaysButton = root.requireViewById(R.id.allow_always_radio_button);
        mAllowForegroundButton = root.requireViewById(R.id.allow_foreground_only_radio_button);
@@ -260,6 +253,13 @@ public class AppPermissionFragment extends SettingsWithLargeHeader
            mDenyForegroundButton.setVisibility(View.GONE);
        }

        if (mViewModel.getFullStorageStateLiveData().isInitialized() && mIsStorageGroup) {
            setSpecialStorageState(mViewModel.getFullStorageStateLiveData().getValue(), root);
        } else {
            TextView storageFooter = root.requireViewById(R.id.footer_storage_special_app_access);
            storageFooter.setVisibility(View.GONE);
        }

        getActivity().setTitle(
                getPreferenceManager().getContext().getString(R.string.app_permission_title,
                        mPermGroupLabel));
@@ -392,9 +392,12 @@ public class AppPermissionFragment extends SettingsWithLargeHeader
    }

    private void setSpecialStorageState(FullStoragePackageState storageState, View v) {
        TextView textView = v.requireViewById(R.id.footer_storage_special_app_access);
        if (v == null) {
            return;
        }

        if (v == null || mAllowButton == null || !mIsStorageGroup) {
        TextView textView = v.requireViewById(R.id.footer_storage_special_app_access);
        if (mAllowButton == null || !mIsStorageGroup) {
            textView.setVisibility(View.GONE);
            return;
        }