1/**
2 * Copyright (C) 2015 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 * use this file except in compliance with the License. You may obtain a copy
6 * of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 * License for the specific language governing permissions and limitations
14 * under the License.
15 */
16
17package com.android.settings.applications;
18
19import android.app.Fragment;
20import android.app.FragmentManager;
21import android.app.FragmentTransaction;
22import android.content.res.TypedArray;
23import android.os.Bundle;
24import android.preference.PreferenceFrameLayout;
25import android.support.v13.app.FragmentPagerAdapter;
26import android.support.v4.view.PagerTabStrip;
27import android.support.v4.view.ViewPager;
28import android.view.LayoutInflater;
29import android.view.View;
30import android.view.ViewGroup;
31
32import com.android.internal.logging.MetricsProto.MetricsEvent;
33import com.android.settings.InstrumentedFragment;
34import com.android.settings.R;
35
36public class BackgroundCheckSummary extends InstrumentedFragment {
37    // layout inflater object used to inflate views
38    private LayoutInflater mInflater;
39
40    @Override
41    protected int getMetricsCategory() {
42        return MetricsEvent.BACKGROUND_CHECK_SUMMARY;
43    }
44
45    @Override
46    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
47        // initialize the inflater
48        mInflater = inflater;
49
50        View rootView = mInflater.inflate(R.layout.background_check_summary,
51                container, false);
52
53        // We have to do this now because PreferenceFrameLayout looks at it
54        // only when the view is added.
55        if (container instanceof PreferenceFrameLayout) {
56            ((PreferenceFrameLayout.LayoutParams) rootView.getLayoutParams()).removeBorders = true;
57        }
58
59        FragmentTransaction ft = getChildFragmentManager().beginTransaction();
60        ft.add(R.id.appops_content, new AppOpsCategory(AppOpsState.RUN_IN_BACKGROUND_TEMPLATE,
61                        true), "appops");
62        ft.commitAllowingStateLoss();
63
64        return rootView;
65    }
66}
67