From 5214fae4be424844aaaf58eebf931edb70cb7c46 Mon Sep 17 00:00:00 2001 From: Fan Zhang Date: Sat, 28 Oct 2017 13:55:11 -0700 Subject: [PATCH] Remove dead code - Remove AppOpsDetails/AppOpsSummary and related code Bug: 68426851 Test: robotests Change-Id: I4b665e65bfff8b0365f45325b34965dc51d07bc0 --- AndroidManifest.xml | 17 -- res/layout/app_ops_details.xml | 57 ----- res/layout/app_ops_summary.xml | 43 ---- res/values/strings.xml | 2 - src/com/android/settings/Settings.java | 10 - .../settings/applications/AppOpsCategory.java | 92 ++------ .../settings/applications/AppOpsDetails.java | 223 ------------------ .../settings/applications/AppOpsState.java | 2 - .../settings/applications/AppOpsSummary.java | 132 ----------- .../applications/BackgroundCheckSummary.java | 4 +- 10 files changed, 28 insertions(+), 554 deletions(-) delete mode 100644 res/layout/app_ops_details.xml delete mode 100644 res/layout/app_ops_summary.xml delete mode 100644 src/com/android/settings/applications/AppOpsDetails.java delete mode 100644 src/com/android/settings/applications/AppOpsSummary.java diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 4b6d7779309..5a310e980f3 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -1192,23 +1192,6 @@ - - - - - - - - - - - - - - - - - - - - diff --git a/res/layout/app_ops_summary.xml b/res/layout/app_ops_summary.xml deleted file mode 100644 index 2073a005690..00000000000 --- a/res/layout/app_ops_summary.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - diff --git a/res/values/strings.xml b/res/values/strings.xml index bda0996a3ef..72badfbfa11 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -3916,8 +3916,6 @@ More info on %1$s - - App ops Running diff --git a/src/com/android/settings/Settings.java b/src/com/android/settings/Settings.java index f3f3f075f2e..cbae80cae43 100644 --- a/src/com/android/settings/Settings.java +++ b/src/com/android/settings/Settings.java @@ -19,7 +19,6 @@ package com.android.settings; import android.os.Bundle; import android.util.FeatureFlagUtils; -import com.android.settings.applications.AppOpsSummary; import com.android.settings.enterprise.EnterprisePrivacySettings; /** @@ -57,15 +56,6 @@ public class Settings extends SettingsActivity { public static class ManageApplicationsActivity extends SettingsActivity { /* empty */ } public static class ManageAssistActivity extends SettingsActivity { /* empty */ } public static class HighPowerApplicationsActivity extends SettingsActivity { /* empty */ } - public static class AppOpsSummaryActivity extends SettingsActivity { - @Override - public boolean isValidFragment(String className) { - if (AppOpsSummary.class.getName().equals(className)) { - return true; - } - return super.isValidFragment(className); - } - } public static class BackgroundCheckSummaryActivity extends SettingsActivity { /* empty */ } public static class StorageUseActivity extends SettingsActivity { /* empty */ } diff --git a/src/com/android/settings/applications/AppOpsCategory.java b/src/com/android/settings/applications/AppOpsCategory.java index e27e05bef48..5b0337b803f 100644 --- a/src/com/android/settings/applications/AppOpsCategory.java +++ b/src/com/android/settings/applications/AppOpsCategory.java @@ -39,7 +39,6 @@ import android.widget.Switch; import android.widget.TextView; import com.android.settings.R; -import com.android.settings.SettingsActivity; import com.android.settings.applications.AppOpsState.AppOpEntry; import java.util.List; @@ -47,27 +46,17 @@ import java.util.List; public class AppOpsCategory extends ListFragment implements LoaderManager.LoaderCallbacks> { - private static final int RESULT_APP_DETAILS = 1; - AppOpsState mState; - boolean mUserControlled; // This is the Adapter being used to display the list's data. AppListAdapter mAdapter; - String mCurrentPkgName; - public AppOpsCategory() { } public AppOpsCategory(AppOpsState.OpsTemplate template) { - this(template, false); - } - - public AppOpsCategory(AppOpsState.OpsTemplate template, boolean userControlled) { Bundle args = new Bundle(); args.putParcelable("template", template); - args.putBoolean("userControlled", userControlled); setArguments(args); } @@ -125,22 +114,18 @@ public class AppOpsCategory extends ListFragment implements final InterestingConfigChanges mLastConfig = new InterestingConfigChanges(); final AppOpsState mState; final AppOpsState.OpsTemplate mTemplate; - final boolean mUserControlled; List mApps; PackageIntentReceiver mPackageObserver; - public AppListLoader(Context context, AppOpsState state, AppOpsState.OpsTemplate template, - boolean userControlled) { + public AppListLoader(Context context, AppOpsState state, AppOpsState.OpsTemplate template) { super(context); mState = state; mTemplate = template; - mUserControlled = userControlled; } @Override public List loadInBackground() { - return mState.buildState(mTemplate, 0, null, - mUserControlled ? AppOpsState.LABEL_COMPARATOR : AppOpsState.RECENCY_COMPARATOR); + return mState.buildState(mTemplate, 0, null, AppOpsState.LABEL_COMPARATOR); } /** @@ -259,15 +244,13 @@ public class AppOpsCategory extends ListFragment implements private final Resources mResources; private final LayoutInflater mInflater; private final AppOpsState mState; - private final boolean mUserControlled; List mList; - public AppListAdapter(Context context, AppOpsState state, boolean userControlled) { + public AppListAdapter(Context context, AppOpsState state) { mResources = context.getResources(); mInflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); mState = state; - mUserControlled = userControlled; } public void setData(List data) { @@ -293,7 +276,8 @@ public class AppOpsCategory extends ListFragment implements /** * Populate new items in the list. */ - @Override public View getView(int position, View convertView, ViewGroup parent) { + @Override + public View getView(int position, View convertView, ViewGroup parent) { View view; if (convertView == null) { @@ -303,21 +287,14 @@ public class AppOpsCategory extends ListFragment implements } AppOpEntry item = getItem(position); - ((ImageView)view.findViewById(R.id.app_icon)).setImageDrawable( + ((ImageView) view.findViewById(R.id.app_icon)).setImageDrawable( item.getAppEntry().getIcon()); - ((TextView)view.findViewById(R.id.app_name)).setText(item.getAppEntry().getLabel()); - if (mUserControlled) { - ((TextView) view.findViewById(R.id.op_name)).setText( - item.getTimeText(mResources, false)); - view.findViewById(R.id.op_time).setVisibility(View.GONE); - ((Switch) view.findViewById(R.id.op_switch)).setChecked( - item.getPrimaryOpMode() == AppOpsManager.MODE_ALLOWED); - } else { - ((TextView) view.findViewById(R.id.op_name)).setText(item.getSummaryText(mState)); - ((TextView) view.findViewById(R.id.op_time)).setText( - item.getTimeText(mResources, false)); - view.findViewById(R.id.op_switch).setVisibility(View.GONE); - } + ((TextView) view.findViewById(R.id.app_name)).setText(item.getAppEntry().getLabel()); + ((TextView) view.findViewById(R.id.op_name)).setText( + item.getTimeText(mResources, false)); + view.findViewById(R.id.op_time).setVisibility(View.GONE); + ((Switch) view.findViewById(R.id.op_switch)).setChecked( + item.getPrimaryOpMode() == AppOpsManager.MODE_ALLOWED); return view; } @@ -327,7 +304,6 @@ public class AppOpsCategory extends ListFragment implements public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); mState = new AppOpsState(getActivity()); - mUserControlled = getArguments().getBoolean("userControlled"); } @Override public void onActivityCreated(Bundle savedInstanceState) { @@ -341,7 +317,7 @@ public class AppOpsCategory extends ListFragment implements setHasOptionsMenu(true); // Create an empty adapter we will use to display the loaded data. - mAdapter = new AppListAdapter(getActivity(), mState, mUserControlled); + mAdapter = new AppListAdapter(getActivity(), mState); setListAdapter(mAdapter); // Start out with a progress indicator. @@ -351,36 +327,20 @@ public class AppOpsCategory extends ListFragment implements getLoaderManager().initLoader(0, null, this); } - // utility method used to start sub activity - private void startApplicationDetailsActivity() { - // start new fragment to display extended information - Bundle args = new Bundle(); - args.putString(AppOpsDetails.ARG_PACKAGE_NAME, mCurrentPkgName); - - SettingsActivity sa = (SettingsActivity) getActivity(); - sa.startPreferencePanel(this, AppOpsDetails.class.getName(), args, - R.string.app_ops_settings, null, this, RESULT_APP_DETAILS); - } - @Override public void onListItemClick(ListView l, View v, int position, long id) { AppOpEntry entry = mAdapter.getItem(position); if (entry != null) { - if (mUserControlled) { - // We treat this as tapping on the check box, toggling the app op state. - Switch sw = ((Switch) v.findViewById(R.id.op_switch)); - boolean checked = !sw.isChecked(); - sw.setChecked(checked); - AppOpsManager.OpEntry op = entry.getOpEntry(0); - int mode = checked ? AppOpsManager.MODE_ALLOWED : AppOpsManager.MODE_IGNORED; - mState.getAppOpsManager().setMode(op.getOp(), - entry.getAppEntry().getApplicationInfo().uid, - entry.getAppEntry().getApplicationInfo().packageName, - mode); - entry.overridePrimaryOpMode(mode); - } else { - mCurrentPkgName = entry.getAppEntry().getApplicationInfo().packageName; - startApplicationDetailsActivity(); - } + // We treat this as tapping on the check box, toggling the app op state. + Switch sw = v.findViewById(R.id.op_switch); + boolean checked = !sw.isChecked(); + sw.setChecked(checked); + AppOpsManager.OpEntry op = entry.getOpEntry(0); + int mode = checked ? AppOpsManager.MODE_ALLOWED : AppOpsManager.MODE_IGNORED; + mState.getAppOpsManager().setMode(op.getOp(), + entry.getAppEntry().getApplicationInfo().uid, + entry.getAppEntry().getApplicationInfo().packageName, + mode); + entry.overridePrimaryOpMode(mode); } } @@ -388,9 +348,9 @@ public class AppOpsCategory extends ListFragment implements Bundle fargs = getArguments(); AppOpsState.OpsTemplate template = null; if (fargs != null) { - template = (AppOpsState.OpsTemplate)fargs.getParcelable("template"); + template = fargs.getParcelable("template"); } - return new AppListLoader(getActivity(), mState, template, mUserControlled); + return new AppListLoader(getActivity(), mState, template); } @Override public void onLoadFinished(Loader> loader, List data) { diff --git a/src/com/android/settings/applications/AppOpsDetails.java b/src/com/android/settings/applications/AppOpsDetails.java deleted file mode 100644 index 0e41cab2847..00000000000 --- a/src/com/android/settings/applications/AppOpsDetails.java +++ /dev/null @@ -1,223 +0,0 @@ -/** - * Copyright (C) 2013 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy - * of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - */ - -package com.android.settings.applications; - -import android.app.Activity; -import android.app.AppOpsManager; -import android.content.Context; -import android.content.Intent; -import android.content.pm.PackageInfo; -import android.content.pm.PackageManager; -import android.content.pm.PackageManager.NameNotFoundException; -import android.content.pm.PermissionGroupInfo; -import android.content.pm.PermissionInfo; -import android.content.res.Resources; -import android.graphics.drawable.Drawable; -import android.os.Bundle; -import android.text.TextUtils; -import android.util.Log; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; -import android.widget.CompoundButton; -import android.widget.ImageView; -import android.widget.LinearLayout; -import android.widget.Switch; -import android.widget.TextView; - -import com.android.internal.logging.nano.MetricsProto.MetricsEvent; -import com.android.settings.applications.manageapplications.ManageApplications; -import com.android.settings.core.InstrumentedPreferenceFragment; -import com.android.settings.R; -import com.android.settings.SettingsActivity; -import com.android.settings.Utils; -import com.android.settings.widget.EntityHeaderController; - -import java.util.List; - -public class AppOpsDetails extends InstrumentedPreferenceFragment { - static final String TAG = "AppOpsDetails"; - - public static final String ARG_PACKAGE_NAME = "package"; - - private AppOpsState mState; - private PackageManager mPm; - private AppOpsManager mAppOps; - private PackageInfo mPackageInfo; - private LayoutInflater mInflater; - private View mRootView; - private LinearLayout mOperationsSection; - - // Utility method to set application label and icon. - private void setAppLabelAndIcon(PackageInfo pkgInfo) { - final View appSnippet = mRootView.findViewById(R.id.app_snippet); - CharSequence label = mPm.getApplicationLabel(pkgInfo.applicationInfo); - Drawable icon = mPm.getApplicationIcon(pkgInfo.applicationInfo); - setupAppSnippet(appSnippet, label, icon, - pkgInfo != null ? pkgInfo.versionName : null); - } - - private String retrieveAppEntry() { - final Bundle args = getArguments(); - String packageName = (args != null) ? args.getString(ARG_PACKAGE_NAME) : null; - if (packageName == null) { - Intent intent = (args == null) ? - getActivity().getIntent() : (Intent) args.getParcelable("intent"); - if (intent != null) { - packageName = intent.getData().getSchemeSpecificPart(); - } - } - try { - mPackageInfo = mPm.getPackageInfo(packageName, - PackageManager.MATCH_DISABLED_COMPONENTS | - PackageManager.MATCH_ANY_USER); - } catch (NameNotFoundException e) { - Log.e(TAG, "Exception when retrieving package:" + packageName, e); - mPackageInfo = null; - } - - return packageName; - } - - private boolean refreshUi() { - if (mPackageInfo == null) { - return false; - } - - setAppLabelAndIcon(mPackageInfo); - - Resources res = getActivity().getResources(); - - mOperationsSection.removeAllViews(); - String lastPermGroup = ""; - for (AppOpsState.OpsTemplate tpl : AppOpsState.ALL_TEMPLATES) { - List entries = mState.buildState(tpl, - mPackageInfo.applicationInfo.uid, mPackageInfo.packageName); - for (final AppOpsState.AppOpEntry entry : entries) { - final AppOpsManager.OpEntry firstOp = entry.getOpEntry(0); - final View view = mInflater.inflate(R.layout.app_ops_details_item, - mOperationsSection, false); - mOperationsSection.addView(view); - String perm = AppOpsManager.opToPermission(firstOp.getOp()); - if (perm != null) { - try { - PermissionInfo pi = mPm.getPermissionInfo(perm, 0); - if (pi.group != null && !lastPermGroup.equals(pi.group)) { - lastPermGroup = pi.group; - PermissionGroupInfo pgi = mPm.getPermissionGroupInfo(pi.group, 0); - if (pgi.icon != 0) { - ((ImageView)view.findViewById(R.id.op_icon)).setImageDrawable( - pgi.loadIcon(mPm)); - } - } - } catch (NameNotFoundException e) { - } - } - ((TextView)view.findViewById(R.id.op_name)).setText( - entry.getSwitchText(mState)); - ((TextView)view.findViewById(R.id.op_time)).setText( - entry.getTimeText(res, true)); - Switch sw = (Switch)view.findViewById(R.id.switchWidget); - final int switchOp = AppOpsManager.opToSwitch(firstOp.getOp()); - sw.setChecked(mAppOps.checkOp(switchOp, entry.getPackageOps().getUid(), - entry.getPackageOps().getPackageName()) == AppOpsManager.MODE_ALLOWED); - sw.setOnCheckedChangeListener(new Switch.OnCheckedChangeListener() { - @Override - public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { - mAppOps.setMode(switchOp, entry.getPackageOps().getUid(), - entry.getPackageOps().getPackageName(), isChecked - ? AppOpsManager.MODE_ALLOWED : AppOpsManager.MODE_IGNORED); - } - }); - } - } - - return true; - } - - private void setIntentAndFinish(boolean finish, boolean appChanged) { - Intent intent = new Intent(); - intent.putExtra(ManageApplications.APP_CHG, appChanged); - SettingsActivity sa = (SettingsActivity)getActivity(); - sa.finishPreferencePanel(this, Activity.RESULT_OK, intent); - } - - /** Called when the activity is first created. */ - @Override - public void onCreate(Bundle icicle) { - super.onCreate(icicle); - - mState = new AppOpsState(getActivity()); - mPm = getActivity().getPackageManager(); - mInflater = (LayoutInflater)getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE); - mAppOps = (AppOpsManager)getActivity().getSystemService(Context.APP_OPS_SERVICE); - - retrieveAppEntry(); - - setHasOptionsMenu(true); - } - - @Override - public View onCreateView( - LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { - final View view = inflater.inflate(R.layout.app_ops_details, container, false); - Utils.prepareCustomPreferencesList(container, view, view, false); - - mRootView = view; - mOperationsSection = (LinearLayout)view.findViewById(R.id.operations_section); - return view; - } - - @Override - public int getMetricsCategory() { - return MetricsEvent.APP_OPS_DETAILS; - } - - @Override - public void onResume() { - super.onResume(); - if (!refreshUi()) { - setIntentAndFinish(true, true); - } - } - - /** - * @deprecated app info pages should use {@link EntityHeaderController} to show the app header. - */ - void setupAppSnippet(View appSnippet, CharSequence label, Drawable icon, - CharSequence versionName) { - LayoutInflater.from(appSnippet.getContext()).inflate(R.layout.widget_text_views, - appSnippet.findViewById(android.R.id.widget_frame)); - - ImageView iconView = appSnippet.findViewById(android.R.id.icon); - iconView.setImageDrawable(icon); - // Set application name. - TextView labelView = appSnippet.findViewById(android.R.id.title); - labelView.setText(label); - // Version number of application - TextView appVersion = appSnippet.findViewById(R.id.widget_text1); - - if (!TextUtils.isEmpty(versionName)) { - appVersion.setSelected(true); - appVersion.setVisibility(View.VISIBLE); - appVersion.setText(appSnippet.getContext().getString(R.string.version_text, - String.valueOf(versionName))); - } else { - appVersion.setVisibility(View.INVISIBLE); - } - } -} diff --git a/src/com/android/settings/applications/AppOpsState.java b/src/com/android/settings/applications/AppOpsState.java index 2a5c49ad8d1..7f002e2a6b9 100644 --- a/src/com/android/settings/applications/AppOpsState.java +++ b/src/com/android/settings/applications/AppOpsState.java @@ -50,8 +50,6 @@ public class AppOpsState { final CharSequence[] mOpSummaries; final CharSequence[] mOpLabels; - List mApps; - public AppOpsState(Context context) { mContext = context; mAppOps = (AppOpsManager)context.getSystemService(Context.APP_OPS_SERVICE); diff --git a/src/com/android/settings/applications/AppOpsSummary.java b/src/com/android/settings/applications/AppOpsSummary.java deleted file mode 100644 index ba2a3c911cb..00000000000 --- a/src/com/android/settings/applications/AppOpsSummary.java +++ /dev/null @@ -1,132 +0,0 @@ -/** - * Copyright (C) 2013 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy - * of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - */ - -package com.android.settings.applications; - -import android.app.Fragment; -import android.app.FragmentManager; -import android.content.res.TypedArray; -import android.os.Bundle; -import android.preference.PreferenceFrameLayout; -import android.support.v13.app.FragmentPagerAdapter; -import android.support.v4.view.PagerTabStrip; -import android.support.v4.view.ViewPager; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; - -import com.android.internal.logging.nano.MetricsProto.MetricsEvent; -import com.android.settings.core.InstrumentedPreferenceFragment; -import com.android.settings.R; - -public class AppOpsSummary extends InstrumentedPreferenceFragment { - // layout inflater object used to inflate views - private LayoutInflater mInflater; - - private ViewGroup mContentContainer; - private View mRootView; - private ViewPager mViewPager; - - CharSequence[] mPageNames; - static AppOpsState.OpsTemplate[] sPageTemplates = new AppOpsState.OpsTemplate[] { - AppOpsState.LOCATION_TEMPLATE, - AppOpsState.PERSONAL_TEMPLATE, - AppOpsState.MESSAGING_TEMPLATE, - AppOpsState.MEDIA_TEMPLATE, - AppOpsState.DEVICE_TEMPLATE - }; - - int mCurPos; - - @Override - public int getMetricsCategory() { - return MetricsEvent.APP_OPS_SUMMARY; - } - - class MyPagerAdapter extends FragmentPagerAdapter implements ViewPager.OnPageChangeListener { - - public MyPagerAdapter(FragmentManager fm) { - super(fm); - } - - @Override - public Fragment getItem(int position) { - return new AppOpsCategory(sPageTemplates[position]); - } - - @Override - public int getCount() { - return sPageTemplates.length; - } - - @Override - public CharSequence getPageTitle(int position) { - return mPageNames[position]; - } - - @Override - public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) { - } - - @Override - public void onPageSelected(int position) { - mCurPos = position; - } - - @Override - public void onPageScrollStateChanged(int state) { - if (state == ViewPager.SCROLL_STATE_IDLE) { - //updateCurrentTab(mCurPos); - } - } - } - - @Override - public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { - // initialize the inflater - mInflater = inflater; - - View rootView = mInflater.inflate(R.layout.app_ops_summary, - container, false); - mContentContainer = container; - mRootView = rootView; - - mPageNames = getResources().getTextArray(R.array.app_ops_categories); - - mViewPager = (ViewPager) rootView.findViewById(R.id.pager); - MyPagerAdapter adapter = new MyPagerAdapter(getChildFragmentManager()); - mViewPager.setAdapter(adapter); - mViewPager.setOnPageChangeListener(adapter); - PagerTabStrip tabs = (PagerTabStrip) rootView.findViewById(R.id.tabs); - - // This should be set in the XML layout, but PagerTabStrip lives in - // support-v4 and doesn't have styleable attributes. - final TypedArray ta = tabs.getContext().obtainStyledAttributes( - new int[] { android.R.attr.colorAccent }); - final int colorAccent = ta.getColor(0, 0); - ta.recycle(); - - tabs.setTabIndicatorColorResource(colorAccent); - - // We have to do this now because PreferenceFrameLayout looks at it - // only when the view is added. - if (container instanceof PreferenceFrameLayout) { - ((PreferenceFrameLayout.LayoutParams) rootView.getLayoutParams()).removeBorders = true; - } - - return rootView; - } -} diff --git a/src/com/android/settings/applications/BackgroundCheckSummary.java b/src/com/android/settings/applications/BackgroundCheckSummary.java index 4be3396f99e..f2dd1a9e384 100644 --- a/src/com/android/settings/applications/BackgroundCheckSummary.java +++ b/src/com/android/settings/applications/BackgroundCheckSummary.java @@ -60,8 +60,8 @@ public class BackgroundCheckSummary extends InstrumentedPreferenceFragment { } FragmentTransaction ft = getChildFragmentManager().beginTransaction(); - ft.add(R.id.appops_content, new AppOpsCategory(AppOpsState.RUN_IN_BACKGROUND_TEMPLATE, - true), "appops"); + ft.add(R.id.appops_content, new AppOpsCategory(AppOpsState.RUN_IN_BACKGROUND_TEMPLATE), + "appops"); ft.commitAllowingStateLoss(); return rootView;