build
Revision | dc785843c7f1f4dcbcf603c8ae8e9599ea2d15b1 (tree) |
---|---|
Time | 2009-09-04 06:12:45 |
Author | Jean-Baptiste Queru <jbq@goog...> |
Commiter | Jean-Baptiste Queru |
merge from donut
@@ -299,7 +299,7 @@ else # TARGET_BOOTIMAGE_USE_EXT2 != true | ||
299 | 299 | $(INSTALLED_BOOTIMAGE_TARGET): $(MKBOOTIMG) $(INTERNAL_BOOTIMAGE_FILES) |
300 | 300 | $(call pretty,"Target boot image: $@") |
301 | 301 | $(hide) $(MKBOOTIMG) $(INTERNAL_BOOTIMAGE_ARGS) --output $@ |
302 | - $(hide) $(call assert-max-file-size,$@,$(BOARD_BOOTIMAGE_MAX_SIZE)) | |
302 | + $(hide) $(call assert-max-file-size,$@,$(BOARD_BOOTIMAGE_MAX_SIZE),raw) | |
303 | 303 | endif # TARGET_BOOTIMAGE_USE_EXT2 |
304 | 304 | |
305 | 305 | else # TARGET_NO_KERNEL |
@@ -577,7 +577,7 @@ $(INSTALLED_RECOVERYIMAGE_TARGET): $(MKBOOTFS) $(MKBOOTIMG) $(MINIGZIP) \ | ||
577 | 577 | $(MKBOOTFS) $(TARGET_RECOVERY_ROOT_OUT) | $(MINIGZIP) > $(recovery_ramdisk) |
578 | 578 | $(MKBOOTIMG) $(INTERNAL_RECOVERYIMAGE_ARGS) --output $@ |
579 | 579 | @echo ----- Made recovery image -------- $@ |
580 | - $(hide) $(call assert-max-file-size,$@,$(BOARD_RECOVERYIMAGE_MAX_SIZE)) | |
580 | + $(hide) $(call assert-max-file-size,$@,$(BOARD_RECOVERYIMAGE_MAX_SIZE),raw) | |
581 | 581 | |
582 | 582 | else |
583 | 583 | INSTALLED_RECOVERYIMAGE_TARGET := |
@@ -662,7 +662,7 @@ endif | ||
662 | 662 | $(INSTALLED_SYSTEMIMAGE): $(BUILT_SYSTEMIMAGE) $(RECOVERY_FROM_BOOT_PATCH) | $(ACP) |
663 | 663 | @echo "Install system fs image: $@" |
664 | 664 | $(copy-file-to-target) |
665 | - $(hide) $(call assert-max-file-size,$@ $(RECOVERY_FROM_BOOT_PATCH),$(BOARD_SYSTEMIMAGE_MAX_SIZE)) | |
665 | + $(hide) $(call assert-max-file-size,$@ $(RECOVERY_FROM_BOOT_PATCH),$(BOARD_SYSTEMIMAGE_MAX_SIZE),yaffs) | |
666 | 666 | |
667 | 667 | systemimage: $(INSTALLED_SYSTEMIMAGE) |
668 | 668 |
@@ -671,7 +671,7 @@ systemimage-nodeps snod: $(filter-out systemimage-nodeps snod,$(MAKECMDGOALS)) \ | ||
671 | 671 | | $(INTERNAL_MKUSERFS) |
672 | 672 | @echo "make $@: ignoring dependencies" |
673 | 673 | $(call build-systemimage-target,$(INSTALLED_SYSTEMIMAGE)) |
674 | - $(hide) $(call assert-max-file-size,$(INSTALLED_SYSTEMIMAGE),$(BOARD_SYSTEMIMAGE_MAX_SIZE)) | |
674 | + $(hide) $(call assert-max-file-size,$(INSTALLED_SYSTEMIMAGE),$(BOARD_SYSTEMIMAGE_MAX_SIZE),yaffs) | |
675 | 675 | |
676 | 676 | ####### |
677 | 677 | ## system tarball |
@@ -708,7 +708,7 @@ define build-userdataimage-target | ||
708 | 708 | $(call pretty,"Target userdata fs image: $(INSTALLED_USERDATAIMAGE_TARGET)") |
709 | 709 | @mkdir -p $(TARGET_OUT_DATA) |
710 | 710 | $(call build-userimage-ext2-target,$(TARGET_OUT_DATA),$(INSTALLED_USERDATAIMAGE_TARGET),userdata,) |
711 | - $(hide) $(call assert-max-file-size,$(INSTALLED_USERDATAIMAGE_TARGET),$(BOARD_USERDATAIMAGE_MAX_SIZE)) | |
711 | + $(hide) $(call assert-max-file-size,$(INSTALLED_USERDATAIMAGE_TARGET),$(BOARD_USERDATAIMAGE_MAX_SIZE),yaffs) | |
712 | 712 | endef |
713 | 713 | |
714 | 714 | else # TARGET_USERIMAGES_USE_EXT2 != true |
@@ -718,7 +718,7 @@ define build-userdataimage-target | ||
718 | 718 | $(call pretty,"Target userdata fs image: $(INSTALLED_USERDATAIMAGE_TARGET)") |
719 | 719 | @mkdir -p $(TARGET_OUT_DATA) |
720 | 720 | $(hide) $(MKYAFFS2) -f $(TARGET_OUT_DATA) $(INSTALLED_USERDATAIMAGE_TARGET) |
721 | - $(hide) $(call assert-max-file-size,$(INSTALLED_USERDATAIMAGE_TARGET),$(BOARD_USERDATAIMAGE_MAX_SIZE)) | |
721 | + $(hide) $(call assert-max-file-size,$(INSTALLED_USERDATAIMAGE_TARGET),$(BOARD_USERDATAIMAGE_MAX_SIZE),yaffs) | |
722 | 722 | endef |
723 | 723 | endif # TARGET_USERIMAGES_USE_EXT2 |
724 | 724 |
@@ -47,6 +47,7 @@ LOCAL_PREBUILT_LIBS:= | ||
47 | 47 | LOCAL_PREBUILT_EXECUTABLES:= |
48 | 48 | LOCAL_PREBUILT_JAVA_LIBRARIES:= |
49 | 49 | LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES:= |
50 | +LOCAL_PREBUILT_STRIP_COMMENTS:= | |
50 | 51 | LOCAL_INTERMEDIATE_SOURCES:= |
51 | 52 | LOCAL_JAVA_LIBRARIES:= |
52 | 53 | LOCAL_NO_STANDARD_LIBRARIES:= |
@@ -1469,6 +1469,19 @@ define copy-file-to-target-with-cp | ||
1469 | 1469 | $(hide) cp -fp $< $@ |
1470 | 1470 | endef |
1471 | 1471 | |
1472 | +# The same as copy-file-to-target, but use the zipalign tool to do so. | |
1473 | +define copy-file-to-target-with-zipalign | |
1474 | +@mkdir -p $(dir $@) | |
1475 | +$(hide) $(ZIPALIGN) -f 4 $< $@ | |
1476 | +endef | |
1477 | + | |
1478 | +# The same as copy-file-to-target, but strip out "# comment"-style | |
1479 | +# comments (for config files and such). | |
1480 | +define copy-file-to-target-strip-comments | |
1481 | +@mkdir -p $(dir $@) | |
1482 | +$(hide) sed -e 's/#.*$$//' -e 's/[ \t]*$$//' -e '/^$$/d' < $< > $@ | |
1483 | +endef | |
1484 | + | |
1472 | 1485 | # The same as copy-file-to-target, but don't preserve |
1473 | 1486 | # the old modification time. |
1474 | 1487 | define copy-file-to-new-target |
@@ -1489,6 +1502,18 @@ define transform-prebuilt-to-target | ||
1489 | 1502 | $(copy-file-to-target) |
1490 | 1503 | endef |
1491 | 1504 | |
1505 | +# Copy a prebuilt file to a target location, using zipalign on it. | |
1506 | +define transform-prebuilt-to-target-with-zipalign | |
1507 | +@echo "$(if $(PRIVATE_IS_HOST_MODULE),host,target) Prebuilt APK: $(PRIVATE_MODULE) ($@)" | |
1508 | +$(copy-file-to-target-with-zipalign) | |
1509 | +endef | |
1510 | + | |
1511 | +# Copy a prebuilt file to a target location, stripping "# comment" comments. | |
1512 | +define transform-prebuilt-to-target-strip-comments | |
1513 | +@echo "$(if $(PRIVATE_IS_HOST_MODULE),host,target) Prebuilt: $(PRIVATE_MODULE) ($@)" | |
1514 | +$(copy-file-to-target-strip-comments) | |
1515 | +endef | |
1516 | + | |
1492 | 1517 | |
1493 | 1518 | ########################################################### |
1494 | 1519 | ## On some platforms (MacOS), after copying a static |
@@ -1547,6 +1572,7 @@ endef | ||
1547 | 1572 | |
1548 | 1573 | # $(1): The file(s) to check (often $@) |
1549 | 1574 | # $(2): The maximum total image size, in decimal bytes |
1575 | +# $(3): the type of filesystem "yaffs" or "raw" | |
1550 | 1576 | # |
1551 | 1577 | # If $(2) is empty, evaluates to "true" |
1552 | 1578 | # |
@@ -1560,9 +1586,15 @@ $(if $(2), \ | ||
1560 | 1586 | printname=$$(echo -n "$(1)" | tr " " +); \ |
1561 | 1587 | echo "$$printname total size is $$total"; \ |
1562 | 1588 | img_blocksize=$(call image-size-from-data-size,$(BOARD_FLASH_BLOCK_SIZE)); \ |
1589 | + if [ "$(3)" == "yaffs" ]; then \ | |
1590 | + reservedblocks=5; \ | |
1591 | + else \ | |
1592 | + reservedblocks=0; \ | |
1593 | + fi; \ | |
1563 | 1594 | twoblocks=$$((img_blocksize * 2)); \ |
1564 | 1595 | onepct=$$((((($(2) / 100) - 1) / img_blocksize + 1) * img_blocksize)); \ |
1565 | - reserve=$$((twoblocks > onepct ? twoblocks : onepct)); \ | |
1596 | + reserve=$$(((twoblocks > onepct ? twoblocks : onepct) + \ | |
1597 | + reservedblocks * img_blocksize)); \ | |
1566 | 1598 | maxsize=$$(($(2) - reserve)); \ |
1567 | 1599 | if [ "$$total" -gt "$$maxsize" ]; then \ |
1568 | 1600 | echo "error: $$printname too large ($$total > [$(2) - $$reserve])"; \ |
@@ -339,6 +339,7 @@ ifeq ($(SDK_ONLY),true) | ||
339 | 339 | subdirs := \ |
340 | 340 | prebuilt \ |
341 | 341 | build/libs/host \ |
342 | + build/tools/zipalign \ | |
342 | 343 | dalvik/dexdump \ |
343 | 344 | dalvik/libdex \ |
344 | 345 | dalvik/tools/dmtracedump \ |
@@ -366,7 +367,6 @@ ifneq (,$(shell which javac 2>/dev/null)) | ||
366 | 367 | $(warning sdk-only: javac available.) |
367 | 368 | subdirs += \ |
368 | 369 | build/tools/signapk \ |
369 | - build/tools/zipalign \ | |
370 | 370 | dalvik/dx \ |
371 | 371 | dalvik/libcore \ |
372 | 372 | development/apps \ |
@@ -3,7 +3,7 @@ | ||
3 | 3 | ## |
4 | 4 | ## Additional inputs from base_rules.make: |
5 | 5 | ## None. |
6 | -## | |
6 | +## | |
7 | 7 | ########################################################### |
8 | 8 | |
9 | 9 | ifneq ($(LOCAL_PREBUILT_LIBS),) |
@@ -26,8 +26,35 @@ else | ||
26 | 26 | prebuilt_module_is_a_library := |
27 | 27 | endif |
28 | 28 | |
29 | +# Ensure that prebuilt .apks have been aligned. | |
30 | +ifneq ($(filter APPS,$(LOCAL_MODULE_CLASS)),) | |
31 | +$(LOCAL_BUILT_MODULE) : $(LOCAL_PATH)/$(LOCAL_SRC_FILES) | $(ZIPALIGN) | |
32 | + $(transform-prebuilt-to-target-with-zipalign) | |
33 | +else | |
34 | +ifneq ($(LOCAL_PREBUILT_STRIP_COMMENTS),) | |
35 | +$(LOCAL_BUILT_MODULE) : $(LOCAL_PATH)/$(LOCAL_SRC_FILES) | |
36 | + $(transform-prebuilt-to-target-strip-comments) | |
37 | +else | |
29 | 38 | $(LOCAL_BUILT_MODULE) : $(LOCAL_PATH)/$(LOCAL_SRC_FILES) | $(ACP) |
30 | 39 | $(transform-prebuilt-to-target) |
40 | +endif | |
41 | +endif | |
42 | + | |
43 | +ifeq ($(LOCAL_CERTIFICATE),) | |
44 | + # can't re-sign this package, so predexopt is not available. | |
45 | +else | |
46 | + | |
47 | +# If this is not an absolute certificate, assign it to a generic one. | |
48 | +ifeq ($(dir $(strip $(LOCAL_CERTIFICATE))),./) | |
49 | + LOCAL_CERTIFICATE := $(SRC_TARGET_DIR)/product/security/$(LOCAL_CERTIFICATE) | |
50 | +endif | |
51 | + | |
52 | +PACKAGES.$(LOCAL_MODULE).PRIVATE_KEY := $(LOCAL_CERTIFICATE).pk8 | |
53 | +PACKAGES.$(LOCAL_MODULE).CERTIFICATE := $(LOCAL_CERTIFICATE).x509.pem | |
54 | +PACKAGES := $(PACKAGES) $(LOCAL_MODULE) | |
55 | + | |
56 | +endif | |
57 | + | |
31 | 58 | ifneq ($(prebuilt_module_is_a_library),) |
32 | 59 | ifneq ($(LOCAL_IS_HOST_MODULE),) |
33 | 60 | $(transform-host-ranlib-copy-hack) |
@@ -26,6 +26,7 @@ endif | ||
26 | 26 | CTS_HOST_JAR := $(HOST_OUT_JAVA_LIBRARIES)/cts.jar |
27 | 27 | |
28 | 28 | junit_host_jar := $(HOST_OUT_JAVA_LIBRARIES)/junit.jar |
29 | +HOSTTESTLIB_JAR := $(HOST_OUT_JAVA_LIBRARIES)/hosttestlib.jar | |
29 | 30 | |
30 | 31 | CTS_CORE_CASE_LIST := android.core.tests.annotation \ |
31 | 32 | android.core.tests.archive \ |
@@ -49,12 +50,25 @@ CTS_CORE_CASE_LIST := android.core.tests.annotation \ | ||
49 | 50 | android.core.tests.xnet \ |
50 | 51 | android.core.tests.runner |
51 | 52 | |
53 | +CTS_SECURITY_APPS_LIST := \ | |
54 | + CtsAppAccessData \ | |
55 | + CtsAppWithData \ | |
56 | + CtsInstrumentationAppDiffCert \ | |
57 | + CtsPermissionDeclareApp \ | |
58 | + CtsSharedUidInstall \ | |
59 | + CtsSharedUidInstallDiffCert \ | |
60 | + CtsSimpleAppInstall \ | |
61 | + CtsSimpleAppInstallDiffCert \ | |
62 | + CtsTargetInstrumentationApp \ | |
63 | + CtsUsePermissionDiffCert | |
64 | + | |
52 | 65 | CTS_CASE_LIST := \ |
53 | 66 | DeviceInfoCollector \ |
54 | 67 | CtsTestStubs \ |
55 | 68 | CtsAppTestCases \ |
56 | 69 | CtsContentTestCases \ |
57 | 70 | CtsDatabaseTestCases \ |
71 | + CtsGestureTestCases \ | |
58 | 72 | CtsGraphicsTestCases \ |
59 | 73 | CtsHardwareTestCases \ |
60 | 74 | CtsLocationTestCases \ |
@@ -78,13 +92,14 @@ CTS_CASE_LIST := \ | ||
78 | 92 | CtsPerformance5TestCases \ |
79 | 93 | ApiDemos \ |
80 | 94 | ApiDemosReferenceTest \ |
81 | - $(CTS_CORE_CASE_LIST) | |
95 | + $(CTS_CORE_CASE_LIST) \ | |
96 | + $(CTS_SECURITY_APPS_LIST) | |
82 | 97 | |
83 | 98 | DEFAULT_TEST_PLAN := $(PRIVATE_DIR)/resource/plans |
84 | 99 | |
85 | 100 | $(cts_dir)/all_cts_files_stamp: PRIVATE_JUNIT_HOST_JAR := $(junit_host_jar) |
86 | 101 | |
87 | -$(cts_dir)/all_cts_files_stamp: $(CTS_CASE_LIST) $(junit_host_jar) $(ACP) | |
102 | +$(cts_dir)/all_cts_files_stamp: $(CTS_CASE_LIST) $(junit_host_jar) $(HOSTTESTLIB_JAR) $(ACP) | |
88 | 103 | # Make necessary directory for CTS |
89 | 104 | @rm -rf $(PRIVATE_CTS_DIR) |
90 | 105 | @mkdir -p $(TMP_DIR) |
@@ -97,6 +112,8 @@ $(cts_dir)/all_cts_files_stamp: $(CTS_CASE_LIST) $(junit_host_jar) $(ACP) | ||
97 | 112 | $(hide) $(ACP) -fp $(CTS_EXECUTABLE_PATH) $(PRIVATE_DIR)/tools |
98 | 113 | # Copy junit jar |
99 | 114 | $(hide) $(ACP) -fp $(PRIVATE_JUNIT_HOST_JAR) $(PRIVATE_DIR)/tools |
115 | +# Copy hosttestlib jar | |
116 | + $(hide) $(ACP) -fp $(HOSTTESTLIB_JAR) $(PRIVATE_DIR)/tools | |
100 | 117 | # Change mode of the executables |
101 | 118 | $(hide) chmod ug+rwX $(PRIVATE_DIR)/tools/$(notdir $(CTS_EXECUTABLE_PATH)) |
102 | 119 | $(foreach apk,$(CTS_CASE_LIST), \ |
@@ -106,13 +123,17 @@ $(cts_dir)/all_cts_files_stamp: $(CTS_CASE_LIST) $(junit_host_jar) $(ACP) | ||
106 | 123 | $(hide) touch $@ |
107 | 124 | |
108 | 125 | # Generate the test descriptions for the core-tests |
109 | - | |
126 | +# Parameters: | |
127 | +# $1 : The output file where the description should be written (without the '.xml' extension) | |
128 | +# $2 : The AndroidManifest.xml corresponding to the test package | |
129 | +# $3 : The name of the TestSuite generator class to use | |
130 | +# $4 : The Android.mk corresponding to the test package (required for host-side tests only) | |
110 | 131 | define generate-core-test-description |
111 | 132 | @echo "Generate core-test description ("$(notdir $(1))")" |
112 | 133 | $(hide) java $(PRIVATE_JAVAOPTS) \ |
113 | 134 | -classpath $(PRIVATE_CLASSPATH) \ |
114 | 135 | $(PRIVATE_PARAMS) CollectAllTests $(1) \ |
115 | - $(2) $(3) | |
136 | + $(2) $(3) $(4) | |
116 | 137 | endef |
117 | 138 | |
118 | 139 | CORE_INTERMEDIATES :=$(call intermediates-dir-for,JAVA_LIBRARIES,core,,COMMON) |
@@ -214,10 +235,17 @@ $(CORE_VM_TEST_DESC): vm-tests $(HOST_OUT_JAVA_LIBRARIES)/descGen.jar $(CORE_INT | ||
214 | 235 | dot.junit.AllJunitHostTests, cts/tools/vm-tests/Android.mk) |
215 | 236 | $(ACP) -fv $(VMTESTS_INTERMEDIATES)/android.core.vm-tests.jar $(PRIVATE_DIR)/repository/testcases/android.core.vm-tests.jar |
216 | 237 | |
238 | +# Move app security host-side tests to the repository | |
239 | +APP_SECURITY_LIB := $(cts_dir)/$(cts_name)/repository/testcases/CtsAppSecurityTests.jar | |
240 | + | |
241 | +$(APP_SECURITY_LIB): $(HOST_OUT_JAVA_LIBRARIES)/CtsAppSecurityTests.jar $(cts_dir)/all_cts_files_stamp $(ACP) | |
242 | + $(ACP) -fv $(HOST_OUT_JAVA_LIBRARIES)/CtsAppSecurityTests.jar $(APP_SECURITY_LIB) | |
243 | + | |
217 | 244 | # Generate the default test plan for User. |
218 | -$(DEFAULT_TEST_PLAN): $(cts_dir)/all_cts_files_stamp $(cts_dir)/all_cts_core_files_stamp $(cts_tools_src_dir)/utils/genDefaultTestPlan.sh $(CORE_VM_TEST_DESC) | |
219 | - $(hide) bash $(cts_tools_src_dir)/utils/genDefaultTestPlan.sh cts/tests/tests/ \ | |
220 | - $(PRIVATE_DIR) $(TMP_DIR) $(TOP) $(TARGET_COMMON_OUT_ROOT) $(OUT_DIR) | |
245 | +# Usage: buildCts.py <testRoot> <ctsOutputDir> <tempDir> <androidRootDir> <docletPath> | |
246 | +$(DEFAULT_TEST_PLAN): $(cts_dir)/all_cts_files_stamp $(cts_dir)/all_cts_core_files_stamp $(cts_tools_src_dir)/utils/buildCts.py $(CORE_VM_TEST_DESC) $(APP_SECURITY_LIB) $(HOST_OUT_JAVA_LIBRARIES)/descGen.jar | |
247 | + $(hide) $(cts_tools_src_dir)/utils/buildCts.py cts/tests/tests/ $(PRIVATE_DIR) $(TMP_DIR) \ | |
248 | + $(TOP) $(HOST_OUT_JAVA_LIBRARIES)/descGen.jar | |
221 | 249 | |
222 | 250 | # Package CTS and clean up. |
223 | 251 | # |
@@ -41,7 +41,7 @@ ifeq "" "$(PLATFORM_VERSION)" | ||
41 | 41 | # which is the version that we reveal to the end user. |
42 | 42 | # Update this value when the platform version changes (rather |
43 | 43 | # than overriding it somewhere else). Can be an arbitrary string. |
44 | - PLATFORM_VERSION := Donut | |
44 | + PLATFORM_VERSION := 1.6 | |
45 | 45 | endif |
46 | 46 | |
47 | 47 | ifeq "" "$(PLATFORM_SDK_VERSION)" |
@@ -53,13 +53,13 @@ ifeq "" "$(PLATFORM_SDK_VERSION)" | ||
53 | 53 | # intermediate builds). During development, this number remains at the |
54 | 54 | # SDK version the branch is based on and PLATFORM_VERSION_CODENAME holds |
55 | 55 | # the code-name of the new development work. |
56 | - PLATFORM_SDK_VERSION := 3 | |
56 | + PLATFORM_SDK_VERSION := 4 | |
57 | 57 | endif |
58 | 58 | |
59 | 59 | ifeq "" "$(PLATFORM_VERSION_CODENAME)" |
60 | 60 | # If the build is not a final release build, then this is the current |
61 | 61 | # development code-name. If this is a final release build, it is simply "REL". |
62 | - PLATFORM_VERSION_CODENAME := Donut | |
62 | + PLATFORM_VERSION_CODENAME := REL | |
63 | 63 | endif |
64 | 64 | |
65 | 65 | ifeq "" "$(DEFAULT_APP_TARGET_SDK)" |
@@ -24,6 +24,5 @@ PRODUCT_PACKAGES := \ | ||
24 | 24 | VpnServices \ |
25 | 25 | UserDictionaryProvider \ |
26 | 26 | PackageInstaller \ |
27 | - WebSearchProvider \ | |
28 | 27 | Bugreport |
29 | 28 |
@@ -12,7 +12,6 @@ PRODUCT_PACKAGES := \ | ||
12 | 12 | MediaProvider \ |
13 | 13 | SettingsProvider \ |
14 | 14 | PackageInstaller \ |
15 | - WebSearchProvider \ | |
16 | 15 | Bugreport \ |
17 | 16 | Launcher \ |
18 | 17 | Settings \ |
@@ -863,6 +863,7 @@ public class ClassInfo extends DocInfo implements ContainerInfo, Comparable, Sco | ||
863 | 863 | data.setValue(base + ".kind", this.kind()); |
864 | 864 | TagInfo.makeHDF(data, base + ".shortDescr", this.firstSentenceTags()); |
865 | 865 | TagInfo.makeHDF(data, base + ".deprecated", deprecatedTags()); |
866 | + data.setValue(base + ".since", getSince()); | |
866 | 867 | } |
867 | 868 | |
868 | 869 | /** |
@@ -56,6 +56,7 @@ public class DroidDoc | ||
56 | 56 | public static ArrayList<String[]> mHDFData = new ArrayList<String[]>(); |
57 | 57 | public static Map<Character,String> escapeChars = new HashMap<Character,String>(); |
58 | 58 | public static String title = ""; |
59 | + public static SinceTagger sinceTagger = new SinceTagger(); | |
59 | 60 | |
60 | 61 | public static boolean checkLevel(int level) |
61 | 62 | { |
@@ -97,7 +98,6 @@ public class DroidDoc | ||
97 | 98 | String apiFile = null; |
98 | 99 | String debugStubsFile = ""; |
99 | 100 | HashSet<String> stubPackages = null; |
100 | - SinceTagger sinceTagger = new SinceTagger(); | |
101 | 101 | |
102 | 102 | root = r; |
103 | 103 |
@@ -518,6 +518,7 @@ public class DroidDoc | ||
518 | 518 | i++; |
519 | 519 | } |
520 | 520 | |
521 | + sinceTagger.writeVersionNames(data); | |
521 | 522 | return data; |
522 | 523 | } |
523 | 524 |
@@ -25,7 +25,7 @@ public class NavTree { | ||
25 | 25 | for (PackageInfo pkg: DroidDoc.choosePackages()) { |
26 | 26 | children.add(makePackageNode(pkg)); |
27 | 27 | } |
28 | - Node node = new Node("Reference", dir + "packages.html", children); | |
28 | + Node node = new Node("Reference", dir + "packages.html", children, null); | |
29 | 29 | |
30 | 30 | StringBuilder buf = new StringBuilder(); |
31 | 31 | if (false) { |
@@ -46,7 +46,7 @@ public class NavTree { | ||
46 | 46 | private static Node makePackageNode(PackageInfo pkg) { |
47 | 47 | ArrayList<Node> children = new ArrayList(); |
48 | 48 | |
49 | - children.add(new Node("Description", pkg.fullDescriptionHtmlPage(), null)); | |
49 | + children.add(new Node("Description", pkg.fullDescriptionHtmlPage(), null, null)); | |
50 | 50 | |
51 | 51 | addClassNodes(children, "Interfaces", pkg.interfaces()); |
52 | 52 | addClassNodes(children, "Classes", pkg.ordinaryClasses()); |
@@ -54,7 +54,7 @@ public class NavTree { | ||
54 | 54 | addClassNodes(children, "Exceptions", pkg.exceptions()); |
55 | 55 | addClassNodes(children, "Errors", pkg.errors()); |
56 | 56 | |
57 | - return new Node(pkg.name(), pkg.htmlPage(), children); | |
57 | + return new Node(pkg.name(), pkg.htmlPage(), children, pkg.getSince()); | |
58 | 58 | } |
59 | 59 | |
60 | 60 | private static void addClassNodes(ArrayList<Node> parent, String label, ClassInfo[] classes) { |
@@ -62,12 +62,12 @@ public class NavTree { | ||
62 | 62 | |
63 | 63 | for (ClassInfo cl: classes) { |
64 | 64 | if (cl.checkLevel()) { |
65 | - children.add(new Node(cl.name(), cl.htmlPage(), null)); | |
65 | + children.add(new Node(cl.name(), cl.htmlPage(), null, cl.getSince())); | |
66 | 66 | } |
67 | 67 | } |
68 | 68 | |
69 | 69 | if (children.size() > 0) { |
70 | - parent.add(new Node(label, null, children)); | |
70 | + parent.add(new Node(label, null, children, null)); | |
71 | 71 | } |
72 | 72 | } |
73 | 73 |
@@ -75,11 +75,13 @@ public class NavTree { | ||
75 | 75 | private String mLabel; |
76 | 76 | private String mLink; |
77 | 77 | ArrayList<Node> mChildren; |
78 | + private String mSince; | |
78 | 79 | |
79 | - Node(String label, String link, ArrayList<Node> children) { | |
80 | + Node(String label, String link, ArrayList<Node> children, String since) { | |
80 | 81 | mLabel = label; |
81 | 82 | mLink = link; |
82 | 83 | mChildren = children; |
84 | + mSince = since; | |
83 | 85 | } |
84 | 86 | |
85 | 87 | static void renderString(StringBuilder buf, String s) { |
@@ -136,6 +138,8 @@ public class NavTree { | ||
136 | 138 | renderString(buf, mLink); |
137 | 139 | buf.append(", "); |
138 | 140 | renderChildren(buf); |
141 | + buf.append(", "); | |
142 | + renderString(buf, mSince); | |
139 | 143 | buf.append(" ]"); |
140 | 144 | } |
141 | 145 | } |
@@ -123,6 +123,7 @@ public class PackageInfo extends DocInfo implements ContainerInfo | ||
123 | 123 | ClassInfo.makeLinkListHDF(data, base + ".enums", enums()); |
124 | 124 | ClassInfo.makeLinkListHDF(data, base + ".exceptions", exceptions()); |
125 | 125 | ClassInfo.makeLinkListHDF(data, base + ".errors", errors()); |
126 | + data.setValue(base + ".since", getSince()); | |
126 | 127 | } |
127 | 128 | |
128 | 129 | public ClassInfo[] interfaces() |
@@ -4,6 +4,8 @@ import com.android.apicheck.*; | ||
4 | 4 | |
5 | 5 | import java.util.*; |
6 | 6 | |
7 | +import org.clearsilver.HDF; | |
8 | + | |
7 | 9 | /** |
8 | 10 | * Applies version information to the DroidDoc class model from apicheck XML |
9 | 11 | * files. Sample usage: |
@@ -46,6 +48,17 @@ public class SinceTagger { | ||
46 | 48 | } |
47 | 49 | |
48 | 50 | /** |
51 | + * Writes an index of the version names to {@code data}. | |
52 | + */ | |
53 | + public void writeVersionNames(HDF data) { | |
54 | + int index = 1; | |
55 | + for (String version : xmlToName.values()) { | |
56 | + data.setValue("since." + index + ".name", version); | |
57 | + index++; | |
58 | + } | |
59 | + } | |
60 | + | |
61 | + /** | |
49 | 62 | * Applies the version information to {@code classDocs} where not already |
50 | 63 | * present. |
51 | 64 | * |
@@ -1,24 +1,27 @@ | ||
1 | 1 | <?cs # This file defines custom definitions for the masthead (logo, searchbox, tabs, etc) and |
2 | -left nav (toc) that gets placed on all pages. ?> | |
2 | +left nav (toc) that gets placed on all pages, for the open source site?> | |
3 | 3 | |
4 | 4 | <?cs |
5 | 5 | def:custom_masthead() ?> |
6 | 6 | <div id="header"> |
7 | 7 | <div id="headerLeft"> |
8 | - <a href="<?cs var:toroot ?>guide/index.html" tabindex="-1"><img | |
8 | + <a href="http://source.android.com" tabindex="-1"><img | |
9 | 9 | src="<?cs var:toroot ?>assets/images/open_source.png" alt="Open Source Project: Platform Development Kit" /></a> |
10 | 10 | <ul class="<?cs |
11 | - if:reference ?> <?cs | |
12 | - elif:guide ?> <?cs | |
13 | - elif:sdk ?> <?cs | |
14 | - elif:home ?> <?cs | |
15 | - elif:community ?> <?cs | |
16 | - elif:publish ?> <?cs | |
17 | - elif:about ?> <?cs /if ?>"> | |
18 | - <!--<li id="guide-link"><a href="<?cs var:toroot ?>guide/index.html" | |
19 | - onClick="return loadLast('guide)'"><span>Dev Guide</span></a></li> | |
20 | - <li id="opensource-link"><a href="http://source.android.com/" | |
21 | - onClick="return loadLast('open')"><span>Open Source</span></a></li>--> | |
11 | + if:releases ?> releases<?cs | |
12 | + elif:guide ?> guide<?cs | |
13 | + elif:licenses ?>licenses <?cs | |
14 | + elif:home ?>home <?cs | |
15 | + elif:community ?>community <?cs /if ?>"> | |
16 | + <li id="home-link"><a href="<?cs var:toroot ?>index.html"><span>Home</span></a></li> | |
17 | + <li id="guide-link"><a href="<?cs var:toroot ?>guide/index.html" | |
18 | + onClick="return loadLast('guide)'"><span>Guide</span></a></li> | |
19 | + <li id="releases-ink"><a href="<?cs var:toroot ?>releases/index.html" | |
20 | + onClick="return loadLast('releases)'"><span>Releases</span></a></li> | |
21 | + <li id="licenses-link"><a href="<?cs var:toroot ?>licenses/index.html" | |
22 | + onClick="return loadLast('licenses)'"><span>Licenses</span></a></li> | |
23 | + <li id="community-link"><a href="<?cs var:toroot ?>community/index.html" | |
24 | + onClick="return loadLast('community)'"><span>Community</span></a></li> | |
22 | 25 | </ul> |
23 | 26 | </div> |
24 | 27 | <div id="headerRight"> |
@@ -49,9 +52,45 @@ def:guide_nav() ?> | ||
49 | 52 | </script> |
50 | 53 | <?cs /def ?> |
51 | 54 | |
55 | +<?cs | |
56 | +def:licenses_nav() ?> | |
57 | + <div class="g-section g-tpl-240" id="body-content"> | |
58 | + <div class="g-unit g-first side-nav-resizable" id="side-nav"> | |
59 | + <div id="devdoc-nav"><?cs | |
60 | + include:"../../../../development/pdk/docs/licenses/licenses_toc.cs" ?> | |
61 | + </div> | |
62 | + </div> <!-- end side-nav --> | |
63 | + <script> | |
64 | + addLoadEvent(function() { | |
65 | + scrollIntoView("devdoc-nav"); | |
66 | + }); | |
67 | + </script> | |
68 | +<?cs /def ?> | |
69 | + | |
70 | +<?cs | |
71 | +def:releases_nav() ?> | |
72 | + <div class="g-section g-tpl-240" id="body-content"> | |
73 | + <div class="g-unit g-first side-nav-resizable" id="side-nav"> | |
74 | + <div id="devdoc-nav"><?cs | |
75 | + include:"../../../../development/pdk/docs/releases/releases_toc.cs" ?> | |
76 | + </div> | |
77 | + </div> <!-- end side-nav --> | |
78 | + <script> | |
79 | + addLoadEvent(function() { | |
80 | + scrollIntoView("devdoc-nav"); | |
81 | + }); | |
82 | + </script> | |
83 | +<?cs /def ?> | |
84 | + | |
52 | 85 | <?cs |
53 | -def:custom_left_nav() ?><?cs | |
54 | - call:guide_nav() ?><?cs | |
86 | +def:custom_left_nav() ?><?cs | |
87 | + if:doc.type == "guide" ?><?cs | |
88 | + call:guide_nav() ?><?cs | |
89 | + elif:doc.type == "licenses" ?><?cs | |
90 | + call:licenses_nav() ?><?cs | |
91 | + elif:doc.type == "releases" ?><?cs | |
92 | + call:releases_nav() ?><?cs | |
93 | + /if ?><?cs | |
55 | 94 | /def ?> |
56 | 95 | |
57 | 96 | <?cs # appears at the bottom of every page ?><?cs |
@@ -47,34 +47,51 @@ def:custom_masthead() ?> | ||
47 | 47 | <div id="headerRight"> |
48 | 48 | <div id="headerLinks"> |
49 | 49 | <?cs if:template.showLanguageMenu ?> |
50 | - <img src="<?cs var:toroot ?>assets/images/icon_world.jpg" alt="" /> | |
51 | - <span id="language"> | |
50 | + <img src="<?cs var:toroot ?>assets/images/icon_world.jpg" alt="Language:" /> | |
51 | + <span id="language"> | |
52 | 52 | <select name="language" onChange="changeLangPref(this.value, true)"> |
53 | - <option value="en">English </option> | |
54 | - <option value="ja">日本語</option> | |
55 | - <?cs # | |
56 | - <option value="de">Deutsch</option> | |
57 | - <option value="es">Español</option> | |
58 | - <option value="fr">Français</option> | |
59 | - <option value="it">Italiano</option> | |
60 | - <option value="zh-CN">中文 (简体)</option> | |
61 | - <option value="zh-TW">中文 (繁體)</option> | |
62 | - ?> | |
53 | + <option value="en">English </option> | |
54 | + <option value="ja">日本語</option> | |
55 | + <?cs # | |
56 | + <option value="de">Deutsch</option> | |
57 | + <option value="es">Español</option> | |
58 | + <option value="fr">Français</option> | |
59 | + <option value="it">Italiano</option> | |
60 | + <option value="zh-CN">中文 (简体)</option> | |
61 | + <option value="zh-TW">中文 (繁體)</option> | |
62 | + ?> | |
63 | 63 | </select> |
64 | 64 | <script type="text/javascript"> |
65 | 65 | <!-- |
66 | 66 | loadLangPref(); |
67 | 67 | //--> |
68 | 68 | </script> |
69 | - </span> | |
69 | + </span> | |
70 | 70 | <?cs /if ?> |
71 | 71 | <a href="http://www.android.com">Android.com</a> |
72 | 72 | </div><?cs |
73 | - call:default_search_box() ?> | |
73 | + call:default_search_box() ?><?cs | |
74 | + if:reference ?> | |
75 | + <div id="api-level-toggle"> | |
76 | + <label for="apiLevelControl"><a href="<?cs var:toroot ?>guide/appendix/api-levels.html">Filter by API Level</a>: </label> | |
77 | + <select id="apiLevelControl"> | |
78 | + <!-- option elements added by buildApiLevelToggle() --> | |
79 | + </select> | |
80 | + </div> | |
81 | + <script> | |
82 | + var SINCE_DATA = [ <?cs | |
83 | + each:since = since ?>'<?cs | |
84 | + var:since.name ?>'<?cs | |
85 | + if:!last(since) ?>, <?cs /if ?><?cs | |
86 | + /each | |
87 | + ?> ]; | |
88 | + buildApiLevelToggle(); | |
89 | + </script><?cs | |
90 | + /if ?> | |
74 | 91 | </div><!-- headerRight --> |
75 | 92 | <script type="text/javascript"> |
76 | 93 | <!-- |
77 | - changeTabLang(getLangPref()); | |
94 | + changeTabLang(getLangPref()); | |
78 | 95 | //--> |
79 | 96 | </script> |
80 | 97 | </div><!-- header --><?cs |
@@ -58,8 +58,16 @@ | ||
58 | 58 | <?cs /if ?> |
59 | 59 | </a></li> |
60 | 60 | <li id="videos-link"><a href="<?cs var:toroot ?>videos/index.html" onClick="return loadLast('videos')"> |
61 | + <?cs if:!sdk.redirect ?> | |
61 | 62 | <span class="en">Videos</span> |
62 | - <span class="ja">ビデオ</span> | |
63 | + <span class="de"></span> | |
64 | + <span class="es"></span> | |
65 | + <span class="fr"></span> | |
66 | + <span class="it"></span> | |
67 | + <span class="ja">ビデオ</span> | |
68 | + <span class="zh-CN"></span> | |
69 | + <span class="zh-TW"></span> | |
70 | + <?cs /if ?> | |
63 | 71 | </a></li> |
64 | 72 | <li id="community-link"><a href="<?cs var:toroot ?>community/index.html"> |
65 | 73 | <?cs if:!sdk.redirect ?> |
@@ -5,8 +5,8 @@ | ||
5 | 5 | <head> |
6 | 6 | <title>Redirecting...</title> |
7 | 7 | <meta http-equiv="refresh" content="0;url=<?cs var:toroot ?>sdk/<?cs |
8 | - if:sdk.redirect.path ?><?cs var:sdk.redirect.path ?>"<?cs | |
9 | - else ?><?cs var:sdk.current ?>/index.html<?cs /if ?>" | |
8 | + if:sdk.redirect.path ?><?cs var:sdk.redirect.path ?><?cs | |
9 | + else ?><?cs var:sdk.current ?>/index.html<?cs /if ?>"> | |
10 | 10 | <link href="<?cs var:toroot ?>assets/android-developer-docs.css" rel="stylesheet" type="text/css" /> |
11 | 11 | </head> |
12 | 12 | <?cs else ?> |
@@ -24,8 +24,10 @@ | ||
24 | 24 | <div id="jd-content"> |
25 | 25 | <p>Redirecting to |
26 | 26 | <a href="<?cs var:toroot ?>sdk/<?cs |
27 | - if:sdk.redirect.path ?><?cs var:sdk.redirect.path ?>">/sdk/<?cs var:sdk.redirect.path ?><?cs | |
28 | - else ?><?cs var:sdk.current ?>/index.html">/sdk/<?cs var:sdk.current ?>/index.html<?cs /if ?> | |
27 | + if:sdk.redirect.path ?><?cs var:sdk.redirect.path ?><?cs | |
28 | + else ?><?cs var:sdk.current ?>/index.html<?cs /if ?>">sdk/<?cs | |
29 | + if:sdk.redirect.path ?><?cs var:sdk.redirect.path ?><?cs | |
30 | + else ?><?cs var:sdk.current ?>/index.html<?cs /if ?> | |
29 | 31 | </a> ...</p> |
30 | 32 | <?cs else ?> |
31 | 33 | <div class="g-unit" id="doc-content" > |
@@ -50,7 +52,7 @@ | ||
50 | 52 | </div> |
51 | 53 | <?cs /if ?> |
52 | 54 | |
53 | -<?cs if:android.whichdoc != "online" ?> | |
55 | +<?cs if:android.whichdoc != "online" && !android.preview ?> | |
54 | 56 | |
55 | 57 | <p>The sections below provide an overview of the SDK package. </p> |
56 | 58 |
@@ -101,7 +103,20 @@ computer. </p> | ||
101 | 103 | </tr> |
102 | 104 | </table> |
103 | 105 | |
104 | - <?cs else ?> | |
106 | + <?cs else ?><?cs if:android.whichdoc == "online" ?> | |
107 | + | |
108 | + <?cs if:sdk.preview ?> | |
109 | + <p>Welcome developers! The next release of the Android platform will be | |
110 | + Android 1.6 and we are pleased to announce the availability of an early look | |
111 | + SDK to give you a head-start on developing applications for it. </p> | |
112 | + | |
113 | + <p>The Android 1.6 platform includes a variety of improvements and new | |
114 | + features for users and developers. Additionally, the SDK itself introduces | |
115 | + several new capabilities that enable you to develop applications more | |
116 | + efficiently. See the <a href="features.html">Android 1.6 Highlights</a> | |
117 | + document for a list of highlights.</p> | |
118 | + <?cs /if ?> | |
119 | + | |
105 | 120 | <p>Before downloading, please read the <a href="requirements.html"> |
106 | 121 | System Requirements</a> document. As you start the download, you will also need to review and agree to |
107 | 122 | the Terms and Conditions that govern the use of the Android SDK. </p> |
@@ -137,9 +152,32 @@ the Terms and Conditions that govern the use of the Android SDK. </p> | ||
137 | 152 | <td><?cs var:sdk.linux_bytes ?> bytes</td> |
138 | 153 | <td><?cs var:sdk.linux_checksum ?></td> |
139 | 154 | </tr> |
155 | + <?cs if:adt.zip_download ?> | |
156 | + <tr class="alt-color"> | |
157 | + <td>ADT Plugin for Eclipse <?cs var:adt.zip_version ?></td> | |
158 | + <td> | |
159 | + <a href="<?cs var:toroot ?>sdk/download.html?v=<?cs var:adt.zip_download ?>"><?cs var:adt.zip_download ?></a> | |
160 | + </td> | |
161 | + <td><?cs var:adt.zip_bytes ?> bytes</td> | |
162 | + <td><?cs var:adt.zip_checksum ?></td> | |
163 | + </tr> | |
164 | + <?cs /if ?> | |
140 | 165 | </table> |
141 | 166 | |
142 | -<?cs /if ?> | |
167 | + <?cs /if ?> | |
168 | + <?cs /if ?> | |
169 | +<?cs /if ?> | |
170 | + | |
171 | +<?cs if:android.whichdoc != "online" && sdk.preview ?> | |
172 | + <p>Welcome developers! The next release of the Android platform will be | |
173 | + Android 1.6 and we are pleased to announce the availability of an early look SDK | |
174 | + to give you a head-start on developing applications for it. </p> | |
175 | + | |
176 | + <p>The Android 1.6 platform includes a variety of improvements and new features | |
177 | + for users and developers. Additionally, the SDK itself introduces several new | |
178 | + capabilities that enable you to develop applications more efficiently. | |
179 | + See the <a href="http://developer.android.com/sdk/preview/features.html"> | |
180 | + Android 1.6 Highlights</a> document for a list of highlights.</p> | |
143 | 181 | <?cs /if ?> |
144 | 182 | |
145 | 183 | <?cs call:tag_list(root.descr) ?> |
@@ -49,6 +49,8 @@ a:visited code { | ||
49 | 49 | |
50 | 50 | input, select, |
51 | 51 | textarea, option { |
52 | + font-family:inherit; | |
53 | + font-size:inherit; | |
52 | 54 | padding:0; |
53 | 55 | margin:0; |
54 | 56 | } |
@@ -131,13 +133,17 @@ dd pre, dd table, dd img { | ||
131 | 133 | } |
132 | 134 | |
133 | 135 | li ul, |
134 | -li ol { | |
135 | - margin:.5em 0 0 0; | |
136 | +li ol, | |
137 | +dd ul, | |
138 | +dd ol { | |
139 | + margin:0; | |
136 | 140 | padding: 0 0 0 2em; |
137 | 141 | } |
138 | 142 | |
139 | -dl li { | |
140 | - padding:.5em 0 0 0; | |
143 | +li li, | |
144 | +dd li { | |
145 | + margin:0; | |
146 | + padding:.5em 0 0; | |
141 | 147 | } |
142 | 148 | |
143 | 149 | dl dl, |
@@ -177,6 +183,8 @@ hr.blue { | ||
177 | 183 | |
178 | 184 | /* LAYOUT */ |
179 | 185 | #body-content { |
186 | + /* "Preliminary" watermark for preview releases and interim builds. | |
187 | + background:transparent url(images/preliminary.png) repeat scroll 0 0; */ | |
180 | 188 | margin:0; |
181 | 189 | position:relative; |
182 | 190 | width:100%; |
@@ -777,7 +785,7 @@ td.gsc-search-button { | ||
777 | 785 | } |
778 | 786 | |
779 | 787 | #carouselMain { |
780 | - background: url('/assets/images/home/bg_home_carousel_board.png') 0 0 no-repeat; | |
788 | + background: url(images/home/bg_home_carousel_board.png) 0 0 no-repeat; | |
781 | 789 | height:auto; |
782 | 790 | padding: 25px 21px 0; |
783 | 791 | overflow:hidden; |
@@ -800,7 +808,7 @@ td.gsc-search-button { | ||
800 | 808 | } |
801 | 809 | |
802 | 810 | #carouselWheel { |
803 | - background: url('/assets/images/home/bg_home_carousel_wheel.png') 0 0 no-repeat; | |
811 | + background: url(images/home/bg_home_carousel_wheel.png) 0 0 no-repeat; | |
804 | 812 | padding-top:40px; |
805 | 813 | height:150px; |
806 | 814 | } |
@@ -1154,12 +1162,12 @@ ul.videoPreviews p.full { | ||
1154 | 1162 | |
1155 | 1163 | ul.videoPreviews span.more { |
1156 | 1164 | padding:0 0 0 12px; |
1157 | - background:url('/assets/images/arrow_bluelink_down.png') 0 2px no-repeat; | |
1165 | + background:url(images/arrow_bluelink_down.png) 0 2px no-repeat; | |
1158 | 1166 | } |
1159 | 1167 | |
1160 | 1168 | ul.videoPreviews span.less { |
1161 | 1169 | padding:0 0 0 12px; |
1162 | - background:url('/assets/images/arrow_bluelink_up.png') 0 2px no-repeat; | |
1170 | + background:url(images/arrow_bluelink_up.png) 0 2px no-repeat; | |
1163 | 1171 | display:none; |
1164 | 1172 | } |
1165 | 1173 |
@@ -276,9 +276,9 @@ | ||
276 | 276 | |
277 | 277 | /* summary tables for reference pages */ |
278 | 278 | .jd-sumtable { |
279 | -margin: .5em 1em 1em 1em; | |
280 | -width:99%; | |
281 | -font-size:.9em; | |
279 | + margin: .5em 1em 1em 1em; | |
280 | + width:95%; /* consistent table widths; within IE's quirks */ | |
281 | + font-size:.9em; | |
282 | 282 | } |
283 | 283 | |
284 | 284 | .jd-sumtable a { |
@@ -330,8 +330,7 @@ font-size:.9em; | ||
330 | 330 | links to summary tables) */ |
331 | 331 | #api-info-block { |
332 | 332 | font-size:.8em; |
333 | - margin:0; | |
334 | - padding:6px; | |
333 | + padding:6px 10px; | |
335 | 334 | font-weight:normal; |
336 | 335 | float:right; |
337 | 336 | text-align:right; |
@@ -346,20 +345,56 @@ links to summary tables) */ | ||
346 | 345 | color:#999; |
347 | 346 | } |
348 | 347 | |
349 | -h4.jd-details-title .api-level, | |
350 | -div#jd-header .api-level { | |
351 | - font-size:12px; | |
348 | +div.api-level { | |
349 | + font-size:.8em; | |
352 | 350 | font-weight:normal; |
353 | 351 | color:#999; |
354 | - position:absolute; | |
355 | - top:5px; | |
356 | - right:5px; | |
352 | + float:right; | |
353 | + padding:0 7px 0; | |
354 | + margin-top:-25px; | |
357 | 355 | } |
358 | 356 | |
359 | -div#jd-header .api-level { | |
360 | - position:relative; | |
361 | - float:right; | |
362 | - margin-top:-1.7em; | |
357 | +#api-info-block div.api-level { | |
358 | + font-size:1.3em; | |
359 | + font-weight:bold; | |
360 | + float:none; | |
361 | + color:#444; | |
362 | + padding:0; | |
363 | + margin:0; | |
364 | +} | |
365 | + | |
366 | +/* Force link colors for IE6 */ | |
367 | +div.api-level a { | |
368 | + color:#999; | |
369 | +} | |
370 | +#api-info-block div.api-level a:link { | |
371 | + color:#444; | |
372 | +} | |
373 | +#api-level-toggle a { | |
374 | + color:#999; | |
375 | +} | |
376 | + | |
377 | +div#naMessage { | |
378 | + display:none; | |
379 | + width:555px; | |
380 | + height:0; | |
381 | + margin:0 auto; | |
382 | +} | |
383 | + | |
384 | +div#naMessage div { | |
385 | + width:450px; | |
386 | + position:fixed; | |
387 | + margin:50px 0; | |
388 | + padding:4em 4em 3em; | |
389 | + background:#FFF; | |
390 | + background:rgba(255,255,255,0.7); | |
391 | + border:1px solid #dddd00; | |
392 | +} | |
393 | +/* IE6 can't position fixed */ | |
394 | +* html div#naMessage div { position:absolute; } | |
395 | + | |
396 | +div#naMessage strong { | |
397 | + font-size:1.1em; | |
363 | 398 | } |
364 | 399 | |
365 | 400 | .absent, |
@@ -367,25 +402,53 @@ div#jd-header .api-level { | ||
367 | 402 | .absent a:visited, |
368 | 403 | .absent a:hover, |
369 | 404 | .absent * { |
370 | - color:#aaa !important; | |
371 | - background-color:#f6f6f6 !important; | |
405 | + color:#bbb !important; | |
372 | 406 | cursor:default !important; |
373 | 407 | text-decoration:none !important; |
374 | 408 | } |
375 | 409 | |
376 | -#side-nav li.absent, | |
377 | -#side-nav li.absent * { | |
378 | - background-color:#fff !important; | |
410 | +#api-level-toggle a, | |
411 | +.api-level a { | |
412 | + color:inherit; | |
413 | + text-decoration:none; | |
414 | +} | |
415 | + | |
416 | +#api-level-toggle a:hover, | |
417 | +.api-level a:hover { | |
418 | + color:inherit; | |
419 | + text-decoration:underline !important; | |
420 | + cursor:pointer !important; | |
379 | 421 | } |
380 | 422 | |
381 | 423 | #side-nav li.absent.selected, |
382 | -#side-nav li.absent.selected * { | |
383 | - background-color:#eee !important; | |
424 | +#side-nav li.absent.selected *, | |
425 | +#side-nav div.label.absent.selected, | |
426 | +#side-nav div.label.absent.selected * { | |
427 | + background-color:#eaeaea !important; | |
428 | +} | |
429 | +/* IE6 quirk (won't chain classes, so just keep background blue) */ | |
430 | +* html #side-nav li.selected, | |
431 | +* html #side-nav li.selected *, | |
432 | +* html #side-nav div.label.selected, | |
433 | +* html #side-nav div.label.selected * { | |
434 | + background-color: #435a6e !important; | |
384 | 435 | } |
385 | 436 | |
437 | + | |
438 | +.absent h4.jd-details-title, | |
439 | +.absent h4.jd-details-title * { | |
440 | + background-color:#f6f6f6 !important; | |
441 | +} | |
442 | + | |
443 | +.absent img { | |
444 | + opacity: .3; | |
445 | + filter: alpha(opacity=30); | |
446 | + -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=30)"; | |
447 | +} | |
448 | + | |
449 | + | |
386 | 450 | /* applies to a div containing links to summary tables */ |
387 | 451 | .sum-details-links { |
388 | - margin:0 .5em; | |
389 | 452 | padding:0; |
390 | 453 | font-weight:normal; |
391 | 454 | } |
@@ -554,8 +617,7 @@ h4.jd-details-title { | ||
554 | 617 | font-size:1.15em; |
555 | 618 | background-color: #E2E2E2; |
556 | 619 | margin:1.5em 0 .6em; |
557 | - padding:3px; | |
558 | - position:relative; /* so the api level can be absolute */ | |
620 | + padding:3px 95px 3px 3px; /* room for api-level */ | |
559 | 621 | } |
560 | 622 | |
561 | 623 | h4.jd-tagtitle { |
@@ -1122,21 +1184,16 @@ body .ui-resizable-autohide .ui-resizable-handle { display: none; } /* use 'body | ||
1122 | 1184 | padding:0; |
1123 | 1185 | } |
1124 | 1186 | |
1125 | - #headerLeft .guide { | |
1126 | - display:none; | |
1127 | - } | |
1128 | - | |
1129 | - #headerRight { | |
1187 | + #header-tabs, | |
1188 | + #headerRight, | |
1189 | + #side-nav, | |
1190 | + #api-info-block { | |
1130 | 1191 | display:none; |
1131 | 1192 | } |
1132 | 1193 | |
1133 | 1194 | #body-content { |
1134 | 1195 | position:inherit; |
1135 | 1196 | } |
1136 | - | |
1137 | - #side-nav { | |
1138 | - display:none; | |
1139 | - } | |
1140 | 1197 | |
1141 | 1198 | #doc-content { |
1142 | 1199 | margin-left:0 !important; |
@@ -31,16 +31,9 @@ if ((agent.indexOf("Mobile") != -1) || | ||
31 | 31 | addLoadEvent(mobileSetup); |
32 | 32 | } |
33 | 33 | |
34 | -/* loads the lists.js file to the page. | |
35 | -Loading this in the head was slowing page load time */ | |
36 | -addLoadEvent( function() { | |
37 | - var lists = document.createElement("script"); | |
38 | - lists.setAttribute("type","text/javascript"); | |
39 | - lists.setAttribute("src", toRoot+"reference/lists.js"); | |
40 | - $("head").append($(lists)); | |
41 | -} ); | |
42 | - | |
34 | +addLoadEvent(function() { | |
43 | 35 | window.onresize = resizeAll; |
36 | +}); | |
44 | 37 | |
45 | 38 | function mobileSetup() { |
46 | 39 | $("body").css({'overflow':'auto'}); |
@@ -51,6 +44,15 @@ function mobileSetup() { | ||
51 | 44 | $("#nav-tree").css({'overflow-y': 'auto'}); |
52 | 45 | } |
53 | 46 | |
47 | +/* loads the lists.js file to the page. | |
48 | +Loading this in the head was slowing page load time */ | |
49 | +addLoadEvent( function() { | |
50 | + var lists = document.createElement("script"); | |
51 | + lists.setAttribute("type","text/javascript"); | |
52 | + lists.setAttribute("src", toRoot+"reference/lists.js"); | |
53 | + $("head").append($(lists)); | |
54 | +} ); | |
55 | + | |
54 | 56 | function setToRoot(root) { |
55 | 57 | toRoot = root; |
56 | 58 | // note: toRoot also used by carousel.js |
@@ -1,5 +1,69 @@ | ||
1 | 1 | |
2 | -function new_node(me, mom, text, link, children_data) | |
2 | +/* API LEVEL TOGGLE */ | |
3 | +addLoadEvent(changeApiLevel); | |
4 | +var API_LEVEL_COOKIE = "api_level"; | |
5 | +var minLevel = 1; | |
6 | + | |
7 | +function buildApiLevelToggle() { | |
8 | + var maxLevel = SINCE_DATA.length; | |
9 | + var userApiLevel = readCookie(API_LEVEL_COOKIE); | |
10 | + | |
11 | + if (userApiLevel != 0) { | |
12 | + selectedLevel = userApiLevel; | |
13 | + } else { | |
14 | + selectedLevel = maxLevel; | |
15 | + } | |
16 | + | |
17 | + minLevel = $("body").attr("class"); | |
18 | + var select = $("#apiLevelControl").html("").change(changeApiLevel); | |
19 | + for (var i = maxLevel-1; i >= 0; i--) { | |
20 | + var option = $("<option />").attr("value",""+SINCE_DATA[i]).append(""+SINCE_DATA[i]); | |
21 | +// if (SINCE_DATA[i] < minLevel) option.addClass("absent"); // always false for strings (codenames) | |
22 | + select.append(option); | |
23 | + } | |
24 | + | |
25 | + // get the DOM element and use setAttribute cuz IE6 fails when using jquery .attr('selected',true) | |
26 | + var selectedLevelItem = $("#apiLevelControl option[value='"+selectedLevel+"']").get(0); | |
27 | + selectedLevelItem.setAttribute('selected',true); | |
28 | +} | |
29 | + | |
30 | +function changeApiLevel() { | |
31 | + var selectedLevel = $("#apiLevelControl option:selected").val(); | |
32 | + toggleVisisbleApis(selectedLevel, "body"); | |
33 | + | |
34 | + var date = new Date(); | |
35 | + date.setTime(date.getTime()+(50*365*24*60*60*1000)); // keep this for 50 years | |
36 | + writeCookie(API_LEVEL_COOKIE, selectedLevel, null, date); | |
37 | + | |
38 | + if (selectedLevel < minLevel) { | |
39 | + var thing = ($("#jd-header").html().indexOf("package") != -1) ? "package" : "class"; | |
40 | + $("#naMessage").show().html("<div><p><strong>This " + thing + " is not available with API Level " + selectedLevel + ".</strong></p>" | |
41 | + + "<p>To use this " + thing + ", your application must specify API Level " + minLevel + " or higher in its manifest " | |
42 | + + "and be compiled against a version of the Android library that supports an equal or higher API Level. To reveal this " | |
43 | + + "document, change the value of the API Level filter above.</p>" | |
44 | + + "<p><a href='" +toRoot+ "guide/appendix/api-levels.html'>What is the API Level?</a></p></div>"); | |
45 | + } else { | |
46 | + $("#naMessage").hide(); | |
47 | + } | |
48 | +} | |
49 | + | |
50 | +function toggleVisisbleApis(selectedLevel, context) { | |
51 | + var apis = $(".api",context); | |
52 | + apis.each(function(i) { | |
53 | + var obj = $(this); | |
54 | + var className = obj.attr("class"); | |
55 | + var apiLevelIndex = className.lastIndexOf("-")+1; | |
56 | + var apiLevelEndIndex = className.indexOf(" ", apiLevelIndex); | |
57 | + apiLevelEndIndex = apiLevelEndIndex != -1 ? apiLevelEndIndex : className.length; | |
58 | + var apiLevel = className.substring(apiLevelIndex, apiLevelEndIndex); | |
59 | + if (apiLevel > selectedLevel) obj.addClass("absent").attr("title","Requires API Level "+apiLevel+" or higher"); | |
60 | + else obj.removeClass("absent").removeAttr("title"); | |
61 | + }); | |
62 | +} | |
63 | + | |
64 | +/* NAVTREE */ | |
65 | + | |
66 | +function new_node(me, mom, text, link, children_data, api_level) | |
3 | 67 | { |
4 | 68 | var node = new Object(); |
5 | 69 | node.children = Array(); |
@@ -10,9 +74,13 @@ function new_node(me, mom, text, link, children_data) | ||
10 | 74 | mom.get_children_ul().appendChild(node.li); |
11 | 75 | |
12 | 76 | node.label_div = document.createElement("div"); |
77 | + node.label_div.className = "label"; | |
78 | + if (api_level != null) { | |
79 | + $(node.label_div).addClass("api"); | |
80 | + $(node.label_div).addClass("api-level-"+api_level); | |
81 | + } | |
13 | 82 | node.li.appendChild(node.label_div); |
14 | 83 | node.label_div.style.paddingLeft = 10*node.depth + "px"; |
15 | - node.label_div.className = "label"; | |
16 | 84 | |
17 | 85 | if (children_data == null) { |
18 | 86 | // 12 is the width of the triangle and padding extra space |
@@ -81,10 +149,15 @@ function expand_node(me, node) | ||
81 | 149 | $(node.get_children_ul()).slideDown("fast"); |
82 | 150 | } else { |
83 | 151 | get_node(me, node); |
152 | + if ($(node.label_div).hasClass("absent")) $(node.get_children_ul()).addClass("absent"); | |
84 | 153 | $(node.get_children_ul()).slideDown("fast"); |
85 | 154 | } |
86 | 155 | node.plus_img.src = me.toroot + "assets/images/triangle-opened-small.png"; |
87 | 156 | node.expanded = true; |
157 | + | |
158 | + // perform api level toggling because new nodes are new to the DOM | |
159 | + var selectedLevel = $("#apiLevelControl option:selected").val(); | |
160 | + toggleVisisbleApis(selectedLevel, "#side-nav"); | |
88 | 161 | } |
89 | 162 | } |
90 | 163 |
@@ -94,7 +167,7 @@ function get_node(me, mom) | ||
94 | 167 | for (var i in mom.children_data) { |
95 | 168 | var node_data = mom.children_data[i]; |
96 | 169 | mom.children[i] = new_node(me, mom, node_data[0], node_data[1], |
97 | - node_data[2]); | |
170 | + node_data[2], node_data[3]); | |
98 | 171 | } |
99 | 172 | } |
100 | 173 |
@@ -104,8 +177,7 @@ function this_page_relative(toroot) | ||
104 | 177 | var file = ""; |
105 | 178 | if (toroot.substr(0, 1) == "/") { |
106 | 179 | if (full.substr(0, toroot.length) == toroot) { |
107 | - var basePath = getBaseUri(full); | |
108 | - return basePath.substring(toroot.length); | |
180 | + return full.substr(toroot.length); | |
109 | 181 | } else { |
110 | 182 | // the file isn't under toroot. Fail. |
111 | 183 | return null; |
@@ -150,15 +222,18 @@ function load_navtree_data(toroot) { | ||
150 | 222 | navtreeData.setAttribute("type","text/javascript"); |
151 | 223 | navtreeData.setAttribute("src", toroot+"navtree_data.js"); |
152 | 224 | $("head").append($(navtreeData)); |
153 | -} | |
225 | +} | |
154 | 226 | |
155 | 227 | function init_default_navtree(toroot) { |
156 | - load_navtree_data(toroot); | |
157 | 228 | init_navtree("nav-tree", toroot, NAVTREE_DATA); |
229 | + | |
230 | + // perform api level toggling because because the whole tree is new to the DOM | |
231 | + var selectedLevel = $("#apiLevelControl option:selected").val(); | |
232 | + toggleVisisbleApis(selectedLevel, "#side-nav"); | |
158 | 233 | } |
159 | 234 | |
160 | 235 | function init_navtree(navtree_id, toroot, root_nodes) |
161 | -{ | |
236 | +{ | |
162 | 237 | var me = new Object(); |
163 | 238 | me.toroot = toroot; |
164 | 239 | me.node = new Object(); |
@@ -189,4 +264,3 @@ function init_navtree(navtree_id, toroot, root_nodes) | ||
189 | 264 | }); |
190 | 265 | } |
191 | 266 | } |
192 | - |
@@ -2,7 +2,7 @@ | ||
2 | 2 | <?cs include:"macros.cs" ?> |
3 | 3 | <html> |
4 | 4 | <?cs include:"head_tag.cs" ?> |
5 | -<body> | |
5 | +<body class="<?cs var:class.since ?>"> | |
6 | 6 | <script type="text/javascript"> |
7 | 7 | function toggleInherited(linkObj, expand) { |
8 | 8 | var base = linkObj.getAttribute("id"); |
@@ -26,7 +26,6 @@ function toggleInherited(linkObj, expand) { | ||
26 | 26 | return false; |
27 | 27 | } |
28 | 28 | </script> |
29 | - | |
30 | 29 | <?cs include:"header.cs" ?> |
31 | 30 | |
32 | 31 | <div class="g-unit" id="doc-content"> |
@@ -106,7 +105,9 @@ Summary: | ||
106 | 105 | | <a href="#" onclick="return toggleAllSummaryInherited(this)">[Expand All]</a> |
107 | 106 | <?cs /if ?> |
108 | 107 | </div><!-- end sum-details-links --> |
109 | - | |
108 | +<div class="api-level"> | |
109 | + <?cs call:since_tags(class) ?> | |
110 | +</div> | |
110 | 111 | </div><!-- end api-info-block --> |
111 | 112 | |
112 | 113 | <?cs # this next line must be exactly like this to be parsed by eclipse ?> |
@@ -134,12 +135,11 @@ Summary: | ||
134 | 135 | <?cs set:colspan = colspan-1 ?> |
135 | 136 | <?cs /each ?> |
136 | 137 | |
137 | -<div class="api-level"><?cs call:since_tags(class) ?></div> | |
138 | - | |
139 | 138 | </div><!-- end header --> |
140 | 139 | |
140 | +<div id="naMessage"></div> | |
141 | 141 | |
142 | -<div id="jd-content" class="apilevel-<?cs var:class.since ?>"> | |
142 | +<div id="jd-content" class="api apilevel-<?cs var:class.since ?>"> | |
143 | 143 | <table class="jd-inheritance-table"> |
144 | 144 | <?cs set:colspan = subcount(class.inheritance) ?> |
145 | 145 | <?cs each:supr = class.inheritance ?> |
@@ -215,7 +215,7 @@ Summary: | ||
215 | 215 | <?cs def:write_field_summary(fields) ?> |
216 | 216 | <?cs set:count = #1 ?> |
217 | 217 | <?cs each:field=fields ?> |
218 | - <tr <?cs if:count % #2 ?>class="alt-color"<?cs /if ?> > | |
218 | + <tr class="<?cs if:count % #2 ?>alt-color<?cs /if ?> api apilevel-<?cs var:field.since ?>" > | |
219 | 219 | <td class="jd-typecol"><nobr> |
220 | 220 | <?cs var:field.scope ?> |
221 | 221 | <?cs var:field.static ?> |
@@ -231,7 +231,7 @@ Summary: | ||
231 | 231 | <?cs def:write_constant_summary(fields) ?> |
232 | 232 | <?cs set:count = #1 ?> |
233 | 233 | <?cs each:field=fields ?> |
234 | - <tr <?cs if:count % #2 ?>class="alt-color"<?cs /if ?> > | |
234 | + <tr class="<?cs if:count % #2 ?>alt-color<?cs /if ?> api apilevel-<?cs var:field.since ?>" > | |
235 | 235 | <td class="jd-typecol"><?cs call:type_link(field.type) ?></td> |
236 | 236 | <td class="jd-linkcol"><a href="<?cs var:toroot ?><?cs var:field.href ?>"><?cs var:field.name ?></a></td> |
237 | 237 | <td class="jd-descrcol" width="100%"><?cs call:short_descr(field) ?></td> |
@@ -248,7 +248,7 @@ Summary: | ||
248 | 248 | <td><nobr><em>Description</em></nobr></td> |
249 | 249 | </tr> |
250 | 250 | <?cs each:attr=attrs ?> |
251 | - <tr <?cs if:count % #2 ?>class="alt-color"<?cs /if ?> > | |
251 | + <tr class="<?cs if:count % #2 ?>alt-color<?cs /if ?> api apilevel-<?cs var:attr.since ?>" > | |
252 | 252 | <td class="jd-linkcol"><a href="<?cs var:toroot ?><?cs var:attr.href ?>"><?cs var:attr.name ?></a></td> |
253 | 253 | <td class="jd-linkcol"><?cs each:m=attr.methods ?> |
254 | 254 | <a href="<?cs var:toroot ?><?cs var:m.href ?>"><?cs var:m.name ?></a> |
@@ -263,13 +263,13 @@ Summary: | ||
263 | 263 | <?cs def:write_inners_summary(classes) ?> |
264 | 264 | <?cs set:count = #1 ?> |
265 | 265 | <?cs each:cl=class.inners ?> |
266 | - <tr <?cs if:count % #2 ?>class="alt-color"<?cs /if ?> > | |
266 | + <tr class="<?cs if:count % #2 ?>alt-color<?cs /if ?> api apilevel-<?cs var:cl.since ?>" > | |
267 | 267 | <td class="jd-typecol"><nobr> |
268 | - <?cs var:class.scope ?> | |
269 | - <?cs var:class.static ?> | |
270 | - <?cs var:class.final ?> | |
271 | - <?cs var:class.abstract ?> | |
272 | - <?cs var:class.kind ?></nobr></td> | |
268 | + <?cs var:cl.scope ?> | |
269 | + <?cs var:cl.static ?> | |
270 | + <?cs var:cl.final ?> | |
271 | + <?cs var:cl.abstract ?> | |
272 | + <?cs var:cl.kind ?></nobr></td> | |
273 | 273 | <td class="jd-linkcol"><?cs call:type_link(cl.type) ?></td> |
274 | 274 | <td class="jd-descrcol" width="100%"><?cs call:short_descr(cl) ?> </td> |
275 | 275 | </tr> |
@@ -305,7 +305,8 @@ Summary: | ||
305 | 305 | <div style="clear:left;">Inherited XML Attributes</div></th></tr> |
306 | 306 | <?cs each:cl=class.inherited ?> |
307 | 307 | <?cs if:subcount(cl.attrs) ?> |
308 | -<tr><td colspan="12"> | |
308 | +<tr class="api apilevel-<?cs var:cl.since ?>" > | |
309 | +<td colspan="12"> | |
309 | 310 | <?cs call:expando_trigger("inherited-attrs-"+cl.qualified, "closed") ?>From <?cs var:cl.kind ?> |
310 | 311 | <a href="<?cs var:toroot ?><?cs var:cl.link ?>"><?cs var:cl.qualified ?></a> |
311 | 312 | <div id="inherited-attrs-<?cs var:cl.qualified ?>"> |
@@ -329,7 +330,7 @@ Summary: | ||
329 | 330 | <table id="enumconstants" class="jd-sumtable"><tr><th colspan="12">Enum Values</th></tr> |
330 | 331 | <?cs set:count = #1 ?> |
331 | 332 | <?cs each:field=class.enumConstants ?> |
332 | - <tr <?cs if:count % #2 ?>class="alt-color"<?cs /if ?> > | |
333 | + <tr class="<?cs if:count % #2 ?>alt-color<?cs /if ?> api apilevel-<?cs var:field.since ?>" > | |
333 | 334 | <td class="jd-descrcol"><?cs call:type_link(field.type) ?> </td> |
334 | 335 | <td class="jd-linkcol"><a href="<?cs var:toroot ?><?cs var:field.href ?>"><?cs var:field.name ?></a> </td> |
335 | 336 | <td class="jd-descrcol" width="100%"><?cs call:short_descr(field) ?> </td> |
@@ -355,7 +356,8 @@ Summary: | ||
355 | 356 | <div style="clear:left;">Inherited Constants</div></th></tr> |
356 | 357 | <?cs each:cl=class.inherited ?> |
357 | 358 | <?cs if:subcount(cl.constants) ?> |
358 | -<tr><td colspan="12"> | |
359 | +<tr class="api apilevel-<?cs var:cl.since ?>" > | |
360 | +<td colspan="12"> | |
359 | 361 | <?cs call:expando_trigger("inherited-constants-"+cl.qualified, "closed") ?>From <?cs var:cl.kind ?> |
360 | 362 | <a href="<?cs var:toroot ?><?cs var:cl.link ?>"><?cs var:cl.qualified ?></a> |
361 | 363 | <div id="inherited-constants-<?cs var:cl.qualified ?>"> |
@@ -390,7 +392,8 @@ Summary: | ||
390 | 392 | <div style="clear:left;">Inherited Fields</div></th></tr> |
391 | 393 | <?cs each:cl=class.inherited ?> |
392 | 394 | <?cs if:subcount(cl.fields) ?> |
393 | -<tr><td colspan="12"> | |
395 | +<tr class="api apilevel-<?cs var:cl.since ?>" > | |
396 | +<td colspan="12"> | |
394 | 397 | <?cs call:expando_trigger("inherited-fields-"+cl.qualified, "closed") ?>From <?cs var:cl.kind ?> |
395 | 398 | <a href="<?cs var:toroot ?><?cs var:cl.link ?>"><?cs var:cl.qualified ?></a> |
396 | 399 | <div id="inherited-fields-<?cs var:cl.qualified ?>"> |
@@ -449,7 +452,8 @@ Summary: | ||
449 | 452 | <div style="clear:left;">Inherited Methods</div></th></tr> |
450 | 453 | <?cs each:cl=class.inherited ?> |
451 | 454 | <?cs if:subcount(cl.methods) ?> |
452 | -<tr><td colspan="12"><?cs call:expando_trigger("inherited-methods-"+cl.qualified, "closed") ?> | |
455 | +<tr class="api apilevel-<?cs var:cl.since ?>" > | |
456 | +<td colspan="12"><?cs call:expando_trigger("inherited-methods-"+cl.qualified, "closed") ?> | |
453 | 457 | From <?cs var:cl.kind ?> <a href="<?cs var:toroot ?><?cs var:cl.link ?>"><?cs var:cl.qualified ?></a> |
454 | 458 | <div id="inherited-methods-<?cs var:cl.qualified ?>"> |
455 | 459 | <div id="inherited-methods-<?cs var:cl.qualified ?>-list" |
@@ -485,11 +489,12 @@ From <?cs var:cl.kind ?> <a href="<?cs var:toroot ?><?cs var:cl.link ?>"><?cs va | ||
485 | 489 | <?cs call:type_link(field.type) ?> |
486 | 490 | </span> |
487 | 491 | <?cs var:field.name ?> |
488 | - <span class="api-level"> | |
489 | - <?cs call:since_tags(field) ?> | |
490 | - </span> | |
491 | 492 | </h4> |
492 | - <div class="jd-details-descr"><?cs call:description(field) ?> | |
493 | + <div class="api-level"> | |
494 | + <?cs call:since_tags(field) ?> | |
495 | + </div> | |
496 | + <div class="jd-details-descr"> | |
497 | + <?cs call:description(field) ?> | |
493 | 498 | <?cs if:subcount(field.constantValue) ?> |
494 | 499 | <div class="jd-tagdata"> |
495 | 500 | <span class="jd-tagtitle">Constant Value: </span> |
@@ -525,11 +530,13 @@ From <?cs var:cl.kind ?> <a href="<?cs var:toroot ?><?cs var:cl.link ?>"><?cs va | ||
525 | 530 | </span> |
526 | 531 | <span class="sympad"><?cs var:method.name ?></span> |
527 | 532 | <span class="normal">(<?cs call:parameter_list(method.params) ?>)</span> |
528 | - <span class="api-level"> | |
529 | - <?cs call:since_tags(method) ?> | |
530 | - </span> | |
531 | 533 | </h4> |
532 | - <div class="jd-details-descr"><?cs call:description(method) ?></div> | |
534 | + <div class="api-level"> | |
535 | + <?cs call:since_tags(method) ?> | |
536 | + </div> | |
537 | + <div class="jd-details-descr"> | |
538 | + <?cs call:description(method) ?> | |
539 | + </div> | |
533 | 540 | </div> |
534 | 541 | <?cs /each ?> |
535 | 542 | <?cs /def ?> |
@@ -541,10 +548,10 @@ From <?cs var:cl.kind ?> <a href="<?cs var:toroot ?><?cs var:cl.link ?>"><?cs va | ||
541 | 548 | <?cs # The apilevel-N class MUST BE LAST in the sequence of class names ?> |
542 | 549 | <div class="jd-details api apilevel-<?cs var:attr.since ?>"> |
543 | 550 | <h4 class="jd-details-title"><?cs var:attr.name ?> |
544 | - <span class="api-level"> | |
545 | - <?cs call:since_tags(attr) ?> | |
546 | - </span> | |
547 | 551 | </h4> |
552 | + <div class="api-level"> | |
553 | + <?cs call:since_tags(attr) ?> | |
554 | + </div> | |
548 | 555 | <div class="jd-details-descr"> |
549 | 556 | <?cs call:description(attr) ?> |
550 | 557 |
@@ -22,7 +22,7 @@ | ||
22 | 22 | <table class="jd-sumtable"> |
23 | 23 | <?cs set:cur_row = #0 ?> |
24 | 24 | <?cs each:cl = letter ?> |
25 | - <tr <?cs if:count % #2 ?>class="alt-color"<?cs /if ?> > | |
25 | + <tr class="<?cs if:count % #2 ?>alt-color<?cs /if ?> api apilevel-<?cs var:cl.since ?>" > | |
26 | 26 | <td class="jd-linkcol"><?cs call:type_link(cl.type) ?></td> |
27 | 27 | <td class="jd-descrcol" width="100%"><?cs call:short_descr(cl) ?> </td> |
28 | 28 | </tr> |
@@ -17,7 +17,8 @@ else ?> | ||
17 | 17 | setToRoot("<?cs var:toroot ?>"); |
18 | 18 | </script><?cs |
19 | 19 | if:reference ?> |
20 | -<script src="<?cs var:toroot ?>assets/navtree.js" type="text/javascript"></script><?cs | |
20 | +<script src="<?cs var:toroot ?>assets/android-developer-reference.js" type="text/javascript"></script> | |
21 | +<script src="<?cs var:toroot ?>navtree_data.js" type="text/javascript"></script><?cs | |
21 | 22 | /if ?> |
22 | 23 | <noscript> |
23 | 24 | <style type="text/css"> |
@@ -117,7 +117,7 @@ def:see_also_tags(also) ?><?cs | ||
117 | 117 | |
118 | 118 | <?cs # print the API Level ?><?cs |
119 | 119 | def:since_tags(obj) ?> |
120 | - Since: API Level <?cs var:obj.since ?> | |
120 | + Since: <a href="<?cs var:toroot ?>guide/appendix/api-levels.html#level<?cs var:obj.since ?>">API Level <?cs var:obj.since ?></a> | |
121 | 121 | <?cs /def ?> |
122 | 122 | |
123 | 123 | <?cs # Print the long-form description for something. |
@@ -203,7 +203,7 @@ def:list(label, classes) ?><?cs | ||
203 | 203 | <li><h2><?cs var:label ?></h2> |
204 | 204 | <ul><?cs |
205 | 205 | each:cl=classes ?> |
206 | - <li class="<?cs if:class.name == cl.label?>selected<?cs /if ?> api apilevel-<?cs var:cl.since ?>"><?cs call:type_link(cl) ?></li><?cs | |
206 | + <li class="<?cs if:class.name == cl.label?>selected <?cs /if ?>api apilevel-<?cs var:cl.since ?>"><?cs call:type_link(cl) ?></li><?cs | |
207 | 207 | /each ?> |
208 | 208 | </ul> |
209 | 209 | </li><?cs |
@@ -213,7 +213,7 @@ def:list(label, classes) ?><?cs | ||
213 | 213 | <?cs # A list of links to packages, for use in the side navigation of packages (panel nav) ?><?cs |
214 | 214 | def:package_link_list(packages) ?><?cs |
215 | 215 | each:pkg=packages ?> |
216 | - <li class="<?cs if:(class.package.name == pkg.name) || (package.name == pkg.name)?>selected<?cs /if ?> api apilevel-<?cs var:pkg.since ?>"><?cs call:package_link(pkg) ?></li><?cs | |
216 | + <li class="<?cs if:(class.package.name == pkg.name) || (package.name == pkg.name)?>selected <?cs /if ?>api apilevel-<?cs var:pkg.since ?>"><?cs call:package_link(pkg) ?></li><?cs | |
217 | 217 | /each ?><?cs |
218 | 218 | /def ?> |
219 | 219 |
@@ -2,26 +2,31 @@ | ||
2 | 2 | <?cs include:"macros.cs" ?> |
3 | 3 | <html> |
4 | 4 | <?cs include:"head_tag.cs" ?> |
5 | +<body class="<?cs var:package.since ?>"> | |
5 | 6 | <?cs include:"header.cs" ?> |
6 | 7 | |
7 | 8 | <div class="g-unit" id="doc-content"> |
8 | 9 | |
10 | +<div id="api-info-block"> | |
11 | +<div class="api-level"> | |
12 | + <?cs call:since_tags(package) ?> | |
13 | +</div> | |
14 | +</div> | |
15 | + | |
9 | 16 | <div id="jd-header"> |
10 | - <strong> | |
11 | - <div class="jd-page_title-prefix">package</div> | |
12 | - </strong> | |
17 | + package | |
13 | 18 | <h1><?cs var:package.name ?></b></h1> |
14 | 19 | <div class="jd-nav"> |
15 | - <a class="jd-navlink" href="package-summary.html">Classes</a> | | |
16 | - Description | |
20 | + <a class="jd-navlink" href="package-summary.html">Classes</a> | Description | |
17 | 21 | </div> |
18 | 22 | </div><!-- end header --> |
19 | 23 | |
20 | -<div id="jd-content"> | |
24 | +<div id="naMessage"></div> | |
25 | + | |
26 | +<div id="jd-content" class="api apilevel-<?cs var:package.since ?>"> | |
21 | 27 | <div class="jd-descr"> |
22 | 28 | <p><?cs call:tag_list(package.descr) ?></p> |
23 | 29 | </div> |
24 | -<?cs call:since_tags(package) ?> | |
25 | 30 | |
26 | 31 | <?cs include:"footer.cs" ?> |
27 | 32 | </div><!-- end jd-content --> |
@@ -2,25 +2,30 @@ | ||
2 | 2 | <?cs include:"macros.cs" ?> |
3 | 3 | <html> |
4 | 4 | <?cs include:"head_tag.cs" ?> |
5 | +<body class="<?cs var:package.since ?>"> | |
5 | 6 | <?cs include:"header.cs" ?> |
6 | 7 | |
7 | 8 | <div class="g-unit" id="doc-content"> |
8 | 9 | |
10 | +<div id="api-info-block"> | |
11 | +<div class="api-level"> | |
12 | + <?cs call:since_tags(package) ?> | |
13 | +</div> | |
14 | +</div> | |
15 | + | |
9 | 16 | <div id="jd-header"> |
10 | 17 | package |
11 | 18 | <h1><?cs var:package.name ?></h1> |
12 | 19 | <div class="jd-nav"> |
13 | 20 | <?cs if:subcount(package.shortDescr) ?> |
14 | - Classes | | |
15 | - <a class="jd-navlink" href="package-descr.html">Description</a> | |
21 | + Classes | <a class="jd-navlink" href="package-descr.html">Description</a> | |
16 | 22 | <?cs /if ?> |
17 | 23 | </div> |
18 | - <span class="api-level"> | |
19 | - <?cs call:since_tags(package) ?> | |
20 | - </span> | |
21 | -</div> | |
24 | +</div><!-- end header --> | |
25 | + | |
26 | +<div id="naMessage"></div> | |
22 | 27 | |
23 | -<div id="jd-content"> | |
28 | +<div id="jd-content" class="api apilevel-<?cs var:package.since ?>"> | |
24 | 29 | |
25 | 30 | <?cs if:subcount(package.shortDescr) ?> |
26 | 31 | <div class="jd-descr"> |
@@ -20,7 +20,7 @@ | ||
20 | 20 | <?cs set:count = #1 ?> |
21 | 21 | <table class="jd-sumtable"> |
22 | 22 | <?cs each:pkg = docs.packages ?> |
23 | - <tr <?cs if:count % #2 ?>class="alt-color"<?cs /if ?> > | |
23 | + <tr class="<?cs if:count % #2 ?>alt-color<?cs /if ?> api apilevel-<?cs var:pkg.since ?>" > | |
24 | 24 | <td class="jd-linkcol"><?cs call:package_link(pkg) ?></td> |
25 | 25 | <td class="jd-descrcol" width="100%"><?cs call:tag_list(pkg.shortDescr) ?> </td> |
26 | 26 | </tr> |
@@ -180,6 +180,7 @@ class AmendGenerator(object): | ||
180 | 180 | |
181 | 181 | def MakeSymlinks(self, symlink_list): |
182 | 182 | """Create symlinks, given a list of (dest, link) pairs.""" |
183 | + self.DeleteFiles([i[1] for i in symlink_list]) | |
183 | 184 | self.script.extend(["symlink %s %s" % (i[0], self._FileRoot(i[1])) |
184 | 185 | for i in sorted(symlink_list)]) |
185 | 186 |
@@ -46,18 +46,20 @@ def Run(args, **kwargs): | ||
46 | 46 | return subprocess.Popen(args, **kwargs) |
47 | 47 | |
48 | 48 | |
49 | -def LoadBoardConfig(fn): | |
50 | - """Parse a board_config.mk file looking for lines that specify the | |
51 | - maximum size of various images, and parse them into the | |
52 | - OPTIONS.max_image_size dict.""" | |
49 | +def LoadMaxSizes(): | |
50 | + """Load the maximum allowable images sizes from the input | |
51 | + target_files size.""" | |
53 | 52 | OPTIONS.max_image_size = {} |
54 | - for line in open(fn): | |
55 | - line = line.strip() | |
56 | - m = re.match(r"BOARD_(BOOT|RECOVERY|SYSTEM|USERDATA)IMAGE_MAX_SIZE" | |
57 | - r"\s*:=\s*(\d+)", line) | |
58 | - if not m: continue | |
59 | - | |
60 | - OPTIONS.max_image_size[m.group(1).lower() + ".img"] = int(m.group(2)) | |
53 | + try: | |
54 | + for line in open(os.path.join(OPTIONS.input_tmp, "META", "imagesizes.txt")): | |
55 | + pieces = line.split() | |
56 | + if len(pieces) != 2: continue | |
57 | + image = pieces[0] | |
58 | + size = int(pieces[1]) | |
59 | + OPTIONS.max_image_size[image + ".img"] = size | |
60 | + except IOError, e: | |
61 | + if e.errno == errno.ENOENT: | |
62 | + pass | |
61 | 63 | |
62 | 64 | |
63 | 65 | def BuildAndAddBootableImage(sourcedir, targetname, output_zip): |
@@ -142,7 +144,7 @@ def UnzipTemp(filename): | ||
142 | 144 | |
143 | 145 | tmp = tempfile.mkdtemp(prefix="targetfiles-") |
144 | 146 | OPTIONS.tempfiles.append(tmp) |
145 | - p = Run(["unzip", "-q", filename, "-d", tmp], stdout=subprocess.PIPE) | |
147 | + p = Run(["unzip", "-o", "-q", filename, "-d", tmp], stdout=subprocess.PIPE) | |
146 | 148 | p.communicate() |
147 | 149 | if p.returncode != 0: |
148 | 150 | raise ExternalError("failed to unzip input target-files \"%s\"" % |
@@ -21,8 +21,7 @@ use with 'fastboot update'. | ||
21 | 21 | Usage: img_from_target_files [flags] input_target_files output_image_zip |
22 | 22 | |
23 | 23 | -b (--board_config) <file> |
24 | - Specifies a BoardConfig.mk file containing image max sizes | |
25 | - against which the generated image files are checked. | |
24 | + Deprecated. | |
26 | 25 | |
27 | 26 | """ |
28 | 27 |
@@ -109,10 +108,10 @@ def main(argv): | ||
109 | 108 | |
110 | 109 | def option_handler(o, a): |
111 | 110 | if o in ("-b", "--board_config"): |
112 | - common.LoadBoardConfig(a) | |
113 | - return True | |
111 | + pass # deprecated | |
114 | 112 | else: |
115 | 113 | return False |
114 | + return True | |
116 | 115 | |
117 | 116 | args = common.ParseOptions(argv, __doc__, |
118 | 117 | extra_opts="b:", |
@@ -123,15 +122,15 @@ def main(argv): | ||
123 | 122 | common.Usage(__doc__) |
124 | 123 | sys.exit(1) |
125 | 124 | |
125 | + OPTIONS.input_tmp = common.UnzipTemp(args[0]) | |
126 | + | |
127 | + common.LoadMaxSizes() | |
126 | 128 | if not OPTIONS.max_image_size: |
127 | 129 | |
128 | - print " WARNING: No board config specified; will not check image" | |
129 | - print " sizes against limits. Use -b to make sure the generated" | |
130 | - print " images don't exceed partition sizes." | |
130 | + print " WARNING: Failed to load max image sizes; will not enforce" | |
131 | + print " image size limits." | |
131 | 132 | |
132 | 133 | |
133 | - OPTIONS.input_tmp = common.UnzipTemp(args[0]) | |
134 | - | |
135 | 134 | output_zip = zipfile.ZipFile(args[1], "w", compression=zipfile.ZIP_DEFLATED) |
136 | 135 | |
137 | 136 | common.AddBoot(output_zip) |
@@ -22,8 +22,7 @@ a full OTA is produced. | ||
22 | 22 | Usage: ota_from_target_files [flags] input_target_files output_ota_package |
23 | 23 | |
24 | 24 | -b (--board_config) <file> |
25 | - Specifies a BoardConfig.mk file containing image max sizes | |
26 | - against which the generated image files are checked. | |
25 | + Deprecated. | |
27 | 26 | |
28 | 27 | -k (--package_key) <key> |
29 | 28 | Key to use to sign the package (default is |
@@ -619,7 +618,8 @@ def WriteIncrementalOTAPackage(target_zip, source_zip, output_zip): | ||
619 | 618 | script.Print("Removing unneeded files...") |
620 | 619 | script.DeleteFiles(["/"+i[0] for i in verbatim_targets] + |
621 | 620 | ["/"+i for i in sorted(source_data) |
622 | - if i not in target_data]) | |
621 | + if i not in target_data] + | |
622 | + ["/system/recovery.img"]) | |
623 | 623 | |
624 | 624 | if updating_boot: |
625 | 625 | # Produce the boot image by applying a patch to the current |
@@ -736,7 +736,7 @@ def main(argv): | ||
736 | 736 | |
737 | 737 | def option_handler(o, a): |
738 | 738 | if o in ("-b", "--board_config"): |
739 | - common.LoadBoardConfig(a) | |
739 | + pass # deprecated | |
740 | 740 | elif o in ("-k", "--package_key"): |
741 | 741 | OPTIONS.package_key = a |
742 | 742 | elif o in ("-i", "--incremental_from"): |
@@ -768,13 +768,6 @@ def main(argv): | ||
768 | 768 | common.Usage(__doc__) |
769 | 769 | sys.exit(1) |
770 | 770 | |
771 | - if not OPTIONS.max_image_size: | |
772 | ||
773 | - print " WARNING: No board config specified; will not check image" | |
774 | - print " sizes against limits. Use -b to make sure the generated" | |
775 | - print " images don't exceed partition sizes." | |
776 | ||
777 | - | |
778 | 771 | if OPTIONS.script_mode not in ("amend", "edify", "auto"): |
779 | 772 | raise ValueError('unknown script mode "%s"' % (OPTIONS.script_mode,)) |
780 | 773 |
@@ -783,6 +776,14 @@ def main(argv): | ||
783 | 776 | |
784 | 777 | print "unzipping target target-files..." |
785 | 778 | OPTIONS.input_tmp = common.UnzipTemp(args[0]) |
779 | + | |
780 | + common.LoadMaxSizes() | |
781 | + if not OPTIONS.max_image_size: | |
782 | ||
783 | + print " WARNING: Failed to load max image sizes; will not enforce" | |
784 | + print " image size limits." | |
785 | ||
786 | + | |
786 | 787 | OPTIONS.target_tmp = OPTIONS.input_tmp |
787 | 788 | input_zip = zipfile.ZipFile(args[0], "r") |
788 | 789 | if OPTIONS.package_key: |
@@ -272,8 +272,13 @@ def ReplaceOtaKeys(input_tf_zip, output_tf_zip): | ||
272 | 272 | k = m.group(1) |
273 | 273 | mapped_keys.append(OPTIONS.key_map.get(k, k) + ".x509.pem") |
274 | 274 | |
275 | - print "using:\n ", "\n ".join(mapped_keys) | |
276 | - print "for OTA package verification" | |
275 | + if mapped_keys: | |
276 | + print "using:\n ", "\n ".join(mapped_keys) | |
277 | + print "for OTA package verification" | |
278 | + else: | |
279 | + mapped_keys.append( | |
280 | + OPTIONS.key_map["build/target/product/security/testkey"] + ".x509.pem") | |
281 | + print "META/otakeys.txt has no keys; using", mapped_keys[0] | |
277 | 282 | |
278 | 283 | # recovery uses a version of the key that has been slightly |
279 | 284 | # predigested (by DumpPublicKey.java) and put in res/keys. |