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.inputmethod.AvailableVirtualKeyboardFragment;
25 import com.android.settings.inputmethod.NewKeyboardLayoutEnabledLocalesFragment;
26 import com.android.settings.location.LocationServices;
27 
28 import java.util.Map;
29 
30 /**
31  * A registry to keep track of which page and its own profile selection page.
32  */
33 public class ProfileFragmentBridge {
34 
35     /**
36      * Map from parent fragment to category key. The parent fragment hosts child with
37      * category_key.
38      */
39     public static final Map<String, String> FRAGMENT_MAP;
40 
41     static {
42         FRAGMENT_MAP = new ArrayMap<>();
AccountDashboardFragment.class.getName()43         FRAGMENT_MAP.put(AccountDashboardFragment.class.getName(),
44                 ProfileSelectAccountFragment.class.getName());
ManageApplications.class.getName()45         FRAGMENT_MAP.put(ManageApplications.class.getName(),
46                 ProfileSelectManageApplications.class.getName());
LocationServices.class.getName()47         FRAGMENT_MAP.put(LocationServices.class.getName(),
48                 ProfileSelectLocationServicesFragment.class.getName());
StorageDashboardFragment.class.getName()49         FRAGMENT_MAP.put(StorageDashboardFragment.class.getName(),
50                 ProfileSelectStorageFragment.class.getName());
AvailableVirtualKeyboardFragment.class.getName()51         FRAGMENT_MAP.put(AvailableVirtualKeyboardFragment.class.getName(),
52                 ProfileSelectKeyboardFragment.class.getName());
NewKeyboardLayoutEnabledLocalesFragment.class.getName()53         FRAGMENT_MAP.put(NewKeyboardLayoutEnabledLocalesFragment.class.getName(),
54                 ProfileSelectPhysicalKeyboardFragment.class.getName());
55     }
56 }
57