• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements.  See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License.  You may obtain a copy of the License at
8  *
9  *     http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 /*
18  * Copyright (C) 2016 The Android Open Source Project
19  *
20  * Licensed under the Apache License, Version 2.0 (the "License");
21  * you may not use this file except in compliance with the License.
22  * You may obtain a copy of the License at
23  *
24  *      http://www.apache.org/licenses/LICENSE-2.0
25  *
26  * Unless required by applicable law or agreed to in writing, software
27  * distributed under the License is distributed on an "AS IS" BASIS,
28  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
29  * See the License for the specific language governing permissions and
30  * limitations under the License.
31  */
32 
33 package java.lang;
34 
35 import java.util.Properties;
36 
37 /**
38  * A class encoding all hardcoded system property values on Android. A compiler may
39  * take advantage of these properties. Changing them at load-time (-D) or runtime
40  * may not have any effect.
41  *
42  * @hide
43  */
44 public final class AndroidHardcodedSystemProperties {
45 
46     // This value is shared with sun.misc.Version. It is defined here so that the compiler
47     // can use it.
48     public final static String JAVA_VERSION = "0";
49 
50     final static String[][] STATIC_PROPERTIES = {
51         // None of these four are meaningful on Android, but these keys are guaranteed
52         // to be present for System.getProperty. For java.class.version, we use the maximum
53         // class file version that dx currently supports.
54         { "java.class.version", "50.0" },
55         { "java.version", JAVA_VERSION },
56         { "java.compiler", "" },
57         { "java.ext.dirs", "" },
58 
59         { "java.specification.name", "Dalvik Core Library" },
60         { "java.specification.vendor", "The Android Project" },
61         { "java.specification.version", "0.9" },
62 
63         { "java.vendor", "The Android Project" },
64         { "java.vendor.url", "http://www.android.com/" },
65         { "java.vm.name", "Dalvik" },
66         { "java.vm.specification.name", "Dalvik Virtual Machine Specification" },
67         { "java.vm.specification.vendor", "The Android Project" },
68         { "java.vm.specification.version", "0.9" },
69         { "java.vm.vendor", "The Android Project" },
70 
71         { "java.vm.vendor.url", "http://www.android.com/" },
72 
73         { "java.net.preferIPv6Addresses", "false" },
74 
75         { "file.encoding", "UTF-8" },
76 
77         { "file.separator", "/" },
78         { "line.separator", "\n" },
79         { "path.separator", ":" },
80 
81         // Turn off ICU debugging. This allows compile-time initialization of a range of
82         // classes. b/28039175
83         { "ICUDebug", null },
84 
85         // Hardcode DecimalFormat parsing flag to be default. b/27265238
86         { "android.icu.text.DecimalFormat.SkipExtendedSeparatorParsing", null },
87         // Hardcode MessagePattern apostrophe mode to be default. b/27265238
88         { "android.icu.text.MessagePattern.ApostropheMode", null },
89 
90         // Hardcode "sun.io.useCanonCaches" to use the default (on). b/28174137
91         { "sun.io.useCanonCaches", null },
92         { "sun.io.useCanonPrefixCache", null },
93 
94         // Hardcode some http properties to use the default. b/28174137
95         { "http.keepAlive", null },
96         { "http.keepAliveDuration", null },
97         { "http.maxConnections", null },
98 
99         // Hardcode "os.name" to "Linux." Aids compile-time initialization, checked in System.
100         // b/28174137
101         { "os.name", "Linux" },
102 
103         // Turn off javax.net debugging. This allows compile-time initialization of a range
104         // of classes. b/28174137
105         { "javax.net.debug", null },
106 
107         // Hardcode default value for AVA. b/28174137
108         { "com.sun.security.preserveOldDCEncoding", null },
109     };
110 }
111 
112