• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2019 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy 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,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package com.android.settings.dashboard.profileselector;
18 
19 import android.util.ArrayMap;
20 
21 import com.android.settings.accounts.AccountDashboardFragment;
22 import com.android.settings.applications.manageapplications.ManageApplications;
23 import com.android.settings.deviceinfo.StorageDashboardFragment;
24 import com.android.settings.location.LocationServices;
25 import com.android.settings.location.RecentLocationAccessSeeAllFragment;
26 
27 import java.util.Map;
28 
29 /**
30  * A registry to keep track of which page and its own profile selection page.
31  */
32 public class ProfileFragmentBridge {
33 
34     /**
35      * Map from parent fragment to category key. The parent fragment hosts child with
36      * category_key.
37      */
38     public static final Map<String, String> FRAGMENT_MAP;
39 
40     static {
41         FRAGMENT_MAP = new ArrayMap<>();
AccountDashboardFragment.class.getName()42         FRAGMENT_MAP.put(AccountDashboardFragment.class.getName(),
43                 ProfileSelectAccountFragment.class.getName());
ManageApplications.class.getName()44         FRAGMENT_MAP.put(ManageApplications.class.getName(),
45                 ProfileSelectManageApplications.class.getName());
RecentLocationAccessSeeAllFragment.class.getName()46         FRAGMENT_MAP.put(RecentLocationAccessSeeAllFragment.class.getName(),
47                 ProfileSelectRecentLocationAccessFragment.class.getName());
LocationServices.class.getName()48         FRAGMENT_MAP.put(LocationServices.class.getName(),
49                 ProfileSelectLocationServicesFragment.class.getName());
StorageDashboardFragment.class.getName()50         FRAGMENT_MAP.put(StorageDashboardFragment.class.getName(),
51                 ProfileSelectStorageFragment.class.getName());
52     }
53 }
54