• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2009 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.sdklib.internal.project;
18 
19 import java.util.HashMap;
20 import java.util.Map;
21 
22 /**
23  * Settings for multiple APK generation.
24  */
25 public class ApkSettings {
26     private boolean mSplitByDpi = false;
27 
ApkSettings()28     public ApkSettings() {
29     }
30 
31     /**
32      * Returns a map of configuration filters to be used by the -c option of aapt.
33      * <p/>The map stores (key, value) pairs where the keys is a filename modifier and the value
34      * is the parameter to pass to aapt through the -c option.
35      * @return a map, always. It can however be empty.
36      */
getResourceFilters()37     public Map<String, String> getResourceFilters() {
38         Map<String, String> map = new HashMap<String, String>();
39         if (mSplitByDpi) {
40             map.put("hdpi", "hdpi,nodpi");
41             map.put("mdpi", "mdpi,nodpi");
42             map.put("ldpi", "ldpi,nodpi");
43         }
44 
45         return map;
46     }
47 
48     /**
49      * Indicates whether APKs should be generate for each dpi level.
50      */
isSplitByDpi()51     public boolean isSplitByDpi() {
52         return mSplitByDpi;
53     }
54 
setSplitByDensity(boolean split)55     public void setSplitByDensity(boolean split) {
56         mSplitByDpi = split;
57     }
58 }
59