diff --git a/proprietary/bootable/bootloader/lk/Android.mk b/proprietary/bootable/bootloader/lk/Android.mk deleted file mode 100755 index c1388fd5ae61561f152ae3fce77691568d2aeb02..0000000000000000000000000000000000000000 --- a/proprietary/bootable/bootloader/lk/Android.mk +++ /dev/null @@ -1,62 +0,0 @@ -LOCAL_PATH := $(call my-dir) -LK_ROOT_DIR := $(PWD) -HOST_OS ?= $(shell uname | tr '[A-Z]' '[a-z]') -export HOST_OS LCM_WIDTH LCM_HEIGHT - -ifdef LK_PROJECT - LK_DIR := $(LOCAL_PATH) - INSTALLED_LK_TARGET := $(PRODUCT_OUT)/lk.bin - INSTALLED_LOGO_TARGET := $(PRODUCT_OUT)/logo.bin - - ifeq ($(wildcard $(TARGET_PREBUILT_LK)),) - TARGET_LK_OUT ?= $(if $(filter /% ~%,$(TARGET_OUT_INTERMEDIATES)),,$(LK_ROOT_DIR)/)$(TARGET_OUT_INTERMEDIATES)/BOOTLOADER_OBJ - BUILT_LK_TARGET := $(TARGET_LK_OUT)/build-$(LK_PROJECT)/lk.bin - ifeq ($(LK_CROSS_COMPILE),) - ifeq ($(TARGET_ARCH), arm) -# LK_CROSS_COMPILE := $(LK_ROOT_DIR)/$(TARGET_TOOLS_PREFIX) - else ifeq ($(TARGET_2ND_ARCH), arm) -# LK_CROSS_COMPILE := $(LK_ROOT_DIR)/$($(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_TOOLS_PREFIX) - endif - endif - LK_MAKE_OPTION := $(if $(SHOW_COMMANDS),NOECHO=) $(if $(LK_CROSS_COMPILE),TOOLCHAIN_PREFIX=$(LK_CROSS_COMPILE)) BOOTLOADER_OUT=$(TARGET_LK_OUT) ROOTDIR=$(LK_ROOT_DIR) - -$(BUILT_LK_TARGET): FORCE - $(hide) mkdir -p $(dir $@) - $(MAKE) -C $(LK_DIR) $(LK_MAKE_OPTION) $(LK_PROJECT) - -$(TARGET_PREBUILT_LK): $(BUILT_LK_TARGET) - $(hide) mkdir -p $(dir $@) - $(hide) cp -f $(BUILT_LK_TARGET) $@ - $(hide) cp -f $(dir $(BUILT_LK_TARGET))logo.bin $(dir $@)logo.bin - - else - BUILT_LK_TARGET := $(TARGET_PREBUILT_LK) - endif#TARGET_PREBUILT_LK - -$(INSTALLED_LK_TARGET): $(BUILT_LK_TARGET) - $(hide) mkdir -p $(dir $@) - $(hide) cp -f $(BUILT_LK_TARGET) $(INSTALLED_LK_TARGET) - -$(INSTALLED_LOGO_TARGET): $(BUILT_LK_TARGET) - $(hide) mkdir -p $(dir $@) - $(hide) cp -f $(dir $(BUILT_LK_TARGET))logo.bin $(INSTALLED_LOGO_TARGET) - -.PHONY: lk save-lk clean-lk -droidcore: $(INSTALLED_LK_TARGET) $(INSTALLED_LOGO_TARGET) -lk: $(INSTALLED_LK_TARGET) $(INSTALLED_LOGO_TARGET) -save-lk: $(TARGET_PREBUILT_LK) - -clean-lk: - $(hide) rm -rf $(INSTALLED_LK_TARGET) $(INSTALLED_LOGO_TARGET) $(TARGET_LK_OUT) - -droid: check-lk-config -check-mtk-config: check-lk-config -check-lk-config: -ifneq (yes,$(strip $(DISABLE_MTK_CONFIG_CHECK))) - python device/mediatek/build/build/tools/check_kernel_config.py -c $(MTK_TARGET_PROJECT_FOLDER)/ProjectConfig.mk -l $(LK_DIR)/project/$(LK_PROJECT).mk -p $(MTK_PROJECT_NAME) -else - -python device/mediatek/build/build/tools/check_kernel_config.py -c $(MTK_TARGET_PROJECT_FOLDER)/ProjectConfig.mk -l $(LK_DIR)/project/$(LK_PROJECT).mk -p $(MTK_PROJECT_NAME) -endif - - -endif#LK_PROJECT diff --git a/proprietary/bootable/bootloader/lk/platform/mt6757/atags.c b/proprietary/bootable/bootloader/lk/platform/mt6757/atags.c index 089ac2d936b7461aeb2390e055822d578e48fee6..c6561a32a4ae7033420c3646fdce64dcb1e42a3c 100755 --- a/proprietary/bootable/bootloader/lk/platform/mt6757/atags.c +++ b/proprietary/bootable/bootloader/lk/platform/mt6757/atags.c @@ -548,14 +548,14 @@ int target_fdt_model(void *fdt) const struct fdt_property *prop; char *prop_name = "model"; const char *mali_model_name[] = { - "MT8163", - "MT8163", - "MT8163", + "MT6757", + "MT6757", + "MT6757", }; const char *sph_model_name[] = { - "MT8163S", - "MT8163S", - "MT8163S", + "MT6757S", + "MT6757S", + "MT6757S", }; if (code > code_max) diff --git a/proprietary/bootable/bootloader/lk/platform/mt6757/include/platform/msdc.h b/proprietary/bootable/bootloader/lk/platform/mt6757/include/platform/msdc.h index fa12c08ab8944a8f1c14ca4f7f9f0b5138988c0b..90a2ffcb56365201d13391ce190b0fc9b7c0e5bb 100755 --- a/proprietary/bootable/bootloader/lk/platform/mt6757/include/platform/msdc.h +++ b/proprietary/bootable/bootloader/lk/platform/mt6757/include/platform/msdc.h @@ -835,7 +835,7 @@ /* - * This definition is used for MT8163_GPIO_RegMap.doc by fengguo.gao + * This definition is used for MT6757_GPIO_RegMap.doc by fengguo.gao * Zhanyong.Wang * 2014/11/28 */ @@ -1517,7 +1517,7 @@ typedef enum __MSDC_PIN_STATE { }MSDC_PIN_STATE; /* - * this definition is used for MT8163_GPIO_RegMap.doc by Sander.Lin + * this definition is used for MT6757_GPIO_RegMap.doc by Sander.Lin * Zhanyong.Wang * 2014/12/14 */ diff --git a/proprietary/bootable/bootloader/lk/platform/mt6757/mmc_core.c b/proprietary/bootable/bootloader/lk/platform/mt6757/mmc_core.c index 6bc6dfc54f19c7f2b20598162b094e056857fefe..4ed02303ec6e3eb7bae10a8512b5974dc94a443c 100755 --- a/proprietary/bootable/bootloader/lk/platform/mt6757/mmc_core.c +++ b/proprietary/bootable/bootloader/lk/platform/mt6757/mmc_core.c @@ -3550,10 +3550,10 @@ u32 mmc_is_exist(u32 id) #define EFUSE_M_HW2_RES0 0x000061C0 #define EFUSE_EMMC_MSDC3_DIS (1ul << 7) #define EFUSE_EMMC_MSDC0_DIS (1ul << 6) -#define MT8163_IO_READ32(addr, index) (*(volatile unsigned int*)((addr) + (index))) +#define MT6757_IO_READ32(addr, index) (*(volatile unsigned int*)((addr) + (index))) -#define EFUSE_EMMC_MSDC3_IsDisabled() (!!(MT8163_IO_READ32(EFUSE_BASE,EFUSE_M_HW2_RES0) & EFUSE_EMMC_MSDC3_DIS)) -#define EFUSE_EMMC_MSDC0_IsDisabled() (!!(MT8163_IO_READ32(EFUSE_BASE,EFUSE_M_HW2_RES0) & EFUSE_EMMC_MSDC0_DIS)) +#define EFUSE_EMMC_MSDC3_IsDisabled() (!!(MT6757_IO_READ32(EFUSE_BASE,EFUSE_M_HW2_RES0) & EFUSE_EMMC_MSDC3_DIS)) +#define EFUSE_EMMC_MSDC0_IsDisabled() (!!(MT6757_IO_READ32(EFUSE_BASE,EFUSE_M_HW2_RES0) & EFUSE_EMMC_MSDC0_DIS)) #endif u32 mmc_whoami(void) { diff --git a/proprietary/bootable/bootloader/preloader/Android.mk b/proprietary/bootable/bootloader/preloader/Android.mk deleted file mode 100755 index 3bce156e791cf704582f83021654b2c15b38cd2f..0000000000000000000000000000000000000000 --- a/proprietary/bootable/bootloader/preloader/Android.mk +++ /dev/null @@ -1,72 +0,0 @@ -LOCAL_PATH := $(call my-dir) -PRELOADER_ROOT_DIR := $(PWD) - -ifdef PRELOADER_TARGET_PRODUCT - PRELOADER_DIR := $(LOCAL_PATH) - PRELOADER_OUT ?= $(if $(filter /% ~%,$(TARGET_OUT_INTERMEDIATES)),,$(PRELOADER_ROOT_DIR)/)$(TARGET_OUT_INTERMEDIATES)/PRELOADER_OBJ - ifdef PL_MODE - INSTALLED_PRELOADER_TARGET := $(PRODUCT_OUT)/preloader_$(PRELOADER_TARGET_PRODUCT).bin - BUILT_PRELOADER_TARGET := $(PRELOADER_OUT)/bin/preloader_$(PRELOADER_TARGET_PRODUCT)_$(PL_MODE).bin - else - INSTALLED_PRELOADER_TARGET := $(PRODUCT_OUT)/preloader_$(PRELOADER_TARGET_PRODUCT).bin - BUILT_PRELOADER_TARGET := $(PRELOADER_OUT)/bin/preloader_$(PRELOADER_TARGET_PRODUCT).bin - endif - ifeq ($(LK_CROSS_COMPILE),) - ifeq ($(TARGET_ARCH), arm) -# PRELOADER_CROSS_COMPILE := $(PRELOADER_ROOT_DIR)/$(TARGET_TOOLS_PREFIX) - else ifeq ($(TARGET_2ND_ARCH), arm) -# PRELOADER_CROSS_COMPILE := $(PRELOADER_ROOT_DIR)/$($(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_TOOLS_PREFIX) - endif - endif - -ifneq (MT8127,$(strip $(MTK_PLATFORM))) - PRELOADER_CROSS_COMPILE := $(CURDIR)/prebuilts/gcc/$(HOST_OS)-x86/arm/arm-linux-androideabi-4.8/bin/arm-linux-androideabi- -else - PRELOADER_CROSS_COMPILE := $(CURDIR)/prebuilts/gcc/$(HOST_OS)-x86/arm/arm-eabi-4.8/bin/arm-eabi- -endif - PRELOADER_MAKE_OPTION := $(if $(SHOW_COMMANDS),,-s) -f Makefile $(if $(PRELOADER_CROSS_COMPILE),CROSS_COMPILE=$(PRELOADER_CROSS_COMPILE)) PRELOADER_OUT=$(PRELOADER_OUT) MTK_PROJECT=$(PRELOADER_TARGET_PRODUCT) TOOL_PATH=$(PRELOADER_ROOT_DIR)/device/mediatek/build/build/tools ROOTDIR=$(PRELOADER_ROOT_DIR) - - ifeq ($(wildcard $(TARGET_PREBUILT_PRELOADER)),) -$(BUILT_PRELOADER_TARGET): FORCE - $(hide) mkdir -p $(dir $@) - $(MAKE) -C $(PRELOADER_DIR) $(PRELOADER_MAKE_OPTION) - -$(TARGET_PREBUILT_PRELOADER): $(BUILT_PRELOADER_TARGET) | $(ACP) - $(copy-file-to-target) - - else - BUILT_PRELOADER_TARGET := $(TARGET_PREBUILT_PRELOADER) - endif#TARGET_PREBUILT_PRELOADER - - ifneq ($(INSTALLED_PRELOADER_TARGET),$(BUILT_PRELOADER_TARGET)) -$(INSTALLED_PRELOADER_TARGET): $(BUILT_PRELOADER_TARGET) | $(ACP) - $(copy-file-to-target) - - endif - -.PHONY: preloader pl save-preloader %-preloader clean-preloader check-mtk-config check-pl-config - -TARGET_PRELOADER := $(PRODUCT_OUT)/preloader.img -$(TARGET_PRELOADER): $(INSTALLED_PRELOADER_TARGET) $(PRELOADER_DIR)/tools/gen-preloader-img.py - $(hide) $(PRELOADER_DIR)/tools/gen-preloader-img.py $< $@ - -droidcore: preloader -preloader pl: check-pl-config $(INSTALLED_PRELOADER_TARGET) $(TARGET_PRELOADER) -save-preloader: $(TARGET_PREBUILT_PRELOADER) - -%-preloader: - $(MAKE) -C $(PRELOADER_DIR) $(PRELOADER_MAKE_OPTION) $(patsubst %-preloader,%,$@) - -clean-preloader: - $(hide) rm -rf $(INSTALLED_PRELOADER_TARGET) $(TARGET_PRELOADER) $(PRELOADER_OUT) - -check-mtk-config: check-pl-config -check-pl-config: -ifneq (yes,$(strip $(DISABLE_MTK_CONFIG_CHECK))) - python device/mediatek/build/build/tools/check_kernel_config.py -c $(MTK_TARGET_PROJECT_FOLDER)/ProjectConfig.mk -b $(PRELOADER_DIR)/custom/$(PRELOADER_TARGET_PRODUCT)/$(PRELOADER_TARGET_PRODUCT).mk -p $(MTK_PROJECT_NAME) -else - -python device/mediatek/build/build/tools/check_kernel_config.py -c $(MTK_TARGET_PROJECT_FOLDER)/ProjectConfig.mk -b $(PRELOADER_DIR)/custom/$(PRELOADER_TARGET_PRODUCT)/$(PRELOADER_TARGET_PRODUCT).mk -p $(MTK_PROJECT_NAME) -endif - - -endif#PRELOADER_TARGET_PRODUCT diff --git a/proprietary/bootable/bootloader/preloader/platform/mt6757/src/drivers/dramc_dle_cal.c b/proprietary/bootable/bootloader/preloader/platform/mt6757/src/drivers/dramc_dle_cal.c index ead469d977f0ba24a560d2e0106ce39ea0ec493b..636b8496a86ee185de812f86bb8cc3261003562a 100755 --- a/proprietary/bootable/bootloader/preloader/platform/mt6757/src/drivers/dramc_dle_cal.c +++ b/proprietary/bootable/bootloader/preloader/platform/mt6757/src/drivers/dramc_dle_cal.c @@ -161,7 +161,7 @@ void dle_factor_handler(char **factor_value, char mode) { curr_val = atoi(*factor_value); //dbg_print("dle_factor_handler, curr_val:0x%x\n", curr_val); - #if 1 //MT8163 + #if 1 //MT6757 DRAMC_WRITE_REG((DRAMC_READ_REG(DRAMC_DATLATCTL) & 0xFFE0E0FF) | ((curr_val & 0x1F) << 16) | (((curr_val & 0x1F) - 0x4) << 8), //Notice: Need ensure curr_val( from dle_tbl) >= 4 !!! diff --git a/proprietary/bootable/bootloader/preloader/platform/mt6757/src/drivers/emi.c b/proprietary/bootable/bootloader/preloader/platform/mt6757/src/drivers/emi.c index 49da7b6fefaf893b7826b11b6403138f840d6652..3cb483c36d05067cca1890062cef74503ccda2b9 100755 --- a/proprietary/bootable/bootloader/preloader/platform/mt6757/src/drivers/emi.c +++ b/proprietary/bootable/bootloader/preloader/platform/mt6757/src/drivers/emi.c @@ -48,9 +48,9 @@ //#define print #define dbg_print //print -#define MT8163_BRINGUP_TMP (1) +#define MT6757_BRINGUP_TMP (1) -#if MT8163_BRINGUP_TMP +#if MT6757_BRINGUP_TMP #define GATING_CLOCK_CONTROL_DVT //for DVT test //#define TEST_ASYMMETRY_MODE #endif @@ -577,7 +577,7 @@ static void init_lpddr2(EMI_SETTINGS *emi_setting) #endif #endif - // For MT8163 LPDDR2 + // For MT6757 LPDDR2 *((V_UINT32P)(DRAMC0_BASE + 0x00f0)) = 0xC0000000; // Edward: [31]DQ4BMUX=1 in SBS. [30]S2=1, Edward : 100b for LPDDR2/3, 110b for DDR3x16x2 *((V_UINT32P)(DDRPHY_BASE + 0x00f0)) = 0xC0000000; @@ -604,7 +604,7 @@ static void init_lpddr2(EMI_SETTINGS *emi_setting) *((V_UINT32P)(DRAMC0_BASE + 0x0168)) = 0x00000080; *((V_UINT32P)(DDRPHY_BASE + 0x0168)) = 0x00000080; - //For MT8163 LPDDR2 + //For MT6757 LPDDR2 *((V_UINT32P)(DRAMC0_BASE + 0x00d8)) = 0x00700900; *((V_UINT32P)(DDRPHY_BASE + 0x00d8)) = 0x00700900; @@ -630,7 +630,7 @@ static void init_lpddr2(EMI_SETTINGS *emi_setting) //*((V_UINT32P)(DRAMC0_BASE + 0x0158)) = 0xf0f0f0f0; // Edward: 4 bit swap enable 0xf0f0f0f0. disable 0xff00ff00. //*((V_UINT32P)(DDRPHY_BASE + 0x0158)) = 0xf0f0f0f0; - //For MT8163 LPDDR2 + //For MT6757 LPDDR2 *((V_UINT32P)(DRAMC0_BASE + 0x0230)) = 0xf00f0ff0; *((V_UINT32P)(DDRPHY_BASE + 0x0230)) = 0xf00f0ff0; @@ -1015,7 +1015,7 @@ static void init_lpddr3(EMI_SETTINGS *emi_setting) *((V_UINT32P)(DRAMC0_BASE + 0x0048)) = 0x0001110d; *((V_UINT32P)(DDRPHY_BASE + 0x0048)) = 0x0001110d; - // Todo: For MT8163 LPDDR3 POP + // Todo: For MT6757 LPDDR3 POP if((emi_setting->LPDDR3_MODE_REG_5 & 0xFFF00000) == 0x17800000) { *((V_UINT32P)(DRAMC0_BASE + 0x00d8)) = 0x40500900; @@ -1061,7 +1061,7 @@ static void init_lpddr3(EMI_SETTINGS *emi_setting) //*((V_UINT32P)(DRAMC0_BASE + 0x00f0)) = 0x00000000; // Edward: DQ4BMUX=1 for SBS. [30]S2=1, Edward : 100b for LPDDR2/3, 110b for DDR3x16x2 //*((V_UINT32P)(DDRPHY_BASE + 0x00f0)) = 0x00000000; - // Todo: For MT8163 LPDDR3 DSC + // Todo: For MT6757 LPDDR3 DSC if((emi_setting->LPDDR3_MODE_REG_5 & 0xFFF00000) == 0x17800000) { *((V_UINT32P)(DRAMC0_BASE + 0x00f0)) = 0x40000000; @@ -1094,7 +1094,7 @@ static void init_lpddr3(EMI_SETTINGS *emi_setting) *((V_UINT32P)(DRAMC0_BASE + 0x0168)) = 0x00000080; *((V_UINT32P)(DDRPHY_BASE + 0x0168)) = 0x00000080; - // Todo: For MT8163 LPDDR3 POP + // Todo: For MT6757 LPDDR3 POP if((emi_setting->LPDDR3_MODE_REG_5 & 0xFFF00000) == 0x17800000) { *((V_UINT32P)(DRAMC0_BASE + 0x00d8)) = 0x40700900; @@ -1150,7 +1150,7 @@ static void init_lpddr3(EMI_SETTINGS *emi_setting) *((V_UINT32P)(DRAMC0_BASE + 0x01e8)) = emi_setting->DRAMC_ACTIM1_VAL; //LPDDR3EN set to 1 *((V_UINT32P)(DDRPHY_BASE + 0x01e8)) = emi_setting->DRAMC_ACTIM1_VAL; //LPDDR3EN set to 1 - // Todo: Current for MT8163 LPDDR3 POP + // Todo: Current for MT6757 LPDDR3 POP if((emi_setting->LPDDR3_MODE_REG_5 & 0xFFF00000) == 0x17800000) { *((V_UINT32P)(DRAMC0_BASE + 0x0230)) = 0xffff0000; @@ -1621,7 +1621,7 @@ static void init_ddr3(EMI_SETTINGS *emi_setting) } #endif - // Todo: For MT8163 PCDDR3 + // Todo: For MT6757 PCDDR3 if(emi_setting->PCDDR3_MODE_REG5 & (0x1<<30)) {//DDR3 8bit x4 *(volatile unsigned int *)(DRAMC0_BASE + 0x00F0) = 0xC0000000; @@ -1707,7 +1707,7 @@ static void init_ddr3(EMI_SETTINGS *emi_setting) *(volatile unsigned int *)(DDRPHY_BASE + 0x00D8) = 0x00300900; } #endif - // Todo: For MT8163 PCDDR3 + // Todo: For MT6757 PCDDR3 *(volatile unsigned int *)(DRAMC0_BASE + 0x00D8) = 0x80300900; *(volatile unsigned int *)(DDRPHY_BASE + 0x00D8) = 0x80300900; @@ -1743,7 +1743,7 @@ static void init_ddr3(EMI_SETTINGS *emi_setting) *(volatile unsigned int *)(DDRPHY_BASE + 0x0230) = 0xffff0000; } #endif - // Todo: For MT8163 PCDDR3 + // Todo: For MT6757 PCDDR3 if(emi_setting->PCDDR3_MODE_REG5 & (0x1<<30)) {//DDR3 8bit x4 *(volatile unsigned int *)(DRAMC0_BASE + 0x0230) = 0xf00f0ff0; @@ -1861,7 +1861,7 @@ static void init_ddr3(EMI_SETTINGS *emi_setting) } else { - //dual rank mode, MT8163 2GB setting + //dual rank mode, MT6757 2GB setting *((volatile unsigned int *)(DRAMC0_BASE + 0x0110)) = 0x0b051211; *((volatile unsigned int *)(DDRPHY_BASE + 0x0110)) = 0x0b051211; } @@ -1994,7 +1994,7 @@ static void init_ddr3(EMI_SETTINGS *emi_setting) *((volatile unsigned int *)(DRAMC0_BASE + 0x00E4)) = 0x000007a3; //CKEBYCTL *((volatile unsigned int *)(DDRPHY_BASE + 0x00E4)) = 0x000007a3; - if(emi_setting->PCDDR3_MODE_REG5 & (0x1<<28)) // MT8163 DDR3 2GB + if(emi_setting->PCDDR3_MODE_REG5 & (0x1<<28)) // MT6757 DDR3 2GB {//DDR3 8bit x4 *((volatile unsigned int *)(DRAMC0_BASE + 0x01ec)) = 0x00000001; // Edward : Add this to enable dual scheduler according to Cl and SY. *((volatile unsigned int *)(DDRPHY_BASE + 0x01ec)) = 0x00000001; @@ -2210,7 +2210,7 @@ static int emmc_nand_id_len=16; static int fw_id_len; static int mt_get_mdl_number (void) { -#if MT8163_BRINGUP_TMP //For bringup temorarily +#if MT6757_BRINGUP_TMP //For bringup temorarily return 0; #else static int found = 0; @@ -3167,7 +3167,7 @@ void mt_set_emi (void) *((volatile unsigned int *)(DRAMC0_BASE + 0x00B8)) = 0xFF00CC00; /* [15:8] DQ0~15 driving */ *((volatile unsigned int *)(DDRPHY_BASE + 0x00B8)) = 0xFF00CC00; } - #else // MT8163 2GB setting, disable driving. + #else // MT6757 2GB setting, disable driving. { //*((volatile unsigned int *)(DRAMC0_BASE + 0x00B4)) = 0xFF00CC00; /* [15:8] DQ16~31 driving */ //*((volatile unsigned int *)(DDRPHY_BASE + 0x00B4)) = 0xFF00CC00; diff --git a/proprietary/bootable/bootloader/preloader/platform/mt6757/src/drivers/inc/dramc_register.h b/proprietary/bootable/bootloader/preloader/platform/mt6757/src/drivers/inc/dramc_register.h index 172fdcd3bd1eb1b1b7d75c7aa6baec23bb045156..17feaa6efdda7f88f66bcd9d8c03a678a82b13e9 100755 --- a/proprietary/bootable/bootloader/preloader/platform/mt6757/src/drivers/inc/dramc_register.h +++ b/proprietary/bootable/bootloader/preloader/platform/mt6757/src/drivers/inc/dramc_register.h @@ -255,7 +255,7 @@ #define LPDDR3_TEST2_4_048 0x2301110D #define LPDDR3_MISCTL0_VAL_0fc 0x17000000 -#else //default MT8163 EVB +#else //default MT6757 EVB #define LPDDR3_EMI_CONA 0x0002A052 #define LPDDR3_ACTIM_000 0x66CB4619 diff --git a/proprietary/bootable/bootloader/preloader/platform/mt6757/src/drivers/inc/msdc.h b/proprietary/bootable/bootloader/preloader/platform/mt6757/src/drivers/inc/msdc.h index 9b9d8d0e3c9ca81c63a50f516a44ce9f6f6b4de9..9fa7e5f1caa54834221bf49ef4a3bfbcb96286a5 100755 --- a/proprietary/bootable/bootloader/preloader/platform/mt6757/src/drivers/inc/msdc.h +++ b/proprietary/bootable/bootloader/preloader/platform/mt6757/src/drivers/inc/msdc.h @@ -835,7 +835,7 @@ /* - * This definition is used for MT8163_GPIO_RegMap.doc by fengguo.gao + * This definition is used for MT6757_GPIO_RegMap.doc by fengguo.gao * Zhanyong.Wang * 2014/11/28 */ @@ -1517,7 +1517,7 @@ typedef enum __MSDC_PIN_STATE { }MSDC_PIN_STATE; /* - * this definition is used for MT8163_GPIO_RegMap.doc by Sander.Lin + * this definition is used for MT6757_GPIO_RegMap.doc by Sander.Lin * Zhanyong.Wang * 2014/12/14 */ diff --git a/proprietary/bootable/bootloader/preloader/platform/mt6757/src/drivers/inc/mt6757.h b/proprietary/bootable/bootloader/preloader/platform/mt6757/src/drivers/inc/mt6757.h index f51e2617431ad1f97eba85a61020b4e4cfc09800..3427c49476db85eb55838985e18197448f888556 100755 --- a/proprietary/bootable/bootloader/preloader/platform/mt6757/src/drivers/inc/mt6757.h +++ b/proprietary/bootable/bootloader/preloader/platform/mt6757/src/drivers/inc/mt6757.h @@ -33,8 +33,8 @@ * applicable license agreements with MediaTek Inc. */ -#ifndef MT8163_H -#define MT8163_H +#ifndef MT6757_H +#define MT6757_H /*=======================================================================*/ /* Constant Definitions */ @@ -50,7 +50,7 @@ /*=======================================================================*/ /* FIXME, these registers are defined for mt6589, not sure the corresponding register in mt6582*/ #define TOPCKGEN_BASE (IO_PHYS + 0x0000) -#define CONFIG_BASE (IO_PHYS + 0x1000) /* FIXME do not list in MT8163 memory map*/ +#define CONFIG_BASE (IO_PHYS + 0x1000) /* FIXME do not list in MT6757 memory map*/ #define INFRACFG_AO_BASE (IO_PHYS + 0x1000) #define IOCFG_L_BASE (IO_PHYS + 0x2000) #define IOCFG_B_BASE (IO_PHYS + 0x2400) @@ -68,11 +68,11 @@ #define DDRPHY_BASE (IO_PHYS + 0xF000) #define KPD_BASE (IO_PHYS + 0x00010000) -//#define DEM_BASE (IO_PHYS + 0x0011A000) /* FIXME do not list in MT8163 memory map*/ +//#define DEM_BASE (IO_PHYS + 0x0011A000) /* FIXME do not list in MT6757 memory map*/ #define MCUSYS_CFGREG_BASE (IO_PHYS + 0x00200000) -#define CA7MCUCFG_BASE (IO_PHYS + 0x00200100) /* FIXME do not list in MT8163 memory map*/ -#define CA15L_CONFIG_BASE (IO_PHYS + 0x00200200) /* FIXME do not list in MT8163 memory map*/ +#define CA7MCUCFG_BASE (IO_PHYS + 0x00200100) /* FIXME do not list in MT6757 memory map*/ +#define CA15L_CONFIG_BASE (IO_PHYS + 0x00200200) /* FIXME do not list in MT6757 memory map*/ #define SRAMROM_BASE (IO_PHYS + 0x00202000) #define EMI_BASE (IO_PHYS + 0x00203000) #define DRAMC_NAO_BASE (IO_PHYS + 0x0020E000) @@ -94,8 +94,8 @@ #define SPI_BASE (IO_PHYS + 0x0100A000) #define NFI_BASE (IO_PHYS + 0x0100D000) #define NFIECC_BASE (IO_PHYS + 0x0100E000) -//#define I2C3_BASE (IO_PHYS + 0x01010000) /* FIXME do not list in MT8163 memory map*/ -//#define I2C4_BASE (IO_PHYS + 0x01011000) /* FIXME do not list in MT8163 memory map*/ +//#define I2C3_BASE (IO_PHYS + 0x01010000) /* FIXME do not list in MT6757 memory map*/ +//#define I2C4_BASE (IO_PHYS + 0x01011000) /* FIXME do not list in MT6757 memory map*/ #define USBSIF_BASE (IO_PHYS + 0x01210000) #define MSDC0_BASE (IO_PHYS + 0x01230000) #define MSDC1_BASE (IO_PHYS + 0x01240000) @@ -103,8 +103,8 @@ #define MSDC3_BASE (IO_PHYS + 0x01260000) //#define U3D_BASE (IO_PHYS + 0x01270000) #define USB_BASE (IO_PHYS + 0x01200000) -//#define USB_SIF_BASE (IO_PHYS + 0x01280000) /* FIXME do not list in MT8163 memory map*/ -//#define USB_SIF2_BASE (IO_PHYS + 0x01290000) /* FIXME do not list in MT8163 memory map*/ +//#define USB_SIF_BASE (IO_PHYS + 0x01280000) /* FIXME do not list in MT6757 memory map*/ +//#define USB_SIF2_BASE (IO_PHYS + 0x01290000) /* FIXME do not list in MT6757 memory map*/ /*=======================================================================*/ @@ -126,9 +126,9 @@ #define SSUSB_USB3_SYS_CSR_BASE (U3D_BASE + 0x2400) #define SSUSB_USB2_CSR_BASE (U3D_BASE + 0x3400) -#define SSUSB_SIFSLV_IPPC_BASE (USB_SIF_BASE + 0x700) /* FIXME do not list in MT8163 memory map*/ -#define SSUSB_SIFSLV_U2PHY_COM_BASE (USB_SIF_BASE + 0x800) /* FIXME do not list in MT8163 memory map*/ -#define SSUSB_SIFSLV_U2PHY_COM_SIV_B_BASE (USB_SIF2_BASE + 0x800) /* FIXME do not list in MT8163 memory map*/ +#define SSUSB_SIFSLV_IPPC_BASE (USB_SIF_BASE + 0x700) /* FIXME do not list in MT6757 memory map*/ +#define SSUSB_SIFSLV_U2PHY_COM_BASE (USB_SIF_BASE + 0x800) /* FIXME do not list in MT6757 memory map*/ +#define SSUSB_SIFSLV_U2PHY_COM_SIV_B_BASE (USB_SIF2_BASE + 0x800) /* FIXME do not list in MT6757 memory map*/ /*=======================================================================*/ diff --git a/proprietary/bootable/bootloader/preloader/platform/mt6757/src/drivers/mmc_core.c b/proprietary/bootable/bootloader/preloader/platform/mt6757/src/drivers/mmc_core.c index 3da9f52171ec04a847c9f385717f3718275058b3..f8dc6ddd076c288190de46724e737df66b139d4e 100755 --- a/proprietary/bootable/bootloader/preloader/platform/mt6757/src/drivers/mmc_core.c +++ b/proprietary/bootable/bootloader/preloader/platform/mt6757/src/drivers/mmc_core.c @@ -3531,10 +3531,10 @@ u32 mmc_is_exist(u32 id) #define EFUSE_M_HW2_RES0 0x000061C0 #define EFUSE_EMMC_MSDC3_DIS (1ul << 7) #define EFUSE_EMMC_MSDC0_DIS (1ul << 6) -#define MT8163_IO_READ32(addr, index) (*(volatile unsigned int*)((addr) + (index))) +#define MT6757_IO_READ32(addr, index) (*(volatile unsigned int*)((addr) + (index))) -#define EFUSE_EMMC_MSDC3_IsDisabled() (!!(MT8163_IO_READ32(EFUSE_BASE,EFUSE_M_HW2_RES0) & EFUSE_EMMC_MSDC3_DIS)) -#define EFUSE_EMMC_MSDC0_IsDisabled() (!!(MT8163_IO_READ32(EFUSE_BASE,EFUSE_M_HW2_RES0) & EFUSE_EMMC_MSDC0_DIS)) +#define EFUSE_EMMC_MSDC3_IsDisabled() (!!(MT6757_IO_READ32(EFUSE_BASE,EFUSE_M_HW2_RES0) & EFUSE_EMMC_MSDC3_DIS)) +#define EFUSE_EMMC_MSDC0_IsDisabled() (!!(MT6757_IO_READ32(EFUSE_BASE,EFUSE_M_HW2_RES0) & EFUSE_EMMC_MSDC0_DIS)) #endif u32 mmc_whoami(void) { diff --git a/proprietary/bootable/bootloader/preloader/platform/mt6757/src/drivers/pll.c b/proprietary/bootable/bootloader/preloader/platform/mt6757/src/drivers/pll.c index 728dfc449798fa3b7feefa0fe5be4e95b61a9c34..0e423c07dc62fdb617fde362daecd367d50022a6 100755 --- a/proprietary/bootable/bootloader/preloader/platform/mt6757/src/drivers/pll.c +++ b/proprietary/bootable/bootloader/preloader/platform/mt6757/src/drivers/pll.c @@ -2617,7 +2617,7 @@ void mt_pll_init(void) int ret = 0; unsigned int temp; - //MT8163 workaround + //MT6757 workaround #define NFI_1X_INFRA_SEL 0x10001098 temp = DRV_Reg32(NFI_1X_INFRA_SEL); temp &= (0x1 << 10); diff --git a/proprietary/bootable/recovery/applysig/Android.mk b/proprietary/bootable/recovery/applysig/Android.mk deleted file mode 100755 index d13fe75c1217393b2a3f10fa42a6754de4cc4cc3..0000000000000000000000000000000000000000 --- a/proprietary/bootable/recovery/applysig/Android.mk +++ /dev/null @@ -1,37 +0,0 @@ -# Copyright (C) 2008 The Android Open Source Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -LOCAL_PATH := $(call my-dir) -include $(CLEAR_VARS) - -LOCAL_SRC_FILES := applysig.c -LOCAL_MODULE := libapplysig -LOCAL_MULTILIB := both -LOCAL_MODULE_TAGS := eng -LOCAL_C_INCLUDES += external/bzip2 external/zlib bootable/recovery system/core/mkbootimg \ - vendor/mediatek/proprietary/bootable/recovery/utils/include - -LOCAL_STATIC_LIBRARIES += libmtdutils libstdc++ - -include $(BUILD_STATIC_LIBRARY) - -include $(CLEAR_VARS) - -LOCAL_SRC_FILES := main.c -LOCAL_MODULE := applysig -LOCAL_C_INCLUDES += bootable/recovery -LOCAL_STATIC_LIBRARIES += libapplysig libmtdutils libpartition -LOCAL_SHARED_LIBRARIES += libcutils libstdc++ libc - -include $(BUILD_EXECUTABLE) diff --git a/proprietary/external/AudioCompensationFilter/Android.mk b/proprietary/external/AudioCompensationFilter/Android.mk deleted file mode 100755 index 18ed511e08c7f54016406ad60c15c72e4cb2f28c..0000000000000000000000000000000000000000 --- a/proprietary/external/AudioCompensationFilter/Android.mk +++ /dev/null @@ -1,72 +0,0 @@ -ifneq ($(strip $(MTK_PLATFORM)),) -LOCAL_PATH := $(my-dir) - -include $(CLEAR_VARS) - -ifeq ($(findstring MTK_AOSP_ENHANCEMENT, $(COMMON_GLOBAL_CPPFLAGS)),) - LOCAL_CFLAGS += -DMTK_BASIC_PACKAGE -endif - -LOCAL_SRC_FILES := \ -AudioCompFltCustParam.cpp - -LOCAL_C_INCLUDES := \ - $(MTK_PATH_SOURCE)/external/audiocustparam \ - $(MTK_PATH_SOURCE)/external/nvram/libnvram \ - $(MTK_PATH_CUSTOM)/cgen/inc \ - $(MTK_PATH_CUSTOM)/cgen/cfgfileinc \ - $(MTK_PATH_CUSTOM)/cgen/cfgdefault - - - -LOCAL_SHARED_LIBRARIES := \ - libcustom_nvram \ - libnvram \ - libnativehelper \ - libcutils \ - libutils \ - libaudiocustparam - -# MTK Audio Tuning Tool Version -LOCAL_C_INCLUDES += \ - external/libxml2/include \ - external/icu/icu4c/source/common \ - $(JNI_H_INCLUDE) \ - $(MTK_PATH_SOURCE)/external/AudioParamParser/include \ - $(MTK_PATH_SOURCE)/external/AudioParamParser - -ifneq ($(MTK_AUDIO_TUNING_TOOL_VERSION),) - ifneq ($(strip $(MTK_AUDIO_TUNING_TOOL_VERSION)),V1) - MTK_AUDIO_TUNING_TOOL_V2_PHASE:=$(shell echo $(MTK_AUDIO_TUNING_TOOL_VERSION) | sed 's/V2.//g') - LOCAL_CFLAGS += -DMTK_AUDIO_HIERARCHICAL_PARAM_SUPPORT - LOCAL_CFLAGS += -DMTK_AUDIO_TUNING_TOOL_V2_PHASE=$(MTK_AUDIO_TUNING_TOOL_V2_PHASE) - LOCAL_SHARED_LIBRARIES += libaudio_param_parser - LOCAL_SHARED_LIBRARIES += libmedia - endif -endif -# MTK Audio Tuning Tool Version - -ifeq ($(MTK_STEREO_SPK_ACF_TUNING_SUPPORT),yes) - LOCAL_CFLAGS += -DMTK_STEREO_SPK_ACF_TUNING_SUPPORT -endif - -ifeq ($(MTK_AUDIO_BLOUD_CUSTOMPARAMETER_REV),MTK_AUDIO_BLOUD_CUSTOMPARAMETER_V5) - LOCAL_CFLAGS += -DMTK_AUDIO_BLOUD_CUSTOMPARAMETER_V5 -else - ifeq ($(strip $(MTK_AUDIO_BLOUD_CUSTOMPARAMETER_REV)),MTK_AUDIO_BLOUD_CUSTOMPARAMETER_V4) - LOCAL_CFLAGS += -DMTK_AUDIO_BLOUD_CUSTOMPARAMETER_V4 - endif -endif - -LOCAL_MODULE := libaudiocompensationfilter - -LOCAL_MODULE_TAGS := optional - -#ifeq ($(MTK_AUDIO_A64_SUPPORT),yes) -LOCAL_MULTILIB := both -#else -#LOCAL_MULTILIB := 32 -#endif - -include $(BUILD_SHARED_LIBRARY) -endif diff --git a/proprietary/external/AudioComponentEngine/Android.mk b/proprietary/external/AudioComponentEngine/Android.mk deleted file mode 100755 index 94eeb51b52e766073897bab0d6f180ec299877a1..0000000000000000000000000000000000000000 --- a/proprietary/external/AudioComponentEngine/Android.mk +++ /dev/null @@ -1,48 +0,0 @@ -ifneq ($(strip $(MTK_PLATFORM)),) -LOCAL_PATH := $(my-dir) - -include $(CLEAR_VARS) - -LOCAL_SRC_FILES := \ -MtkAudioBitConverter.cpp \ -MtkAudioSrc.cpp \ -MtkAudioLoud.cpp - -LOCAL_C_INCLUDES := \ - $(MTK_PATH_SOURCE)/external/nvram/libnvram \ - $(MTK_PATH_SOURCE)/external/AudioCompensationFilter \ - $(MTK_PATH_SOURCE)/external/blisrc/blisrc32 \ - $(MTK_PATH_SOURCE)/external/limiter \ - $(MTK_PATH_SOURCE)/external/shifter \ - $(MTK_PATH_SOURCE)/external/bessound_HD - - -LOCAL_SHARED_LIBRARIES := \ - libaudiocompensationfilter \ - libnvram \ - libnativehelper \ - libcutils \ - libutils \ - libblisrc32 \ - libbessound_hd_mtk \ - libmtklimiter \ - libmtkshifter - -ifeq ($(MTK_AUDIO_BLOUD_CUSTOMPARAMETER_REV),MTK_AUDIO_BLOUD_CUSTOMPARAMETER_V5) - LOCAL_CFLAGS += -DMTK_AUDIO_BLOUD_CUSTOMPARAMETER_V5 -else - ifeq ($(strip $(MTK_AUDIO_BLOUD_CUSTOMPARAMETER_REV)),MTK_AUDIO_BLOUD_CUSTOMPARAMETER_V4) - LOCAL_CFLAGS += -DMTK_AUDIO_BLOUD_CUSTOMPARAMETER_V4 - endif -endif - -LOCAL_MODULE := libaudiocomponentengine - -LOCAL_MODULE_TAGS := optional -#ifeq ($(MTK_AUDIO_A64_SUPPORT),yes) -LOCAL_MULTILIB := both -#else -#LOCAL_MULTILIB := 32 -#endif -include $(BUILD_SHARED_LIBRARY) -endif diff --git a/proprietary/external/AudioDCRemoval/Android.mk b/proprietary/external/AudioDCRemoval/Android.mk deleted file mode 100755 index c8286561fc1e8adef2cffbce39cef29880a95944..0000000000000000000000000000000000000000 --- a/proprietary/external/AudioDCRemoval/Android.mk +++ /dev/null @@ -1,27 +0,0 @@ -ifneq ($(strip $(MTK_PLATFORM)),) -LOCAL_PATH := $(my-dir) - -include $(CLEAR_VARS) - -LOCAL_SRC_FILES := \ -AudioMTKDcRemoval.cpp - -LOCAL_C_INCLUDES := \ - $(MTK_PATH_SOURCE)/external/audiodcremoveflt - -LOCAL_SHARED_LIBRARIES := \ - libaudiodcrflt \ - libnativehelper \ - libcutils \ - libutils - -LOCAL_MODULE := libaudiomtkdcremoval - -LOCAL_MODULE_TAGS := optional -#ifeq ($(MTK_AUDIO_A64_SUPPORT),yes)# -LOCAL_MULTILIB := both -#else# -#LOCAL_MULTILIB := 32# -#endif# -include $(BUILD_SHARED_LIBRARY) -endif diff --git a/proprietary/external/AudioParamParser/Android.mk b/proprietary/external/AudioParamParser/Android.mk deleted file mode 100755 index 65a6aad8c58fde7212a2c01cb33525921b287077..0000000000000000000000000000000000000000 --- a/proprietary/external/AudioParamParser/Android.mk +++ /dev/null @@ -1,73 +0,0 @@ -LOCAL_PATH:= $(call my-dir) - -include $(CLEAR_VARS) - -ifeq ($(strip $(MTK_APP_FORCE_ENABLE_CUS_XML_SUPPORT)),yes) - LOCAL_CFLAGS += APP_FORCE_ENABLE_CUS_XML -endif - -ifeq ($(strip $(TARGET_BUILD_VARIANT)),eng) - LOCAL_CFLAGS += -DCONFIG_MT_ENG_BUILD -endif - -LOCAL_MODULE_TAGS := optional - -LOCAL_SRC_FILES:= \ - AudioCategory.c \ - AudioParam.c \ - AudioParamFieldInfo.c \ - AudioParamParser.c \ - AudioParamTreeView.c \ - AudioParamUnit.c \ - AudioType.c \ - AudioUtils.c \ - UnitTest.c \ - guicon.cpp - -LOCAL_C_INCLUDES= \ - external/libxml2/include \ - external/icu/icu4c/source/common \ - $(JNI_H_INCLUDE) \ - $(LOCAL_PATH)/include \ - $(MTK_PATH_SOURCE)/external/audiocustparam - -LOCAL_SHARED_LIBRARIES += \ - libicuuc \ - libutils \ - libcutils \ - libbinder \ - libmedia \ - libaudiocustparam - -LOCAL_STATIC_LIBRARIES := libxml2 - -LOCAL_MODULE := libaudio_param_parser - -LOCAL_MULTILIB := both - -include $(BUILD_SHARED_LIBRARY) - - -include $(CLEAR_VARS) -LOCAL_MODULE_TAGS := eng - -LOCAL_SRC_FILES:= \ - test/main.c - -LOCAL_C_INCLUDES= \ - $(MTK_PATH_SOURCE)/external/AudioParamParser/ \ - $(MTK_PATH_SOURCE)/external/AudioParamParser/include - -LOCAL_SHARED_LIBRARIES += \ - libaudio_param_parser - -LOCAL_MODULE := audio_param_test - -#LOCAL_MULTILIB := 32 - -include $(BUILD_EXECUTABLE) - -include $(LOCAL_PATH)/DeployAudioParam.mk - -include $(LOCAL_PATH)/GenAudioParamOptionsXml.mk - diff --git a/proprietary/external/AudioSpeechEnhancement/Android.mk b/proprietary/external/AudioSpeechEnhancement/Android.mk deleted file mode 100755 index 93ef6df8837d877ea354de64b00bc61900e98d76..0000000000000000000000000000000000000000 --- a/proprietary/external/AudioSpeechEnhancement/Android.mk +++ /dev/null @@ -1,71 +0,0 @@ -# Copyright Statement: -# -# This software/firmware and related documentation ("MediaTek Software") are -# protected under relevant copyright laws. The information contained herein -# is confidential and proprietary to MediaTek Inc. and/or its licensors. -# Without the prior written permission of MediaTek inc. and/or its licensors, -# any reproduction, modification, use or disclosure of MediaTek Software, -# and information contained herein, in whole or in part, shall be strictly prohibited. - -# MediaTek Inc. (C) 2010. All rights reserved. -# -# BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES -# THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE") -# RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER ON -# AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT. -# NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE -# SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR -# SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES TO LOOK ONLY TO SUCH -# THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. RECEIVER EXPRESSLY ACKNOWLEDGES -# THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES -# CONTAINED IN MEDIATEK SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK -# SOFTWARE RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR -# STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND -# CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE, -# AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE, -# OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY RECEIVER TO -# MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. -# -# The following software/firmware and/or related documentation ("MediaTek Software") -# have been modified by MediaTek Inc. All revisions are subject to any receiver's -# applicable license agreements with MediaTek Inc. - - -# -# Copyright (C) 2008 The Android Open Source Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -LOCAL_PATH := $(my-dir) - -include $(CLEAR_VARS) - -CHIP := $(shell echo $(MTK_PLATFORM) | tr A-Z a-z ) -ifeq ($(filter mt2601 mt6572 mt6582 mt6592 mt7623 ,$(CHIP)),) - DIR := V3 -else - DIR := V2 -endif - -LOCAL_MODULE := libspeech_enh_lib -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_CLASS := SHARED_LIBRARIES -LOCAL_SRC_FILES_arm := $(DIR)/libspeech_enh_lib.so -LOCAL_MODULE_SUFFIX := .so -LOCAL_SRC_FILES_arm64 := $(DIR)/lib64speech_enh_lib.so -LOCAL_MULTILIB := both - -include $(BUILD_PREBUILT) diff --git a/proprietary/external/AudioTimeStretch/Android.mk b/proprietary/external/AudioTimeStretch/Android.mk deleted file mode 100755 index 7620a8ab016d3ad2f41b23315d95d2b07d93892f..0000000000000000000000000000000000000000 --- a/proprietary/external/AudioTimeStretch/Android.mk +++ /dev/null @@ -1,65 +0,0 @@ -# Copyright Statement: -# -# This software/firmware and related documentation ("MediaTek Software") are -# protected under relevant copyright laws. The information contained herein -# is confidential and proprietary to MediaTek Inc. and/or its licensors. -# Without the prior written permission of MediaTek inc. and/or its licensors, -# any reproduction, modification, use or disclosure of MediaTek Software, -# and information contained herein, in whole or in part, shall be strictly prohibited. - -# MediaTek Inc. (C) 2010. All rights reserved. -# -# BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES -# THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE") -# RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER ON -# AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT. -# NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE -# SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR -# SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES TO LOOK ONLY TO SUCH -# THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. RECEIVER EXPRESSLY ACKNOWLEDGES -# THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES -# CONTAINED IN MEDIATEK SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK -# SOFTWARE RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR -# STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND -# CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE, -# AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE, -# OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY RECEIVER TO -# MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. -# -# The following software/firmware and/or related documentation ("MediaTek Software") -# have been modified by MediaTek Inc. All revisions are subject to any receiver's -# applicable license agreements with MediaTek Inc. - - -# -# Copyright (C) 2008 The Android Open Source Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -LOCAL_PATH := $(my-dir) - -include $(CLEAR_VARS) -#LOCAL_PREBUILT_LIBS := libtimestretch.so -#LOCAL_MODULE_TAGS := optional -#include $(BUILD_MULTI_PREBUILT) -LOCAL_MODULE := libtimestretch -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_CLASS := SHARED_LIBRARIES -LOCAL_SRC_FILES_arm := libtimestretch.so -LOCAL_MODULE_SUFFIX := .so -LOCAL_SRC_FILES_arm64 := lib64timestretch.so -LOCAL_MULTILIB := both -include $(BUILD_PREBUILT) - diff --git a/proprietary/external/LaunchPPPoe/Android.mk b/proprietary/external/LaunchPPPoe/Android.mk deleted file mode 100755 index d2fe6e47f8b088c5b44a627ea2db06ec6d44e513..0000000000000000000000000000000000000000 --- a/proprietary/external/LaunchPPPoe/Android.mk +++ /dev/null @@ -1,10 +0,0 @@ -LOCAL_PATH:= $(call my-dir) - -include $(CLEAR_VARS) -LOCAL_SRC_FILES:= LanunchPPPoe.c -LOCAL_CFLAGS := -Werror=format -LOCAL_MODULE:= launchpppoe -LOCAL_C_INCLUDES := system/core/include/netutils/ system/core/include/cutils/ -LOCAL_SHARED_LIBRARIES := libcutils libnetutils - -include $(BUILD_EXECUTABLE) diff --git a/proprietary/external/SRS_AudioEffect/SRSTruMedia/Android.mk b/proprietary/external/SRS_AudioEffect/SRSTruMedia/Android.mk deleted file mode 100755 index 3d207edf055a5fb225045bc0d3bd894b8553a69f..0000000000000000000000000000000000000000 --- a/proprietary/external/SRS_AudioEffect/SRSTruMedia/Android.mk +++ /dev/null @@ -1,13 +0,0 @@ -ifeq ($(strip $(HAVE_SRSAUDIOEFFECT_FEATURE)),yes) - -LOCAL_PATH := $(call my-dir) -include $(CLEAR_VARS) -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE := DTSTruMedia -LOCAL_SRC_FILES := $(LOCAL_MODULE).apk -LOCAL_MODULE_CLASS := APPS -LOCAL_MODULE_SUFFIX := $(COMMON_ANDROID_PACKAGE_SUFFIX) -LOCAL_CERTIFICATE := platform -include $(BUILD_PREBUILT) - -endif diff --git a/proprietary/external/SRS_AudioEffect/srs_processing/Android.mk b/proprietary/external/SRS_AudioEffect/srs_processing/Android.mk deleted file mode 100755 index ecfd91b86c13ccbf754faaf5c2df370153f96f5e..0000000000000000000000000000000000000000 --- a/proprietary/external/SRS_AudioEffect/srs_processing/Android.mk +++ /dev/null @@ -1,639 +0,0 @@ -ifeq ($(strip $(MTK_AUDIO)),yes) -ifeq ($(strip $(HAVE_SRSAUDIOEFFECT_FEATURE)),yes) -LOCAL_PATH := $(call my-dir) - -include $(CLEAR_VARS) -include $(LOCAL_PATH)/CONFIG.mk $(LOCAL_PATH)/license/LICENSE.mk - -################################################################################ -#### BUILD SETUP - DO NOT EDIT ################################################# - -VCHECK_EMPTY := -VCHECK_SPACE := $(VCHECK_EMPTY) $(VCHECK_EMPTY) -VCHECK_DOT := . -VCHECK_NUMS := $(subst $(VCHECK_DOT),$(VCHECK_SPACE),$(PLATFORM_VERSION)) - -ifeq ($(word 1,$(VCHECK_NUMS)),3) -AND_PLAT_HONEY := true -endif - -ifeq ($(word 1,$(VCHECK_NUMS)),4) -ifeq ($(word 2,$(VCHECK_NUMS)),0) -AND_PLAT_ICS := true -endif -ifeq ($(word 2,$(VCHECK_NUMS)),1) -AND_PLAT_JB := true -endif -ifeq ($(word 2,$(VCHECK_NUMS)),2) -AND_PLAT_JB := true -endif -ifeq ($(word 2,$(VCHECK_NUMS)),3) -AND_PLAT_JB := true -endif -ifeq ($(word 2,$(VCHECK_NUMS)),4) -AND_PLAT_KK := true -endif -endif - -ifeq ($(word 1,$(VCHECK_NUMS)),5) -ifeq ($(word 2,$(VCHECK_NUMS)),0) -AND_PLAT_L := true -endif -endif - -AND_PLAT_EXT := -AND_PLAT_INDEX := 7 - -ifeq ($(AND_PLAT_HONEY),true) -AND_PLAT_INDEX := 8 -endif - -ifeq ($(AND_PLAT_ICS),true) -AND_PLAT_EXT := _ics -AND_PLAT_INDEX := 9 -endif - -ifeq ($(AND_PLAT_JB),true) -AND_PLAT_EXT := _jb -AND_PLAT_INDEX := 10 -endif - -ifeq ($(AND_PLAT_KK),true) -AND_PLAT_EXT := _kk -AND_PLAT_INDEX := 11 -endif - -ifeq ($(AND_PLAT_L),true) -AND_PLAT_EXT := _l -AND_PLAT_INDEX := 12 -endif - -#ifeq ($(TARGET_ARCH),arm) -SRSLIB_PLAT := ARMV5TE_LE -SRSLIB_PATH := srs_libs_arm -#endif - -#ifeq ($(TARGET_ARCH),arm64) -#SRSLIB_PLAT := ARMV8_LE -#SRSLIB_PATH := srs_libs_arm64 -#endif - -#ifeq ($(TARGET_ARCH),aarch64) -#SRSLIB_PLAT := ARMV8_LE -#SRSLIB_PATH := srs_libs_arm64 -#endif - -ifeq ($(TARGET_ARCH),x86) -SRSLIB_PLAT := x86 -SRSLIB_PATH := srs_libs_x86 -endif - -###################################################################################### -#### ENVIRONMENT CONFIG - SETUP BASED ON ENVIRONMENT VARIABLES ####################### - -ifneq (,$(SRS_ENV_PRODUCT)) -SRS_PRODUCT := $(SRS_ENV_PRODUCT) -endif - -ifneq (,$(SRS_ENV_VARIANT)) -SRS_VARIANT := $(SRS_ENV_VARIANT) -endif - -ifneq (,$(SRS_ENV_TAGS)) -SRS_TAGS := $(SRS_ENV_TAGS) -endif - -ifneq (,$(SRS_ENV_FEATURES)) -SRS_FEATURES := $(SRS_ENV_FEATURES) -endif - -################################################################################ -#### AUTO CONFIG - SETUP BASED ON BUILD CONFIG VARIABLES ####################### - -ifeq ($(SRS_PRODUCT),trumedia_hd) -SRS_TECH_WOWHDX := true -SRS_TECH_HPF := true -SRS_TECH_CSHP := true -SRS_TECH_AEQ := true -SRS_TECH_HLIMIT := true -endif - -ifeq ($(SRS_PRODUCT),trumedia) -SRS_TECH_WOWHDX := true -SRS_TECH_HPF := true -SRS_TECH_CSHP := true -SRS_TECH_AEQ := true -SRS_TECH_HLIMIT := true -endif - -ifneq (,$(findstring userpeq,$(SRS_FEATURES))) -SRS_TECH_USERPEQ := true -endif - -ifneq (,$(findstring usergeq,$(SRS_FEATURES))) -SRS_TECH_GEQ := true -endif - -ifeq ($(SRS_TECH_USERPEQ),true) -SRS_TECH_AEQ := true -endif - -ifeq ($(SRS_TECH_WOWHDX),true) -SRS_TECHLIB_SRS3D := true -SRS_TECHLIB_SA_TRUBASS := true -SRS_TECHLIB_WIDESUR := true -SRS_TECHLIB_FFT := true -SRS_TECHLIB_DESIGN := true -endif - -ifeq ($(SRS_TECH_WOWHD),true) -SRS_TECHLIB_SRS3D := true -SRS_TECHLIB_SA_TRUBASS := true -SRS_TECHLIB_DESIGN := true -endif - -ifeq ($(SRS_TECH_CSHP),true) -SRS_TECHLIB_CSDECODE := true -SRS_TECHLIB_DESIGN := true -SRS_TECHLIB_HP360 := true -SRS_TECHLIB_SA_TRUBASS := true -endif - -ifeq ($(SRS_TECH_AEQ),true) -SRS_TECHLIB_AEQ := true -SRS_TECHLIB_FFT := true -SRS_TECHLIB_DESIGN := true -endif - - -################################################################################ -#### BUILD STATIC LIBRARY RULES ################################################ - -ifeq ($(SRS_TECH_WOWHDX),true) -include $(CLEAR_VARS) -LOCAL_MODULE := srs_wowhdx_$(SRSLIB_PLAT)_NDK -LOCAL_MODULE_CLASS := STATIC_LIBRARIES -LOCAL_MULTILIB := 32 -LOCAL_ARM_MODE := arm -LOCAL_SRC_FILES_arm := $(SRSLIB_PATH)/srs_wowhdx_$(SRSLIB_PLAT)_NDK.a -LOCAL_MODULE_SUFFIX := .a -include $(BUILD_PREBUILT) -endif - -ifeq ($(SRS_TECH_WOWHD),true) -include $(CLEAR_VARS) -LOCAL_MODULE := srs_wowhd_$(SRSLIB_PLAT)_NDK -LOCAL_MODULE_CLASS := STATIC_LIBRARIES -LOCAL_MULTILIB := 32 -LOCAL_ARM_MODE := arm -LOCAL_SRC_FILES_arm := $(SRSLIB_PATH)/srs_wowhd_$(SRSLIB_PLAT)_NDK.a -LOCAL_MODULE_SUFFIX := .a -include $(BUILD_PREBUILT) -endif - -ifeq ($(SRS_TECH_CSHP),true) -include $(CLEAR_VARS) -LOCAL_MODULE := srs_cshp_$(SRSLIB_PLAT)_NDK -LOCAL_MODULE_CLASS := STATIC_LIBRARIES -LOCAL_MULTILIB := 32 -LOCAL_ARM_MODE := arm -LOCAL_SRC_FILES_arm := $(SRSLIB_PATH)/srs_cshp_$(SRSLIB_PLAT)_NDK.a -LOCAL_MODULE_SUFFIX := .a -include $(BUILD_PREBUILT) -endif - -ifeq ($(SRS_TECH_HLIMIT),true) -include $(CLEAR_VARS) -LOCAL_MODULE := srs_hardlimiter_$(SRSLIB_PLAT)_NDK -LOCAL_MODULE_CLASS := STATIC_LIBRARIES -LOCAL_MULTILIB := 32 -LOCAL_ARM_MODE := arm -LOCAL_SRC_FILES_arm := $(SRSLIB_PATH)/srs_hardlimiter_$(SRSLIB_PLAT)_NDK.a -LOCAL_MODULE_SUFFIX := .a -include $(BUILD_PREBUILT) -endif - -ifeq ($(SRS_TECHLIB_WIDESUR),true) -include $(CLEAR_VARS) -LOCAL_MODULE := srs_widesrd_$(SRSLIB_PLAT)_NDK -LOCAL_MODULE_CLASS := STATIC_LIBRARIES -LOCAL_MULTILIB := 32 -LOCAL_ARM_MODE := arm -LOCAL_SRC_FILES_arm := $(SRSLIB_PATH)/srs_widesrd_$(SRSLIB_PLAT)_NDK.a -LOCAL_MODULE_SUFFIX := .a -include $(BUILD_PREBUILT) -endif - -ifeq ($(SRS_TECHLIB_SRS3D),true) -include $(CLEAR_VARS) -LOCAL_MODULE := srs_srs3d_$(SRSLIB_PLAT)_NDK -LOCAL_MODULE_CLASS := STATIC_LIBRARIES -LOCAL_MULTILIB := 32 -LOCAL_ARM_MODE := arm -LOCAL_SRC_FILES_arm := $(SRSLIB_PATH)/srs_srs3d_$(SRSLIB_PLAT)_NDK.a -LOCAL_MODULE_SUFFIX := .a -include $(BUILD_PREBUILT) -endif - -ifeq ($(SRS_TECHLIB_CSDECODE),true) -include $(CLEAR_VARS) -LOCAL_MODULE := srs_csdecoder_$(SRSLIB_PLAT)_NDK -LOCAL_MODULE_CLASS := STATIC_LIBRARIES -LOCAL_MULTILIB := 32 -LOCAL_ARM_MODE := arm -LOCAL_SRC_FILES_arm := $(SRSLIB_PATH)/srs_csdecoder_$(SRSLIB_PLAT)_NDK.a -LOCAL_MODULE_SUFFIX := .a -include $(BUILD_PREBUILT) -endif - -ifeq ($(SRS_TECHLIB_HP360),true) -include $(CLEAR_VARS) -LOCAL_MODULE := srs_hp360_$(SRSLIB_PLAT)_NDK -LOCAL_MODULE_CLASS := STATIC_LIBRARIES -LOCAL_MULTILIB := 32 -LOCAL_ARM_MODE := arm -LOCAL_SRC_FILES_arm := $(SRSLIB_PATH)/srs_hp360_$(SRSLIB_PLAT)_NDK.a -LOCAL_MODULE_SUFFIX := .a -include $(BUILD_PREBUILT) -endif - -ifeq ($(SRS_TECHLIB_SA_TRUBASS),true) -include $(CLEAR_VARS) -LOCAL_MODULE := srs_tbhd_$(SRSLIB_PLAT)_NDK -LOCAL_MODULE_CLASS := STATIC_LIBRARIES -LOCAL_MULTILIB := 32 -LOCAL_ARM_MODE := arm -LOCAL_SRC_FILES_arm := $(SRSLIB_PATH)/srs_tbhd_$(SRSLIB_PLAT)_NDK.a -LOCAL_MODULE_SUFFIX := .a -include $(BUILD_PREBUILT) -endif - -ifeq ($(SRS_TECHLIB_FFT),true) -include $(CLEAR_VARS) -LOCAL_MODULE := srs_fft_$(SRSLIB_PLAT)_NDK -LOCAL_MODULE_CLASS := STATIC_LIBRARIES -LOCAL_MULTILIB := 32 -LOCAL_ARM_MODE := arm -LOCAL_SRC_FILES_arm := $(SRSLIB_PATH)/srs_fft_$(SRSLIB_PLAT)_NDK.a -LOCAL_MODULE_SUFFIX := .a -include $(BUILD_PREBUILT) -endif - -ifeq ($(SRS_TECHLIB_DESIGN),true) -include $(CLEAR_VARS) -LOCAL_MODULE := srs_designer_$(SRSLIB_PLAT)_NDK -LOCAL_MODULE_CLASS := STATIC_LIBRARIES -LOCAL_MULTILIB := 32 -LOCAL_ARM_MODE := arm -LOCAL_SRC_FILES_arm := $(SRSLIB_PATH)/srs_designer_$(SRSLIB_PLAT)_NDK.a -LOCAL_MODULE_SUFFIX := .a -include $(BUILD_PREBUILT) -endif - -ifeq ($(SRS_TECHLIB_AEQ),true) -include $(CLEAR_VARS) -LOCAL_MODULE := srs_aeq_$(SRSLIB_PLAT)_NDK -LOCAL_MODULE_CLASS := STATIC_LIBRARIES -LOCAL_MULTILIB := 32 -LOCAL_ARM_MODE := arm -LOCAL_SRC_FILES_arm := $(SRSLIB_PATH)/srs_aeq_$(SRSLIB_PLAT)_NDK.a -LOCAL_MODULE_SUFFIX := .a -include $(BUILD_PREBUILT) -endif - -ifeq ($(SRS_TECH_GEQ),true) -include $(CLEAR_VARS) -LOCAL_MODULE := srs_geq_$(SRSLIB_PLAT)_NDK -LOCAL_MODULE_CLASS := STATIC_LIBRARIES -LOCAL_MULTILIB := 32 -LOCAL_ARM_MODE := arm -LOCAL_SRC_FILES_arm := $(SRSLIB_PATH)/srs_geq_$(SRSLIB_PLAT)_NDK.a -LOCAL_MODULE_SUFFIX := .a -include $(BUILD_PREBUILT) -endif - -include $(CLEAR_VARS) -LOCAL_MODULE := srs_common_$(SRSLIB_PLAT)_NDK -LOCAL_MODULE_CLASS := STATIC_LIBRARIES -LOCAL_MULTILIB := 32 -LOCAL_ARM_MODE := arm -LOCAL_SRC_FILES_arm := $(SRSLIB_PATH)/srs_common_$(SRSLIB_PLAT)_NDK.a -LOCAL_MODULE_SUFFIX := .a -include $(BUILD_PREBUILT) - -# License libraries needed by both SRS license and dsec -include $(CLEAR_VARS) -LOCAL_MODULE := libsrs_spool_$(SRS_PROTECT_TYPE)_$(SRSLIB_PLAT)_NDK -LOCAL_MODULE_CLASS := STATIC_LIBRARIES -LOCAL_MULTILIB := 32 -LOCAL_ARM_MODE := arm -LOCAL_SRC_FILES_arm := license/libsrs_spool_$(SRS_PROTECT_TYPE)_$(SRSLIB_PLAT)_NDK.a -LOCAL_MODULE_SUFFIX := .a -include $(BUILD_PREBUILT) - -include $(CLEAR_VARS) -LOCAL_MODULE := libdts-security-dsec_$(SRSLIB_PLAT)_NDK -LOCAL_MODULE_CLASS := STATIC_LIBRARIES -LOCAL_MULTILIB := 32 -LOCAL_ARM_MODE := arm -LOCAL_SRC_FILES_arm := license/libdts-security-dsec_$(SRSLIB_PLAT)_NDK.a -LOCAL_MODULE_SUFFIX := .a -include $(BUILD_PREBUILT) - - - -################################################################################ -#### BUILD LIBSRSPROCESSING.SO RULES ########################################### - -include $(CLEAR_VARS) - -LOCAL_MODULE:= libsrsprocessing -LOCAL_MODULE_TAGS := eng -LOCAL_32_BIT_ONLY := true -LOCAL_PRELINK_MODULE := false - -LOCAL_SRC_FILES := \ - srs_techs/srs_tech_tools.cpp \ - srs_processing.cpp \ - srs_workspace.cpp \ - srs_params.cpp - -LOCAL_SRC_FILES += srs_subs/srs_routing.cpp - -#ifeq ($(TARGET_ARCH),arm) -LOCAL_MULTILIB := 32 -LOCAL_ARM_MODE := arm -#else ifeq ($(TARGET_ARCH),arm64) -#LOCAL_MULTILIB := 64 -#LOCAL_ARM_MODE := arm64 -#else ifeq ($(TARGET_ARCH),aarch64) -#LOCAL_MULTILIB := 64 -#LOCAL_ARM_MODE := arm64 -#endif - -# Enable 32-bit processing -LOCAL_CFLAGS += -D_SRS_PROC_32BIT - -# Enable android synchronization between setParameter() and Config() -LOCAL_CFLAGS += -D_SRS_PROC_ANDROID_SYNCHRONIZE - -LOCAL_SRC_FILES += srs_trumedia.cpp - -ifeq ($(SRS_PRODUCT),trumedia_hd) -LOCAL_CFLAGS += -D_SRSCFG_TRUMEDIA_HD -endif - -ifeq ($(SRS_PRODUCT),trumedia) -LOCAL_CFLAGS += -D_SRSCFG_TRUMEDIA -endif - - -ifeq ($(SRS_TECH_HPF),true) -LOCAL_SRC_FILES += srs_techs/srs_tech_hpf.cpp -endif - -ifeq ($(SRS_TECH_WOWHDX),true) -LOCAL_SRC_FILES += srs_techs/srs_tech_wowhdx.cpp -LOCAL_STATIC_LIBRARIES += srs_wowhdx_$(SRSLIB_PLAT)_NDK -LOCAL_CFLAGS += -D_SRSCFG_WOWHDX -endif - -ifeq ($(SRS_TECH_WOWHD),true) -LOCAL_SRC_FILES += srs_techs/srs_tech_wowhd.cpp -LOCAL_STATIC_LIBRARIES += srs_wowhd_$(SRSLIB_PLAT)_NDK -endif - -ifeq ($(SRS_TECH_CSHP),true) -LOCAL_SRC_FILES += srs_techs/srs_tech_cshp.cpp -LOCAL_STATIC_LIBRARIES += srs_cshp_$(SRSLIB_PLAT)_NDK -endif - -ifeq ($(SRS_TECH_USERPEQ),true) -LOCAL_SRC_FILES += srs_techs/srs_tech_userpeq.cpp -LOCAL_CFLAGS += -D_SRSCFG_USERPEQ -endif - -ifeq ($(SRS_TECH_AEQ),true) -LOCAL_SRC_FILES += srs_techs/srs_tech_aeq.cpp -LOCAL_SRC_FILES += libb64/src/cdecode.c -LOCAL_C_INCLUDES = $(LOCAL_PATH)/libb64/include -endif - -ifeq ($(SRS_TECH_HLIMIT),true) -LOCAL_SRC_FILES += srs_techs/srs_tech_hlimit.cpp -LOCAL_STATIC_LIBRARIES += srs_hardlimiter_$(SRSLIB_PLAT)_NDK -endif - -ifeq ($(SRS_TECHLIB_WIDESUR),true) -LOCAL_STATIC_LIBRARIES += srs_widesrd_$(SRSLIB_PLAT)_NDK -endif - -ifeq ($(SRS_TECHLIB_CSDECODE),true) -LOCAL_STATIC_LIBRARIES += srs_csdecoder_$(SRSLIB_PLAT)_NDK -endif - -ifeq ($(SRS_TECHLIB_HP360),true) -LOCAL_STATIC_LIBRARIES += srs_hp360_$(SRSLIB_PLAT)_NDK -endif - -ifeq ($(SRS_TECHLIB_SRS3D),true) -LOCAL_STATIC_LIBRARIES += srs_srs3d_$(SRSLIB_PLAT)_NDK -endif - -ifeq ($(SRS_TECHLIB_SA_TRUBASS),true) -LOCAL_STATIC_LIBRARIES += srs_tbhd_$(SRSLIB_PLAT)_NDK -endif - -ifeq ($(SRS_TECHLIB_FFT),true) -LOCAL_STATIC_LIBRARIES += srs_fft_$(SRSLIB_PLAT)_NDK -endif - -ifeq ($(SRS_TECHLIB_DESIGN),true) -LOCAL_STATIC_LIBRARIES += srs_designer_$(SRSLIB_PLAT)_NDK -endif - -ifeq ($(SRS_TECHLIB_AEQ),true) -LOCAL_STATIC_LIBRARIES += srs_aeq_$(SRSLIB_PLAT)_NDK -endif - -ifeq ($(SRS_TECH_GEQ),true) -LOCAL_SRC_FILES += srs_techs/srs_tech_geq.cpp -LOCAL_STATIC_LIBRARIES += srs_geq_$(SRSLIB_PLAT)_NDK -LOCAL_CFLAGS += -D_SRSCFG_MOBILE_EQ - -ifneq (,$(findstring extendgeq,$(SRS_FEATURES))) -LOCAL_CFLAGS += -D_SRSCFG_MOBILE_EQ_EXTENDED -else -LOCAL_CFLAGS += -D_SRSCFG_MOBILE_EQ_BASIC -endif - -endif - -# License libraries needed by both SRS license and dsec -LOCAL_STATIC_LIBRARIES += libsrs_spool_$(SRS_PROTECT_TYPE)_$(SRSLIB_PLAT)_NDK -LOCAL_STATIC_LIBRARIES += libdts-security-dsec_$(SRSLIB_PLAT)_NDK - -#DSPOFFLOAD_PATH :=vendor_qdsp/QDSP.mk -#ifneq (,$(DSPOFFLOAD_PATH)) -#include $(LOCAL_PATH)/$(DSPOFFLOAD_PATH) -#endif - -LOCAL_STATIC_LIBRARIES += srs_common_$(SRSLIB_PLAT)_NDK -ifeq ($(AND_PLAT_ICS),true) -LOCAL_STATIC_LIBRARIES += libmedia_helper -endif - -ifeq ($(AND_PLAT_JB),true) -LOCAL_STATIC_LIBRARIES += libmedia_helper -endif - -ifeq ($(AND_PLAT_KK),true) -LOCAL_STATIC_LIBRARIES += libmedia_helper -endif - -ifeq ($(AND_PLAT_L),true) -LOCAL_STATIC_LIBRARIES += libmedia_helper -endif - -LOCAL_SHARED_LIBRARIES += \ - libcutils \ - libutils \ - libmedia - -LOCAL_C_INCLUDES += frameworks/base/libs/audioflinger - -LOCAL_CFLAGS += -DSRS_BASECFG_READPATH=$(SRS_BASECFG_READPATH) -LOCAL_CFLAGS += -DSRS_USERCFG_PATH=$(SRS_USERCFG_PATH) -LOCAL_CFLAGS += -D_SRSCFG_LIBVARIANT=$(SRS_VARIANT) - -ifeq ($(TARGET_ARCH),arm) -LOCAL_CFLAGS += -D_SRSCFG_ARCH_ARM -endif - -ifeq ($(TARGET_ARCH),arm64) -LOCAL_CFLAGS += -D_SRSCFG_ARCH_ARM64 -endif - -ifeq ($(TARGET_ARCH),aarch64) -LOCAL_CFLAGS += -D_SRSCFG_ARCH_ARM64 -endif - -ifeq ($(TARGET_ARCH),x86) -LOCAL_CFLAGS += -D_SRSCFG_ARCH_X86 -endif - -ifneq (,$(POSTPRO_PROPGATE)) -LOCAL_CFLAGS += -DPOSTPRO_PROPGATE -endif - -ifeq ($(SRS_USERCFG_ALLOW),true) -LOCAL_CFLAGS += -DSRS_USERCFG_ALLOW -endif - -ifeq ($(SRS_USERCFG_UNLOCKED),true) -LOCAL_CFLAGS += -DSRS_USERCFG_UNLOCKED -endif - -ifneq (,$(findstring logging,$(SRS_FEATURES))) -LOCAL_CFLAGS += -DSRS_VERBOSE -endif - -ifneq (,$(findstring audiolog,$(SRS_FEATURES))) -LOCAL_CFLAGS += -DSRS_AUDIOLOG -LOCAL_CFLAGS += -DSRS_AUDIOLOG_PREPATH=$(SRS_AUDIOLOG_PREPATH) -LOCAL_CFLAGS += -DSRS_AUDIOLOG_POSTPATH=$(SRS_AUDIOLOG_POSTPATH) - -ifneq (,$(findstring audiosesslog,$(SRS_FEATURES))) -LOCAL_CFLAGS += -DSRS_AUDIOLOG_MARKERS -endif - -endif - -ifneq (,$(findstring forcesilence,$(SRS_FEATURES))) -LOCAL_CFLAGS += -DSRS_FORCE_SILENCE -endif - -LOCAL_CFLAGS += -DSRS_AND_PLAT_INDEX=$(AND_PLAT_INDEX) - -STAGS_EMPTY := -STAGS_SPACE := $(STAGS_EMPTY) $(STAGS_EMPTY) -STAGS_COMMA := , -STAGS_SEP := ^ -SRS_TAGS_NOSPACE := $(subst $(STAGS_SPACE),$(STAGS_SEP),$(SRS_TAGS)) -SRS_TAGS_OUT := $(subst $(STAGS_COMMA),$(STAGS_SEP),$(SRS_TAGS_NOSPACE)) - -LOCAL_CFLAGS += -DSRS_TAGS=$(SRS_TAGS_OUT) - -ifeq ($(SRS_PROTECT_TYPE),license) -LOCAL_CFLAGS += -DSRS_PROTECT_PATH=$(SRS_PROTECT_PATH) -LOCAL_CFLAGS += -DSRS_PROTECT_AUTHID=$(SRS_PROTECT_AUTHID) -endif - -ifeq ($(SRS_PROTECT_TYPE),dsec) -LOCAL_CFLAGS += -DSRS_PROTECT_PATH=$(DSEC_PATH) -LOCAL_CFLAGS += -DSRS_PROTECT_AUTHID=$(DSEC_AUTHID) -endif - -ifneq (,$(findstring perftrack,$(SRS_FEATURES))) -LOCAL_CFLAGS += -D_SRSCFG_PERFTRACK -endif - -ifeq ($(SRS_PARAMWRITE_CFG),false) -LOCAL_CFLAGS += -DSRS_PARAMWRITE_CFG_BLOCK -endif - -ifeq ($(SRS_PARAMWRITE_PREF),false) -LOCAL_CFLAGS += -DSRS_PARAMWRITE_PREF_BLOCK -endif - -ifeq ($(SRS_PARAMREAD_INFO),false) -LOCAL_CFLAGS += -DSRS_PARAMREAD_INFO_BLOCK -endif - -ifeq ($(SRS_PARAMREAD_DEBUG),false) -LOCAL_CFLAGS += -DSRS_PARAMREAD_DEBUG_BLOCK -endif - -ifeq ($(SRS_PARAMREAD_CFG),false) -LOCAL_CFLAGS += -DSRS_PARAMREAD_CFG_BLOCK -endif - -ifeq ($(SRS_PARAMREAD_PREF),false) -LOCAL_CFLAGS += -DSRS_PARAMREAD_PREF_BLOCK -endif - -ifneq (,$(SRS_AEQ_FIR_COEFF_FILE_PATH)) -LOCAL_CFLAGS += -DSRS_AEQ_COEFF_FROM_FILE -LOCAL_CFLAGS += -DSRS_AEQ_FIR_COEFF_FILE_PATH=$(SRS_AEQ_FIR_COEFF_FILE_PATH) -endif - -ifeq ($(TARGET_SIMULATOR),true) - LOCAL_LDLIBS += -ldl -else - LOCAL_SHARED_LIBRARIES += libdl -endif - -ifeq ($(TARGET_SIMULATOR),true) - ifeq ($(HOST_OS),linux) - LOCAL_LDLIBS += -lrt -lpthread - endif -endif - -#ifeq ($(TARGET_ARCH),arm) - LOCAL_LDFLAGS += -Wl,--no-warn-shared-textrel -#endif - -#FORCE_COMPAT := true - -ifeq ($(TARGET_ARCH),arm) - ifeq ($(FORCE_COMPAT),true) - LOCAL_CFLAGS += -fno-exceptions \ - -march=armv6 \ - -mthumb-interwork \ - -mfloat-abi=softfp \ - -g - endif -endif -include $(BUILD_SHARED_LIBRARY) -endif -endif diff --git a/proprietary/external/VideoSpeedEffect/Android.mk b/proprietary/external/VideoSpeedEffect/Android.mk deleted file mode 100755 index 941e8c2253bec010eec60269037cf0abbf74015e..0000000000000000000000000000000000000000 --- a/proprietary/external/VideoSpeedEffect/Android.mk +++ /dev/null @@ -1,140 +0,0 @@ -# Copyright Statement: -# -# This software/firmware and related documentation ("MediaTek Software") are -# protected under relevant copyright laws. The information contained herein -# is confidential and proprietary to MediaTek Inc. and/or its licensors. -# Without the prior written permission of MediaTek inc. and/or its licensors, -# any reproduction, modification, use or disclosure of MediaTek Software, -# and information contained herein, in whole or in part, shall be strictly prohibited. -# -# MediaTek Inc. (C) 2014. All rights reserved. -# -# BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES -# THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE") -# RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER ON -# AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT. -# NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE -# SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR -# SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES TO LOOK ONLY TO SUCH -# THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. RECEIVER EXPRESSLY ACKNOWLEDGES -# THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES -# CONTAINED IN MEDIATEK SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK -# SOFTWARE RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR -# STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND -# CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE, -# AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE, -# OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY RECEIVER TO -# MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. -# -# The following software/firmware and/or related documentation ("MediaTek Software") -# have been modified by MediaTek Inc. All revisions are subject to any receiver's -# applicable license agreements with MediaTek Inc. - - -ifneq ($(strip $(MTK_USE_ANDROID_MM_DEFAULT_CODE)),yes) - -ifeq ($(strip $(MTK_SLOW_MOTION_VIDEO_SUPPORT)),yes) - -LOCAL_PATH:= $(call my-dir) -include $(CLEAR_VARS) - - -LOCAL_SRC_FILES += \ - VideoSpeedEffect.cpp - -LOCAL_C_INCLUDES:= \ - $(TOP)/$(MTK_PATH_SOURCE)/frameworks-ext/av/include \ - $(TOP)/frameworks/av/services/audioflinger \ - $(TOP)/$(MTK_PATH_SOURCE)/external/AudioTimeStretch/inc \ - $(TOP)/frameworks/av/include \ - $(TOP)/frameworks/native/include \ - $(TOP)/frameworks/av/include/mediapwd \ - $(TOP)/$(MTK_ROOT)/frameworks/native/include/media/openmax \ - $(TOP)/$(MTK_PATH_SOURCE)/frameworks/av/media/libstagefright/include/omx_core \ - $(TOP)/$(MTK_PATH_SOURCE)/hardware/dpframework/inc \ - $(TOP)/$(MTK_PATH_SOURCE)/external/mhal/src/core/drv/inc \ - $(TOP)/$(MTK_PATH_SOURCE)/external/mhal/inc \ - -LOCAL_SHARED_LIBRARIES := \ - libbinder \ - libmedia \ - libutils \ - libcutils \ - libui \ - libgui \ - libskia \ - libstagefright \ - libstagefright_foundation \ - libtimestretch \ - libMTKAudioTimeStretch \ - libdpframework \ - libvcodecdrv \ - - -LOCAL_CFLAGS += -Wno-multichar -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE:= libMtkVideoSpeedEffect - -include $(BUILD_SHARED_LIBRARY) - -include $(call all-makefiles-under,$(LOCAL_PATH)) - -################################################################################ -include $(CLEAR_VARS) - -LOCAL_SRC_FILES:= \ - VideoSpeedEffectTest.cpp - -LOCAL_SHARED_LIBRARIES := \ - libstagefright liblog libutils libcutils libbinder libstagefright_foundation - -LOCAL_SHARED_LIBRARIES += \ - libMtkVideoSpeedEffect \ - -LOCAL_C_INCLUDES:= \ - frameworks/av/media/libstagefright \ - $(TOP)/frameworks/native/include/media/openmax - -LOCAL_CFLAGS += -Wno-multichar - -LOCAL_MODULE_TAGS := optional - -LOCAL_MODULE:= VideoSpeedEffectTest -LOCAL_32_BIT_ONLY := true - -include $(BUILD_EXECUTABLE) - -################################################################################ - -include $(CLEAR_VARS) - -LOCAL_SRC_FILES:= \ - VideoParseInfoTest.cpp - -LOCAL_SHARED_LIBRARIES := \ - libstagefright liblog libutils libcutils libbinder libstagefright_foundation - -LOCAL_SHARED_LIBRARIES += \ - -LOCAL_C_INCLUDES:= \ - $(TOP)/frameworks/av/include \ - $(TOP)/frameworks/native/include \ - $(TOP)/frameworks/av/media/libstagefright \ - $(TOP)/frameworks/av/include/media/stagefright \ - -LOCAL_CFLAGS += -Wno-multichar - -LOCAL_MODULE_TAGS := optional - -LOCAL_MODULE:= VideoParseInfoTest -LOCAL_32_BIT_ONLY := true - -include $(BUILD_EXECUTABLE) - - -endif - - -endif diff --git a/proprietary/external/adpcmdec/Android.mk b/proprietary/external/adpcmdec/Android.mk deleted file mode 100755 index fc384163b8a3f92a8ff0264b546ed5887166fb75..0000000000000000000000000000000000000000 --- a/proprietary/external/adpcmdec/Android.mk +++ /dev/null @@ -1,60 +0,0 @@ -# Copyright Statement: -# -# This software/firmware and related documentation ("MediaTek Software") are -# protected under relevant copyright laws. The information contained herein -# is confidential and proprietary to MediaTek Inc. and/or its licensors. -# Without the prior written permission of MediaTek inc. and/or its licensors, -# any reproduction, modification, use or disclosure of MediaTek Software, -# and information contained herein, in whole or in part, shall be strictly prohibited. - -# MediaTek Inc. (C) 2010. All rights reserved. -# -# BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES -# THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE") -# RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER ON -# AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT. -# NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE -# SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR -# SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES TO LOOK ONLY TO SUCH -# THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. RECEIVER EXPRESSLY ACKNOWLEDGES -# THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES -# CONTAINED IN MEDIATEK SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK -# SOFTWARE RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR -# STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND -# CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE, -# AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE, -# OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY RECEIVER TO -# MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. -# -# The following software/firmware and/or related documentation ("MediaTek Software") -# have been modified by MediaTek Inc. All revisions are subject to any receiver's -# applicable license agreements with MediaTek Inc. - - -# -# Copyright (C) 2008 The Android Open Source Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -LOCAL_PATH := $(my-dir) -include $(CLEAR_VARS) - -LOCAL_MODULE := libadpcmdec_mtk -LOCAL_MODULE_CLASS := STATIC_LIBRARIES -LOCAL_SRC_FILES_32 := arm/libadpcmdec_mtk.a -LOCAL_SRC_FILES_64 := libadpcmdec_mtk.a -LOCAL_MODULE_SUFFIX := .a -LOCAL_MULTILIB := both -include $(BUILD_PREBUILT) diff --git a/proprietary/external/adpcmenc/Android.mk b/proprietary/external/adpcmenc/Android.mk deleted file mode 100755 index e4b0b46493925c66b74aac3468ef82ca738e94a7..0000000000000000000000000000000000000000 --- a/proprietary/external/adpcmenc/Android.mk +++ /dev/null @@ -1,60 +0,0 @@ -# Copyright Statement: -# -# This software/firmware and related documentation ("MediaTek Software") are -# protected under relevant copyright laws. The information contained herein -# is confidential and proprietary to MediaTek Inc. and/or its licensors. -# Without the prior written permission of MediaTek inc. and/or its licensors, -# any reproduction, modification, use or disclosure of MediaTek Software, -# and information contained herein, in whole or in part, shall be strictly prohibited. - -# MediaTek Inc. (C) 2010. All rights reserved. -# -# BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES -# THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE") -# RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER ON -# AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT. -# NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE -# SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR -# SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES TO LOOK ONLY TO SUCH -# THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. RECEIVER EXPRESSLY ACKNOWLEDGES -# THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES -# CONTAINED IN MEDIATEK SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK -# SOFTWARE RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR -# STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND -# CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE, -# AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE, -# OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY RECEIVER TO -# MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. -# -# The following software/firmware and/or related documentation ("MediaTek Software") -# have been modified by MediaTek Inc. All revisions are subject to any receiver's -# applicable license agreements with MediaTek Inc. - - -# -# Copyright (C) 2008 The Android Open Source Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -LOCAL_PATH := $(my-dir) -include $(CLEAR_VARS) - -LOCAL_MODULE := libadpcmenc_mtk -LOCAL_MODULE_CLASS := STATIC_LIBRARIES -LOCAL_SRC_FILES_32 := arm/libadpcmenc_mtk.a -LOCAL_SRC_FILES_64 := libadpcmenc_mtk.a -LOCAL_MODULE_SUFFIX := .a -LOCAL_MULTILIB := both -include $(BUILD_PREBUILT) diff --git a/proprietary/external/aee/binary/Android.mk b/proprietary/external/aee/binary/Android.mk deleted file mode 100755 index 2df564773eb77264752a90ae77456f087381bf87..0000000000000000000000000000000000000000 --- a/proprietary/external/aee/binary/Android.mk +++ /dev/null @@ -1,61 +0,0 @@ -# Copyright Statement: -# -# This software/firmware and related documentation ("MediaTek Software") are -# protected under relevant copyright laws. The information contained herein -# is confidential and proprietary to MediaTek Inc. and/or its licensors. -# Without the prior written permission of MediaTek inc. and/or its licensors, -# any reproduction, modification, use or disclosure of MediaTek Software, -# and information contained herein, in whole or in part, shall be strictly prohibited. -# -# MediaTek Inc. (C) 2010. All rights reserved. -# -# BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES -# THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE") -# RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER ON -# AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT. -# NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE -# SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR -# SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES TO LOOK ONLY TO SUCH -# THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. RECEIVER EXPRESSLY ACKNOWLEDGES -# THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES -# CONTAINED IN MEDIATEK SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK -# SOFTWARE RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR -# STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND -# CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE, -# AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE, -# OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY RECEIVER TO -# MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. -# -# The following software/firmware and/or related documentation ("MediaTek Software") -# have been modified by MediaTek Inc. All revisions are subject to any receiver's -# applicable license agreements with MediaTek Inc. - - -LOCAL_PATH:= $(call my-dir) - -ifeq ($(HAVE_AEE_FEATURE),yes) -include $(CLEAR_VARS) - -LOCAL_PREBUILT_EXECUTABLES := \ - bin/aee \ - bin/aee_core_forwarder \ - bin/aee_dumpstate \ - bin/rtt \ - bin/aee_archive -include $(BUILD_MULTI_PREBUILT) - -endif # HAVE_AEE_FEATURE=yes - - -include $(CLEAR_VARS) -LOCAL_MODULE := libaed -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_CLASS := SHARED_LIBRARIES -LOCAL_SRC_FILES_arm := lib/libaed.so -LOCAL_SRC_FILES_arm64 := lib64/libaed.so -LOCAL_MODULE_SUFFIX := .so -LOCAL_MULTILIB := both -LOCAL_SHARED_LIBRARIES := libz libselinux libmrdump -include $(BUILD_PREBUILT) diff --git a/proprietary/external/aee/direct-coredump/Android.mk b/proprietary/external/aee/direct-coredump/Android.mk deleted file mode 100755 index 86149deed014f568c53544230e3fc31eea5f8205..0000000000000000000000000000000000000000 --- a/proprietary/external/aee/direct-coredump/Android.mk +++ /dev/null @@ -1,11 +0,0 @@ -LOCAL_PATH := $(call my-dir) -include $(CLEAR_VARS) - -LOCAL_SRC_FILES := \ - direct-coredump.c - -LOCAL_SHARED_LIBRARIES := libcutils libdl - -LOCAL_MODULE := libdirect-coredump -LOCAL_MODULE_TAGS := optional -include $(BUILD_SHARED_LIBRARY) \ No newline at end of file diff --git a/proprietary/external/amr/Android.mk b/proprietary/external/amr/Android.mk deleted file mode 100755 index a71d0aae1a8608dcf89fe6cd9a41e993dc03f0a1..0000000000000000000000000000000000000000 --- a/proprietary/external/amr/Android.mk +++ /dev/null @@ -1,24 +0,0 @@ -# -# Copyright (C) 2008 The Android Open Source Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -LOCAL_PATH := $(my-dir) - -include $(CLEAR_VARS) -LOCAL_MODULE := libamr_mtk -LOCAL_MODULE_CLASS := STATIC_LIBRARIES -LOCAL_SRC_FILES_arm := libamr_mtk.a -LOCAL_MODULE_SUFFIX := .a -LOCAL_MULTILIB := 32 -include $(BUILD_PREBUILT) diff --git a/proprietary/external/ant-wireless/ANTHALService/Android.mk b/proprietary/external/ant-wireless/ANTHALService/Android.mk deleted file mode 100755 index 2169f06629db39ed4f29c9dfe7b5cd8fd567e027..0000000000000000000000000000000000000000 --- a/proprietary/external/ant-wireless/ANTHALService/Android.mk +++ /dev/null @@ -1,40 +0,0 @@ -# -# ANT Stack -# -# Copyright 2011 Dynastream Innovations -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -ifneq ($(BOARD_ANT_WIRELESS_DEVICE),) -LOCAL_PATH := $(call my-dir) -include $(CLEAR_VARS) - -# -# ANT java system service -# - -LOCAL_SRC_FILES := \ - $(call all-java-files-under, src) \ - src/com/dsi/ant/server/IAntHal.aidl \ - src/com/dsi/ant/server/IAntHalCallback.aidl - -LOCAL_REQUIRED_MODULES := libantradio -LOCAL_PROGUARD_FLAG_FILES := proguard.flags -LOCAL_CERTIFICATE := platform -LOCAL_MODULE_TAGS := optional -LOCAL_PACKAGE_NAME := AntHalService - -include $(BUILD_PACKAGE) - -endif # BOARD_ANT_WIRELESS_DEVICE defined diff --git a/proprietary/external/ant-wireless/antradio-library/Android.mk b/proprietary/external/ant-wireless/antradio-library/Android.mk deleted file mode 100755 index 33442f262d4bdfa6d56662438af41c22fefe25d2..0000000000000000000000000000000000000000 --- a/proprietary/external/ant-wireless/antradio-library/Android.mk +++ /dev/null @@ -1,33 +0,0 @@ -# -# Copyright (C) 2011 Dynastream Innovations inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -ifneq ($(BOARD_ANT_WIRELESS_DEVICE),) -LOCAL_PATH := $(call my-dir) -include $(CLEAR_VARS) - -# -# Dummy ANT java library -# - -LOCAL_SRC_FILES := \ - $(call all-subdir-java-files) - -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE:= com.dsi.ant.antradio_library - -include $(BUILD_JAVA_LIBRARY) - -endif # BOARD_ANT_WIRELESS_DEVICE defined diff --git a/proprietary/external/apedec/Android.mk b/proprietary/external/apedec/Android.mk deleted file mode 100755 index 87f827e04a1dc135e2a62ae231c82d1fa4aa8557..0000000000000000000000000000000000000000 --- a/proprietary/external/apedec/Android.mk +++ /dev/null @@ -1,20 +0,0 @@ -# -# Copyright (C) 2010 The Android Open Source Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - - -LOCAL_PATH := $(call my-dir) - -include $(all-subdir-makefiles) diff --git a/proprietary/external/apedec/arm_32/Android.mk b/proprietary/external/apedec/arm_32/Android.mk deleted file mode 100755 index 8d06fc4c18d023711f68c64005f670aa2ca2aede..0000000000000000000000000000000000000000 --- a/proprietary/external/apedec/arm_32/Android.mk +++ /dev/null @@ -1,33 +0,0 @@ -LOCAL_PATH := $(call my-dir) - -include $(CLEAR_VARS) -ifeq ($(proj), box_tv) -LOCAL_CFLAGS +=-D__ANDROID_BOX_TV__ -else -LOCAL_CFLAGS +=-D__ANDROID_SP_TABLET__ -endif - -LOCAL_SRC_FILES := \ - src/apedec_all.c \ - src/gnu_asm/ARMv6_aligned_dot_and_add_64.s\ - src/gnu_asm/ARMv6_aligned_dot_and_sub_64.s\ - src/gnu_asm/ARMv6_unaligned_dot_and_add_64.s\ - src/gnu_asm/ARMv6_unaligned_dot_and_sub_64.s\ - src/gnu_asm/ARMv6_dot_product.s\ - src/gnu_asm/ARMv6_predictor.s - -LOCAL_C_INCLUDES := $(LOCAL_PATH)/inc -LOCAL_CFLAGS += -D__arm__ -D__ANDROID__ -D'__inline=inline' -D'__int64=long long' -mcpu=arm1136j-s -O3 -D'STATIC_DECLARE=static' -DSTATIC_ENHANCE -D'EXTERN=static' -ifeq ($(symbol), scramble) -LOCAL_CFLAGS +=-D__SCRAMBLE_SYMBOL__ -endif -LOCAL_MODULE:= libapedec_mtk -LOCAL_MULTILIB := 32 -LOCAL_PRELINK_MODULE:=false -LOCAL_ARM_MODE:=arm -LOCAL_SHARED_LIBRARIES:=\ - libnativehelper \ - libcutils \ - libutils - -include $(BUILD_STATIC_LIBRARY) diff --git a/proprietary/external/apedec/arm_32/exe/Android.mk b/proprietary/external/apedec/arm_32/exe/Android.mk deleted file mode 100755 index c59afe0d043b596408a35fb1ec4ff19518fb1975..0000000000000000000000000000000000000000 --- a/proprietary/external/apedec/arm_32/exe/Android.mk +++ /dev/null @@ -1,33 +0,0 @@ -LOCAL_PATH := $(my-dir) - -include $(CLEAR_VARS) -ifeq ($(proj), box_tv) -LOCAL_STATIC_LIBRARIES += libdrvb_boxtv -PRODUCT_COPY_FILES += $(LOCAL_PATH)/../libdrvb_boxtv.a:obj/STATIC_LIBRARIES/libdrvb_intermediates/libdrvb_boxtv.a -LOCAL_CFLAGS +=-D__ANDROID_BOX_TV__ -else -LOCAL_STATIC_LIBRARIES += libapedec_mtk -LOCAL_STATIC_LIBRARIES += libdrvb -//PRODUCT_COPY_FILES += $(LOCAL_PATH)/../libdrvb.a:obj/STATIC_LIBRARIES/libdrvb_intermediates/libdrvb.a -LOCAL_CFLAGS +=-D__ANDROID_SP_TABLET__ -endif - -LOCAL_SRC_FILES := \ - ../demo/demac.c\ - ../demo/cue_parser.c\ - ../demo/libprofiler.c\ - ../demo/parser.c\ - ../demo/wavwrite.c - -LOCAL_C_INCLUDES := $(LOCAL_PATH)/../inc\ - $(LOCAL_PATH)/../demo - -LOCAL_CFLAGS += -D__arm__ -D__ANDROID__ -D'__inline=inline' -D'__int64=long long' -mcpu=arm1136j-s -O3 -D'STATIC_DECLARE=static' -DSTATIC_ENHANCE -D'EXTERN=static' -LOCAL_MODULE_TAGS:=user -LOCAL_MODULE := $(sp2_swip) -LOCAL_PRELINK_MODULE:=false -LOCAL_ARM_MODE:=arm - - - -include $(BUILD_EXECUTABLE) diff --git a/proprietary/external/apedec/arm_64/Android.mk b/proprietary/external/apedec/arm_64/Android.mk deleted file mode 100755 index 7862705035745c21e9eacab01bd720c7b06dbcc3..0000000000000000000000000000000000000000 --- a/proprietary/external/apedec/arm_64/Android.mk +++ /dev/null @@ -1,37 +0,0 @@ -LOCAL_PATH := $(call my-dir) -include $(CLEAR_VARS) - -LOCAL_SRC_FILES := \ - src/apedec_all.c \ - src/ape_decoder_swip.c - #src/apedec_all.c \ - #src/gnu_asm/ARMv6_aligned_dot_and_add_64.s\ - #src/gnu_asm/ARMv6_aligned_dot_and_sub_64.s\ - #src/gnu_asm/ARMv6_unaligned_dot_and_add_64.s\ - #src/gnu_asm/ARMv6_unaligned_dot_and_sub_64.s\ - #src/gnu_asm/ARMv6_dot_product.s\ - #src/gnu_asm/ARMv6_predictor.s - -LOCAL_C_INCLUDES := $(LOCAL_PATH)/inc \ - $(LOCAL_PATH)/src \ - $(LOCAL_PATH)/demo - -LOCAL_CFLAGS += -DARM -D__arm__ -D__ANDROID__ -D'__inline=inline' -D'__int64=long long' -D'STATIC_DECLARE=static' -DSTATIC_ENHANCE -D'EXTERN=static' - -ifeq ($(symbol), scramble) -LOCAL_CFLAGS +=-D__SCRAMBLE_SYMBOL__ -endif - -LOCAL_MODULE_PATH_32 := $(LOCAL_PATH)/out32/ -LOCAL_MODULE_PATH_64 := $(LOCAL_PATH)/out64/ - -#LOCAL_MODULE_TAGS:=user -LOCAL_MODULE := libapedec_mtk -LOCAL_PRELINK_MODULE:=false -LOCAL_ARM_MODE:=arm -LOCAL_SHARED_LIBRARIES:=\ - libnativehelper \ - libcutils \ - libutils -LOCAL_MULTILIB := 64 -include $(BUILD_STATIC_LIBRARY) diff --git a/proprietary/external/apedec/arm_64/exe/Android.mk b/proprietary/external/apedec/arm_64/exe/Android.mk deleted file mode 100755 index c59afe0d043b596408a35fb1ec4ff19518fb1975..0000000000000000000000000000000000000000 --- a/proprietary/external/apedec/arm_64/exe/Android.mk +++ /dev/null @@ -1,33 +0,0 @@ -LOCAL_PATH := $(my-dir) - -include $(CLEAR_VARS) -ifeq ($(proj), box_tv) -LOCAL_STATIC_LIBRARIES += libdrvb_boxtv -PRODUCT_COPY_FILES += $(LOCAL_PATH)/../libdrvb_boxtv.a:obj/STATIC_LIBRARIES/libdrvb_intermediates/libdrvb_boxtv.a -LOCAL_CFLAGS +=-D__ANDROID_BOX_TV__ -else -LOCAL_STATIC_LIBRARIES += libapedec_mtk -LOCAL_STATIC_LIBRARIES += libdrvb -//PRODUCT_COPY_FILES += $(LOCAL_PATH)/../libdrvb.a:obj/STATIC_LIBRARIES/libdrvb_intermediates/libdrvb.a -LOCAL_CFLAGS +=-D__ANDROID_SP_TABLET__ -endif - -LOCAL_SRC_FILES := \ - ../demo/demac.c\ - ../demo/cue_parser.c\ - ../demo/libprofiler.c\ - ../demo/parser.c\ - ../demo/wavwrite.c - -LOCAL_C_INCLUDES := $(LOCAL_PATH)/../inc\ - $(LOCAL_PATH)/../demo - -LOCAL_CFLAGS += -D__arm__ -D__ANDROID__ -D'__inline=inline' -D'__int64=long long' -mcpu=arm1136j-s -O3 -D'STATIC_DECLARE=static' -DSTATIC_ENHANCE -D'EXTERN=static' -LOCAL_MODULE_TAGS:=user -LOCAL_MODULE := $(sp2_swip) -LOCAL_PRELINK_MODULE:=false -LOCAL_ARM_MODE:=arm - - - -include $(BUILD_EXECUTABLE) diff --git a/proprietary/external/atvctrlservice/Android.mk b/proprietary/external/atvctrlservice/Android.mk deleted file mode 100755 index 4a267724f341fdf71678156199de3c64af20be18..0000000000000000000000000000000000000000 --- a/proprietary/external/atvctrlservice/Android.mk +++ /dev/null @@ -1,73 +0,0 @@ -# Copyright Statement: -# -# This software/firmware and related documentation ("MediaTek Software") are -# protected under relevant copyright laws. The information contained herein -# is confidential and proprietary to MediaTek Inc. and/or its licensors. -# Without the prior written permission of MediaTek inc. and/or its licensors, -# any reproduction, modification, use or disclosure of MediaTek Software, -# and information contained herein, in whole or in part, shall be strictly prohibited. - -# MediaTek Inc. (C) 2010. All rights reserved. -# -# BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES -# THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE") -# RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER ON -# AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT. -# NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE -# SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR -# SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES TO LOOK ONLY TO SUCH -# THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. RECEIVER EXPRESSLY ACKNOWLEDGES -# THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES -# CONTAINED IN MEDIATEK SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK -# SOFTWARE RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR -# STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND -# CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE, -# AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE, -# OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY RECEIVER TO -# MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. -# -# The following software/firmware and/or related documentation ("MediaTek Software") -# have been modified by MediaTek Inc. All revisions are subject to any receiver's -# applicable license agreements with MediaTek Inc. - -ifneq ($(TARGET_BUILD_PDK),true) - -LOCAL_PATH:= $(call my-dir) - -## ==> build this lib only when HAVE_MATV_FEATURE is yes -#ifeq ($(HAVE_MATV_FEATURE),yes) - -include $(CLEAR_VARS) - - -LOCAL_SRC_FILES:= \ - ATVCtrlService.cpp - -LOCAL_SHARED_LIBRARIES := \ - libcutils \ - libutils \ - libbinder \ - libmedia \ - libhardware \ - libaudiosetting \ - libmatv_cust - - -LOCAL_PRELINK_MODULE := false -LOCAL_MODULE:= libatvctrlservice - -LOCAL_C_INCLUDES:= \ - $(TOP)/$(MTK_PATH_SOURCE)/frameworks-ext/av/include \ - $(TOP)/$(MTK_PATH_SOURCE)/frameworks/av/media/libs \ - $(TOP)/$(MTK_ROOT)/external/matv/matvctrl - -# LOCAL_CFLAGS:= -D$(MTK_FM_CHIP) - -include $(BUILD_SHARED_LIBRARY) - -#endif -## <== build this lib only when HAVE_MATV_FEATURE is yes - -endif diff --git a/proprietary/external/audiocommand/Android.mk b/proprietary/external/audiocommand/Android.mk deleted file mode 100755 index 06be981e74440eba5d73e57c27188c5d2f67f836..0000000000000000000000000000000000000000 --- a/proprietary/external/audiocommand/Android.mk +++ /dev/null @@ -1,44 +0,0 @@ -ifeq ($(TARGET_BUILD_PDK),) -ifneq ($(strip $(MTK_PLATFORM)),) -LOCAL_PATH:= $(call my-dir) - -include $(CLEAR_VARS) -LOCAL_MODULE_TAGS := eng - -ifeq ($(findstring MTK_AOSP_ENHANCEMENT, $(COMMON_GLOBAL_CPPFLAGS)),) - LOCAL_CFLAGS += -DMTK_BASIC_PACKAGE -endif - -LOCAL_SRC_FILES:= \ - audiocommand.cpp - -LOCAL_C_INCLUDES= \ - $(MTK_PATH_SOURCE)/frameworks/base/include/media \ - external/tinyalsa/include - - -LOCAL_C_INCLUDES+= \ - $(MTK_PATH_SOURCE)/platform/common/hardware/audio/include - -LOCAL_SHARED_LIBRARIES := libcutils libutils libbinder libmedia libaudioflinger libtinyalsa - -#LOCAL_SHARED_LIBRARIES += libaudio.primary.default - -ifeq ($(HAVE_AEE_FEATURE),yes) - LOCAL_SHARED_LIBRARIES += libaed - LOCAL_C_INCLUDES += \ - $(MTK_PATH_SOURCE)/external/aee/binary/inc - LOCAL_CFLAGS += -DHAVE_AEE_FEATURE -endif -ifeq ($(MTK_AUDIO),yes) -LOCAL_C_INCLUDES+= \ - $(TOP)/$(MTK_PATH_SOURCE)/hardware/audio/common/include -endif - -LOCAL_MODULE:= audiocommand - -LOCAL_MULTILIB := 32 - -include $(BUILD_EXECUTABLE) -endif -endif #ifeq ($(TARGET_BUILD_PDK),) diff --git a/proprietary/external/audiocustparam/Android.mk b/proprietary/external/audiocustparam/Android.mk deleted file mode 100755 index f3d26f8e84e816cd52ab951e83039668c28c5b99..0000000000000000000000000000000000000000 --- a/proprietary/external/audiocustparam/Android.mk +++ /dev/null @@ -1,188 +0,0 @@ -LOCAL_PATH := $(my-dir) -include $(CLEAR_VARS) - -LOCAL_MODULE_TAGS := optional - -ifeq ($(findstring MTK_AOSP_ENHANCEMENT, $(COMMON_GLOBAL_CPPFLAGS)),) - LOCAL_CFLAGS += -DMTK_BASIC_PACKAGE -endif - -LOCAL_C_INCLUDES:= \ - $(MTK_PATH_SOURCE)/external/nvram/libnvram \ - $(MTK_PATH_CUSTOM)/hal/audioflinger/audio \ - $(MTK_PATH_CUSTOM)/cgen/inc \ - $(MTK_PATH_CUSTOM)/cgen/cfgfileinc \ - $(MTK_PATH_CUSTOM)/cgen/cfgdefault - -LOCAL_SRC_FILES := \ - AudioCustParam.cpp - -LOCAL_SHARED_LIBRARIES := \ - libcutils \ - libutils \ - libnvram \ - libcustom_nvram -# Speaker Monitor -ifeq ($(MTK_SPEAKER_MONITOR_SUPPORT),yes) -LOCAL_CFLAGS += -DMTK_SPEAKER_MONITOR_SUPPORT -endif -# Speaker Monitor - -# Audio HD Record -ifeq ($(MTK_AUDIO_HD_REC_SUPPORT),yes) -LOCAL_CFLAGS += -DMTK_AUDIO_HD_REC_SUPPORT -endif -# Audio HD Record - -# Wearable support -ifeq ($(strip $(MTK_WEARABLE_PLATFORM )),yes) - LOCAL_CFLAGS += -DMTK_WEARABLE_PLATFORM -endif - - -# Dual Mic Support -ifeq ($(MTK_DUAL_MIC_SUPPORT),yes) -LOCAL_CFLAGS += -DMTK_DUAL_MIC_SUPPORT -endif -# Dual Mic Support - -# DMNR3.0 Support -ifeq ($(MTK_HANDSFREE_DMNR_SUPPORT),yes) -LOCAL_CFLAGS += -DMTK_HANDSFREE_DMNR_SUPPORT -endif -# DMNR3.0 Support - -# VOIP enhance Support -ifeq ($(MTK_VOIP_ENHANCEMENT_SUPPORT),yes) -LOCAL_CFLAGS += -DMTK_VOIP_ENHANCEMENT_SUPPORT -endif -# VOIP enhance Support - -# Automatic Speech Recognition Support -ifeq ($(MTK_ASR_SUPPORT),yes) -LOCAL_CFLAGS += -DMTK_ASR_SUPPORT -endif -# Automatic Speech Recognition Support - -# VoIP normal mode DMNR Support -ifeq ($(MTK_VOIP_NORMAL_DMNR),yes) -LOCAL_CFLAGS += -DMTK_VOIP_NORMAL_DMNR -endif -# VoIP normal mode DMNR Support - -# VoIP handsfree mode DMNR Support -ifeq ($(MTK_VOIP_HANDSFREE_DMNR),yes) -LOCAL_CFLAGS += -DMTK_VOIP_HANDSFREE_DMNR -endif -# VoIP handsfree mode DMNR Support - -# Incall handsfree mode DMNR Support -ifeq ($(MTK_INCALL_HANDSFREE_DMNR),yes) -LOCAL_CFLAGS += -DMTK_INCALL_HANDSFREE_DMNR -endif -# Incall handsfree mode DMNR Support - -# Incall normal mode DMNR Support -ifneq ($(MTK_INCALL_NORMAL_DMNR),no) -LOCAL_CFLAGS += -DMTK_INCALL_NORMAL_DMNR -endif -# Incall normal mode DMNR Support - -# wifi only -ifeq ($(MTK_TB_WIFI_3G_MODE),WIFI_ONLY) - LOCAL_CFLAGS += -DMTK_WIFI_ONLY_SUPPORT -endif -# wifi only - -# 3g data -ifeq ($(MTK_TB_WIFI_3G_MODE),3GDATA_SMS) - LOCAL_CFLAGS += -DMTK_3G_DATA_ONLY_SUPPORT -endif - -ifeq ($(MTK_TB_WIFI_3G_MODE),3GDATA_ONLY) - LOCAL_CFLAGS += -DMTK_3G_DATA_ONLY_SUPPORT -endif -# 3g data - -# check if there is receiver -ifeq ($(DISABLE_EARPIECE),yes) - LOCAL_CFLAGS += -DMTK_DISABLE_EARPIECE -endif -# check if there is receiver - -# WB Speech Support -ifeq ($(MTK_WB_SPEECH_SUPPORT),yes) - LOCAL_CFLAGS += -DMTK_WB_SPEECH_SUPPORT -endif -#WB Speech Support - -# DMNR tuning at modem side -ifeq ($(DMNR_TUNNING_AT_MODEMSIDE),yes) - LOCAL_CFLAGS += -DDMNR_TUNNING_AT_MODEMSIDE -endif -# DMNR tuning at modem side - -# Voice Unlock -ifeq ($(MTK_VOICE_UNLOCK_SUPPORT),yes) - LOCAL_CFLAGS += -DMTK_VOICE_UNLOCK_SUPPORT -endif -# Voice Unlock - -# Voice UI -ifeq ($(MTK_VOICE_UI_SUPPORT),yes) - LOCAL_CFLAGS += -DMTK_VOICE_UI_SUPPORT -endif -# Voice UI - -# DMNR 2.5 complex arch -#ifeq ($(DMNR_COMPLEX_ARCH_SUPPORT),yes) - LOCAL_CFLAGS += -DDMNR_COMPLEX_ARCH_SUPPORT -#endif -# DMNR 2.5 complex arch - -# Magic Conference Support -ifeq ($(MTK_MAGICONFERENCE_SUPPORT),yes) -LOCAL_CFLAGS += -DMTK_MAGICONFERENCE_SUPPORT -endif -# Magic Conference Support - -# HAC Support -ifeq ($(MTK_HAC_SUPPORT),yes) -LOCAL_CFLAGS += -DMTK_HAC_SUPPORT -endif -# HAC Support - -# TC1 Gain Table Support -ifeq ($(MTK_SUPPORT_TC1_TUNNING),yes) - LOCAL_CFLAGS += -DMTK_AUDIO_GAIN_TABLE -endif -# TC1 Gain Table Support - -# MTK Audio Tuning Tool Version -ifneq ($(MTK_AUDIO_TUNING_TOOL_VERSION),) - ifneq ($(strip $(MTK_AUDIO_TUNING_TOOL_VERSION)),V1) - MTK_AUDIO_TUNING_TOOL_V2_PHASE:=$(shell echo $(MTK_AUDIO_TUNING_TOOL_VERSION) | sed 's/V2.//g') - LOCAL_CFLAGS += -DMTK_AUDIO_HIERARCHICAL_PARAM_SUPPORT - LOCAL_CFLAGS += -DMTK_AUDIO_TUNING_TOOL_V2_PHASE=$(MTK_AUDIO_TUNING_TOOL_V2_PHASE) - endif -endif - -ifeq ($(MTK_AUDIO_BLOUD_CUSTOMPARAMETER_REV),MTK_AUDIO_BLOUD_CUSTOMPARAMETER_V5) - LOCAL_CFLAGS += -DMTK_AUDIO_BLOUD_CUSTOMPARAMETER_V5 -else - ifeq ($(strip $(MTK_AUDIO_BLOUD_CUSTOMPARAMETER_REV)),MTK_AUDIO_BLOUD_CUSTOMPARAMETER_V4) - LOCAL_CFLAGS += -DMTK_AUDIO_BLOUD_CUSTOMPARAMETER_V4 - endif -endif - -LOCAL_MODULE := libaudiocustparam - -#ifeq ($(MTK_AUDIO_A64_SUPPORT),yes) -#LOCAL_MULTILIB := both -#else -#LOCAL_MULTILIB := 32 -#endif - -LOCAL_ARM_MODE := arm - -include $(BUILD_SHARED_LIBRARY) diff --git a/proprietary/external/audiodcremoveflt/Android.mk b/proprietary/external/audiodcremoveflt/Android.mk deleted file mode 100755 index 46de841abd4ab60fed0847139b677ca76a4a56d5..0000000000000000000000000000000000000000 --- a/proprietary/external/audiodcremoveflt/Android.mk +++ /dev/null @@ -1,70 +0,0 @@ -# Copyright Statement: -# -# This software/firmware and related documentation ("MediaTek Software") are -# protected under relevant copyright laws. The information contained herein -# is confidential and proprietary to MediaTek Inc. and/or its licensors. -# Without the prior written permission of MediaTek inc. and/or its licensors, -# any reproduction, modification, use or disclosure of MediaTek Software, -# and information contained herein, in whole or in part, shall be strictly prohibited. - -# MediaTek Inc. (C) 2010. All rights reserved. -# -# BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES -# THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE") -# RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER ON -# AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT. -# NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE -# SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR -# SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES TO LOOK ONLY TO SUCH -# THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. RECEIVER EXPRESSLY ACKNOWLEDGES -# THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES -# CONTAINED IN MEDIATEK SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK -# SOFTWARE RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR -# STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND -# CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE, -# AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE, -# OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY RECEIVER TO -# MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. -# -# The following software/firmware and/or related documentation ("MediaTek Software") -# have been modified by MediaTek Inc. All revisions are subject to any receiver's -# applicable license agreements with MediaTek Inc. - - -# -# Copyright (C) 2008 The Android Open Source Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -LOCAL_PATH := $(my-dir) - -include $(CLEAR_VARS) -#LOCAL_PREBUILT_LIBS := libaudiodcrflt.so -#LOCAL_MODULE_TAGS := optional -#include $(BUILD_MULTI_PREBUILT) -LOCAL_MODULE := libaudiodcrflt -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_CLASS := SHARED_LIBRARIES -LOCAL_SRC_FILES_arm := libaudiodcrflt.so -LOCAL_MODULE_SUFFIX := .so -#ifeq ($(MTK_AUDIO_A64_SUPPORT),yes)# -LOCAL_SRC_FILES_arm64 := lib64audiodcrflt.so -LOCAL_MULTILIB := both -#else# -#LOCAL_MULTILIB := 32# -#endif# -include $(BUILD_PREBUILT) - - diff --git a/proprietary/external/audioregsetting/Android.mk b/proprietary/external/audioregsetting/Android.mk deleted file mode 100755 index a0d9671fa48aaf9343f1b9fc7cdff6940b12bbdb..0000000000000000000000000000000000000000 --- a/proprietary/external/audioregsetting/Android.mk +++ /dev/null @@ -1,23 +0,0 @@ -ifneq ($(strip $(MTK_PLATFORM)),) - -LOCAL_PATH:= $(call my-dir) - -include $(CLEAR_VARS) -LOCAL_MODULE_TAGS := eng - -LOCAL_SRC_FILES:= \ - audioregsetting.cpp - -LOCAL_C_INCLUDES= \ - $(MTK_PATH_SOURCE)/frameworks/av/include/media \ - $(TOP)/frameworks/av/include/media - -LOCAL_SHARED_LIBRARIES := libcutils libutils libbinder libmedia libaudioflinger - -LOCAL_MODULE:= audioregsetting - -LOCAL_MULTILIB := 32 - -include $(BUILD_EXECUTABLE) - -endif diff --git a/proprietary/external/audiosetting/Android.mk b/proprietary/external/audiosetting/Android.mk deleted file mode 100755 index 5baa43b0b7603544ae93751a085440e3c935cb01..0000000000000000000000000000000000000000 --- a/proprietary/external/audiosetting/Android.mk +++ /dev/null @@ -1,61 +0,0 @@ -# Copyright Statement: -# -# This software/firmware and related documentation ("MediaTek Software") are -# protected under relevant copyright laws. The information contained herein -# is confidential and proprietary to MediaTek Inc. and/or its licensors. -# Without the prior written permission of MediaTek inc. and/or its licensors, -# any reproduction, modification, use or disclosure of MediaTek Software, -# and information contained herein, in whole or in part, shall be strictly prohibited. - -# MediaTek Inc. (C) 2010. All rights reserved. -# -# BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES -# THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE") -# RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER ON -# AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT. -# NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE -# SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR -# SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES TO LOOK ONLY TO SUCH -# THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. RECEIVER EXPRESSLY ACKNOWLEDGES -# THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES -# CONTAINED IN MEDIATEK SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK -# SOFTWARE RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR -# STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND -# CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE, -# AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE, -# OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY RECEIVER TO -# MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. -# -# The following software/firmware and/or related documentation ("MediaTek Software") -# have been modified by MediaTek Inc. All revisions are subject to any receiver's -# applicable license agreements with MediaTek Inc. - -LOCAL_PATH := $(my-dir) - - -include $(CLEAR_VARS) - -LOCAL_SRC_FILES += \ - audiosetting.cpp - -LOCAL_MODULE := libaudiosetting - -LOCAL_SHARED_LIBRARIES := \ - libnativehelper \ - libcutils \ - libutils - -LOCAL_STATIC_LIBRARIES += - -LOCAL_C_INCLUDES := \ - $(TOP)/frameworks/base/include/media - -#ifeq ($(MTK_AUDIO_A64_SUPPORT),yes) -#LOCAL_MULTILIB := both -#else -#LOCAL_MULTILIB := 32 -#endif - -include $(BUILD_SHARED_LIBRARY) diff --git a/proprietary/external/awb/Android.mk b/proprietary/external/awb/Android.mk deleted file mode 100755 index 6ef0fdea0fefaa480a9208e59e06606141a96139..0000000000000000000000000000000000000000 --- a/proprietary/external/awb/Android.mk +++ /dev/null @@ -1,24 +0,0 @@ -# -# Copyright (C) 2008 The Android Open Source Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -LOCAL_PATH := $(my-dir) - -include $(CLEAR_VARS) -LOCAL_MODULE := libawb_mtk -LOCAL_MODULE_CLASS := STATIC_LIBRARIES -LOCAL_SRC_FILES_arm := libawb_mtk.a -LOCAL_MODULE_SUFFIX := .a -LOCAL_MULTILIB := 32 -include $(BUILD_PREBUILT) diff --git a/proprietary/external/bessound_HD/Android.mk b/proprietary/external/bessound_HD/Android.mk deleted file mode 100755 index c27a177c642d30f38773846fa15295b0206296bd..0000000000000000000000000000000000000000 --- a/proprietary/external/bessound_HD/Android.mk +++ /dev/null @@ -1,31 +0,0 @@ -# -# Copyright (C) 2008 The Android Open Source Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -LOCAL_PATH := $(my-dir) - -include $(CLEAR_VARS) - -LOCAL_MODULE := libbessound_hd_mtk -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_CLASS := SHARED_LIBRARIES -LOCAL_SRC_FILES_arm := libbessound_hd_mtk.so -LOCAL_MODULE_SUFFIX := .so -#ifeq ($(MTK_AUDIO_A64_SUPPORT),yes) -LOCAL_SRC_FILES_arm64 := lib64bessound_hd_mtk.so -LOCAL_MULTILIB := both -#else -#LOCAL_MULTILIB := 32 -#endif -include $(BUILD_PREBUILT) diff --git a/proprietary/external/bessurround_mtk/Android.mk b/proprietary/external/bessurround_mtk/Android.mk deleted file mode 100755 index 0834063b6411bc3dc62c30b0888feda3ec3106c1..0000000000000000000000000000000000000000 --- a/proprietary/external/bessurround_mtk/Android.mk +++ /dev/null @@ -1,31 +0,0 @@ -# -# Copyright (C) 2008 The Android Open Source Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -LOCAL_PATH := $(my-dir) - - -include $(CLEAR_VARS) - -LOCAL_MODULE := libbessurround_mtk -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_CLASS := SHARED_LIBRARIES -LOCAL_SRC_FILES_arm := libbessurround_mtk.so -LOCAL_MODULE_SUFFIX := .so -#ifeq ($(MTK_AUDIO_A64_SUPPORT),yes) -LOCAL_SRC_FILES_arm64 := lib64bessurround_mtk.so -LOCAL_MULTILIB := both -#else -#LOCAL_MULTILIB := 32 -#endif -include $(BUILD_PREBUILT) diff --git a/proprietary/external/blisrc/Android.mk b/proprietary/external/blisrc/Android.mk deleted file mode 100755 index 6f84c219ec2012bfec3d6537e7db021541f19fe5..0000000000000000000000000000000000000000 --- a/proprietary/external/blisrc/Android.mk +++ /dev/null @@ -1,70 +0,0 @@ -# Copyright Statement: -# -# This software/firmware and related documentation ("MediaTek Software") are -# protected under relevant copyright laws. The information contained herein -# is confidential and proprietary to MediaTek Inc. and/or its licensors. -# Without the prior written permission of MediaTek inc. and/or its licensors, -# any reproduction, modification, use or disclosure of MediaTek Software, -# and information contained herein, in whole or in part, shall be strictly prohibited. - -# MediaTek Inc. (C) 2010. All rights reserved. -# -# BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES -# THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE") -# RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER ON -# AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT. -# NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE -# SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR -# SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES TO LOOK ONLY TO SUCH -# THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. RECEIVER EXPRESSLY ACKNOWLEDGES -# THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES -# CONTAINED IN MEDIATEK SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK -# SOFTWARE RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR -# STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND -# CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE, -# AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE, -# OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY RECEIVER TO -# MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. -# -# The following software/firmware and/or related documentation ("MediaTek Software") -# have been modified by MediaTek Inc. All revisions are subject to any receiver's -# applicable license agreements with MediaTek Inc. - - -# -# Copyright (C) 2008 The Android Open Source Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -LOCAL_PATH := $(my-dir) - -include $(CLEAR_VARS) -LOCAL_MODULE := libblisrc -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_CLASS := SHARED_LIBRARIES -LOCAL_SRC_FILES_arm := blisrc16/libblisrc.so -LOCAL_MODULE_SUFFIX := .so -LOCAL_SRC_FILES_arm64 := blisrc16/lib64blisrc.so -LOCAL_MULTILIB := both -include $(BUILD_PREBUILT) -include $(CLEAR_VARS) -LOCAL_MODULE := libblisrc32 -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_CLASS := SHARED_LIBRARIES -LOCAL_SRC_FILES_arm := blisrc32/libblisrc32.so -LOCAL_MODULE_SUFFIX := .so -LOCAL_SRC_FILES_arm64 := blisrc32/lib64blisrc32.so -LOCAL_MULTILIB := both -include $(BUILD_PREBUILT) diff --git a/proprietary/external/bluetooth/Android.mk b/proprietary/external/bluetooth/Android.mk deleted file mode 100755 index a6cdd44d5a551863df0eb1009f8b4d8ed5373a61..0000000000000000000000000000000000000000 --- a/proprietary/external/bluetooth/Android.mk +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright Statement: -# -# This software/firmware and related documentation ("MediaTek Software") are -# protected under relevant copyright laws. The information contained herein -# is confidential and proprietary to MediaTek Inc. and/or its licensors. -# Without the prior written permission of MediaTek inc. and/or its licensors, -# any reproduction, modification, use or disclosure of MediaTek Software, -# and information contained herein, in whole or in part, shall be strictly prohibited. - -# MediaTek Inc. (C) 2010. All rights reserved. -# -# BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES -# THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE") -# RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER ON -# AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT. -# NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE -# SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR -# SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES TO LOOK ONLY TO SUCH -# THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. RECEIVER EXPRESSLY ACKNOWLEDGES -# THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES -# CONTAINED IN MEDIATEK SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK -# SOFTWARE RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR -# STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND -# CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE, -# AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE, -# OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY RECEIVER TO -# MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. -# -# The following software/firmware and/or related documentation ("MediaTek Software") -# have been modified by MediaTek Inc. All revisions are subject to any receiver's -# applicable license agreements with MediaTek Inc. - -include $(call all-subdir-makefiles) diff --git a/proprietary/external/bluetooth/bt_cust/Android.mk b/proprietary/external/bluetooth/bt_cust/Android.mk deleted file mode 100755 index 1e09f52c827ffdefb00774e632bfa2ac60dfe406..0000000000000000000000000000000000000000 --- a/proprietary/external/bluetooth/bt_cust/Android.mk +++ /dev/null @@ -1,101 +0,0 @@ -# Copyright Statement: -# -# This software/firmware and related documentation ("MediaTek Software") are -# protected under relevant copyright laws. The information contained herein -# is confidential and proprietary to MediaTek Inc. and/or its licensors. -# Without the prior written permission of MediaTek inc. and/or its licensors, -# any reproduction, modification, use or disclosure of MediaTek Software, -# and information contained herein, in whole or in part, shall be strictly prohibited. -# -# MediaTek Inc. (C) 2010. All rights reserved. -# -# BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES -# THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE") -# RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER ON -# AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT. -# NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE -# SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR -# SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES TO LOOK ONLY TO SUCH -# THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. RECEIVER EXPRESSLY ACKNOWLEDGES -# THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES -# CONTAINED IN MEDIATEK SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK -# SOFTWARE RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR -# STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND -# CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE, -# AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE, -# OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY RECEIVER TO -# MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. -# -# The following software/firmware and/or related documentation ("MediaTek Software") -# have been modified by MediaTek Inc. All revisions are subject to any receiver's -# applicable license agreements with MediaTek Inc. - -################################################ -# build libbtcusttable start -################################################ -LOCAL_PATH := $(call my-dir) - -include $(CLEAR_VARS) - -LOCAL_SHARED_LIBRARIES := libcutils - -LOCAL_SRC_FILES := \ - bt_cust.c \ - -LOCAL_C_INCLUDES := \ - $(LOCAL_PATH)/inc - -ifeq ($(MTK_BT_30_HS_SUPPORT), yes) -LOCAL_CFLAGS += \ - -D__BT_3_0_HS__ -endif - -ifeq ($(MTK_BT_40_SUPPORT),yes) -LOCAL_CFLAGS += \ - -D__BT_4_0_BLE__ -endif - -ifeq ($(MTK_TC1_FEATURE),yes) -LOCAL_CFLAGS += -D__BT_USE_CUST_TC1__ -endif - -ifeq ($(MTK_BT_CHIP),MTK_MT6620) -else ifeq ($(MTK_BT_CHIP),MTK_MT6628) -else ifeq ($(MTK_BT_CHIP),MTK_CONSYS_MT6572) -else ifeq ($(MTK_BT_CHIP),MTK_CONSYS_MT6582) -else -LOCAL_CFLAGS += \ - -D__USE_CUST_INT_WIN__ -endif - -ifeq ($(MTK_WEARABLE_PLATFORM),yes) -LOCAL_CFLAGS += -D__BT_WEARABLE_SETTINGS__ -endif - - -#LOCAL_MODULE_TAGS := user - - -LOCAL_MODULE := libbtcusttable - -LOCAL_PRELINK_MODULE:= false -include $(BUILD_SHARED_LIBRARY) - -include $(CLEAR_VARS) -LOCAL_MODULE := auto_pair_blacklist.conf -LOCAL_MODULE_CLASS := ETC -LOCAL_MODULE_PATH := $(TARGET_OUT)/etc/bluetooth -LOCAL_MODULE_TAGS := optional -LOCAL_SRC_FILES := $(LOCAL_MODULE) -include $(BUILD_PREBUILT) - -include $(CLEAR_VARS) -LOCAL_MODULE := btconfig.xml -LOCAL_MODULE_CLASS := ETC -LOCAL_MODULE_PATH := $(TARGET_OUT)/etc/bluetooth -LOCAL_MODULE_TAGS := optional -LOCAL_SRC_FILES := $(LOCAL_MODULE) -include $(BUILD_PREBUILT) - diff --git a/proprietary/external/bluetooth/bt_cust_tc1/Android.mk b/proprietary/external/bluetooth/bt_cust_tc1/Android.mk deleted file mode 100755 index 4fbc89a83dce1d1594b358fc1b9768d75af74463..0000000000000000000000000000000000000000 --- a/proprietary/external/bluetooth/bt_cust_tc1/Android.mk +++ /dev/null @@ -1,63 +0,0 @@ -# Copyright Statement: -# -# This software/firmware and related documentation ("MediaTek Software") are -# protected under relevant copyright laws. The information contained herein -# is confidential and proprietary to MediaTek Inc. and/or its licensors. -# Without the prior written permission of MediaTek inc. and/or its licensors, -# any reproduction, modification, use or disclosure of MediaTek Software, -# and information contained herein, in whole or in part, shall be strictly prohibited. -# -# MediaTek Inc. (C) 2010. All rights reserved. -# -# BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES -# THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE") -# RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER ON -# AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT. -# NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE -# SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR -# SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES TO LOOK ONLY TO SUCH -# THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. RECEIVER EXPRESSLY ACKNOWLEDGES -# THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES -# CONTAINED IN MEDIATEK SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK -# SOFTWARE RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR -# STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND -# CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE, -# AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE, -# OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY RECEIVER TO -# MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. -# -# The following software/firmware and/or related documentation ("MediaTek Software") -# have been modified by MediaTek Inc. All revisions are subject to any receiver's -# applicable license agreements with MediaTek Inc. - -################################################ -# build BT cust tc1 lib start -################################################ - -LOCAL_PATH := $(call my-dir) -include $(CLEAR_VARS) - -LOCAL_SRC_FILES := \ - bt_cust_tc1.c \ - -ifeq ($(MTK_TC1_FEATURE),yes) -LOCAL_SHARED_LIBRARIES += libtc1part -endif - -ifeq ($(MTK_TC1_FEATURE),yes) -ifeq ($(MTK_GPT_SCHEME_SUPPORT), yes) -LOCAL_C_INCLUDES += \ - $(MTK_PATH_SOURCE)/external/tc1_interface/gpt -else -LOCAL_C_INCLUDES += \ - $(MTK_PATH_SOURCE)/external/tc1_interface/pmt -endif -endif - -LOCAL_MODULE := libbtcusttc1 - -LOCAL_PRELINK_MODULE:= false -include $(BUILD_SHARED_LIBRARY) - diff --git a/proprietary/external/bluetooth/sbc/Android.mk b/proprietary/external/bluetooth/sbc/Android.mk deleted file mode 100755 index 0f564b6b45e7772bce72f0a57087bede8812b0c0..0000000000000000000000000000000000000000 --- a/proprietary/external/bluetooth/sbc/Android.mk +++ /dev/null @@ -1,9 +0,0 @@ -LOCAL_PATH := $(call my-dir) -include $(CLEAR_VARS) -LOCAL_MODULE := libsbccodec -LOCAL_SRC_FILES := libsbccodec.so -LOCAL_MULTILIB := 32 -#LOCAL_SHARED_LIBRARIES := -LOCAL_MODULE_CLASS := SHARED_LIBRARIES -LOCAL_MODULE_SUFFIX := .so -include $(BUILD_PREBUILT) diff --git a/proprietary/external/ccci_lib/Android.mk b/proprietary/external/ccci_lib/Android.mk deleted file mode 100755 index 210c40a1801d5533732d33e7917ad6c1fbbb7afe..0000000000000000000000000000000000000000 --- a/proprietary/external/ccci_lib/Android.mk +++ /dev/null @@ -1,21 +0,0 @@ -LOCAL_PATH := $(call my-dir) - -include $(CLEAR_VARS) - -LOCAL_SRC_FILES := ccci_lib.c - -LOCAL_STATIC_LIBRARIES := libcutils liblog - -LOCAL_C_INCLUDES := \ - $(MTK_PATH_SOURCE)/external/nvram/libnvram \ - $(MTK_PATH_SOURCE)/hardware/ccci/include - -LOCAL_SHARED_LIBRARIES := libc - -LOCAL_MODULE := libccci_util -LOCAL_MULTILIB := both - -LOCAL_MODULE_TAGS := optional -LOCAL_PRELINK_MODULE:=false - -include $(BUILD_SHARED_LIBRARY) diff --git a/proprietary/external/cvsd_plc_codec/Android.mk b/proprietary/external/cvsd_plc_codec/Android.mk deleted file mode 100755 index 84a9feaa897cbe5e0e6a20645942c7db268dd5d7..0000000000000000000000000000000000000000 --- a/proprietary/external/cvsd_plc_codec/Android.mk +++ /dev/null @@ -1,33 +0,0 @@ -# -# Copyright (C) 2008 The Android Open Source Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -LOCAL_PATH := $(my-dir) - -include $(CLEAR_VARS) -#LOCAL_PREBUILT_LIBS := libcvsd_mtk.so -#LOCAL_MODULE_TAGS := optional -#include $(BUILD_MULTI_PREBUILT) -LOCAL_MODULE := libcvsd_mtk -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_CLASS := SHARED_LIBRARIES -LOCAL_SRC_FILES_arm := libcvsd_mtk.so -LOCAL_MODULE_SUFFIX := .so -#ifeq ($(MTK_AUDIO_A64_SUPPORT),yes) -LOCAL_SRC_FILES_arm64 := lib64cvsd_mtk.so -LOCAL_MULTILIB := both -#else -#LOCAL_MULTILIB := 32 -#endif -include $(BUILD_PREBUILT) diff --git a/proprietary/external/dm_agent_binder/Android.mk b/proprietary/external/dm_agent_binder/Android.mk deleted file mode 100755 index 8796a19c479c4b4cea057014578e3a45b3194627..0000000000000000000000000000000000000000 --- a/proprietary/external/dm_agent_binder/Android.mk +++ /dev/null @@ -1,82 +0,0 @@ -# Copyright Statement: -# -# This software/firmware and related documentation ("MediaTek Software") are -# protected under relevant copyright laws. The information contained herein -# is confidential and proprietary to MediaTek Inc. and/or its licensors. -# Without the prior written permission of MediaTek inc. and/or its licensors, -# any reproduction, modification, use or disclosure of MediaTek Software, -# and information contained herein, in whole or in part, shall be strictly prohibited. -# -# MediaTek Inc. (C) 2010. All rights reserved. -# -# BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES -# THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE") -# RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER ON -# AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT. -# NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE -# SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR -# SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES TO LOOK ONLY TO SUCH -# THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. RECEIVER EXPRESSLY ACKNOWLEDGES -# THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES -# CONTAINED IN MEDIATEK SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK -# SOFTWARE RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR -# STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND -# CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE, -# AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE, -# OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY RECEIVER TO -# MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. -# -# The following software/firmware and/or related documentation ("MediaTek Software") -# have been modified by MediaTek Inc. All revisions are subject to any receiver's -# applicable license agreements with MediaTek Inc. - -ifeq ($(strip $(MTK_BSP_PACKAGE)),no) - -ifeq ($(strip $(OPTR_SPEC_SEG_DEF)),OP09_SPEC0212_SEGDEFAULT) -MTK_DEVREG_APP := yes -MTK_CT4GREG_APP := yes -endif - -ifeq ($(strip $(OPTR_SPEC_SEG_DEF)),OP09_SPEC0212_SEGC) -MTK_DEVREG_APP := yes -MTK_CT4GREG_APP := yes -endif - -ifneq ($(strip $(MTK_DM_APP))_$(strip $(MTK_MDM_APP))_$(strip $(MTK_SMSREG_APP))_$(strip $(MTK_DEVREG_APP))_$(strip $(MTK_CT4GREG_APP)),no_no_no_no_no) - -LOCAL_PATH:= $(call my-dir) -include $(CLEAR_VARS) - -LOCAL_SRC_FILES:= \ - dm_agent.cpp - -LOCAL_C_INCLUDES += \ - ../../external/nvram/libfile_op/ \ - $(MTK_PATH_SOURCE)/frameworks/base/custom/inc - -ifeq ($(MTK_EMMC_SUPPORT),yes) -LOCAL_CFLAGS += \ - -DMTK_EMMC_SUPPORT -endif - -LOCAL_SHARED_LIBRARIES := \ - libutils \ - libcutils \ - libbinder \ - libfile_op \ - libcustom_prop - -#LOCAL_PRELINK_MODULE := false - -#LOCAL_PRELINK_MODULE := false -LOCAL_MODULE_TAGS := optional - -LOCAL_MODULE:= dm_agent_binder - -include $(BUILD_EXECUTABLE) - -endif -endif - diff --git a/proprietary/external/ext_md_daemon/Android.mk b/proprietary/external/ext_md_daemon/Android.mk deleted file mode 100755 index 7d454e606467e711ec9cf2105c9d03ca7a3d77e7..0000000000000000000000000000000000000000 --- a/proprietary/external/ext_md_daemon/Android.mk +++ /dev/null @@ -1,72 +0,0 @@ -# Copyright Statement: -# -# This software/firmware and related documentation ("MediaTek Software") are -# protected under relevant copyright laws. The information contained herein -# is confidential and proprietary to MediaTek Inc. and/or its licensors. -# Without the prior written permission of MediaTek inc. and/or its licensors, -# any reproduction, modification, use or disclosure of MediaTek Software, -# and information contained herein, in whole or in part, shall be strictly prohibited. - -# MediaTek Inc. (C) 2010. All rights reserved. -# -# BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES -# THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE") -# RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER ON -# AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT. -# NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE -# SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR -# SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES TO LOOK ONLY TO SUCH -# THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. RECEIVER EXPRESSLY ACKNOWLEDGES -# THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES -# CONTAINED IN MEDIATEK SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK -# SOFTWARE RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR -# STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND -# CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE, -# AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE, -# OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY RECEIVER TO -# MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. -# -# The following software/firmware and/or related documentation ("MediaTek Software") -# have been modified by MediaTek Inc. All revisions are subject to any receiver's -# applicable license agreements with MediaTek Inc. - - -# -# extern modem control daemont -# - -ifeq ($(MTK_DT_SUPPORT), yes) - -#--------------------------------- - -ifneq ($(MTK_C2K_SUPPORT), yes) - -LOCAL_PATH := $(call my-dir) - -include $(CLEAR_VARS) - -LOCAL_SRC_FILES := emd_d.c - -LOCAL_SHARED_LIBRARIES := libc libcutils libhardware_legacy - -ifeq ($(HAVE_AEE_FEATURE),yes) - LOCAL_SHARED_LIBRARIES += libaed - LOCAL_CFLAGS += -DEMD_HAVE_AEE_FEATURE -endif - -LOCAL_C_INCLUDES := $(MTK_PATH_SOURCE)/hardware/ccci/include - -LOCAL_MODULE := ext_mdinit -LOCAL_MULTILIB := 32 - -LOCAL_MODULE_TAGS := optional - -include $(BUILD_EXECUTABLE) - -endif - -#---------------------------------------- - -endif diff --git a/proprietary/external/fft/Android.mk b/proprietary/external/fft/Android.mk deleted file mode 100755 index 9090bdbe045952319f4ac53c1e684159e1e6f278..0000000000000000000000000000000000000000 --- a/proprietary/external/fft/Android.mk +++ /dev/null @@ -1,60 +0,0 @@ -# Copyright Statement: -# -# This software/firmware and related documentation ("MediaTek Software") are -# protected under relevant copyright laws. The information contained herein -# is confidential and proprietary to MediaTek Inc. and/or its licensors. -# Without the prior written permission of MediaTek inc. and/or its licensors, -# any reproduction, modification, use or disclosure of MediaTek Software, -# and information contained herein, in whole or in part, shall be strictly prohibited. - -# MediaTek Inc. (C) 2010. All rights reserved. -# -# BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES -# THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE") -# RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER ON -# AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT. -# NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE -# SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR -# SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES TO LOOK ONLY TO SUCH -# THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. RECEIVER EXPRESSLY ACKNOWLEDGES -# THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES -# CONTAINED IN MEDIATEK SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK -# SOFTWARE RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR -# STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND -# CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE, -# AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE, -# OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY RECEIVER TO -# MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. -# -# The following software/firmware and/or related documentation ("MediaTek Software") -# have been modified by MediaTek Inc. All revisions are subject to any receiver's -# applicable license agreements with MediaTek Inc. - - -# -# Copyright (C) 2008 The Android Open Source Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -LOCAL_PATH := $(my-dir) -include $(CLEAR_VARS) - -LOCAL_MODULE := libfft -LOCAL_SRC_FILES := Audio_FFT.c \ - Dif_fft.c - -include $(BUILD_STATIC_LIBRARY) - - diff --git a/proprietary/external/flacdec/Android.mk b/proprietary/external/flacdec/Android.mk deleted file mode 100755 index 348c85f8af1d76a2195e3bd299f6ab220282e473..0000000000000000000000000000000000000000 --- a/proprietary/external/flacdec/Android.mk +++ /dev/null @@ -1,44 +0,0 @@ -# Copyright Statement: -# -# This software/firmware and related documentation ("MediaTek Software") are -# protected under relevant copyright laws. The information contained herein -# is confidential and proprietary to MediaTek Inc. and/or its licensors. -# Without the prior written permission of MediaTek inc. and/or its licensors, -# any reproduction, modification, use or disclosure of MediaTek Software, -# and information contained herein, in whole or in part, shall be strictly prohibited. - -# MediaTek Inc. (C) 2010. All rights reserved. -# -# BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES -# THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE") -# RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER ON -# AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT. -# NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE -# SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR -# SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES TO LOOK ONLY TO SUCH -# THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. RECEIVER EXPRESSLY ACKNOWLEDGES -# THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES -# CONTAINED IN MEDIATEK SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK -# SOFTWARE RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR -# STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND -# CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE, -# AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE, -# OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY RECEIVER TO -# MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. -# -# The following software/firmware and/or related documentation ("MediaTek Software") -# have been modified by MediaTek Inc. All revisions are subject to any receiver's -# applicable license agreements with MediaTek Inc. - -LOCAL_PATH := $(my-dir) - -include $(CLEAR_VARS) - -LOCAL_MODULE := libflacdec_mtk -LOCAL_MODULE_CLASS := STATIC_LIBRARIES -LOCAL_SRC_FILES_arm := libflacdec_mtk.a -LOCAL_MODULE_SUFFIX := .a -LOCAL_MULTILIB := 32 -include $(BUILD_PREBUILT) diff --git a/proprietary/external/flp/Android.mk b/proprietary/external/flp/Android.mk deleted file mode 100755 index a6bd139a59b951b378013ddff5f1f62973dcdbb7..0000000000000000000000000000000000000000 --- a/proprietary/external/flp/Android.mk +++ /dev/null @@ -1,113 +0,0 @@ -# Copyright Statement: -# -# This software/firmware and related documentation ("MediaTek Software") are -# protected under relevant copyright laws. The information contained herein -# is confidential and proprietary to MediaTek Inc. and/or its licensors. -# Without the prior written permission of MediaTek inc. and/or its licensors, -# any reproduction, modification, use or disclosure of MediaTek Software, -# and information contained herein, in whole or in part, shall be strictly prohibited. -# -# MediaTek Inc. (C) 2010. All rights reserved. -# -# BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES -# THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE") -# RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER ON -# AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT. -# NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE -# SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR -# SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES TO LOOK ONLY TO SUCH -# THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. RECEIVER EXPRESSLY ACKNOWLEDGES -# THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES -# CONTAINED IN MEDIATEK SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK -# SOFTWARE RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR -# STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND -# CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE, -# AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE, -# OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY RECEIVER TO -# MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. -# -# The following software/firmware and/or related documentation ("MediaTek Software") -# have been modified by MediaTek Inc. All revisions are subject to any receiver's -# applicable license agreements with MediaTek Inc. - -############################################################################### -# build start -############################################################################### - -LOCAL_PATH := $(call my-dir) - -######################################## -# Support Offload FLP -######################################## - -######################################## -# Copy prebuilt FLP share library -######################################## -include $(CLEAR_VARS) -LOCAL_MODULE := libmtkflp -LOCAL_MODULE_CLASS := SHARED_LIBRARIES -LOCAL_SRC_FILES := lib/libmtkflp.so -LOCAL_MODULE_SUFFIX := .so -LOCAL_MULTILIB := 32 -include $(BUILD_PREBUILT) - -######################################## -# Build MTK FLP daemon executable -######################################## -include $(CLEAR_VARS) -MY_LOCAL_PATH := $(LOCAL_PATH) - -LOCAL_SRC_FILES := \ - ./src/mtk_flp_android_main.c \ - ./src/mtk_flp_sys.c \ - ./src/slp_api.c \ - ./src/mtk_flp_dc_cell.c \ - ./src/mtk_flp_dc_offload.c - -LOCAL_C_INCLUDES:= \ - $(LOCAL_PATH) \ - $(LOCAL_PATH)/inc/ \ - -LOCAL_MODULE := mtkFlpDaemon -LOCAL_MULTILIB := 32 -LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES) -LOCAL_PRELINK_MODULE := false -LOCAL_UNSTRIPPED_PATH := $(TARGET_ROOT_OUT_SBIN_UNSTRIPPED) -#LOCAL_CFLAGS += -DUSE_GCC -DSUPPORT_SHARED_LIBRARY -LOCAL_CFLAGS += -DUSE_GCC -DSUPPORT_SHARED_LIBRARY -DMTK_K2_PLATFORM -LOCAL_LDLIBS:= -llog -LOCAL_MODULE_TAGS := optional -LOCAL_SHARED_LIBRARIES += libcutils libmtkflp liblog - -include $(BUILD_EXECUTABLE) - - -######################################## -# Build MTK FLP JNI shared library -######################################## -include $(CLEAR_VARS) -#LOCAL_PATH := $(call my-dir) -LOCAL_PRELINK_MODULE := false -LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw -LOCAL_SHARED_LIBRARIES := liblog libcutils libhardware - -#$(info flag: $(BOARD_GPS_LIBRARIES)) - -#LOCAL_CFLAGS:= -DFLP_HARDWARE_SUPPORT -LOCAL_CFLAGS:= -DFLP_HARDWARE_SUPPORT -DMTK_K2_PLATFORM -LOCAL_LDLIBS:= -llog -LOCAL_SRC_FILES := src/mtk_flp_hal_jni.c \ - src/mtk_flp_sys.c \ - src/geofence_offload.c - -LOCAL_C_INCLUDES:= \ - $(LOCAL_PATH) \ - $(LOCAL_PATH)/inc/ \ - -LOCAL_MODULE := flp.default -LOCAL_MULTILIB := 64 -LOCAL_MODULE_TAGS := optional - -include $(BUILD_SHARED_LIBRARY) diff --git a/proprietary/external/fuelgauged/libfgauge/Android.mk b/proprietary/external/fuelgauged/libfgauge/Android.mk deleted file mode 100755 index 2fa559e3a9145e27d12bb48b51875adeaf6b30e3..0000000000000000000000000000000000000000 --- a/proprietary/external/fuelgauged/libfgauge/Android.mk +++ /dev/null @@ -1,14 +0,0 @@ -LOCAL_PATH:= $(call my-dir) - -include $(CLEAR_VARS) -LOCAL_MODULE:= libfgauge -LOCAL_MODULE_CLASS := SHARED_LIBRARIES -LOCAL_SRC_FILES_arm := libfgauge.so - -#bobule workaround pdk build error, needing review -LOCAL_MULTILIB := 32 -LOCAL_MODULE_SUFFIX := .so - -include $(BUILD_PREBUILT) - - diff --git a/proprietary/external/hotknot/Android.mk b/proprietary/external/hotknot/Android.mk deleted file mode 100755 index ceec856d638eab34b109d663542e30191db1580d..0000000000000000000000000000000000000000 --- a/proprietary/external/hotknot/Android.mk +++ /dev/null @@ -1,33 +0,0 @@ -LOCAL_PATH := $(call my-dir) - -include $(CLEAR_VARS) - -LOCAL_MODULE := hotknot_native_service -ifneq ($(MTK_K64_SUPPORT), yes) -LOCAL_SRC_FILES := hotknot_native/arm/hotknot_native_service -else -LOCAL_SRC_FILES := hotknot_native/arm64/hotknot_native_service -endif -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_CLASS := EXECUTABLES -include $(BUILD_PREBUILT) -###################################################################### -#LOCAL_PATH := $(my-dir) - -include $(CLEAR_VARS) - -DEFAULT_PLATFORM := common -LOCAL_MODULE := libhotknot_dev -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_CLASS := SHARED_LIBRARIES -ifeq ($(wildcard $(LOCAL_PATH)/hotknot_dev/$(TARGET_BOARD_PLATFORM)),) - LOCAL_SRC_FILES_arm := hotknot_dev/$(DEFAULT_PLATFORM)/lib/libhotknot_dev.so - LOCAL_SRC_FILES_arm64 := hotknot_dev/$(DEFAULT_PLATFORM)/lib64/libhotknot_dev.so -else - LOCAL_SRC_FILES_arm := hotknot_dev/$(TARGET_BOARD_PLATFORM)/lib/libhotknot_dev.so - LOCAL_SRC_FILES_arm64 := hotknot_dev/$(TARGET_BOARD_PLATFORM)/lib64/libhotknot_dev.so -endif -LOCAL_MODULE_SUFFIX := .so -LOCAL_MULTILIB := both -include $(BUILD_PREBUILT) - diff --git a/proprietary/external/icusbd/Android.mk b/proprietary/external/icusbd/Android.mk deleted file mode 100755 index 2f0757cd62d3e123a4dfd210701a4fd1177fc75a..0000000000000000000000000000000000000000 --- a/proprietary/external/icusbd/Android.mk +++ /dev/null @@ -1,26 +0,0 @@ -ifeq ($(MTK_ICUSB_SUPPORT),yes) -LOCAL_PATH:= $(call my-dir) -include $(CLEAR_VARS) -LOCAL_MULTILIB := 32 -LOCAL_MODULE_TAGS:= optional -LOCAL_MODULE := icusbd - -LOCAL_SRC_FILES:= \ - icusb_util.c \ - icusb_ccci.c \ - icusb_ccid.c \ - icusb_storage.c - -LOCAL_SRC_FILES += icusb_main.c - -LOCAL_C_INCLUDES = \ - $(TOP)/vendor/mediatek/proprietary/external/libusb/ \ - $(LOCAL_PATH)/ \ - $(TOPDIR)/hardware/libhardware_legacy/include \ - $(TOPDIR)/hardware/libhardware/include \ - $(MTK_PATH_SOURCE)/hardware/ccci/include - -LOCAL_SHARED_LIBRARIES := libc libusb libcutils - -include $(BUILD_EXECUTABLE) -endif diff --git a/proprietary/external/invensense/Android.mk b/proprietary/external/invensense/Android.mk deleted file mode 100755 index 0ef43bb1d0aed54602faba2a96c8cd8c18fc4690..0000000000000000000000000000000000000000 --- a/proprietary/external/invensense/Android.mk +++ /dev/null @@ -1,69 +0,0 @@ -# Copyright (C) 2009 The Android Open Source Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -LOCAL_PATH := $(call my-dir) -include $(CLEAR_VARS) -LOCAL_CFLAGS += -DANDROID_KITKAT -LOCAL_MODULE := invmpld -LOCAL_MODULE_PATH := $(TARGET_OUT)/bin -LOCAL_MODULE_TAGS := optional -LOCAL_SRC_FILES := invmpld.c -LOCAL_C_INCLUDES += $(LOCAL_PATH)/mllite -LOCAL_C_INCLUDES += $(LOCAL_PATH)/mllite/linux -LOCAL_SHARED_LIBRARIES += libcutils -LOCAL_SHARED_LIBRARIES += libutils -LOCAL_SHARED_LIBRARIES += libdl -LOCAL_SHARED_LIBRARIES += liblog -LOCAL_SHARED_LIBRARIES += libmllite -LOCAL_SHARED_LIBRARIES += libpaw8001motion -include $(BUILD_EXECUTABLE) - -include $(CLEAR_VARS) -LOCAL_MODULE := libmllite -LOCAL_SRC_FILES := libmllite.so -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_OWNER := invensense -LOCAL_MODULE_SUFFIX := .so -LOCAL_MODULE_CLASS := SHARED_LIBRARIES -LOCAL_MODULE_PATH := $(TARGET_OUT)/lib -OVERRIDE_BUILT_MODULE_PATH := $(TARGET_OUT_INTERMEDIATE_LIBRARIES) -include $(BUILD_PREBUILT) - -include $(CLEAR_VARS) -LOCAL_MODULE := libpaw8001motion -LOCAL_SRC_FILES := libpaw8001motion.so -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_OWNER := pixart -LOCAL_MODULE_SUFFIX := .so -LOCAL_MODULE_CLASS := SHARED_LIBRARIES -LOCAL_MODULE_PATH := $(TARGET_OUT)/lib -OVERRIDE_BUILT_MODULE_PATH := $(TARGET_OUT_INTERMEDIATE_LIBRARIES) -include $(BUILD_PREBUILT) - -include $(CLEAR_VARS) -LOCAL_MODULE := icm30628fw.bin -LOCAL_SRC_FILES := $(LOCAL_MODULE) -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_CLASS := ETC -LOCAL_MODULE_PATH := $(TARGET_OUT)/etc/firmware -include $(BUILD_PREBUILT) - -include $(CLEAR_VARS) -LOCAL_MODULE := icm30628dmp4.bin -LOCAL_SRC_FILES := $(LOCAL_MODULE) -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_CLASS := ETC -LOCAL_MODULE_PATH := $(TARGET_OUT)/etc/firmware -include $(BUILD_PREBUILT) - diff --git a/proprietary/external/ipo_swap/Android.mk b/proprietary/external/ipo_swap/Android.mk deleted file mode 100755 index 0e02548f6e0bf33b26b9b0a1697fe5865136adf7..0000000000000000000000000000000000000000 --- a/proprietary/external/ipo_swap/Android.mk +++ /dev/null @@ -1,21 +0,0 @@ -# -# create loop device bind on IPO-H file for nand project - -ifeq ($(MTK_IPOH_SUPPORT), yes) -ifeq ($(MTK_MLC_NAND_SUPPORT),yes) - -LOCAL_PATH:=$(call my-dir) -include $(CLEAR_VARS) - -LOCAL_SRC_FILES:= ipo_swap.c - -LOCAL_MODULE:= ipo_swap - -LOCAL_C_INCLUDES += vendor/mediatek/proprietary/external/mtd-utils/include - -LOCAL_SHARED_LIBRARIES += liblog - -include $(BUILD_EXECUTABLE) - -endif -endif diff --git a/proprietary/external/ipod/Android.mk b/proprietary/external/ipod/Android.mk deleted file mode 100755 index c3d1f3be56bb29d2e48c9eda49975a5e9ee7c677..0000000000000000000000000000000000000000 --- a/proprietary/external/ipod/Android.mk +++ /dev/null @@ -1,65 +0,0 @@ -# -# ipo daemon -# - -ifeq (yes, $(strip $(MTK_IPO_SUPPORT))) - -LOCAL_PATH:= $(call my-dir) - -include $(CLEAR_VARS) - -LOCAL_SRC_FILES:= ipodmain.cpp \ - ipodcommon.cpp \ - ipodlights.cpp \ - bootlogo.cpp \ - peripheral_control.cpp \ - charging_control.cpp \ - key_control.cpp - -ifeq ($(MTK_PUMP_EXPRESS_SUPPORT), yes) -LOCAL_CFLAGS += -DMTK_PUMP_EXPRESS_SUPPORT -endif - -ifeq ($(MTK_PUMP_EXPRESS_PLUS_SUPPORT), yes) -LOCAL_CFLAGS += -DMTK_PUMP_EXPRESS_PLUS_SUPPORT -endif - -ifeq ($(MTK_TB_WIFI_3G_MODE), WIFI_ONLY) -LOCAL_CFLAGS += -DMTK_TB_WIFI_ONLY -endif - -ifeq ($(strip $(MTK_IPO_MDRST_SUPPORT)),yes) -#$(warning reset_modem = 1) - LOCAL_CFLAGS += -DMTK_RESET_MODEM=1 -else -#$(warning reset_modem = 0) - LOCAL_CFLAGS += -DMTK_RESET_MODEM=0 -endif - -ifeq ($(MTK_IPOH_SUPPORT), yes) -LOCAL_CFLAGS += -DMTK_IPOH_SUPPORT -endif -LOCAL_CFLAGS += -Wno-unused-variable - -ifeq ($(TRUSTONIC_TEE_SUPPORT), yes) -LOCAL_CFLAGS += -DTRUSTONIC_TEE_SUPPORT -endif - -LOCAL_C_INCLUDES += $(LOCAL_PATH)/../libshowlogo/ \ - $(LOCAL_PATH)/include \ - $(TOP)/external/zlib/ - - -LOCAL_MODULE:= ipod -LOCAL_MULTILIB := 32 - -LOCAL_SHARED_LIBRARIES := libcutils libutils libc libstdc++ libz \ - libdl liblog libgui libui libshowlogo \ - libbinder libpowermanager \ - libhardware_legacy - -LOCAL_PRELINK_MODULE := false - -include $(BUILD_EXECUTABLE) - -endif diff --git a/proprietary/external/kisd/Android.mk b/proprietary/external/kisd/Android.mk deleted file mode 100755 index ac502e969076d30633fad28aa7f72217120641dd..0000000000000000000000000000000000000000 --- a/proprietary/external/kisd/Android.mk +++ /dev/null @@ -1,61 +0,0 @@ -# Copyright Statement: -# -# This software/firmware and related documentation ("MediaTek Software") are -# protected under relevant copyright laws. The information contained herein -# is confidential and proprietary to MediaTek Inc. and/or its licensors. -# Without the prior written permission of MediaTek inc. and/or its licensors, -# any reproduction, modification, use or disclosure of MediaTek Software, -# and information contained herein, in whole or in part, shall be strictly prohibited. - -# MediaTek Inc. (C) 2010. All rights reserved. -# -# BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES -# THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE") -# RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER ON -# AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT. -# NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE -# SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR -# SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES TO LOOK ONLY TO SUCH -# THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. RECEIVER EXPRESSLY ACKNOWLEDGES -# THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES -# CONTAINED IN MEDIATEK SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK -# SOFTWARE RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR -# STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND -# CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE, -# AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE, -# OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY RECEIVER TO -# MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. -# -# The following software/firmware and/or related documentation ("MediaTek Software") -# have been modified by MediaTek Inc. All revisions are subject to any receiver's -# applicable license agreements with MediaTek Inc. -ifeq ($(MTK_DRM_KEY_MNG_SUPPORT), yes) - -LOCAL_PATH := $(call my-dir) - -include $(CLEAR_VARS) - -LOCAL_SRC_FILES := \ - main.c - -LOCAL_C_INCLUDES := $(MTK_PATH_CUSTOM)/drm/ - -LOCAL_STATIC_LIBRARIES := libkisd - -LOCAL_SHARED_LIBRARIES := libcutils libnetutils libc libtz_uree liburee_meta_drmkeyinstall_v2 - -LOCAL_CFLAGS += -Wall -Wno-unused-parameter -Werror -Wall - -LOCAL_MODULE := kisd - -include $(BUILD_EXECUTABLE) - -# for kisd_starter.sh -include $(CLEAR_VARS) -LOCAL_MODULE := kisd_starter.sh -LOCAL_MODULE_CLASS := ETC -LOCAL_SRC_FILES := $(LOCAL_MODULE) -include $(BUILD_PREBUILT) -endif diff --git a/proprietary/external/libifaddrs/Android.mk b/proprietary/external/libifaddrs/Android.mk deleted file mode 100755 index 824eddf8bad21020bbb9e4976b02ff5d24c5e9c3..0000000000000000000000000000000000000000 --- a/proprietary/external/libifaddrs/Android.mk +++ /dev/null @@ -1,11 +0,0 @@ - -LOCAL_PATH:= $(call my-dir) - -include $(CLEAR_VARS) -LOCAL_SRC_FILES := ifaddrs.c -LOCAL_CFLAGS := -O2 -g -LOCAL_C_INCLUDES := -LOCAL_SHARED_LIBRARIES := -LOCAL_MODULE := libifaddrs -LOCAL_MULTILIB := 32 -include $(BUILD_STATIC_LIBRARY) diff --git a/proprietary/external/libion_mtk/Android.mk b/proprietary/external/libion_mtk/Android.mk deleted file mode 100755 index b42f71b8d668682a985d4710cab187af3416e56a..0000000000000000000000000000000000000000 --- a/proprietary/external/libion_mtk/Android.mk +++ /dev/null @@ -1,36 +0,0 @@ -# -# Copyright (C) 2011-2014 MediaTek Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -LOCAL_PATH:= $(call my-dir) - -include $(CLEAR_VARS) -LOCAL_SRC_FILES := ion.c -LOCAL_MODULE := libion_mtk -LOCAL_MODULE_TAGS := optional -LOCAL_C_INCLUDES += \ -$(TOP)/vendor/mediatek/proprietary/external/libion_mtk/include \ -$(TOP)/vendor/mediatek/proprietary/external/include \ -$(TOP)/vendor/mediatek/proprietary/external/udf \ -$(TOP)/system/core/include -LOCAL_SHARED_LIBRARIES := libion liblog libdl - -ifeq ($(MTK_BASIC_PACKAGE),NO) -LOCAL_CFLAGS += \ - -D_MTK_TK_ -endif - -include $(BUILD_SHARED_LIBRARY) - -include $(call all-makefiles-under,$(LOCAL_PATH)) diff --git a/proprietary/external/libion_mtk/mtk_ion_test/Android.mk b/proprietary/external/libion_mtk/mtk_ion_test/Android.mk deleted file mode 100755 index 0cbccc444fc4732fa87f2aaef72d64c348725fed..0000000000000000000000000000000000000000 --- a/proprietary/external/libion_mtk/mtk_ion_test/Android.mk +++ /dev/null @@ -1,17 +0,0 @@ -LOCAL_PATH:= $(call my-dir) -include $(CLEAR_VARS) -LOCAL_SRC_FILES = \ - mtk_ion_test.c \ - -LOCAL_C_INCLUDES += \ - $(TOP)/system/core/include \ - $(TOP)/vendor/mediatek/proprietary/external/libion_mtk/include \ - $(TOP)/vendor/mediatek/proprietary/external/include \ - -LOCAL_MODULE_TAGS := eng -LOCAL_MODULE := mtk_ion_test - -LOCAL_MULTILIB := both - -LOCAL_SHARED_LIBRARIES := libcutils libc libion libion_mtk -include $(BUILD_NATIVE_TEST) diff --git a/proprietary/external/libipod/Android.mk b/proprietary/external/libipod/Android.mk deleted file mode 100755 index a4af9d1973bc537e1345592951d2c37829059b3f..0000000000000000000000000000000000000000 --- a/proprietary/external/libipod/Android.mk +++ /dev/null @@ -1,17 +0,0 @@ -# -# libipod -# -ifeq (yes, $(strip $(MTK_IPO_SUPPORT))) - -LOCAL_PATH := $(my-dir) - -include $(CLEAR_VARS) -LOCAL_MODULE := libipod -LOCAL_MODULE_CLASS := SHARED_LIBRARIES -LOCAL_SRC_FILES_arm := libipod.so -LOCAL_MULTILIB := 32 -LOCAL_MODULE_SUFFIX := .so - -include $(BUILD_PREBUILT) - -endif diff --git a/proprietary/external/libipsec_ims/src/setkey_gd/Android.mk b/proprietary/external/libipsec_ims/src/setkey_gd/Android.mk deleted file mode 100755 index 52b2c2abb1073ccba40aa34f8ae87173a1389234..0000000000000000000000000000000000000000 --- a/proprietary/external/libipsec_ims/src/setkey_gd/Android.mk +++ /dev/null @@ -1,56 +0,0 @@ -# -# Copyright (C) 2011 The Android Open Source Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -LOCAL_PATH := $(call my-dir) - - - - -include $(CLEAR_VARS) - -LOCAL_SRC_FILES := \ - ../libipsec_good/pfkey.c \ - ../libipsec_good/ipsec_strerror.c \ - ../libipsec_good/policy_token.c \ - ../libipsec_good/policy_parse.c \ - ../libipsec_good/pfkey_dump.c \ - ../libipsec_good/key_debug.c \ - ../libipsec_good/ipsec_get_policylen.c \ - ../libipsec_good/ipsec_dump_policy.c \ - setkey.c \ - parse.c \ - token.c -LOCAL_C_INCLUDES += \ - $(LOCAL_PATH) \ - $(LOCAL_PATH)/../include-glibc \ - $(LOCAL_PATH)/../libipsec \ - $(LOCAL_PATH)/../setkey - -LOCAL_SHARED_LIBRARIES := libcutils libcrypto - -LOCAL_CFLAGS := -DANDROID_CHANGES -DHAVE_CONFIG_H - -LOCAL_CFLAGS += -Wno-sign-compare -Wno-missing-field-initializers - -LOCAL_MODULE := setkey_gd - -LOCAL_MODULE_TAGS := eng - - -include $(BUILD_EXECUTABLE) - - - diff --git a/proprietary/external/libsched/Android.mk b/proprietary/external/libsched/Android.mk deleted file mode 100755 index 3b41f6390a95bbb72de705e4ec04e22cb644ac72..0000000000000000000000000000000000000000 --- a/proprietary/external/libsched/Android.mk +++ /dev/null @@ -1,14 +0,0 @@ - -LOCAL_PATH:= $(call my-dir) -include $(CLEAR_VARS) -LOCAL_SRC_FILES = \ - libsched.c \ - -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE := libsched - -LOCAL_SHARED_LIBRARIES := libcutils libc -LOCAL_CFLAGS += -g -include $(BUILD_STATIC_LIBRARY) - - diff --git a/proprietary/external/libshowlogo/Android.mk b/proprietary/external/libshowlogo/Android.mk deleted file mode 100755 index a77de0f09b2f5ea1b61225617f15fe42f13966ec..0000000000000000000000000000000000000000 --- a/proprietary/external/libshowlogo/Android.mk +++ /dev/null @@ -1,32 +0,0 @@ -#################################################################### -LOCAL_PATH := $(call my-dir) -include $(CLEAR_VARS) - - -LOCAL_SRC_FILES := show_logo_common.c\ - decompress_common.c\ - show_animation_common.c\ - charging_animation.cpp - -ifeq ($(MTK_PUMP_EXPRESS_SUPPORT), yes) -LOCAL_CFLAGS += -DMTK_PUMP_EXPRESS_SUPPORT -endif -ifeq ($(MTK_PUMP_EXPRESS_PLUS_SUPPORT), yes) -LOCAL_CFLAGS += -DMTK_PUMP_EXPRESS_PLUS_SUPPORT -endif -LOCAL_SHARED_LIBRARIES := libcutils libutils libc libstdc++ libz libdl liblog libgui libui - -LOCAL_STATIC_LIBRARIES += libfs_mgr - -LOCAL_C_INCLUDES += $(MTK_PATH_CUSTOM)/lk/include/target -LOCAL_C_INCLUDES += $(MTK_PATH_PLATFORM)/lk/include/target -LOCAL_C_INCLUDES += $(LOCAL_PATH)/include -LOCAL_C_INCLUDES += $(TOP)/external/zlib/ -LOCAL_C_INCLUDES += system/core/fs_mgr/include - -LOCAL_MODULE := libshowlogo -LOCAL_MULTILIB := 32 - -LOCAL_PRELINK_MODULE := false - -include $(BUILD_SHARED_LIBRARY) diff --git a/proprietary/external/libusb/libusb/Android.mk b/proprietary/external/libusb/libusb/Android.mk deleted file mode 100755 index 29dbad26c6b457b396cd25c5de5cf949a36cb22b..0000000000000000000000000000000000000000 --- a/proprietary/external/libusb/libusb/Android.mk +++ /dev/null @@ -1,24 +0,0 @@ -LOCAL_PATH:= $(call my-dir) -include $(CLEAR_VARS) - -LOCAL_SRC_FILES:= \ - core.c \ - descriptor.c \ - io.c \ - sync.c \ - os/linux_usbfs.c \ - os/threads_posix.c - -LOCAL_C_INCLUDES += \ -$(LOCAL_PATH)/../ \ -$(LOCAL_PATH)/os \ -$(LOCAL_PATH)/ - -#LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/ - -#LOCAL_MODULE_TAGS = eng -LOCAL_MODULE:= libusb -LOCAL_PRELINK_MODULE := false -#include $(BUILD_STATIC_LIBRARY) -include $(BUILD_SHARED_LIBRARY) - diff --git a/proprietary/external/libxlog/xlogcmd/Android.mk b/proprietary/external/libxlog/xlogcmd/Android.mk deleted file mode 100755 index e924c200b7659812d327386fad43a54c6753dc96..0000000000000000000000000000000000000000 --- a/proprietary/external/libxlog/xlogcmd/Android.mk +++ /dev/null @@ -1,31 +0,0 @@ -LOCAL_PATH := $(call my-dir) - -include $(CLEAR_VARS) -LOCAL_SRC_FILES := \ - xlog.c \ - xlog_filter.c - -ifeq ($(HAVE_AEE_FEATURE),yes) -LOCAL_CFLAGS += -DHAVE_AEE_FEATURE -LOCAL_SHARED_LIBRARIES := \ - liblog \ - libcutils \ - libaed -else -LOCAL_SHARED_LIBRARIES := \ - liblog \ - libcutils -endif - -LOCAL_MODULE := xlog -LOCAL_MULTILIB := 32 -LOCAL_MODULE_TAGS := optional -include $(BUILD_EXECUTABLE) - -include $(CLEAR_VARS) -LOCAL_SRC_FILES := \ - xlog_filter.c \ - xlog_filter_test.c -LOCAL_MODULE := xlog_filter_test -LOCAL_MODULE_TAGS = optional -include $(BUILD_HOST_EXECUTABLE) diff --git a/proprietary/external/limiter/Android.mk b/proprietary/external/limiter/Android.mk deleted file mode 100755 index eada543aa26dd8540692bb194d65db0f5ff8b194..0000000000000000000000000000000000000000 --- a/proprietary/external/limiter/Android.mk +++ /dev/null @@ -1,33 +0,0 @@ -# -# Copyright (C) 2008 The Android Open Source Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -LOCAL_PATH := $(my-dir) - -include $(CLEAR_VARS) -#LOCAL_PREBUILT_LIBS := libmtklimiter.so -#LOCAL_MODULE_TAGS := optional -#include $(BUILD_MULTI_PREBUILT) -LOCAL_MODULE := libmtklimiter -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_CLASS := SHARED_LIBRARIES -LOCAL_SRC_FILES_arm := libmtklimiter.so -LOCAL_MODULE_SUFFIX := .so -#ifeq ($(MTK_AUDIO_A64_SUPPORT),yes) -LOCAL_SRC_FILES_arm64 := lib64mtklimiter.so -LOCAL_MULTILIB := both -#else -#LOCAL_MULTILIB := 32 -#endif -include $(BUILD_PREBUILT) diff --git a/proprietary/external/matv/matv_cli/Android.mk b/proprietary/external/matv/matv_cli/Android.mk deleted file mode 100755 index ff3e9f2504e7ad6b430a6597f3f5c150db9bf00d..0000000000000000000000000000000000000000 --- a/proprietary/external/matv/matv_cli/Android.mk +++ /dev/null @@ -1,61 +0,0 @@ -# Copyright Statement: -# -# This software/firmware and related documentation ("MediaTek Software") are -# protected under relevant copyright laws. The information contained herein -# is confidential and proprietary to MediaTek Inc. and/or its licensors. -# Without the prior written permission of MediaTek inc. and/or its licensors, -# any reproduction, modification, use or disclosure of MediaTek Software, -# and information contained herein, in whole or in part, shall be strictly prohibited. - -# MediaTek Inc. (C) 2010. All rights reserved. -# -# BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES -# THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE") -# RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER ON -# AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT. -# NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE -# SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR -# SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES TO LOOK ONLY TO SUCH -# THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. RECEIVER EXPRESSLY ACKNOWLEDGES -# THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES -# CONTAINED IN MEDIATEK SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK -# SOFTWARE RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR -# STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND -# CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE, -# AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE, -# OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY RECEIVER TO -# MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. -# -# The following software/firmware and/or related documentation ("MediaTek Software") -# have been modified by MediaTek Inc. All revisions are subject to any receiver's -# applicable license agreements with MediaTek Inc. - - - -LOCAL_PATH:= $(call my-dir) - -## ==> build this lib only when HAVE_MATV_FEATURE is yes -ifeq ($(HAVE_MATV_FEATURE),yes) -## build this lib for MT5192 or MT5193 -#ifeq ($(MTK_ATV_CHIP),MTK_MT5192) -ifeq ($(MTK_ATV_CHIP), $(filter $(MTK_ATV_CHIP),MTK_MT5192 MTK_MT5193)) - -include $(CLEAR_VARS) - -LOCAL_SRC_FILES:= \ - matv_cli.cpp - -LOCAL_SHARED_LIBRARIES := libcutils libutils libbinder libmedia - -LOCAL_C_INCLUDES:= $(TOP)/$(MTK_PATH_SOURCE)/frameworks-ext/av/include - -LOCAL_CFLAGS += -Wno-multichar - -LOCAL_MODULE:= matv_cli - -include $(BUILD_EXECUTABLE) -endif -endif -## <== build this lib only when HAVE_MATV_FEATURE is yes diff --git a/proprietary/external/matv/matv_cust/Android.mk b/proprietary/external/matv/matv_cust/Android.mk deleted file mode 100755 index 9fc16eeff51da2f9d6cc363e825d0d594b8e7e75..0000000000000000000000000000000000000000 --- a/proprietary/external/matv/matv_cust/Android.mk +++ /dev/null @@ -1,117 +0,0 @@ -# Copyright Statement: -# -# This software/firmware and related documentation ("MediaTek Software") are -# protected under relevant copyright laws. The information contained herein -# is confidential and proprietary to MediaTek Inc. and/or its licensors. -# Without the prior written permission of MediaTek inc. and/or its licensors, -# any reproduction, modification, use or disclosure of MediaTek Software, -# and information contained herein, in whole or in part, shall be strictly prohibited. - -# MediaTek Inc. (C) 2010. All rights reserved. -# -# BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES -# THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE") -# RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER ON -# AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT. -# NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE -# SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR -# SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES TO LOOK ONLY TO SUCH -# THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. RECEIVER EXPRESSLY ACKNOWLEDGES -# THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES -# CONTAINED IN MEDIATEK SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK -# SOFTWARE RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR -# STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND -# CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE, -# AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE, -# OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY RECEIVER TO -# MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. -# -# The following software/firmware and/or related documentation ("MediaTek Software") -# have been modified by MediaTek Inc. All revisions are subject to any receiver's -# applicable license agreements with MediaTek Inc. - - -# -# Copyright (C) 2008 The Android Open Source Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -LOCAL_PATH := $(call my-dir) - -## ==> build this lib only when HAVE_MATV_FEATURE is yes - -include $(CLEAR_VARS) - -LOCAL_SRC_FILES+= matvctrl.c \ - fmctrl.c \ - mATVdrv_ps_api.cpp - - -LOCAL_C_INCLUDES+= $(TOPDIR)$(MTK_PATH_SOURCE)/external/matvctrl - -ifeq ($(HAVE_MATV_FEATURE),yes) -ifeq ($(MTK_ATV_CHIP), $(filter $(MTK_ATV_CHIP),MTK_MT5192 MTK_MT5193)) -LOCAL_SRC_FILES += custom/mATVdrv_cust.c -LOCAL_C_INCLUDES += $(LOCAL_PATH)/custom/ -ifeq ($(MTK_ATV_CHIP),MTK_MT5192) -LOCAL_C_INCLUDES += $(TOP)/mediatek/custom/$(MTK_PROJECT)/kernel/matv/mt5192 -else -LOCAL_C_INCLUDES += $(TOP)/mediatek/custom/$(MTK_PROJECT)/kernel/matv/mt5193 -endif - -LOCAL_GENERATE_CUSTOM_FOLDER := custom:hal/matv - -LOCAL_CFLAGS += -D__ATV_SUPPORT__ -LOCAL_CFLAGS += -D__MTK_TARGET__ -#for disabling the 6 dummy lines in image -LOCAL_CFLAGS += -D__ATV_SP_SUPPORT__ -endif -endif - - -LOCAL_SHARED_LIBRARIES := \ - libnativehelper \ - libcutils \ - libutils \ - libbinder \ - -ifeq ($(HAVE_MATV_FEATURE),yes) -ifeq ($(MTK_ATV_CHIP),MTK_MT5192) -LOCAL_STATIC_LIBRARIES += libmatvctrl -else -LOCAL_STATIC_LIBRARIES += libmatvctrl_93 -endif -endif - -## ==> build this lib only when HAVE_MATV_FEATURE is yes -ifeq ($(HAVE_MATV_FEATURE),yes) - -## build this lib for MT5192 only -ifeq ($(MTK_ATV_CHIP),MTK_MT5192) -#for disabling the 6 dummy lines in image -LOCAL_CFLAGS += -DHAVE_MTK_MT5192 -endif - -ifeq ($(MTK_ATV_CHIP),MTK_MT5193) -LOCAL_CFLAGS += -DHAVE_MTK_MT5193 -endif - -endif - -LOCAL_MODULE := libmatv_cust - -LOCAL_PRELINK_MODULE:=false - -include $(BUILD_SHARED_LIBRARY) diff --git a/proprietary/external/matv/matvctrl/Android.mk b/proprietary/external/matv/matvctrl/Android.mk deleted file mode 100755 index 9d330e9034016b87a494b9034c0da34fc75b238e..0000000000000000000000000000000000000000 --- a/proprietary/external/matv/matvctrl/Android.mk +++ /dev/null @@ -1,68 +0,0 @@ -# Copyright Statement: -# -# This software/firmware and related documentation ("MediaTek Software") are -# protected under relevant copyright laws. The information contained herein -# is confidential and proprietary to MediaTek Inc. and/or its licensors. -# Without the prior written permission of MediaTek inc. and/or its licensors, -# any reproduction, modification, use or disclosure of MediaTek Software, -# and information contained herein, in whole or in part, shall be strictly prohibited. - -# MediaTek Inc. (C) 2010. All rights reserved. -# -# BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES -# THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE") -# RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER ON -# AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT. -# NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE -# SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR -# SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES TO LOOK ONLY TO SUCH -# THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. RECEIVER EXPRESSLY ACKNOWLEDGES -# THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES -# CONTAINED IN MEDIATEK SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK -# SOFTWARE RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR -# STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND -# CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE, -# AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE, -# OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY RECEIVER TO -# MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. -# -# The following software/firmware and/or related documentation ("MediaTek Software") -# have been modified by MediaTek Inc. All revisions are subject to any receiver's -# applicable license agreements with MediaTek Inc. - - -# -# Copyright (C) 2008 The Android Open Source Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -LOCAL_PATH := $(my-dir) - -## ==> build this lib only when HAVE_MATV_FEATURE is yes -#ifeq ($(HAVE_MATV_FEATURE),yes) -## build this lib for MT5192 or MT5193 -#ifeq ($(MTK_ATV_CHIP),MTK_MT5192) -ifeq ($(MTK_ATV_CHIP), $(filter $(MTK_ATV_CHIP),MTK_MT5192 MTK_MT5193)) - -include $(CLEAR_VARS) -ifeq ($(MTK_ATV_CHIP),MTK_MT5192) -LOCAL_PREBUILT_LIBS := libmatvctrl.a -else -LOCAL_PREBUILT_LIBS := libmatvctrl_93.a -endif -include $(BUILD_MULTI_PREBUILT) -endif -#endif -## <== build this lib only when HAVE_MATV_FEATURE is yes diff --git a/proprietary/external/maxim/Android.mk b/proprietary/external/maxim/Android.mk deleted file mode 100755 index 05a6085099fddc18c38b7d315c1920460890838f..0000000000000000000000000000000000000000 --- a/proprietary/external/maxim/Android.mk +++ /dev/null @@ -1,91 +0,0 @@ -# Copyright Statement: -# -# This software/firmware and related documentation ("MediaTek Software") are -# protected under relevant copyright laws. The information contained herein -# is confidential and proprietary to MediaTek Inc. and/or its licensors. -# Without the prior written permission of MediaTek inc. and/or its licensors, -# any reproduction, modification, use or disclosure of MediaTek Software, -# and information contained herein, in whole or in part, shall be strictly prohibited. - -# MediaTek Inc. (C) 2010. All rights reserved. -# -# BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES -# THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE") -# RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER ON -# AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT. -# NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE -# SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR -# SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES TO LOOK ONLY TO SUCH -# THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. RECEIVER EXPRESSLY ACKNOWLEDGES -# THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES -# CONTAINED IN MEDIATEK SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK -# SOFTWARE RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR -# STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND -# CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE, -# AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE, -# OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY RECEIVER TO -# MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. -# -# The following software/firmware and/or related documentation ("MediaTek Software") -# have been modified by MediaTek Inc. All revisions are subject to any receiver's -# applicable license agreements with MediaTek Inc. - - -# -# Copyright (C) 2008 The Android Open Source Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -ifeq ($(strip $(MAXIM_SPEAKER_SUPPORT)),yes) - -LOCAL_PATH := $(my-dir) - -############################## dsm prebuilt library - -include $(CLEAR_VARS) -LOCAL_MODULE := libdsm -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_CLASS := SHARED_LIBRARIES -LOCAL_SRC_FILES_arm := libdsm.so -LOCAL_MODULE_SUFFIX := .so -LOCAL_SRC_FILES_arm64 := lib64dsm.so -LOCAL_MULTILIB := both -include $(BUILD_PREBUILT) - -############################################### - -############################## dsm interface -include $(CLEAR_VARS) -LOCAL_C_INCLUDES:= $(LOCAL_PATH) - -LOCAL_SRC_FILES := mtk_dsm_interface.c -LOCAL_MODULE := libdsm_interface - -LOCAL_C_INCLUDES = \ - $(MTK_PATH_SOURCE)/external/maxim \ - $(MTK_PATH_SOURCE)/external/maxim/tunning - -LOCAL_LDLIBS := -llog -LOCAL_SHARED_LIBRARIES:= libcutils libutils libdsm -LOCAL_MODULE_TAGS := optional -LOCAL_PRELINK_MODULE := false -LOCAL_MULTILIB := both -include $(BUILD_SHARED_LIBRARY) - -############################################### - -include $(call all-makefiles-under,$(LOCAL_PATH)) - -endif \ No newline at end of file diff --git a/proprietary/external/maxim/tunning/Android.mk b/proprietary/external/maxim/tunning/Android.mk deleted file mode 100755 index f89708b2acb7baa419c6e49beb8e53e506eb9cc8..0000000000000000000000000000000000000000 --- a/proprietary/external/maxim/tunning/Android.mk +++ /dev/null @@ -1,92 +0,0 @@ -# Copyright Statement: -# -# This software/firmware and related documentation ("MediaTek Software") are -# protected under relevant copyright laws. The information contained herein -# is confidential and proprietary to MediaTek Inc. and/or its licensors. -# Without the prior written permission of MediaTek inc. and/or its licensors, -# any reproduction, modification, use or disclosure of MediaTek Software, -# and information contained herein, in whole or in part, shall be strictly prohibited. - -# MediaTek Inc. (C) 2010. All rights reserved. -# -# BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES -# THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE") -# RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER ON -# AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT. -# NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE -# SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR -# SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES TO LOOK ONLY TO SUCH -# THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. RECEIVER EXPRESSLY ACKNOWLEDGES -# THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES -# CONTAINED IN MEDIATEK SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK -# SOFTWARE RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR -# STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND -# CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE, -# AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE, -# OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY RECEIVER TO -# MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. -# -# The following software/firmware and/or related documentation ("MediaTek Software") -# have been modified by MediaTek Inc. All revisions are subject to any receiver's -# applicable license agreements with MediaTek Inc. - - -# -# Copyright (C) 2008 The Android Open Source Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -ifeq ($(strip $(MAXIM_SPEAKER_SUPPORT)),yes) - -LOCAL_PATH:= $(call my-dir) - -include $(CLEAR_VARS) -LOCAL_C_INCLUDES:= \ - $(TOP)/external/tinyalsa/include \ - $(TOP)/external/tinyxml - -LOCAL_SRC_FILES:= flex.cpp Parameters.cpp -LOCAL_MODULE := dsm_ctrl -LOCAL_SHARED_LIBRARIES:= libcutils libutils libbinder libmedia libtinyxml -LOCAL_MODULE_TAGS := optional - -LOCAL_MULTILIB := 32 - -include $(BUILD_EXECUTABLE) - -## dsm config parser lib - -include $(CLEAR_VARS) - -LOCAL_C_INCLUDES:= \ - $(TOP)/external/tinyalsa/include \ - $(TOP)/external/tinyxml \ - $(MTK_PATH_SOURCE)/external/maxim \ - $(MTK_PATH_SOURCE)/external/maxim\tunning - -LOCAL_SRC_FILES:= dsm_config_parser.cpp -LOCAL_MODULE := libdsmconfigparser -LOCAL_SHARED_LIBRARIES:= libcutils libutils libbinder libmedia libtinyxml libdsm -LOCAL_MODULE_TAGS := optional - -#LOCAL_MULTILIB := 32 -LOCAL_MULTILIB := both - -LOCAL_ARM_MODE := arm - -include $(BUILD_SHARED_LIBRARY) - -endif \ No newline at end of file diff --git a/proprietary/external/midiSeektable/Android.mk b/proprietary/external/midiSeektable/Android.mk deleted file mode 100755 index e5cce3cb0390682ca59aa300a54022d39b555a32..0000000000000000000000000000000000000000 --- a/proprietary/external/midiSeektable/Android.mk +++ /dev/null @@ -1,29 +0,0 @@ -# -# Copyright (C) 2008 The Android Open Source Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -LOCAL_PATH := $(my-dir) -include $(CLEAR_VARS) - -LOCAL_MODULE := libMST -LOCAL_SRC_FILES := MIDISeektable.c - - - -#LOCAL_C_INCLUDES := $(KERNEL_HEADERS) -#LOCAL_STATIC_LIBRARIES := libMST -include $(BUILD_STATIC_LIBRARY) - - diff --git a/proprietary/external/mkimage/Android.mk b/proprietary/external/mkimage/Android.mk deleted file mode 100755 index c8ed5b0c9de7822bf120996f128a52dbd3dbdd76..0000000000000000000000000000000000000000 --- a/proprietary/external/mkimage/Android.mk +++ /dev/null @@ -1,9 +0,0 @@ -LOCAL_PATH := $(call my-dir) - -include $(CLEAR_VARS) - -LOCAL_MODULE := mkimage -LOCAL_SRC_FILES := mkimage.c -LOCAL_MODULE_TAGS := optional - -include $(BUILD_HOST_EXECUTABLE) diff --git a/proprietary/external/mmc_ffu/Android.mk b/proprietary/external/mmc_ffu/Android.mk deleted file mode 100755 index e3ba1a38c9147eec66936a3dd481c8c9f9e6db24..0000000000000000000000000000000000000000 --- a/proprietary/external/mmc_ffu/Android.mk +++ /dev/null @@ -1,11 +0,0 @@ -LOCAL_PATH:= $(call my-dir) - -include $(CLEAR_VARS) -LOCAL_MODULE_TAGS := optional -LOCAL_SRC_FILES:= mmc.c -LOCAL_MODULE := mmc_ffu -LOCAL_SHARED_LIBRARIES := libcutils libc -LOCAL_C_INCLUDES += \ - bionic/libc/kernel/uapi/linux/mmc \ - device/mediatek/common/kernel-headers/linux/mmc -include $(BUILD_EXECUTABLE) diff --git a/proprietary/external/mp3dec/Android.mk b/proprietary/external/mp3dec/Android.mk deleted file mode 100755 index ce4febaa05f4dea6d12ecee689c44d0483289008..0000000000000000000000000000000000000000 --- a/proprietary/external/mp3dec/Android.mk +++ /dev/null @@ -1,17 +0,0 @@ -LOCAL_PATH := $(my-dir) - -include $(CLEAR_VARS) -LOCAL_MODULE := libmp3dec_mtk -LOCAL_MODULE_CLASS := STATIC_LIBRARIES -LOCAL_SRC_FILES_32 := arm/libmp3dec_mtk.a -LOCAL_SRC_FILES_64 := libmp3dec_mtk.a -#LOCAL_SRC_FILES_arm64 := libmp3dec64_mtk.a -LOCAL_MODULE_SUFFIX := .a -LOCAL_MULTILIB := both - -#LOCAL_PREBUILT_LIBS += libmp3dec.so \ -# libmp3frmlen.so \ -# libdrvb.a - -include $(BUILD_PREBUILT) - diff --git a/proprietary/external/mpud6050/Android.mk b/proprietary/external/mpud6050/Android.mk deleted file mode 100755 index 730a3ce3fdc364d889ea1ba9470ad52182d097b2..0000000000000000000000000000000000000000 --- a/proprietary/external/mpud6050/Android.mk +++ /dev/null @@ -1,19 +0,0 @@ -# -# InvenSense MPU6050 Daemon -# -ifeq ($(CUSTOM_KERNEL_GYROSCOPE), y) - -LOCAL_PATH := $(my-dir) - -include $(CLEAR_VARS) -LOCAL_PREBUILT_LIBS := libmllitd.so libmplmpd.so - -include $(BUILD_MULTI_PREBUILT) - -include $(CLEAR_VARS) -LOCAL_PREBUILT_EXECUTABLES := mpud6050 -#LOCAL_MODULE_TAGS := user - -include $(BUILD_MULTI_PREBUILT) - -endif diff --git a/proprietary/external/msbc_codec/Android.mk b/proprietary/external/msbc_codec/Android.mk deleted file mode 100755 index c18c88801e75c733ce5baf84b8e25d669bf56b91..0000000000000000000000000000000000000000 --- a/proprietary/external/msbc_codec/Android.mk +++ /dev/null @@ -1,33 +0,0 @@ -# -# Copyright (C) 2008 The Android Open Source Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -LOCAL_PATH := $(my-dir) - -include $(CLEAR_VARS) -#LOCAL_PREBUILT_LIBS := libmsbc_mtk.so -#LOCAL_MODULE_TAGS := optional -#include $(BUILD_MULTI_PREBUILT) -LOCAL_MODULE := libmsbc_mtk -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_CLASS := SHARED_LIBRARIES -LOCAL_SRC_FILES_arm := libmsbc_mtk.so -LOCAL_MODULE_SUFFIX := .so -#ifeq ($(MTK_AUDIO_A64_SUPPORT),yes) -LOCAL_SRC_FILES_arm64 := lib64msbc_mtk.so -LOCAL_MULTILIB := both -#else -#LOCAL_MULTILIB := 32 -#endif -include $(BUILD_PREBUILT) diff --git a/proprietary/external/mtd-utils/Android.mk b/proprietary/external/mtd-utils/Android.mk deleted file mode 100755 index 59da3dff04d2a3131cd589d21179636cb90a5871..0000000000000000000000000000000000000000 --- a/proprietary/external/mtd-utils/Android.mk +++ /dev/null @@ -1,366 +0,0 @@ -LOCAL_PATH := $(call my-dir) - -#ifeq ($(strip $(TARGET_USERIMAGES_USE_UBIFS)),true) - -include $(CLEAR_VARS) - -LOCAL_SRC_FILES := \ - lib/libcrc32.c \ - mkfs.ubifs/compr.c \ - mkfs.ubifs/crc16.c \ - mkfs.ubifs/devtable.c \ - mkfs.ubifs/hashtable/hashtable.c \ - mkfs.ubifs/hashtable/hashtable_itr.c \ - mkfs.ubifs/lpt.c \ - mkfs.ubifs/mkfs.ubifs.c \ - ubi-utils/libubi.c \ - lz4k_encoder/lz4k_compress.c \ - lz4k_encoder/lz4k_decompress.c \ - lz4k_encoder/lz4k_matcher.c \ - lz4k_encoder/divsufsort.c \ - lz4k_encoder/sssort.c \ - lz4k_encoder/trsort.c \ - ../../../../../external/e2fsprogs/lib/uuid/gen_uuid.c \ - ../../../../../external/e2fsprogs/lib/uuid/pack.c \ - ../../../../../external/e2fsprogs/lib/uuid/unpack.c \ - ../../../../../external/e2fsprogs/lib/uuid/unparse.c \ - ../lzo/src/lzo1x_9x.c \ - -LOCAL_C_INCLUDES := \ - external/e2fsprogs/lib \ - $(MTK_ROOT)/external/mtd-utils/include \ - $(MTK_ROOT)/external/mtd-utils/ubi-utils/include \ - $(MTK_ROOT)/external/lzo/include \ - -LOCAL_CFLAGS := -O2 -Wall \ - -DHAVE_INTTYPES_H \ - -DHAVE_UNISTD_H \ - -DHAVE_ERRNO_H \ - -DHAVE_NETINET_IN_H \ - -DHAVE_SYS_IOCTL_H \ - -DHAVE_SYS_MMAN_H \ - -DHAVE_SYS_MOUNT_H \ - -DHAVE_SYS_PRCTL_H \ - -DHAVE_SYS_RESOURCE_H \ - -DHAVE_SYS_SELECT_H \ - -DHAVE_SYS_STAT_H \ - -DHAVE_SYS_TYPES_H \ - -DHAVE_STDLIB_H \ - -DHAVE_STRDUP \ - -DHAVE_MMAP \ - -DHAVE_UTIME_H \ - -DHAVE_GETPAGESIZE \ - -DHAVE_LSEEK64 \ - -DHAVE_LSEEK64_PROTOTYPE \ - -DHAVE_EXT2_IOCTLS \ - -DHAVE_LINUX_FD_H \ - -DHAVE_TYPE_SSIZE_T \ - -DHAVE_SYS_TIME_H \ - -DHAVE_SYSCONF - -LOCAL_STATIC_LIBRARIES := libz libselinux libcutils liblog - -ifeq ($(strip $(MTK_NAND_UBIFS_LZ4K_SUPPORT)),yes) -LOCAL_CFLAGS += -D__NAND_UBIFS_LZ4K_SUPPORT -endif - -LOCAL_MODULE := mkfs_ubifs -LOCAL_MODULE_TAGS := optional - -include $(BUILD_HOST_EXECUTABLE) - - -include $(CLEAR_VARS) - -LOCAL_SRC_FILES := \ - lib/libcrc32.c \ - ubi-utils/dictionary.c \ - ubi-utils/libiniparser.c \ - ubi-utils/libubigen.c \ - ubi-utils/ubinize.c \ - ubi-utils/ubiutils-common.c \ - -LOCAL_C_INCLUDES := \ - $(MTK_ROOT)/external/mtd-utils/include \ - $(MTK_ROOT)/external/mtd-utils/ubi-utils/include \ - -LOCAL_CFLAGS := -O2 -Wall -ifeq ($(strip $(MTK_SLC_BUFFER_SUPPORT)),yes) -LOCAL_CFLAGS += -DMTK_SLC_BUFFER_SUPPORT -endif - -LOCAL_MODULE := ubinize -LOCAL_MODULE_TAGS := optional - -include $(BUILD_HOST_EXECUTABLE) - -include $(CLEAR_VARS) - -LOCAL_SRC_FILES := \ - ftl-utils/mkftl.c \ - ../lzo/src/lzo1x_9x.c \ - lz4k_encoder/lz4k_compress.c \ - lz4k_encoder/lz4k_decompress.c \ - lz4k_encoder/lz4k_matcher.c \ - lz4k_encoder/divsufsort.c \ - lz4k_encoder/sssort.c \ - lz4k_encoder/trsort.c \ - -LOCAL_C_INCLUDES := \ - $(MTK_ROOT)/external/mtd-utils/include \ - $(MTK_ROOT)/external/mtd-utils/ubi-utils/include \ - $(MTK_ROOT)/external/lzo/include \ - -LOCAL_CFLAGS := -O2 -Wall -ifeq ($(strip $(MTK_NAND_UBIFS_LZ4K_SUPPORT)),yes) -LOCAL_CFLAGS += -D__NAND_UBIFS_LZ4K_SUPPORT -endif - -LOCAL_MODULE := mkftl -LOCAL_MODULE_TAGS := optional - -include $(BUILD_HOST_EXECUTABLE) - -#endif - - -include $(CLEAR_VARS) - -LOCAL_SRC_FILES := lib/libmtd.c \ - lib/libmtd_legacy.c \ - lib/libcrc32.c \ - lib/libfec.c \ - -LOCAL_C_INCLUDES := \ - $(MTK_ROOT)/external/mtd-utils/include \ - $(MTK_ROOT)/external/mtd-utils/ubi-utils/include \ - -LOCAL_CFLAGS := -O2 -Wall - -LOCAL_MODULE := libmtd - -LOCAL_MODULE_TAGS := optional - -include $(BUILD_STATIC_LIBRARY) - - -include $(CLEAR_VARS) - -LOCAL_SRC_FILES := nandwrite.c - -LOCAL_C_INCLUDES := \ - $(MTK_ROOT)/external/mtd-utils/include \ - $(MTK_ROOT)/external/mtd-utils/ubi-utils/include \ - -LOCAL_CFLAGS := -O2 -Wall - -LOCAL_MODULE := nandwrite - -LOCAL_MODULE_TAGS := optional - -LOCAL_STATIC_LIBRARIES := libmtd - -include $(BUILD_EXECUTABLE) - - -include $(CLEAR_VARS) - -LOCAL_SRC_FILES := flash_erase.c \ - -LOCAL_C_INCLUDES := $(MTK_ROOT)/external/mtd-utils/include \ - -LOCAL_CFLAGS := -O2 -Wall - -LOCAL_MODULE := flash_erase -LOCAL_MODULE_TAGS := optional - -LOCAL_STATIC_LIBRARIES := libmtd - -include $(BUILD_EXECUTABLE) - -include $(CLEAR_VARS) - -LOCAL_SRC_FILES := ubi-utils/ubiformat.c \ - ubi-utils/libubi.c \ - ubi-utils/ubiutils-common.c \ - ubi-utils/libscan.c \ - ubi-utils/libubigen.c \ - -LOCAL_C_INCLUDES := $(MTK_ROOT)/external/mtd-utils/include \ - $(MTK_ROOT)/external/mtd-utils/ubi-utils/include - -LOCAL_CFLAGS := -O2 -Wall - -LOCAL_MODULE := ubiformat -LOCAL_MODULE_TAGS := optional - -LOCAL_STATIC_LIBRARIES := libmtd - -include $(BUILD_EXECUTABLE) - -include $(CLEAR_VARS) - -LOCAL_SRC_FILES := ubi-utils/ubiformat.c \ - ubi-utils/libubi.c \ - ubi-utils/ubiutils-common.c \ - ubi-utils/libscan.c \ - ubi-utils/libubigen.c \ - -LOCAL_C_INCLUDES := $(MTK_ROOT)/external/mtd-utils/include \ - $(MTK_ROOT)/external/mtd-utils/ubi-utils/include - -LOCAL_CFLAGS := -O2 -Wall - -LOCAL_MODULE := ubiformat_static -LOCAL_MODULE_TAGS := optional - -LOCAL_STATIC_LIBRARIES := libc libstdc++ libmtd -LOCAL_FORCE_STATIC_EXECUTABLE := true - -include $(BUILD_EXECUTABLE) - -include $(CLEAR_VARS) - -LOCAL_SRC_FILES := ubi-utils/libubi.c \ - ubi-utils/ubiutils-common.c \ - -LOCAL_C_INCLUDES := $(MTK_ROOT)/external/mtd-utils/include \ - $(MTK_ROOT)/external/mtd-utils/ubi-utils/include - -LOCAL_CFLAGS := -O2 -Wall - -LOCAL_MODULE := ubi_ota_update -LOCAL_MODULE_TAGS := optional - -LOCAL_STATIC_LIBRARIES := libmtd - -include $(BUILD_STATIC_LIBRARY) - - -include $(CLEAR_VARS) - -LOCAL_SRC_FILES := ubi-utils/ubinfo.c \ - ubi-utils/libubi.c \ - ubi-utils/ubiutils-common.c \ - -LOCAL_C_INCLUDES := $(MTK_ROOT)/external/mtd-utils/include \ - $(MTK_ROOT)/external/mtd-utils/ubi-utils/include - -LOCAL_CFLAGS := -O2 -Wall - -LOCAL_MODULE := ubinfo -LOCAL_MODULE_TAGS := optional - -LOCAL_STATIC_LIBRARIES := libmtd - -include $(BUILD_EXECUTABLE) - -include $(CLEAR_VARS) - -LOCAL_SRC_FILES := ubi-utils/ubiattach.c \ - ubi-utils/libubi.c \ - ubi-utils/ubiutils-common.c \ - -LOCAL_C_INCLUDES := $(MTK_ROOT)/external/mtd-utils/include \ - $(MTK_ROOT)/external/mtd-utils/ubi-utils/include - -LOCAL_CFLAGS := -O2 -Wall - -LOCAL_MODULE := ubiattach -LOCAL_MODULE_TAGS := optional - -LOCAL_STATIC_LIBRARIES := libmtd - -include $(BUILD_EXECUTABLE) - -include $(CLEAR_VARS) - -LOCAL_SRC_FILES := ubi-utils/ubidetach.c \ - ubi-utils/libubi.c \ - -LOCAL_C_INCLUDES := $(MTK_ROOT)/external/mtd-utils/include \ - $(MTK_ROOT)/external/mtd-utils/ubi-utils/include - -LOCAL_CFLAGS := -O2 -Wall - -LOCAL_MODULE := ubidetach -LOCAL_MODULE_TAGS := optional - -LOCAL_STATIC_LIBRARIES := libmtd - -include $(BUILD_EXECUTABLE) - -include $(CLEAR_VARS) - -LOCAL_SRC_FILES := ubi-utils/ubimkvol.c \ - ubi-utils/libubi.c \ - ubi-utils/ubiutils-common.c \ - -LOCAL_C_INCLUDES := $(MTK_ROOT)/external/mtd-utils/include \ - $(MTK_ROOT)/external/mtd-utils/ubi-utils/include - -LOCAL_CFLAGS := -O2 -Wall - -LOCAL_MODULE := ubimkvol -LOCAL_MODULE_TAGS := optional - -LOCAL_STATIC_LIBRARIES := libmtd - -include $(BUILD_EXECUTABLE) - -include $(CLEAR_VARS) - -LOCAL_SRC_FILES := ubi-utils/ubirmvol.c \ - ubi-utils/libubi.c \ - - -LOCAL_C_INCLUDES := $(MTK_ROOT)/external/mtd-utils/include \ - $(MTK_ROOT)/external/mtd-utils/ubi-utils/include - -LOCAL_CFLAGS := -O2 -Wall - -LOCAL_MODULE := ubirmvol -LOCAL_MODULE_TAGS := optional - -LOCAL_STATIC_LIBRARIES := libmtd - -include $(BUILD_EXECUTABLE) - -include $(CLEAR_VARS) - -LOCAL_SRC_FILES := ubi-utils/ubiupdatevol.c \ - ubi-utils/libubi.c \ - - -LOCAL_C_INCLUDES := $(MTK_ROOT)/external/mtd-utils/include \ - $(MTK_ROOT)/external/mtd-utils/ubi-utils/include - -LOCAL_CFLAGS := -O2 -Wall - -LOCAL_MODULE := ubiupdatevol -LOCAL_MODULE_TAGS := optional - -LOCAL_STATIC_LIBRARIES := libmtd - -include $(BUILD_EXECUTABLE) - -ifneq ($(strip $(MTK_SLC_BUFFER_SUPPORT)),yes) -include $(CLEAR_VARS) - -LOCAL_SRC_FILES := ubi-utils/mtdinfo.c \ - ubi-utils/libubi.c \ - ubi-utils/ubiutils-common.c \ - ubi-utils/libubigen.c \ - -LOCAL_C_INCLUDES := $(MTK_ROOT)/external/mtd-utils/include \ - $(MTK_ROOT)/external/mtd-utils/ubi-utils/include - -LOCAL_CFLAGS := -O2 -Wall - -LOCAL_MODULE := mtdinfo -LOCAL_MODULE_TAGS := optional - -LOCAL_STATIC_LIBRARIES := libmtd - -include $(BUILD_EXECUTABLE) -endif diff --git a/proprietary/external/mtknfc/Android.mk b/proprietary/external/mtknfc/Android.mk deleted file mode 100755 index e57ba3917955dc2d61e4ccc6891d32dc3d97949a..0000000000000000000000000000000000000000 --- a/proprietary/external/mtknfc/Android.mk +++ /dev/null @@ -1,142 +0,0 @@ -# Copyright Statement: -# -# This software/firmware and related documentation ("MediaTek Software") are -# protected under relevant copyright laws. The information contained herein -# is confidential and proprietary to MediaTek Inc. and/or its licensors. -# Without the prior written permission of MediaTek inc. and/or its licensors, -# any reproduction, modification, use or disclosure of MediaTek Software, -# and information contained herein, in whole or in part, shall be strictly prohibited. -# -# MediaTek Inc. (C) 2010. All rights reserved. -# -# BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES -# THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE") -# RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER ON -# AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT. -# NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE -# SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR -# SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES TO LOOK ONLY TO SUCH -# THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. RECEIVER EXPRESSLY ACKNOWLEDGES -# THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES -# CONTAINED IN MEDIATEK SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK -# SOFTWARE RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR -# STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND -# CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE, -# AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE, -# OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY RECEIVER TO -# MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. -# -# The following software/firmware and/or related documentation ("MediaTek Software") -# have been modified by MediaTek Inc. All revisions are subject to any receiver's -# applicable license agreements with MediaTek Inc. - -############################################################################### -# build start -############################################################################### - -ifeq ($(MTK_NFC_SUPPORT), yes) -MTK_NFC_HAL=0 -MTK_NFC_SKIP=0 -BUILD_PORTING=no -BUILD_HALIMPL=no -BUILD_MW_LIB=no -AOSP_NFC_PATH=$(strip $(wildcard $(MTK_PATH_SOURCE)/hardware/nfc/Android.mk)) -MTK_NFC_PATH=$(strip $(wildcard $(MTK_PATH_SOURCE)/external/mtknfc/Android.mk)) - -LOCAL_PATH := $(call my-dir) - -ifndef MTK_NFC_PACKAGE - - ifeq ($(strip $(MTK_BASIC_PACKAGE)), yes) - MTK_NFC_HAL=AOSP_B - else ifeq ($(strip $(MTK_BSP_PACKAGE)), yes) - MTK_NFC_HAL=AOSP_B - else - MTK_NFC_HAL=MTK - endif -else - MTK_NFC_HAL=$(MTK_NFC_PACKAGE) -endif -#compare conflict fold -ifneq ($(MTK_NFC_PATH),null) - ifneq ($(AOSP_NFC_PATH),null) - MTK_NFC_SKIP=1 - endif -else - MTK_NFC_SKIP=0 -endif - -######################################## -# build option (yes/no) -######################################## -ifeq ($(MTK_NFC_HAL), MTK) - ifeq ($(MTK_NFC_SKIP),1) - ifneq ($(LOCAL_PATH), $(MTK_PATH_SOURCE)/hardware/nfc) -BUILD_PORTING=yes -BUILD_HALIMPL=yes - BUILD_MW_LIB=yes - endif - else - BUILD_PORTING=yes - BUILD_HALIMPL=yes - BUILD_MW_LIB=yes - endif -else ifeq ($(MTK_NFC_HAL), AOSP_B) - ifeq ($(MTK_NFC_SKIP),1) - ifneq ($(LOCAL_PATH), $(MTK_PATH_SOURCE)/external/mtknfc) - BUILD_PORTING=yes - BUILD_HALIMPL=yes - BUILD_MW_LIB=yes - endif - else - BUILD_PORTING=yes - BUILD_HALIMPL=yes - BUILD_MW_LIB=yes - endif -endif - -$(info BUILD_PORTING=$(BUILD_PORTING)) -$(info BUILD_HALIMPL=$(BUILD_HALIMPL)) -$(info BUILD_MW_LIB=$(BUILD_MW_LIB)) -$(info MTK_NFC_HAL=$(MTK_NFC_HAL)) -######################################## -# prebuilt MTK NFC lib -######################################## -ifeq ($(BUILD_MW_LIB), yes) -include $(LOCAL_PATH)/lib/Android.mk -include $(LOCAL_PATH)/lib64/Android.mk -# $(call add-prebuilt-files, SHARED_LIBRARIES, libmtknfc.so) - -MY_LOCAL_PATH := $(LOCAL_PATH) -endif ########ifeq ($(BUILD_MW_LIB), yes) - - -######################################## -# MTK NFC Executable -######################################## -ifeq ($(BUILD_PORTING), yes) -include $(LOCAL_PATH)/PL.mk -LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES) - -LOCAL_UNSTRIPPED_PATH := $(TARGET_ROOT_OUT_SBIN_UNSTRIPPED) -LOCAL_MULTILIB := 32 -include $(BUILD_EXECUTABLE) - -endif ########ifeq ($(BUILD_PORTING), yes) - - -######################################## -# MTK NFC AOSP HAL -######################################## -ifeq ($(BUILD_HALIMPL), yes) -# Build shared library system/lib/hw/nfc_nci.*.so for Hardware Abstraction Layer. -# Android's generic HAL (libhardware.so) dynamically loads this shared library. -include $(LOCAL_PATH)/halimpl.mk -#LOCAL_MULTILIB := both -LOCAL_MODULE_RELATIVE_PATH := hw - -include $(BUILD_SHARED_LIBRARY) -endif ########ifeq ($(BUILD_HALIMPL), yes) -endif ########ifeq ($(MTK_NFC_SUPPORT), yes) diff --git a/proprietary/external/mtknfc/lib/Android.mk b/proprietary/external/mtknfc/lib/Android.mk deleted file mode 100755 index be3a2b7fc592e06e0a0090be95dae5675ae23c5a..0000000000000000000000000000000000000000 --- a/proprietary/external/mtknfc/lib/Android.mk +++ /dev/null @@ -1,49 +0,0 @@ -# Copyright Statement: -# -# This software/firmware and related documentation ("MediaTek Software") are -# protected under relevant copyright laws. The information contained herein -# is confidential and proprietary to MediaTek Inc. and/or its licensors. -# Without the prior written permission of MediaTek inc. and/or its licensors, -# any reproduction, modification, use or disclosure of MediaTek Software, -# and information contained herein, in whole or in part, shall be strictly prohibited. -# -# MediaTek Inc. (C) 2010. All rights reserved. -# -# BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES -# THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE") -# RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER ON -# AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT. -# NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE -# SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR -# SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES TO LOOK ONLY TO SUCH -# THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. RECEIVER EXPRESSLY ACKNOWLEDGES -# THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES -# CONTAINED IN MEDIATEK SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK -# SOFTWARE RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR -# STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND -# CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE, -# AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE, -# OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY RECEIVER TO -# MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. -# -# The following software/firmware and/or related documentation ("MediaTek Software") -# have been modified by MediaTek Inc. All revisions are subject to any receiver's -# applicable license agreements with MediaTek Inc. - - -#LOCAL_PATH := $(call my-dir) - -include $(CLEAR_VARS) -LOCAL_MODULE := libmtknfc -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_CLASS := SHARED_LIBRARIES -LOCAL_SRC_FILES_arm := lib/libmtknfc.so -#LOCAL_SRC_FILES_arm64 := lib64/libmtknfc.so -LOCAL_MODULE_SUFFIX := .so -#LOCAL_MULTILIB := both -LOCAL_MULTILIB := 32 -include $(BUILD_PREBUILT) - - diff --git a/proprietary/external/mtknfc/lib64/Android.mk b/proprietary/external/mtknfc/lib64/Android.mk deleted file mode 100755 index bc84526a20eb0692b1b142213244f6dd87d51119..0000000000000000000000000000000000000000 --- a/proprietary/external/mtknfc/lib64/Android.mk +++ /dev/null @@ -1,50 +0,0 @@ -# Copyright Statement: -# -# This software/firmware and related documentation ("MediaTek Software") are -# protected under relevant copyright laws. The information contained herein -# is confidential and proprietary to MediaTek Inc. and/or its licensors. -# Without the prior written permission of MediaTek inc. and/or its licensors, -# any reproduction, modification, use or disclosure of MediaTek Software, -# and information contained herein, in whole or in part, shall be strictly prohibited. -# -# MediaTek Inc. (C) 2010. All rights reserved. -# -# BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES -# THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE") -# RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER ON -# AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT. -# NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE -# SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR -# SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES TO LOOK ONLY TO SUCH -# THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. RECEIVER EXPRESSLY ACKNOWLEDGES -# THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES -# CONTAINED IN MEDIATEK SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK -# SOFTWARE RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR -# STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND -# CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE, -# AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE, -# OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY RECEIVER TO -# MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. -# -# The following software/firmware and/or related documentation ("MediaTek Software") -# have been modified by MediaTek Inc. All revisions are subject to any receiver's -# applicable license agreements with MediaTek Inc. - - -#LOCAL_PATH := $(call my-dir) - - -include $(CLEAR_VARS) -LOCAL_MODULE := libmtknfc -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_CLASS := SHARED_LIBRARIES -#LOCAL_SRC_FILES_arm := libmtknfc.so -LOCAL_SRC_FILES_arm64 := lib64/libmtknfc.so -LOCAL_MODULE_SUFFIX := .so -#LOCAL_MULTILIB := both -LOCAL_MULTILIB := 64 - -include $(BUILD_PREBUILT) - diff --git a/proprietary/external/mu3d/Android.mk b/proprietary/external/mu3d/Android.mk deleted file mode 100755 index 1ea395a1d1f00c8d623066058785a3e0f36bf268..0000000000000000000000000000000000000000 --- a/proprietary/external/mu3d/Android.mk +++ /dev/null @@ -1,38 +0,0 @@ -LOCAL_PATH := $(call my-dir) - -$(info Building ts_mu3d) - -# Build the target version -include $(CLEAR_VARS) - -MU3D_TS_SRC_FILES := auto_test_cmd.c \ - cli_input.c \ - cli_parser.c \ - dev_test_cmd.c \ - hub_test_cmd.c \ - main.c \ - ring_test_cmd.c \ - stress_test_cmd.c \ - cli_command.c \ - cli_modulecmd.c \ - dbg_cmd.c \ - hcd_test_cmd.c \ - loop_test_cmd.c \ - power_test_cmd.c \ - slot_test_cmd.c - -MU3D_TS_MODULE := ts_mu3d - -ifeq ($(DEBUG_TS_MU3D),yes) -MU3D_TS_CFLAGS := -DDEBUG_TS_MU3D -else -MU3D_TS_CFLAGS := -endif - - -LOCAL_SRC_FILES := $(MU3D_TS_SRC_FILES) -LOCAL_MODULE := $(MU3D_TS_MODULE) -LOCAL_CFLAGS += $(MU3D_TS_CFLAGS) -LOCAL_MODULE_TAGS := optional - -include $(BUILD_EXECUTABLE) diff --git a/proprietary/external/mvg_app/Android.mk b/proprietary/external/mvg_app/Android.mk deleted file mode 100755 index a4d2feee1e567c509fa6fe71841748cbfe0411ea..0000000000000000000000000000000000000000 --- a/proprietary/external/mvg_app/Android.mk +++ /dev/null @@ -1,47 +0,0 @@ -# Copyright Statement: -# -# This software/firmware and related documentation ("MediaTek Software") are -# protected under relevant copyright laws. The information contained herein -# is confidential and proprietary to MediaTek Inc. and/or its licensors. -# Without the prior written permission of MediaTek inc. and/or its licensors, -# any reproduction, modification, use or disclosure of MediaTek Software, -# and information contained herein, in whole or in part, shall be strictly prohibited. - -# MediaTek Inc. (C) 2010. All rights reserved. -# -# BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES -# THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE") -# RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER ON -# AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT. -# NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE -# SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR -# SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES TO LOOK ONLY TO SUCH -# THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. RECEIVER EXPRESSLY ACKNOWLEDGES -# THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES -# CONTAINED IN MEDIATEK SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK -# SOFTWARE RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR -# STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND -# CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE, -# AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE, -# OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY RECEIVER TO -# MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. -# -# The following software/firmware and/or related documentation ("MediaTek Software") -# have been modified by MediaTek Inc. All revisions are subject to any receiver's -# applicable license agreements with MediaTek Inc. - - -LOCAL_PATH:=$(call my-dir) -include $(CLEAR_VARS) -#LOCAL_ARM_MODE:=arm -LOCAL_SHARED_LIBRARIES:= libc libcutils -LOCAL_SRC_FILES:= \ - MVG_Powerloss_App.c -LOCAL_C_INCLUDES:= external/mediatek/MVG_APP -LOCAL_MODULE:=mvg_app -LOCAL_MODULE_TAGS := optional -include $(BUILD_EXECUTABLE) - - diff --git a/proprietary/external/nvram/libcustom_nvram/Android.mk b/proprietary/external/nvram/libcustom_nvram/Android.mk deleted file mode 100755 index 34f6dceebdf19a585627a2ce807a42e15c775fa0..0000000000000000000000000000000000000000 --- a/proprietary/external/nvram/libcustom_nvram/Android.mk +++ /dev/null @@ -1,92 +0,0 @@ -# Copyright Statement: -# -# This software/firmware and related documentation ("MediaTek Software") are -# protected under relevant copyright laws. The information contained herein -# is confidential and proprietary to MediaTek Inc. and/or its licensors. -# Without the prior written permission of MediaTek inc. and/or its licensors, -# any reproduction, modification, use or disclosure of MediaTek Software, -# and information contained herein, in whole or in part, shall be strictly prohibited. - -# MediaTek Inc. (C) 2010. All rights reserved. -# -# BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES -# THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE") -# RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER ON -# AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT. -# NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE -# SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR -# SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES TO LOOK ONLY TO SUCH -# THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. RECEIVER EXPRESSLY ACKNOWLEDGES -# THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES -# CONTAINED IN MEDIATEK SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK -# SOFTWARE RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR -# STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND -# CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE, -# AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE, -# OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY RECEIVER TO -# MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. -# -# The following software/firmware and/or related documentation ("MediaTek Software") -# have been modified by MediaTek Inc. All revisions are subject to any receiver's -# applicable license agreements with MediaTek Inc. - - -LOCAL_PATH:=$(call my-dir) -include $(CLEAR_VARS) -#LOCAL_ARM_MODE:=arm - -# DMNR 3.0 -ifeq ($(strip $(MTK_HANDSFREE_DMNR_SUPPORT)),yes) - LOCAL_CFLAGS += -DMTK_HANDSFREE_DMNR_SUPPORT -endif -# DMNR 3.0 - -# Dual Mic Support -ifeq ($(MTK_DUAL_MIC_SUPPORT),yes) -LOCAL_CFLAGS += -D__MTK_DUAL_MIC_SUPPORT__ -endif -# Dual Mic Support - -# VoIP normal mode DMNR Support -ifeq ($(MTK_VOIP_NORMAL_DMNR),yes) -LOCAL_CFLAGS += -D__MTK_VOIP_NORMAL_DMNR__ -endif -# VoIP normal mode DMNR Support - -# VoIP handsfree mode DMNR Support -ifeq ($(MTK_VOIP_HANDSFREE_DMNR),yes) -LOCAL_CFLAGS += -D__MTK_VOIP_HANDSFREE_DMNR__ -endif -# VoIP handsfree mode DMNR Support - -# Merge Interface Support -ifeq ($(MTK_MERGE_INTERFACE_SUPPORT),yes) -LOCAL_CFLAGS += -D__MTK_MERGE_INTERFACE_SUPPORT__ -endif -# Merge Interface Support - -# BT I2S interface Support -ifeq ($(MTK_BT_I2S_SUPPORT),yes) -LOCAL_CFLAGS += -D__MTK_BT_I2S_SUPPORT__ -endif -# BT I2S interface Support - -# NXP Speaker Support -ifeq ($(NXP_SMARTPA_SUPPORT),yes) -LOCAL_CFLAGS += -D__NXP_SMARTPA_SUPPORT__ -endif -# NXP Speaker Support - -LOCAL_SHARED_LIBRARIES:= libc libcutils -LOCAL_SRC_FILES:= \ - CFG_file_info.c -LOCAL_C_INCLUDES:= \ - $(MTK_PATH_SOURCE)/external/nvram/libnvram -LOCAL_MODULE:=libcustom_nvram -LOCAL_MODULE_TAGS := optional -LOCAL_PRELINK_MODULE:= false -include $(BUILD_SHARED_LIBRARY) - - diff --git a/proprietary/external/nvram/libnvram_daemon_callback/Android.mk b/proprietary/external/nvram/libnvram_daemon_callback/Android.mk deleted file mode 100755 index 70658fde1c4d846e03ae8276435cc421a70f07f4..0000000000000000000000000000000000000000 --- a/proprietary/external/nvram/libnvram_daemon_callback/Android.mk +++ /dev/null @@ -1,17 +0,0 @@ -LOCAL_PATH:=$(call my-dir) -include $(CLEAR_VARS) -#LOCAL_ARM_MODE:=arm -LOCAL_SHARED_LIBRARIES:= libc libcutils libcustom_nvram libnvram -LOCAL_SRC_FILES:= \ - libnvram_daemon_callback.c -LOCAL_C_INCLUDES:= \ - $(MTK_PATH_SOURCE)/external/nvram/libfile_op \ - $(MTK_PATH_SOURCE)/external/nvram/libnvram \ - $(MTK_PATH_SOURCE)/external/mtd_util \ -LOCAL_STATIC_LIBRARIES := libmtd_util -LOCAL_MODULE:=libnvram_daemon_callback -LOCAL_MODULE_TAGS := optional -LOCAL_PRELINK_MODULE:= false -include $(BUILD_SHARED_LIBRARY) - - diff --git a/proprietary/external/nxp/Android.mk b/proprietary/external/nxp/Android.mk deleted file mode 100755 index ed568e138d1e3092e4ebfb1b62f02047b122c943..0000000000000000000000000000000000000000 --- a/proprietary/external/nxp/Android.mk +++ /dev/null @@ -1,98 +0,0 @@ -# Copyright Statement: -# -# This software/firmware and related documentation ("MediaTek Software") are -# protected under relevant copyright laws. The information contained herein -# is confidential and proprietary to MediaTek Inc. and/or its licensors. -# Without the prior written permission of MediaTek inc. and/or its licensors, -# any reproduction, modification, use or disclosure of MediaTek Software, -# and information contained herein, in whole or in part, shall be strictly prohibited. -# -# MediaTek Inc. (C) 2010. All rights reserved. -# -# BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES -# THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE") -# RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER ON -# AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT. -# NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE -# SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR -# SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES TO LOOK ONLY TO SUCH -# THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. RECEIVER EXPRESSLY ACKNOWLEDGES -# THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES -# CONTAINED IN MEDIATEK SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK -# SOFTWARE RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR -# STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND -# CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE, -# AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE, -# OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY RECEIVER TO -# MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. -# -# The following software/firmware and/or related documentation ("MediaTek Software") -# have been modified by MediaTek Inc. All revisions are subject to any receiver's -# applicable license agreements with MediaTek Inc. - -ifeq ($(strip $(NXP_SMARTPA_SUPPORT)),tfa9890) - -LOCAL_PATH:= $(call my-dir) - -############################## libtfa9890_interface -include $(CLEAR_VARS) -LOCAL_CFLAGS += -DNXP_TFA9890_SUPPORT -LOCAL_C_INCLUDES:= $(LOCAL_PATH)/tfa9890 \ - $(LOCAL_PATH)/tfa9890/hal/inc \ - $(LOCAL_PATH)/tfa9890/tfa/inc \ - $(LOCAL_PATH)/tfa9890/srv/inc - -LOCAL_SRC_FILES := tfa9890/tfa9890_interface.c \ - mtk_tfa98xx_interface.c - -LOCAL_MODULE := libtfa9890_interface -LOCAL_SHARED_LIBRARIES:= libcutils libutils -LOCAL_STATIC_LIBRARIES:= libtfasrv libtfa98xx libtfahal -LOCAL_MODULE_TAGS := optional -LOCAL_PRELINK_MODULE := false - -include $(BUILD_SHARED_LIBRARY) - -############################################### - -include $(call all-makefiles-under,$(LOCAL_PATH)) - -endif - -ifeq ($(NXP_SMARTPA_SUPPORT),yes) - -LOCAL_PATH:= $(call my-dir) - -############################## libtfa9887_interface -include $(CLEAR_VARS) -LOCAL_CFLAGS += -DNXP_TFA9887_SUPPORT -LOCAL_C_INCLUDES:= \ - $(LOCAL_PATH)/tfa9887/interface \ - $(LOCAL_PATH)/tfa9887/climax/inc \ - $(LOCAL_PATH)/tfa9887/climax/src/lxScribo \ - $(LOCAL_PATH)/tfa9887/climax/src/lxScribo/scribosrv \ - $(LOCAL_PATH)/tfa9887/Tfa98xxhal/inc \ - $(LOCAL_PATH)/tfa9887/Tfa98xxhal/src/lxScribo \ - $(LOCAL_PATH)/tfa9887/Tfa98xxhal/inc \ - $(LOCAL_PATH)/tfa9887/Tfa98xx/inc \ - $(LOCAL_PATH)/tfa9887/Tfa98xx/src - -LOCAL_SRC_FILES := tfa9887/interface/tfa9887_interface.c \ - mtk_tfa98xx_interface.c - -LOCAL_MODULE := libtfa9887_interface -LOCAL_SHARED_LIBRARIES:= libcutils libutils -LOCAL_STATIC_LIBRARIES:= libtfa9887 liblxScribo9887 -LOCAL_MODULE_TAGS := optional -LOCAL_PRELINK_MODULE := false - -include $(BUILD_SHARED_LIBRARY) - -############################################### - -include $(call all-makefiles-under,$(LOCAL_PATH)) - -endif - diff --git a/proprietary/external/nxp/tfa9887/Android.mk b/proprietary/external/nxp/tfa9887/Android.mk deleted file mode 100755 index 6c884f47c9a0556cbc9e02ed66d193d19aa5e64b..0000000000000000000000000000000000000000 --- a/proprietary/external/nxp/tfa9887/Android.mk +++ /dev/null @@ -1,95 +0,0 @@ -ifeq ($(NXP_SMARTPA_SUPPORT),yes) - -LOCAL_PATH:= $(call my-dir) - -# linux scribo -include $(CLEAR_VARS) -$(info $(LOCAL_PATH)) -LOCAL_C_INCLUDES:= \ - $(LOCAL_PATH)/climax/inc \ - $(LOCAL_PATH)/climax/src/lxScribo \ - $(LOCAL_PATH)/climax/src/lxScribo/scribosrv \ - $(LOCAL_PATH)/Tfa98xxhal/inc \ - $(LOCAL_PATH)/Tfa98xxhal/src/lxScribo \ - $(LOCAL_PATH)/Tfa98xxhal/inc \ - $(LOCAL_PATH)/Tfa98xx/inc \ - $(LOCAL_PATH)/Tfa98xx/src - -LOCAL_SRC_FILES:= \ - Tfa98xxhal/src/lxScribo/lxScribo.c \ - Tfa98xxhal/src/lxScribo/lxDummy.c \ - Tfa98xxhal/src/lxScribo/lxScriboSerial.c \ - Tfa98xxhal/src/lxScribo/lxScriboSocket.c \ - Tfa98xxhal/src/lxScribo/lxI2c.c \ - Tfa98xxhal/src/NXP_I2C_linux.c \ - Tfa98xxhal/src/lxScribo/i2cserver.c \ - Tfa98xxhal/src/lxScribo/cmd.c - -LOCAL_MODULE := liblxScribo9887 -LOCAL_SHARED_LIBRARIES:= libcutils libutils -LOCAL_MODULE_TAGS := optional -LOCAL_PRELINK_MODULE := false -include $(BUILD_STATIC_LIBRARY) - - -# libtfa98xx -include $(CLEAR_VARS) - -$(info $(LOCAL_PATH)) - -LOCAL_C_INCLUDES+= \ - $(LOCAL_PATH)/climax/inc \ - $(LOCAL_PATH)/climax/src/lxScribo \ - $(LOCAL_PATH)/climax/src/lxScribo/scribosrv \ - $(LOCAL_PATH)/Tfa98xxhal/inc \ - $(LOCAL_PATH)/Tfa98xxhal/src/lxScribo \ - $(LOCAL_PATH)/Tfa98xxhal/inc \ - $(LOCAL_PATH)/Tfa98xx/inc \ - $(LOCAL_PATH)/Tfa98xx/src - -LOCAL_SRC_FILES:= \ - Tfa98xx/src/Tfa98xx.c \ - Tfa98xx/src/Tfa98xx_TextSupport.c \ - Tfa98xx/src/Tfa9887.c \ - Tfa98xx/src/initTfa9887.c - -LOCAL_MODULE := libtfa9887 -LOCAL_SHARED_LIBRARIES:= libcutils libutils -LOCAL_STATIC_LIBRARIES:= liblxScribo9887 -LOCAL_MODULE_TAGS := optional -LOCAL_PRELINK_MODULE := false -include $(BUILD_STATIC_LIBRARY) - -# cli app -include $(CLEAR_VARS) - -LOCAL_C_INCLUDES:= \ - $(LOCAL_PATH)/climax/inc \ - $(LOCAL_PATH)/climax/src/lxScribo \ - $(LOCAL_PATH)/climax/src/lxScribo/scribosrv \ - $(LOCAL_PATH)/Tfa98xxhal/inc \ - $(LOCAL_PATH)/Tfa98xxhal/src/lxScribo \ - $(LOCAL_PATH)/Tfa98xxhal/inc \ - $(LOCAL_PATH)/Tfa98xx/inc \ - $(LOCAL_PATH)/Tfa98xx/src - -LOCAL_SRC_FILES:= \ - climax/src/climax.c \ - climax/src/cliCommands.c \ - climax/src/cli/cmdline.c \ - climax/src/nxpTfa98xx.c \ - climax/src/tfa98xxCalibration.c \ - climax/src/tfa98xxDiagnostics.c \ - climax/src/tfa98xxLiveData.c \ - climax/src/tfa98xxRuntime.c - - -LOCAL_SHARED_LIBRARIES:= libcutils libutils -LOCAL_STATIC_LIBRARIES:= libtfa9887 liblxScribo9887 -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE := climaxtest -include $(BUILD_EXECUTABLE) - -include $(call all-makefiles-under,$(LOCAL_PATH)) - -endif diff --git a/proprietary/external/nxp/tfa9890/Android.mk b/proprietary/external/nxp/tfa9890/Android.mk deleted file mode 100755 index ad7768fc215a94550756fd3b1588083ab248e120..0000000000000000000000000000000000000000 --- a/proprietary/external/nxp/tfa9890/Android.mk +++ /dev/null @@ -1,129 +0,0 @@ -# Copyright Statement: -# -# This software/firmware and related documentation ("MediaTek Software") are -# protected under relevant copyright laws. The information contained herein -# is confidential and proprietary to MediaTek Inc. and/or its licensors. -# Without the prior written permission of MediaTek inc. and/or its licensors, -# any reproduction, modification, use or disclosure of MediaTek Software, -# and information contained herein, in whole or in part, shall be strictly prohibited. -# -# MediaTek Inc. (C) 2010. All rights reserved. -# -# BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES -# THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE") -# RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER ON -# AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT. -# NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE -# SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR -# SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES TO LOOK ONLY TO SUCH -# THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. RECEIVER EXPRESSLY ACKNOWLEDGES -# THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES -# CONTAINED IN MEDIATEK SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK -# SOFTWARE RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR -# STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND -# CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE, -# AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE, -# OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY RECEIVER TO -# MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. -# -# The following software/firmware and/or related documentation ("MediaTek Software") -# have been modified by MediaTek Inc. All revisions are subject to any receiver's -# applicable license agreements with MediaTek Inc. - -ifeq ($(strip $(NXP_SMARTPA_SUPPORT)),tfa9890) - -LOCAL_PATH:= $(call my-dir) - -#NOTE: for now we use static libs -############################## libtfahal linux -include $(CLEAR_VARS) -LOCAL_C_INCLUDES:= $(LOCAL_PATH)/hal/inc \ - $(LOCAL_PATH)/tfa/inc \ - $(LOCAL_PATH)/hal/src/lxScribo - -LOCAL_SRC_FILES:= hal/src/NXP_I2C_linux.c \ - hal/src/lxScribo/lxScribo.c \ - hal/src/lxScribo/lxDummy.c \ - hal/src/lxScribo/lxScriboSerial.c \ - hal/src/lxScribo/lxScriboSocket.c\ - hal/src/lxScribo/lxI2c.c \ - hal/src/lxScribo/scribosrv/i2cserver.c \ - hal/src/lxScribo/scribosrv/cmd.c -LOCAL_MODULE := libtfahal -LOCAL_SHARED_LIBRARIES:= libcutils libutils -LOCAL_MODULE_TAGS := optional -LOCAL_PRELINK_MODULE := false - -include $(BUILD_STATIC_LIBRARY) -#include $(BUILD_SHARED_LIBRARY) - - -############################### libtfa98xx -include $(CLEAR_VARS) -LOCAL_C_INCLUDES:= $(LOCAL_PATH)/tfa/inc \ - $(LOCAL_PATH)/hal/inc \ - $(LOCAL_PATH)/hal/src \ - $(LOCAL_PATH)/hal/src/lxScribo \ - $(LOCAL_PATH)/hal/src/lxScribo/scribosrv - -LOCAL_SRC_FILES := \ - tfa/src/initTfa9890.c\ - tfa/src/initTfa9890N1B12.c\ - tfa/src/Tfa98xx.c\ - tfa/src/Tfa98xx_TextSupport.c - -LOCAL_MODULE := libtfa98xx -LOCAL_SHARED_LIBRARIES:= libcutils libutils -LOCAL_STATIC_LIBRARIES:= libtfahal -LOCAL_MODULE_TAGS := optional -LOCAL_PRELINK_MODULE := false - -include $(BUILD_STATIC_LIBRARY) - -############################### libtfasrv -include $(CLEAR_VARS) -LOCAL_C_INCLUDES:= $(LOCAL_PATH)/srv/inc \ - $(LOCAL_PATH)/tfa/inc \ - $(LOCAL_PATH)/hal/inc \ - $(LOCAL_PATH)/hal/src \ - $(LOCAL_PATH)/hal/src/lxScribo - -LOCAL_SRC_FILES:= \ - srv/src/nxpTfa98xx.c\ - srv/src/tfa98xxRuntime.c \ - srv/src/tfa98xxCalibration.c \ - srv/src/tfa98xxDiagnostics.c \ - srv/src/tfa98xxLiveData.c -LOCAL_MODULE := libtfasrv -LOCAL_SHARED_LIBRARIES:= libcutils libutils -LOCAL_STATIC_LIBRARIES:= libtfahal libtfa98xx -LOCAL_MODULE_TAGS := optional -LOCAL_PRELINK_MODULE := false - -include $(BUILD_STATIC_LIBRARY) - -############################## cli app -include $(CLEAR_VARS) -LOCAL_C_INCLUDES:= $(LOCAL_PATH)/app/climax/inc \ - $(LOCAL_PATH)/srv/inc \ - $(LOCAL_PATH)/tfa/inc \ - $(LOCAL_PATH)/hal/inc \ - $(LOCAL_PATH)/hal/src - -LOCAL_SRC_FILES:= \ - app/climax/src/climax.c \ - app/climax/src/cliCommands.c \ - app/climax/src/cli/cmdline.c -LOCAL_MODULE := climax -LOCAL_SHARED_LIBRARIES:= libcutils libutils -LOCAL_STATIC_LIBRARIES:= libtfasrv libtfa98xx libtfahal -LOCAL_MODULE_TAGS := optional -LOCAL_PRELINK_MODULE := false - -include $(BUILD_EXECUTABLE) - -############################################### - -endif diff --git a/proprietary/external/otp/Android.mk b/proprietary/external/otp/Android.mk deleted file mode 100755 index 5af7e8210430ed857702c4d4bcc7284ef41e9890..0000000000000000000000000000000000000000 --- a/proprietary/external/otp/Android.mk +++ /dev/null @@ -1,56 +0,0 @@ -# Copyright Statement: -# -# This software/firmware and related documentation ("MediaTek Software") are -# protected under relevant copyright laws. The information contained herein -# is confidential and proprietary to MediaTek Inc. and/or its licensors. -# Without the prior written permission of MediaTek inc. and/or its licensors, -# any reproduction, modification, use or disclosure of MediaTek Software, -# and information contained herein, in whole or in part, shall be strictly prohibited. - -# MediaTek Inc. (C) 2010. All rights reserved. -# -# BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES -# THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE") -# RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER ON -# AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT. -# NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE -# SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR -# SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES TO LOOK ONLY TO SUCH -# THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. RECEIVER EXPRESSLY ACKNOWLEDGES -# THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES -# CONTAINED IN MEDIATEK SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK -# SOFTWARE RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR -# STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND -# CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE, -# AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE, -# OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY RECEIVER TO -# MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. -# -# The following software/firmware and/or related documentation ("MediaTek Software") -# have been modified by MediaTek Inc. All revisions are subject to any receiver's -# applicable license agreements with MediaTek Inc. -ifeq ($(NAND_OTP_SUPPORT),yes) - HAVE_NANDOTP_FEATURE = yes -else - HAVE_NANDOTP_FEATURE = no -endif - -LOCAL_PATH:=$(call my-dir) -ifeq ($(HAVE_NANDOTP_FEATURE),yes) -include $(CLEAR_VARS) -LOCAL_SHARED_LIBRARIES:= libc libcutils -LOCAL_SRC_FILES:= otp.c -LOCAL_MODULE:=otp -LOCAL_MODULE_TAGS := optional -include $(BUILD_EXECUTABLE) -endif - -include $(CLEAR_VARS) -LOCAL_SHARED_LIBRARIES:= libc libcutils -LOCAL_SRC_FILES:= emmc_otp.c -LOCAL_MODULE:=emmc_otp -LOCAL_MODULE_TAGS := optional -include $(BUILD_EXECUTABLE) - diff --git a/proprietary/external/permission_check/Android.mk b/proprietary/external/permission_check/Android.mk deleted file mode 100755 index 5c43d2fef7113222873539bba8609af18dca9cf3..0000000000000000000000000000000000000000 --- a/proprietary/external/permission_check/Android.mk +++ /dev/null @@ -1,59 +0,0 @@ -# Copyright Statement: -# -# This software/firmware and related documentation ("MediaTek Software") are -# protected under relevant copyright laws. The information contained herein -# is confidential and proprietary to MediaTek Inc. and/or its licensors. -# Without the prior written permission of MediaTek inc. and/or its licensors, -# any reproduction, modification, use or disclosure of MediaTek Software, -# and information contained herein, in whole or in part, shall be strictly prohibited. - -# MediaTek Inc. (C) 2010. All rights reserved. -# -# BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES -# THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE") -# RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER ON -# AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT. -# NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE -# SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR -# SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES TO LOOK ONLY TO SUCH -# THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. RECEIVER EXPRESSLY ACKNOWLEDGES -# THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES -# CONTAINED IN MEDIATEK SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK -# SOFTWARE RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR -# STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND -# CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE, -# AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE, -# OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY RECEIVER TO -# MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. -# -# The following software/firmware and/or related documentation ("MediaTek Software") -# have been modified by MediaTek Inc. All revisions are subject to any receiver's -# applicable license agreements with MediaTek Inc. - - -# -# File permission check daemon -# - - -#--------------------------------- - -LOCAL_PATH := $(call my-dir) - -include $(CLEAR_VARS) - -LOCAL_SRC_FILES := permission_check.c - -LOCAL_SHARED_LIBRARIES := libc libcutils - -LOCAL_MODULE := permission_check - -LOCAL_MODULE_TAGS := optional - -include $(BUILD_EXECUTABLE) - -#---------------------------------------- - - diff --git a/proprietary/external/pppd_btdun/Android.mk b/proprietary/external/pppd_btdun/Android.mk deleted file mode 100755 index edbd82faaa8b7c8162f2214f81d235fcdd46f152..0000000000000000000000000000000000000000 --- a/proprietary/external/pppd_btdun/Android.mk +++ /dev/null @@ -1,82 +0,0 @@ -ifeq ($(MTK_BT_BLUEDROID_DUN_GW_12), yes) -LOCAL_PATH:= $(call my-dir) -include $(CLEAR_VARS) - -LOCAL_SRC_FILES:= \ - auth.c \ - ccp.c \ - chap-md5.c \ - chap-new.c \ - chap_ms.c \ - demand.c \ - eap.c \ - ecp.c \ - eui64.c \ - fsm.c \ - ipcp.c \ - ipv6cp.c \ - lcp.c \ - magic.c \ - main.c \ - options.c \ - pppcrypt.c \ - pppox.c \ - session.c \ - sys-linux.c \ - tty.c \ - upap.c \ - utils.c - -# options.c:623:21: error: passing 'const char *' to parameter of type 'char *' discards qualifiers. -# [-Werror,-Wincompatible-pointer-types-discards-qualifiers] -LOCAL_CLANG_CFLAGS += -Wno-incompatible-pointer-types-discards-qualifiers - -LOCAL_SHARED_LIBRARIES := \ - libcutils liblog libcrypto - -LOCAL_C_INCLUDES := \ - $(LOCAL_PATH)/include - -LOCAL_CFLAGS := -DCHAPMS=1 -DMPPE=1 -DINET6=1 -DUSE_OPENSSL=1 -Wno-unused-parameter -Wno-empty-body -Wno-missing-field-initializers -Wno-attributes -Wno-sign-compare -Wno-pointer-sign -Werror - -# Turn off warnings for now until this is fixed upstream. b/18632512 -LOCAL_CFLAGS += -Wno-unused-variable - -LOCAL_SRC_FILES += pppbt.c -LOCAL_SHARED_LIBRARIES += libpppbtdun -LOCAL_CFLAGS += -D__BTMTK__ -D__BT_DUN_PROFILE__ - -LOCAL_MODULE:= pppd_btdun - -include $(BUILD_EXECUTABLE) -########################################### -# Loader for ppp_btdun -########################################### -#LOCAL_PATH:= $(call my-dir) -include $(CLEAR_VARS) - -LOCAL_SRC_FILES:= \ - ppp_btdun_loader.c - -# options.c:623:21: error: passing 'const char *' to parameter of type 'char *' discards qualifiers. -# [-Werror,-Wincompatible-pointer-types-discards-qualifiers] -LOCAL_CLANG_CFLAGS += -Wno-incompatible-pointer-types-discards-qualifiers - -LOCAL_SHARED_LIBRARIES := \ - libcutils liblog - -LOCAL_C_INCLUDES := \ - $(LOCAL_PATH)/include - -LOCAL_CFLAGS := -Wno-unused-parameter -Wno-empty-body -Wno-missing-field-initializers -Wno-attributes -Wno-sign-compare -Wno-pointer-sign -Werror - -# Turn off warnings for now until this is fixed upstream. b/18632512 -LOCAL_CFLAGS += -Wno-unused-variable - -LOCAL_MODULE:= pppd_btdun_loader - -include $(BUILD_EXECUTABLE) - -include $(LOCAL_PATH)/libpppbtdun/Android.mk - -endif diff --git a/proprietary/external/pppd_btdun/libpppbtdun/Android.mk b/proprietary/external/pppd_btdun/libpppbtdun/Android.mk deleted file mode 100755 index 0c6c1d325189e7e68b30a8bb89404ff468b46ded..0000000000000000000000000000000000000000 --- a/proprietary/external/pppd_btdun/libpppbtdun/Android.mk +++ /dev/null @@ -1,56 +0,0 @@ -# Copyright Statement: -# -# This software/firmware and related documentation ("MediaTek Software") are -# protected under relevant copyright laws. The information contained herein -# is confidential and proprietary to MediaTek Inc. and/or its licensors. -# Without the prior written permission of MediaTek inc. and/or its licensors, -# any reproduction, modification, use or disclosure of MediaTek Software, -# and information contained herein, in whole or in part, shall be strictly prohibited. -# -# MediaTek Inc. (C) 2010. All rights reserved. -# -# BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES -# THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE") -# RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER ON -# AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT. -# NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE -# SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR -# SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES TO LOOK ONLY TO SUCH -# THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. RECEIVER EXPRESSLY ACKNOWLEDGES -# THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES -# CONTAINED IN MEDIATEK SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK -# SOFTWARE RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR -# STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND -# CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE, -# AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE, -# OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY RECEIVER TO -# MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. -# -# The following software/firmware and/or related documentation ("MediaTek Software") -# have been modified by MediaTek Inc. All revisions are subject to any receiver's -# applicable license agreements with MediaTek Inc. - - -#ifeq ($(TARGET_ARCH),arm) - -LOCAL_PATH:= $(call my-dir) -include $(CLEAR_VARS) - -LOCAL_SRC_FILES:= \ - btdunutils.c \ - ip-dun.c - -LOCAL_SHARED_LIBRARIES := \ - libcutils - -LOCAL_CFLAGS := -D__BTMTK__ -D__BT_DUN_PROFILE__ - -LOCAL_MODULE:= libpppbtdun -LOCAL_MULTILIB := both -LOCAL_PRELINK_MODULE:= false - -include $(BUILD_SHARED_LIBRARY) - -#endif diff --git a/proprietary/external/pppoe/Android.mk b/proprietary/external/pppoe/Android.mk deleted file mode 100755 index eeeb91bf3f861f10ab07862ac4d4ed61101b49f5..0000000000000000000000000000000000000000 --- a/proprietary/external/pppoe/Android.mk +++ /dev/null @@ -1,94 +0,0 @@ -LOCAL_PATH := $(call my-dir) -include vendor/mediatek/proprietary/external/pppoe/src/libevent/Android.mk - -src_dir := src - -local_c_includes := \ - src - -local_c_includes += $(log_c_includes) - -include $(CLEAR_VARS) - -VERSION=3.11 - -sbindir= -PPPOE_PATH=$(sbindir)/pppoe -PPPD_PATH=pppd -PLUGIN_PATH= -PPPOESERVER_PPPD_OPTIONS= -PATHS='-DPPPOE_PATH="$(PPPOE_PATH)"' '-DPPPD_PATH="$(PPPD_PATH)"' \ - '-DPLUGIN_PATH="$(PLUGIN_PATH)"' \ - '-DPPPOE_SERVER_OPTIONS="$(PPPOESERVER_PPPD_OPTIONS)"' - -LOCAL_SRC_FILES := \ - ${src_dir}/pppoe.c \ - ${src_dir}/if.c \ - ${src_dir}/debug.c \ - ${src_dir}/common.c \ - ${src_dir}/ppp.c \ - ${src_dir}/discovery.c - -LOCAL_CFLAGS := '-DVERSION="$(VERSION)"' -LOCAL_C_INCLUDES := $(local_c_includes) -LOCAL_SHARED_LIBRARIES := libcutils -LOCAL_SHARED_LIBRARIES += $(log_shared_libraries) - -LOCAL_MODULE := pppoe - -include $(BUILD_EXECUTABLE) - -include $(CLEAR_VARS) -LOCAL_CFLAGS := '-DVERSION="$(VERSION)"' -LOCAL_C_INCLUDES := $(local_c_includes) -LOCAL_SHARED_LIBRARIES := libcutils -LOCAL_SHARED_LIBRARIES += $(log_shared_libraries) - -LOCAL_SRC_FILES := \ - ${src_dir}/relay.c \ - ${src_dir}/if.c \ - ${src_dir}/debug.c \ - ${src_dir}/common.c - -LOCAL_MODULE := pppoe-relay - -include $(BUILD_EXECUTABLE) - - -include $(CLEAR_VARS) -LOCAL_CFLAGS := '-DVERSION="$(VERSION)"' -LOCAL_C_INCLUDES := $(local_c_includes) -LOCAL_SHARED_LIBRARIES := libcutils -LOCAL_SHARED_LIBRARIES += $(log_shared_libraries) - -LOCAL_SRC_FILES := \ - ${src_dir}/pppoe-sniff.c \ - ${src_dir}/if.c \ - ${src_dir}/debug.c \ - ${src_dir}/common.c - -LOCAL_MODULE := pppoe-sniff - -include $(BUILD_EXECUTABLE) - - -include $(CLEAR_VARS) -LOCAL_CFLAGS := '-DVERSION="$(VERSION)"' $(PATHS) -#LOCAL_C_INCLUDES := $(local_c_includes) -LOCAL_C_INCLUDES := \ - ${LOCAL_PATH}/src/libevent - -LOCAL_SHARED_LIBRARIES := libcutils -LOCAL_STATIC_LIBRARIES := libpppoeevent -LOCAL_SHARED_LIBRARIES += $(log_shared_libraries) - -LOCAL_SRC_FILES := \ - ${src_dir}/pppoe-server.c \ - ${src_dir}/if.c \ - ${src_dir}/debug.c \ - ${src_dir}/common.c \ - ${src_dir}/md5.c - -LOCAL_MODULE := pppoe-server - -include $(BUILD_EXECUTABLE) diff --git a/proprietary/external/pppoe/src/libevent/Android.mk b/proprietary/external/pppoe/src/libevent/Android.mk deleted file mode 100755 index 95674d0225811d47ea250c891679dd5fd13f95c7..0000000000000000000000000000000000000000 --- a/proprietary/external/pppoe/src/libevent/Android.mk +++ /dev/null @@ -1,16 +0,0 @@ -include $(CLEAR_VARS) - -LOCAL_SRC_FILES := \ - src/libevent/event_sig.c \ - src/libevent/event.c \ - src/libevent/event_tcp.c \ - src/libevent/hash.c - -LOCAL_CFLAGS := -DUNIX -DLINUX -LOCAL_C_INCLUDES := $(local_c_includes) -LOCAL_SHARED_LIBRARIES := libcutils -LOCAL_SHARED_LIBRARIES += $(log_shared_libraries) - -LOCAL_MODULE := libpppoeevent - -include $(BUILD_STATIC_LIBRARY) diff --git a/proprietary/external/shifter/Android.mk b/proprietary/external/shifter/Android.mk deleted file mode 100755 index f050d6df7c3dffc8611480947b65ed76c0ff72b2..0000000000000000000000000000000000000000 --- a/proprietary/external/shifter/Android.mk +++ /dev/null @@ -1,33 +0,0 @@ -# -# Copyright (C) 2008 The Android Open Source Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -LOCAL_PATH := $(my-dir) - -include $(CLEAR_VARS) -#LOCAL_PREBUILT_LIBS := libmtkshifter.so -#LOCAL_MODULE_TAGS := optional -#include $(BUILD_MULTI_PREBUILT) -LOCAL_MODULE := libmtkshifter -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_CLASS := SHARED_LIBRARIES -LOCAL_SRC_FILES_arm := libmtkshifter.so -LOCAL_MODULE_SUFFIX := .so -#ifeq ($(MTK_AUDIO_A64_SUPPORT),yes) -LOCAL_SRC_FILES_arm64 := lib64mtkshifter.so -LOCAL_MULTILIB := both -#else -#LOCAL_MULTILIB := 32 -#endif -include $(BUILD_PREBUILT) \ No newline at end of file diff --git a/proprietary/external/simservs/Android.mk b/proprietary/external/simservs/Android.mk deleted file mode 100755 index 573551b5d0bf2f7943a9bf538fa65c1b514a1704..0000000000000000000000000000000000000000 --- a/proprietary/external/simservs/Android.mk +++ /dev/null @@ -1,18 +0,0 @@ - -LOCAL_PATH := $(call my-dir) -include $(CLEAR_VARS) - -LOCAL_JAVA_LIBRARIES := okhttp -LOCAL_STATIC_JAVA_LIBRARIES := xcap - -# Include all the java files. -LOCAL_SRC_FILES := $(call all-java-files-under, src) - -LOCAL_MODULE_TAGS := optional - -# The name of the jar file to create. -LOCAL_MODULE := Simservs - -# Build a static jar file. -include $(BUILD_STATIC_JAVA_LIBRARY) - diff --git a/proprietary/external/sqlite_custom/Android.mk b/proprietary/external/sqlite_custom/Android.mk deleted file mode 100755 index 8e301d5c3e6122e4348dbf7b5d302066190880e1..0000000000000000000000000000000000000000 --- a/proprietary/external/sqlite_custom/Android.mk +++ /dev/null @@ -1,18 +0,0 @@ -LOCAL_PATH:= $(call my-dir) - -libmtksqlite3_custom_local_src_files := \ - sqlite3_android_custom.cpp - -libmtksqlite3_custom_c_includes := external/sqlite/dist - - -include $(CLEAR_VARS) -LOCAL_SRC_FILES:= $(libmtksqlite3_custom_local_src_files) -LOCAL_C_INCLUDES := $(libmtksqlite3_custom_c_includes) - -ifeq ($(OPTR_SPEC_SEG_DEF),OP01_SPEC0200_SEGC) -LOCAL_CFLAGS += -D CONFIG_CMCC_SUPPORT -endif - -LOCAL_MODULE:= libmtksqlite3_custom -include $(BUILD_SHARED_LIBRARY) diff --git a/proprietary/external/strongswan/src/curl/Android.mk b/proprietary/external/strongswan/src/curl/Android.mk deleted file mode 100755 index 7feaac52e396549818de008c0c02f62541ba7caf..0000000000000000000000000000000000000000 --- a/proprietary/external/strongswan/src/curl/Android.mk +++ /dev/null @@ -1,120 +0,0 @@ -# Google Android makefile for curl and libcurl -# -# This file can be used when building curl using the full Android source -# release or the NDK. Most users do not want or need to do this; please -# instead read the Android section in docs/INSTALL for alternate -# methods. -# -# Place the curl source (including this makefile) into external/curl/ in the -# Android source tree. Then build them with 'make curl' or just 'make libcurl' -# from the Android root. Tested with Android versions 1.5, 2.1-2.3 -# -# Note: you must first create a curl_config.h file by running configure in the -# Android environment. The only way I've found to do this is tricky. Perform a -# normal Android build with libcurl in the source tree, providing the target -# "showcommands" to make. The build will eventually fail (because curl_config.h -# doesn't exist yet), but the compiler commands used to build curl will be -# shown. Now, from the external/curl/ directory, run curl's normal configure -# command with flags that match what Android itself uses. This will mean -# putting the compiler directory into the PATH, putting the -I, -isystem and -# -D options into CPPFLAGS, putting the -W, -m, -f, -O and -nostdlib options -# into CFLAGS, and putting the -Wl, -L and -l options into LIBS, along with the -# path to the files libgcc.a, crtbegin_dynamic.o, and ccrtend_android.o. -# Remember that the paths must be absolute since you will not be running -# configure from the same directory as the Android make. The normal -# cross-compiler options must also be set. Note that the -c, -o, -MD and -# similar flags must not be set. -# -# To see all the LIBS options, you'll need to do the "showcommands" trick on an -# executable that's already buildable and watch what flags Android uses to link -# it (dhcpcd is a good choice to watch). You'll also want to add -L options to -# LIBS that point to the out/.../obj/lib/ and out/.../obj/system/lib/ -# directories so that additional libraries can be found and used by curl. -# -# The end result will be a configure command that looks something like this -# (the environment variable A is set to the Android root path which makes the -# command shorter): -# -# A=`realpath ../..` && \ -# PATH="$A/prebuilt/linux-x86/toolchain/arm-eabi-X/bin:$PATH" \ -# ./configure --host=arm-linux CC=arm-eabi-gcc \ -# CPPFLAGS="-I $A/system/core/include ..." \ -# CFLAGS="-nostdlib -fno-exceptions -Wno-multichar ..." \ -# LIBS="$A/prebuilt/linux-x86/toolchain/arm-eabi-X/lib/gcc/arm-eabi/X\ -# /interwork/libgcc.a ..." -# -# Finally, copy the file COPYING to NOTICE so that the curl license gets put -# into the right place (but see the note about this below). -# -# Dan Fandrich -# November 2011 - -LOCAL_PATH:= $(call my-dir) - -common_CFLAGS := -Wpointer-arith -Wwrite-strings -Wunused -Winline -Wnested-externs -Wmissing-declarations -Wmissing-prototypes -Wno-long-long -Wfloat-equal -Wno-multichar -Wsign-compare -Wno-format-nonliteral -Wendif-labels -Wstrict-prototypes -Wdeclaration-after-statement -Wno-system-headers -DHAVE_CONFIG_H - -######################### -# Build the libcurl library - -include $(CLEAR_VARS) -include $(LOCAL_PATH)/lib/Makefile.inc -CURL_HEADERS := \ - curlbuild.h \ - curl.h \ - curlrules.h \ - curlver.h \ - easy.h \ - mprintf.h \ - multi.h \ - stdcheaders.h \ - typecheck-gcc.h - -LOCAL_SRC_FILES := $(addprefix lib/,$(CSOURCES)) -LOCAL_C_INCLUDES += $(LOCAL_PATH)/lib/ -LOCAL_C_INCLUDES += $(LOCAL_PATH)/include/ -LOCAL_C_INCLUDES += $(LOCAL_PATH)/../openssl/include -LOCAL_C_INCLUDES += external/zlib -LOCAL_CFLAGS += $(common_CFLAGS) -LOCAL_LDLIBS += -lcrypto-ss -lssl-ss -lz -lm -llog -LOCAL_COPY_HEADERS_TO := libcurl-ss/curl -LOCAL_COPY_HEADERS := $(addprefix include/curl/,$(CURL_HEADERS)) - -LOCAL_MODULE:= libcurl-ss -LOCAL_MODULE_TAGS := optional - -# Copy the licence to a place where Android will find it. -# Actually, this doesn't quite work because the build system searches -# for NOTICE files before it gets to this point, so it will only be seen -# on subsequent builds. -#ALL_PREBUILT += $(LOCAL_PATH)/NOTICE -#$(LOCAL_PATH)/NOTICE: $(LOCAL_PATH)/COPYING | $(ACP) -# $(copy-file-to-target) - - -LOCAL_SHARED_LIBRARIES += libz -LOCAL_SHARED_LIBRARIES += libssl-ss -LOCAL_SHARED_LIBRARIES += libcrypto-ss -#include $(wildcard $(LOCAL_PATH)/../openssl/Android.mk) - -include $(BUILD_SHARED_LIBRARY) - -# ######################### -# # Build the curl binary -# -# include $(CLEAR_VARS) -# include $(LOCAL_PATH)/src/Makefile.inc -# LOCAL_SRC_FILES := $(addprefix src/,$(CURL_CFILES)) -# -# LOCAL_MODULE := curl -# LOCAL_MODULE_TAGS := optional -# LOCAL_STATIC_LIBRARIES := libcurl -# LOCAL_SYSTEM_SHARED_LIBRARIES := libc -# -# LOCAL_C_INCLUDES += $(LOCAL_PATH)/include $(LOCAL_PATH)/lib -# -# # This may also need to include $(CURLX_CFILES) in order to correctly link -# # if libcurl is changed to be built as a dynamic library -# LOCAL_CFLAGS += $(common_CFLAGS) -# -# include $(BUILD_EXECUTABLE) - diff --git a/proprietary/external/strongswan/src/libcharon/Android.mk b/proprietary/external/strongswan/src/libcharon/Android.mk deleted file mode 100755 index 556358d619f74bbcefe0d17f61eba053c7aae067..0000000000000000000000000000000000000000 --- a/proprietary/external/strongswan/src/libcharon/Android.mk +++ /dev/null @@ -1,245 +0,0 @@ -LOCAL_PATH := $(call my-dir) -include $(CLEAR_VARS) - -# copy-n-paste from Makefile.am -libcharon_la_SOURCES := \ -bus/bus.c bus/bus.h \ -bus/listeners/listener.h \ -bus/listeners/logger.h \ -bus/listeners/file_logger.c bus/listeners/file_logger.h \ -bus/listeners/sys_logger.c bus/listeners/sys_logger.h \ -config/backend_manager.c config/backend_manager.h config/backend.h \ -config/child_cfg.c config/child_cfg.h \ -config/ike_cfg.c config/ike_cfg.h \ -config/peer_cfg.c config/peer_cfg.h \ -config/proposal.c config/proposal.h \ -control/controller.c control/controller.h \ -daemon.c daemon.h \ -encoding/generator.c encoding/generator.h \ -encoding/message.c encoding/message.h \ -encoding/parser.c encoding/parser.h \ -encoding/payloads/auth_payload.c encoding/payloads/auth_payload.h \ -encoding/payloads/cert_payload.c encoding/payloads/cert_payload.h \ -encoding/payloads/certreq_payload.c encoding/payloads/certreq_payload.h \ -encoding/payloads/configuration_attribute.c encoding/payloads/configuration_attribute.h \ -encoding/payloads/cp_payload.c encoding/payloads/cp_payload.h \ -encoding/payloads/delete_payload.c encoding/payloads/delete_payload.h \ -encoding/payloads/eap_payload.c encoding/payloads/eap_payload.h \ -encoding/payloads/encodings.c encoding/payloads/encodings.h \ -encoding/payloads/encryption_payload.c encoding/payloads/encryption_payload.h \ -encoding/payloads/id_payload.c encoding/payloads/id_payload.h \ -encoding/payloads/ike_header.c encoding/payloads/ike_header.h \ -encoding/payloads/ke_payload.c encoding/payloads/ke_payload.h \ -encoding/payloads/nonce_payload.c encoding/payloads/nonce_payload.h \ -encoding/payloads/notify_payload.c encoding/payloads/notify_payload.h \ -encoding/payloads/payload.c encoding/payloads/payload.h \ -encoding/payloads/proposal_substructure.c encoding/payloads/proposal_substructure.h \ -encoding/payloads/sa_payload.c encoding/payloads/sa_payload.h \ -encoding/payloads/traffic_selector_substructure.c encoding/payloads/traffic_selector_substructure.h \ -encoding/payloads/transform_attribute.c encoding/payloads/transform_attribute.h \ -encoding/payloads/transform_substructure.c encoding/payloads/transform_substructure.h \ -encoding/payloads/ts_payload.c encoding/payloads/ts_payload.h \ -encoding/payloads/unknown_payload.c encoding/payloads/unknown_payload.h \ -encoding/payloads/vendor_id_payload.c encoding/payloads/vendor_id_payload.h \ -encoding/payloads/hash_payload.c encoding/payloads/hash_payload.h \ -encoding/payloads/fragment_payload.c encoding/payloads/fragment_payload.h \ -kernel_wrap/kernel_handler.c kernel_wrap/kernel_handler.h \ -network/receiver.c network/receiver.h network/sender.c network/sender.h \ -network/socket.c network/socket.h \ -network/socket_manager.c network/socket_manager.h \ -network/wod_channel.c network/wod_channel.h \ -processing/jobs/acquire_job.c processing/jobs/acquire_job.h \ -processing/jobs/delete_child_sa_job.c processing/jobs/delete_child_sa_job.h \ -processing/jobs/delete_ike_sa_job.c processing/jobs/delete_ike_sa_job.h \ -processing/jobs/migrate_job.c processing/jobs/migrate_job.h \ -processing/jobs/process_message_job.c processing/jobs/process_message_job.h \ -processing/jobs/rekey_child_sa_job.c processing/jobs/rekey_child_sa_job.h \ -processing/jobs/rekey_ike_sa_job.c processing/jobs/rekey_ike_sa_job.h \ -processing/jobs/retransmit_job.c processing/jobs/retransmit_job.h \ -processing/jobs/retry_initiate_job.c processing/jobs/retry_initiate_job.h \ -processing/jobs/send_dpd_job.c processing/jobs/send_dpd_job.h \ -processing/jobs/send_keepalive_job.c processing/jobs/send_keepalive_job.h \ -processing/jobs/start_action_job.c processing/jobs/start_action_job.h \ -processing/jobs/roam_job.c processing/jobs/roam_job.h \ -processing/jobs/update_sa_job.c processing/jobs/update_sa_job.h \ -processing/jobs/inactivity_job.c processing/jobs/inactivity_job.h \ -sa/eap/eap_method.c sa/eap/eap_method.h sa/eap/eap_inner_method.h \ -sa/eap/eap_manager.c sa/eap/eap_manager.h \ -sa/xauth/xauth_method.c sa/xauth/xauth_method.h \ -sa/xauth/xauth_manager.c sa/xauth/xauth_manager.h \ -sa/authenticator.c sa/authenticator.h \ -sa/child_sa.c sa/child_sa.h \ -sa/ike_sa.c sa/ike_sa.h \ -sa/ike_sa_id.c sa/ike_sa_id.h \ -sa/keymat.h sa/keymat.c \ -sa/ike_sa_manager.c sa/ike_sa_manager.h \ -sa/task_manager.h sa/task_manager.c \ -sa/shunt_manager.c sa/shunt_manager.h \ -sa/trap_manager.c sa/trap_manager.h \ -sa/task.c sa/task.h - -libcharon_la_SOURCES += \ -sa/ikev2/keymat_v2.c sa/ikev2/keymat_v2.h \ -sa/ikev2/task_manager_v2.c sa/ikev2/task_manager_v2.h \ -sa/ikev2/authenticators/eap_authenticator.c sa/ikev2/authenticators/eap_authenticator.h \ -sa/ikev2/authenticators/psk_authenticator.c sa/ikev2/authenticators/psk_authenticator.h \ -sa/ikev2/authenticators/pubkey_authenticator.c sa/ikev2/authenticators/pubkey_authenticator.h \ -sa/ikev2/tasks/child_create.c sa/ikev2/tasks/child_create.h \ -sa/ikev2/tasks/child_delete.c sa/ikev2/tasks/child_delete.h \ -sa/ikev2/tasks/child_rekey.c sa/ikev2/tasks/child_rekey.h \ -sa/ikev2/tasks/ike_auth.c sa/ikev2/tasks/ike_auth.h \ -sa/ikev2/tasks/ike_cert_pre.c sa/ikev2/tasks/ike_cert_pre.h \ -sa/ikev2/tasks/ike_cert_post.c sa/ikev2/tasks/ike_cert_post.h \ -sa/ikev2/tasks/ike_config.c sa/ikev2/tasks/ike_config.h \ -sa/ikev2/tasks/ike_delete.c sa/ikev2/tasks/ike_delete.h \ -sa/ikev2/tasks/ike_dpd.c sa/ikev2/tasks/ike_dpd.h \ -sa/ikev2/tasks/ike_init.c sa/ikev2/tasks/ike_init.h \ -sa/ikev2/tasks/ike_natd.c sa/ikev2/tasks/ike_natd.h \ -sa/ikev2/tasks/ike_mobike.c sa/ikev2/tasks/ike_mobike.h \ -sa/ikev2/tasks/ike_rekey.c sa/ikev2/tasks/ike_rekey.h \ -sa/ikev2/tasks/ike_reauth.c sa/ikev2/tasks/ike_reauth.h \ -sa/ikev2/tasks/ike_auth_lifetime.c sa/ikev2/tasks/ike_auth_lifetime.h \ -sa/ikev2/tasks/ike_vendor.c sa/ikev2/tasks/ike_vendor.h - -libcharon_la_SOURCES += \ -sa/ikev1/keymat_v1.c sa/ikev1/keymat_v1.h \ -sa/ikev1/task_manager_v1.c sa/ikev1/task_manager_v1.h \ -sa/ikev1/authenticators/psk_v1_authenticator.c sa/ikev1/authenticators/psk_v1_authenticator.h \ -sa/ikev1/authenticators/pubkey_v1_authenticator.c sa/ikev1/authenticators/pubkey_v1_authenticator.h \ -sa/ikev1/authenticators/hybrid_authenticator.c sa/ikev1/authenticators/hybrid_authenticator.h \ -sa/ikev1/phase1.c sa/ikev1/phase1.h \ -sa/ikev1/tasks/main_mode.c sa/ikev1/tasks/main_mode.h \ -sa/ikev1/tasks/aggressive_mode.c sa/ikev1/tasks/aggressive_mode.h \ -sa/ikev1/tasks/informational.c sa/ikev1/tasks/informational.h \ -sa/ikev1/tasks/isakmp_cert_pre.c sa/ikev1/tasks/isakmp_cert_pre.h \ -sa/ikev1/tasks/isakmp_cert_post.c sa/ikev1/tasks/isakmp_cert_post.h \ -sa/ikev1/tasks/isakmp_natd.c sa/ikev1/tasks/isakmp_natd.h \ -sa/ikev1/tasks/isakmp_vendor.c sa/ikev1/tasks/isakmp_vendor.h \ -sa/ikev1/tasks/isakmp_delete.c sa/ikev1/tasks/isakmp_delete.h \ -sa/ikev1/tasks/isakmp_dpd.c sa/ikev1/tasks/isakmp_dpd.h \ -sa/ikev1/tasks/xauth.c sa/ikev1/tasks/xauth.h \ -sa/ikev1/tasks/quick_mode.c sa/ikev1/tasks/quick_mode.h \ -sa/ikev1/tasks/quick_delete.c sa/ikev1/tasks/quick_delete.h \ -sa/ikev1/tasks/mode_config.c sa/ikev1/tasks/mode_config.h \ -processing/jobs/dpd_timeout_job.c processing/jobs/dpd_timeout_job.h \ -processing/jobs/adopt_children_job.c processing/jobs/adopt_children_job.h - -LOCAL_SRC_FILES := $(filter %.c,$(libcharon_la_SOURCES)) - -# adding the plugin source files - -LOCAL_SRC_FILES += $(call add_plugin, android-dns) -ifneq ($(call plugin_enabled, android-dns),) -LOCAL_SHARED_LIBRARIES += libcutils -endif - -LOCAL_SRC_FILES += $(call add_plugin, android-log) -ifneq ($(call plugin_enabled, android-log),) -LOCAL_LDLIBS += -llog -endif - -LOCAL_SRC_FILES += $(call add_plugin, attr) - -LOCAL_SRC_FILES += $(call add_plugin, eap-aka) - -LOCAL_SRC_FILES += $(call add_plugin, eap-aka-3gpp2) -ifneq ($(call plugin_enabled, eap-aka-3gpp2),) -LOCAL_C_INCLUDES += $(libgmp_PATH) -LOCAL_SHARED_LIBRARIES += libgmp -endif - -LOCAL_SRC_FILES += $(call add_plugin, updown) - -LOCAL_SRC_FILES += $(call add_plugin, eap-gtc) - -LOCAL_SRC_FILES += $(call add_plugin, eap-identity) - -LOCAL_SRC_FILES += $(call add_plugin, eap-md5) - -LOCAL_SRC_FILES += $(call add_plugin, eap-mschapv2) - -LOCAL_SRC_FILES += $(call add_plugin, eap-sim) - -LOCAL_SRC_FILES += $(call add_plugin, eap-simaka-sql) - -LOCAL_SRC_FILES += $(call add_plugin, eap-simaka-pseudonym) - -LOCAL_SRC_FILES += $(call add_plugin, eap-simaka-reauth) -ifneq ($(call plugin_enabled, eap-simaka-reauth),) -LOCAL_SHARED_LIBRARIES += libcutils -endif - -LOCAL_SRC_FILES += $(call add_plugin, eap-sim-file) - -# adding libakasim if either eap-aka or eap-sim is enabled -ifneq ($(or $(call plugin_enabled, eap-aka), $(call plugin_enabled, eap-sim)),) -LOCAL_C_INCLUDES += $(LOCAL_PATH)/../libsimaka/ -LOCAL_SHARED_LIBRARIES += libsimaka -endif - -#LOCAL_SRC_FILES += $(addprefix ../libsimaka/, -# simaka_message.h simaka_message.c \ -# simaka_crypto.h simaka_crypto.c \ -# simaka_manager.h simaka_manager.c \ -# simaka_card.h simaka_provider.h simaka_hooks.h \ -# ) - -LOCAL_SRC_FILES += $(call add_plugin, eap-tls) - -LOCAL_SRC_FILES += $(call add_plugin, eap-ttls) -ifneq ($(call plugin_enabled, eap-ttls),) -# for radius_message.h -LOCAL_C_INCLUDES += $(LOCAL_PATH)/../libradius/ -endif - -LOCAL_SRC_FILES += $(call add_plugin, eap-peap) - -LOCAL_SRC_FILES += $(call add_plugin, eap-tnc) -ifneq ($(call plugin_enabled, eap-tnc),) -LOCAL_C_INCLUDES += $(LOCAL_PATH)/../libtnccs/ $(LOCAL_PATH)/../libtncif/ -LOCAL_SHARED_LIBRARIES += libtnccs libtncif -endif - -# adding libtls if any of the four plugins above is enabled -ifneq ($(or $(call plugin_enabled, eap-tls), $(call plugin_enabled, eap-ttls), \ - $(call plugin_enabled, eap-peap), $(call plugin_enabled, eap-tnc)),) -LOCAL_C_INCLUDES += $(LOCAL_PATH)/../libtls/ -LOCAL_SRC_FILES += $(addprefix ../libtls/, \ - tls_protection.c tls_compression.c tls_fragmentation.c tls_alert.c \ - tls_crypto.c tls_prf.c tls_socket.c tls_eap.c tls_cache.c tls_peer.c \ - tls_server.c tls.c \ - ) -endif - -LOCAL_SRC_FILES += $(call add_plugin, load-tester) - -LOCAL_SRC_FILES += $(call add_plugin, socket-default) - -LOCAL_SRC_FILES += $(call add_plugin, socket-dynamic) - -LOCAL_SRC_FILES += $(call add_plugin, stroke) -ifneq ($(call plugin_enabled, stroke),) -LOCAL_C_INCLUDES += $(LOCAL_PATH)/../stroke/ -endif - -# build libcharon -------------------------------------------------------------- - -LOCAL_C_INCLUDES += \ - $(strongswan_PATH)/src/include \ - $(strongswan_PATH)/src/libhydra \ - $(strongswan_PATH)/src/libstrongswan - -LOCAL_CFLAGS := $(strongswan_CFLAGS) - -LOCAL_MODULE := libcharon - -LOCAL_MODULE_TAGS := optional - -LOCAL_ARM_MODE := arm - -LOCAL_PRELINK_MODULE := false - -LOCAL_SHARED_LIBRARIES += libstrongswan libhydra - -include $(BUILD_SHARED_LIBRARY) - diff --git a/proprietary/external/strongswan/src/libhydra/Android.mk b/proprietary/external/strongswan/src/libhydra/Android.mk deleted file mode 100755 index 75b81e971464978d7fbf2305f18f03a5fa5653ba..0000000000000000000000000000000000000000 --- a/proprietary/external/strongswan/src/libhydra/Android.mk +++ /dev/null @@ -1,52 +0,0 @@ -LOCAL_PATH := $(call my-dir) -include $(CLEAR_VARS) - -# copy-n-paste from Makefile.am -libhydra_la_SOURCES := \ -hydra.c hydra.h \ -attributes/attributes.c attributes/attributes.h \ -attributes/attribute_provider.h attributes/attribute_handler.h \ -attributes/attribute_manager.c attributes/attribute_manager.h \ -attributes/mem_pool.c attributes/mem_pool.h \ -kernel_wrap/kernel_interface.c kernel_wrap/kernel_interface.h \ -kernel_wrap/kernel_ipsec.c kernel_wrap/kernel_ipsec.h \ -kernel_wrap/kernel_net.c kernel_wrap/kernel_net.h \ -kernel_wrap/kernel_listener.h - -LOCAL_SRC_FILES := $(filter %.c,$(libhydra_la_SOURCES)) - -# adding the plugin source files - -LOCAL_SRC_FILES += $(call add_plugin, attr) - -LOCAL_SRC_FILES += $(call add_plugin, kernel-pfkey) - -LOCAL_SRC_FILES += $(call add_plugin, kernel-netlink) - -LOCAL_SRC_FILES += $(call add_plugin, resolve) -ifneq ($(call plugin_enabled, resolve),) -LOCAL_SHARED_LIBRARIES += libcutils -endif - - -# build libhydra --------------------------------------------------------------- - -LOCAL_C_INCLUDES += \ - $(strongswan_PATH)/src/include \ - $(strongswan_PATH)/src/libstrongswan - - -LOCAL_CFLAGS := $(strongswan_CFLAGS) - -LOCAL_MODULE := libhydra - -LOCAL_MODULE_TAGS := optional - -LOCAL_ARM_MODE := arm - -LOCAL_PRELINK_MODULE := false - -LOCAL_SHARED_LIBRARIES += libstrongswan - -include $(BUILD_SHARED_LIBRARY) - diff --git a/proprietary/external/strongswan/src/libipsec/Android.mk b/proprietary/external/strongswan/src/libipsec/Android.mk deleted file mode 100755 index c5d987977b7aaa1a3dfa95133308bd5e55b19073..0000000000000000000000000000000000000000 --- a/proprietary/external/strongswan/src/libipsec/Android.mk +++ /dev/null @@ -1,39 +0,0 @@ -LOCAL_PATH := $(call my-dir) -include $(CLEAR_VARS) - -# copy-n-paste from Makefile.am -libipsec_la_SOURCES := \ -ipsec.c ipsec.h \ -esp_context.c esp_context.h \ -esp_packet.c esp_packet.h \ -ip_packet.c ip_packet.h \ -ipsec_event_listener.h \ -ipsec_event_relay.c ipsec_event_relay.h \ -ipsec_policy.c ipsec_policy.h \ -ipsec_policy_mgr.c ipsec_policy_mgr.h \ -ipsec_processor.c ipsec_processor.h \ -ipsec_sa.c ipsec_sa.h \ -ipsec_sa_mgr.c ipsec_sa_mgr.h - -LOCAL_SRC_FILES := $(filter %.c,$(libipsec_la_SOURCES)) - -# build libipsec --------------------------------------------------------------- - -LOCAL_C_INCLUDES += \ - $(strongswan_PATH)/src/include \ - $(strongswan_PATH)/src/libstrongswan - -LOCAL_CFLAGS := $(strongswan_CFLAGS) - -LOCAL_MODULE := libipsec - -LOCAL_MODULE_TAGS := optional - -LOCAL_ARM_MODE := arm - -LOCAL_PRELINK_MODULE := false - -LOCAL_SHARED_LIBRARIES += libstrongswan - -include $(BUILD_SHARED_LIBRARY) - diff --git a/proprietary/external/strongswan/src/libsimaka/Android.mk b/proprietary/external/strongswan/src/libsimaka/Android.mk deleted file mode 100755 index 7790bfc2e997d78d93d2278aaf7903d33c2edbbc..0000000000000000000000000000000000000000 --- a/proprietary/external/strongswan/src/libsimaka/Android.mk +++ /dev/null @@ -1,30 +0,0 @@ -LOCAL_PATH := $(call my-dir) -include $(CLEAR_VARS) - -# copy-n-paste from Makefile.am -libsimaka_la_SOURCES = simaka_message.h simaka_message.c \ - simaka_crypto.h simaka_crypto.c simaka_manager.h simaka_manager.c \ - simaka_card.h simaka_provider.h simaka_hooks.h - -LOCAL_SRC_FILES := $(filter %.c,$(libsimaka_la_SOURCES)) - -# build libsimaka --------------------------------------------------------------- - -LOCAL_C_INCLUDES += \ - $(strongswan_PATH)/src/include \ - $(strongswan_PATH)/src/libstrongswan - -LOCAL_CFLAGS := $(strongswan_CFLAGS) - -LOCAL_MODULE := libsimaka - -LOCAL_MODULE_TAGS := optional - -LOCAL_ARM_MODE := arm - -LOCAL_PRELINK_MODULE := false - -LOCAL_SHARED_LIBRARIES += libstrongswan - -include $(BUILD_SHARED_LIBRARY) - diff --git a/proprietary/external/strongswan/src/libstrongswan/Android.mk b/proprietary/external/strongswan/src/libstrongswan/Android.mk deleted file mode 100755 index 3ff8c3b9077b7f26de43684a2854f1f227fa6155..0000000000000000000000000000000000000000 --- a/proprietary/external/strongswan/src/libstrongswan/Android.mk +++ /dev/null @@ -1,122 +0,0 @@ -LOCAL_PATH := $(call my-dir) - -include $(CLEAR_VARS) - -# copy-n-paste from Makefile.am -LOCAL_SRC_FILES := \ -library.c \ -asn1/asn1.c asn1/asn1_parser.c asn1/oid.c bio/bio_reader.c bio/bio_writer.c \ -collections/blocking_queue.c collections/enumerator.c collections/hashtable.c \ -collections/array.c \ -collections/linked_list.c crypto/crypters/crypter.c crypto/hashers/hasher.c \ -crypto/proposal/proposal_keywords.c crypto/proposal/proposal_keywords_static.c \ -crypto/prfs/prf.c crypto/prfs/mac_prf.c crypto/pkcs5.c \ -crypto/rngs/rng.c crypto/prf_plus.c crypto/signers/signer.c \ -crypto/signers/mac_signer.c crypto/crypto_factory.c crypto/crypto_tester.c \ -crypto/diffie_hellman.c crypto/aead.c crypto/transform.c \ -crypto/iv/iv_gen_rand.c crypto/iv/iv_gen_seq.c \ -credentials/credential_factory.c credentials/builder.c \ -credentials/cred_encoding.c credentials/keys/private_key.c \ -credentials/keys/public_key.c credentials/keys/shared_key.c \ -credentials/certificates/certificate.c credentials/certificates/crl.c \ -credentials/certificates/ocsp_response.c \ -credentials/containers/container.c credentials/containers/pkcs12.c \ -credentials/ietf_attributes/ietf_attributes.c credentials/credential_manager.c \ -credentials/sets/auth_cfg_wrapper.c credentials/sets/ocsp_response_wrapper.c \ -credentials/sets/cert_cache.c credentials/sets/mem_cred.c \ -credentials/sets/callback_cred.c credentials/auth_cfg.c database/database.c \ -database/database_factory.c fetcher/fetcher.c fetcher/fetcher_manager.c eap/eap.c \ -ipsec/ipsec_types.c \ -networking/host.c networking/host_resolver.c networking/packet.c \ -networking/tun_device.c networking/streams/stream.c \ -networking/streams/stream_service.c networking/streams/stream_manager.c \ -pen/pen.c plugins/plugin_loader.c plugins/plugin_feature.c processing/jobs/job.c \ -processing/jobs/callback_job.c processing/processor.c processing/scheduler.c \ -processing/watcher.c resolver/resolver_manager.c resolver/rr_set.c \ -selectors/traffic_selector.c threading/thread.c threading/thread_value.c \ -threading/mutex.c threading/semaphore.c threading/rwlock.c threading/spinlock.c \ -utils/utils.c utils/chunk.c utils/debug.c utils/enum.c utils/identification.c \ -utils/lexparser.c utils/optionsfrom.c utils/capabilities.c utils/backtrace.c \ -utils/cust_settings.c \ -utils/printf_hook/printf_hook_builtin.c utils/settings.c utils/test.c \ -utils/utils/strerror.c - -# adding the plugin source files - -LOCAL_SRC_FILES += $(call add_plugin, aes) - -LOCAL_SRC_FILES += $(call add_plugin, curl) -ifneq ($(call plugin_enabled, curl),) -LOCAL_C_INCLUDES +=$(LOCAL_PATH)/plugins -LOCAL_SHARED_LIBRARIES += libssl-ss libcurl-ss -endif - -LOCAL_SRC_FILES += $(call add_plugin, des) - -LOCAL_SRC_FILES += $(call add_plugin, fips-prf) - -LOCAL_SRC_FILES += $(call add_plugin, gmp) -ifneq ($(call plugin_enabled, gmp),) -LOCAL_C_INCLUDES += $(libgmp_PATH) -LOCAL_SHARED_LIBRARIES += libgmp -endif - -LOCAL_SRC_FILES += $(call add_plugin, hmac) - -LOCAL_SRC_FILES += $(call add_plugin, md4) - -LOCAL_SRC_FILES += $(call add_plugin, md5) - -LOCAL_SRC_FILES += $(call add_plugin, nonce) - -LOCAL_SRC_FILES += $(call add_plugin, openssl) -ifneq ($(call plugin_enabled, openssl),) -LOCAL_C_INCLUDES += $(openssl_PATH) -LOCAL_SHARED_LIBRARIES += libcrypto-ss -endif - -LOCAL_SRC_FILES += $(call add_plugin, pem) - -LOCAL_SRC_FILES += $(call add_plugin, pkcs1) - -LOCAL_SRC_FILES += $(call add_plugin, pkcs7) - -LOCAL_SRC_FILES += $(call add_plugin, pkcs8) - -LOCAL_SRC_FILES += $(call add_plugin, pkcs11) - -LOCAL_SRC_FILES += $(call add_plugin, pubkey) - -LOCAL_SRC_FILES += $(call add_plugin, random) - -LOCAL_SRC_FILES += $(call add_plugin, sha1) - -LOCAL_SRC_FILES += $(call add_plugin, sha2) - -LOCAL_SRC_FILES += $(call add_plugin, x509) - -LOCAL_SRC_FILES += $(call add_plugin, xcbc) - -LOCAL_SRC_FILES += $(call add_plugin, ctr) - -LOCAL_SRC_FILES += $(call add_plugin, revocation) - - -# build libstrongswan ---------------------------------------------------------- - -LOCAL_CFLAGS := $(strongswan_CFLAGS) \ - -include $(LOCAL_PATH)/AndroidConfigLocal.h - -LOCAL_MODULE := libstrongswan - -LOCAL_MODULE_TAGS := optional - -LOCAL_ARM_MODE := arm - -LOCAL_PRELINK_MODULE := false - -LOCAL_SHARED_LIBRARIES += libdl libcutils - - - -include $(BUILD_SHARED_LIBRARY) diff --git a/proprietary/external/strongswan/src/libtnccs/Android.mk b/proprietary/external/strongswan/src/libtnccs/Android.mk deleted file mode 100755 index 68f85c252d39a3a013b3f1520271b4ad8e5aac34..0000000000000000000000000000000000000000 --- a/proprietary/external/strongswan/src/libtnccs/Android.mk +++ /dev/null @@ -1,55 +0,0 @@ -LOCAL_PATH := $(call my-dir) -include $(CLEAR_VARS) - -# copy-n-paste from Makefile.am -libtnccs_la_SOURCES := \ -tnc/tnc.h tnc/tnc.c \ -tnc/imc/imc.h tnc/imc/imc_manager.h \ -tnc/imv/imv.h tnc/imv/imv_manager.h \ -tnc/imv/imv_recommendations.h tnc/imv/imv_recommendations.c \ -tnc/tnccs/tnccs.h tnc/tnccs/tnccs.c \ -tnc/tnccs/tnccs_manager.h tnc/tnccs/tnccs_manager.c - -LOCAL_SRC_FILES := $(filter %.c,$(libtnccs_la_SOURCES)) - -# adding the plugin source files - -LOCAL_SRC_FILES += $(call add_plugin, tnc-imc) -ifneq ($(call plugin_enabled, tnc-imc),) -LOCAL_SHARED_LIBRARIES += libdl -endif - -LOCAL_SRC_FILES += $(call add_plugin, tnc-tnccs) - -LOCAL_SRC_FILES += $(call add_plugin, tnccs-20) -LOCAL_SRC_FILES += $(call add_plugin_subdirs, tnccs-20, batch messages messages/ietf messages/tcg state_machine) -ifneq ($(call plugin_enabled, tnccs-20),) -LOCAL_C_INCLUDES += $(LOCAL_PATH)/plugins/tnccs_20/ -endif - -ifneq ($(or $(call plugin_enabled, tnc-imc), $(call plugin_enabled, tnc-tnccs), \ - $(call plugin_enabled, tnccs-20)),) -LOCAL_SHARED_LIBRARIES += libtncif -endif - -# build libtncif --------------------------------------------------------------- - -LOCAL_C_INCLUDES += \ - $(strongswan_PATH)/src/libtls \ - $(strongswan_PATH)/src/libtncif \ - $(strongswan_PATH)/src/libstrongswan - -LOCAL_CFLAGS := $(strongswan_CFLAGS) - -LOCAL_MODULE := libtnccs - -LOCAL_MODULE_TAGS := optional - -LOCAL_ARM_MODE := arm - -LOCAL_PRELINK_MODULE := false - -LOCAL_SHARED_LIBRARIES += libstrongswan - -include $(BUILD_SHARED_LIBRARY) - diff --git a/proprietary/external/strongswan/src/libtncif/Android.mk b/proprietary/external/strongswan/src/libtncif/Android.mk deleted file mode 100755 index 36d3f4c33b7c183fa7eaf3c4694769db699fa1fe..0000000000000000000000000000000000000000 --- a/proprietary/external/strongswan/src/libtncif/Android.mk +++ /dev/null @@ -1,31 +0,0 @@ -LOCAL_PATH := $(call my-dir) -include $(CLEAR_VARS) - -# copy-n-paste from Makefile.am -libtncif_la_SOURCES := \ -tncif.h tncifimc.h tncifimv.h tncif_names.h tncif_names.c \ -tncif_identity.h tncif_identity.c \ -tncif_pa_subtypes.h tncif_pa_subtypes.c \ -tncif_policy.h tncif_policy.c - -LOCAL_SRC_FILES := $(filter %.c,$(libtncif_la_SOURCES)) - -# build libtncif --------------------------------------------------------------- - -LOCAL_C_INCLUDES += \ - $(strongswan_PATH)/src/libstrongswan - -LOCAL_CFLAGS := $(strongswan_CFLAGS) - -LOCAL_MODULE := libtncif - -LOCAL_MODULE_TAGS := optional - -LOCAL_ARM_MODE := arm - -LOCAL_PRELINK_MODULE := false - -LOCAL_SHARED_LIBRARIES += libstrongswan - -include $(BUILD_SHARED_LIBRARY) - diff --git a/proprietary/external/tiny_util/Android.mk b/proprietary/external/tiny_util/Android.mk deleted file mode 100755 index 5ea74caeead32842589b8626fd1ea3e71527caae..0000000000000000000000000000000000000000 --- a/proprietary/external/tiny_util/Android.mk +++ /dev/null @@ -1,52 +0,0 @@ -ifeq ($(MTK_TINY_UTIL), yes) -LOCAL_PATH:= $(call my-dir) -include $(CLEAR_VARS) - -LOCAL_SRC_FILES := tiny_mkswap.c - -LOCAL_MODULE := tiny_mkswap - -LOCAL_SHARED_LIBRARIES := libc libcutils - -include $(BUILD_EXECUTABLE) - -include $(CLEAR_VARS) - -LOCAL_SRC_FILES := tiny_swapon.c - -LOCAL_MODULE := tiny_swapon - -LOCAL_SHARED_LIBRARIES := libc libcutils - -include $(BUILD_EXECUTABLE) - -include $(CLEAR_VARS) - -LOCAL_SRC_FILES := tiny_swapoff.c - -LOCAL_MODULE := tiny_swapoff - -LOCAL_SHARED_LIBRARIES := libc - -include $(BUILD_EXECUTABLE) - -include $(CLEAR_VARS) - -LOCAL_SRC_FILES := tiny_switch.c - -LOCAL_MODULE := tiny_switch - -LOCAL_SHARED_LIBRARIES := libc libcutils - -include $(BUILD_EXECUTABLE) - -include $(CLEAR_VARS) - -LOCAL_SRC_FILES := tiny_fallocate.c - -LOCAL_MODULE := tiny_fallocate - -LOCAL_SHARED_LIBRARIES := libc libcutils - -include $(BUILD_EXECUTABLE) -endif diff --git a/proprietary/external/trustzone/mtee/Android.mk b/proprietary/external/trustzone/mtee/Android.mk deleted file mode 100755 index 0979ae10aa8bf23c73b4f041e353fbef25625984..0000000000000000000000000000000000000000 --- a/proprietary/external/trustzone/mtee/Android.mk +++ /dev/null @@ -1,6 +0,0 @@ -ifeq ($(filter $(MTK_IN_HOUSE_TEE_SUPPORT) $(MTK_GOOGLE_TRUSTY_SUPPORT),yes),yes) - -LOCAL_PATH := $(call my-dir) -include $(call all-makefiles-under,$(LOCAL_PATH)) - -endif # MTK_IN_HOUSE_TEE_SUPPORT || MTK_GOOGLE_TRUSTY_SUPPORT diff --git a/proprietary/external/trustzone/mtee/MtkVideoSecureAL/Android.mk b/proprietary/external/trustzone/mtee/MtkVideoSecureAL/Android.mk deleted file mode 100755 index 50c13457c2d88288d7bce9b7655b5f2b5b14dc76..0000000000000000000000000000000000000000 --- a/proprietary/external/trustzone/mtee/MtkVideoSecureAL/Android.mk +++ /dev/null @@ -1,37 +0,0 @@ -ifeq ($(strip $(MTK_SEC_VIDEO_PATH_SUPPORT)),yes) - -LOCAL_PATH := $(call my-dir) - -$(warning start lib_uree_mtk_video_secure_al) -include $(CLEAR_VARS) -LOCAL_MODULE := lib_uree_mtk_video_secure_al -LOCAL_SRC_FILES := MtkVideoSecureAL.c -LOCAL_MODULE_TAGS := optional -LOCAL_C_INCLUDES += \ - $(call include-path-for, trustzone-uree) - -LOCAL_SHARED_LIBRARIES := \ - libutils \ - libcutils - -ifeq ($(strip $(MTK_IN_HOUSE_TEE_SUPPORT)),yes) -LOCAL_CFLAGS += -DMTK_IN_HOUSE_TEE_SUPPORT -endif - -ifeq ($(strip $(MTK_SEC_WFD_VIDEO_PATH_SUPPORT)),yes) -LOCAL_CFLAGS += -DMTK_SEC_WFD_VIDEO_PATH_SUPPORT -endif - -ifeq ($(strip $(MTK_SEC_VIDEO_PATH_SUPPORT)),yes) -LOCAL_CFLAGS += -DMTK_SEC_VIDEO_PATH_SUPPORT -endif - -#LOCAL_CFLAGS += ${TZ_CFLAG} -#LOCAL_LDFLAGS += --gc-sections -#LOCAL_ASFLAGS += -DASSEMBLY -#LOCAL_STATIC_LIBRARIES += libc_tz libtest -LOCAL_SHARED_LIBRARIES += libtz_uree -include $(BUILD_SHARED_LIBRARY) - -$(warning finish lib_uree_mtk_video_secure_al) -endif diff --git a/proprietary/external/trustzone/mtee/gatekeeper/Android.mk b/proprietary/external/trustzone/mtee/gatekeeper/Android.mk deleted file mode 100755 index 99e1914be0a4a26c51b121a7521170bad5962aad..0000000000000000000000000000000000000000 --- a/proprietary/external/trustzone/mtee/gatekeeper/Android.mk +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright Statement: -# -# This software/firmware and related documentation ("MediaTek Software") are -# protected under relevant copyright laws. The information contained herein -# is confidential and proprietary to MediaTek Inc. and/or its licensors. -# Without the prior written permission of MediaTek inc. and/or its licensors, -# any reproduction, modification, use or disclosure of MediaTek Software, -# and information contained herein, in whole or in part, shall be strictly prohibited. -# -# MediaTek Inc. (C) 2010. All rights reserved. -# -# BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES -# THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE") -# RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER ON -# AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT. -# NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE -# SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR -# SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES TO LOOK ONLY TO SUCH -# THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. RECEIVER EXPRESSLY ACKNOWLEDGES -# THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES -# CONTAINED IN MEDIATEK SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK -# SOFTWARE RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR -# STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND -# CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE, -# AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE, -# OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY RECEIVER TO -# MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. -# -# The following software/firmware and/or related documentation ("MediaTek Software") -# have been modified by MediaTek Inc. All revisions are subject to any receiver's -# applicable license agreements with MediaTek Inc. -ifeq ($(MTK_IN_HOUSE_TEE_SUPPORT),yes) - -LOCAL_PATH := $(call my-dir) -include $(call all-makefiles-under,$(LOCAL_PATH)) - -endif - diff --git a/proprietary/external/trustzone/mtee/gatekeeper/common/Android.mk b/proprietary/external/trustzone/mtee/gatekeeper/common/Android.mk deleted file mode 100755 index fb3eaf58ce49525d40775553db4de496a7be3ac9..0000000000000000000000000000000000000000 --- a/proprietary/external/trustzone/mtee/gatekeeper/common/Android.mk +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright (C) 2013 The Android Open Source Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -LOCAL_PATH := $(call my-dir) - -include $(CLEAR_VARS) - -LOCAL_MODULE_RELATIVE_PATH := hw -LOCAL_C_INCLUDES += hardware/libhardware/include \ - $(LOCAL_PATH)/include \ - $(call include-path-for, trustzone-uree) - -LOCAL_SHARED_LIBRARIES := liblog libtz_uree -LOCAL_SRC_FILES := module.cpp gatekeeper.cpp - -LOCAL_MODULE := gatekeeper.$(TARGET_BOARD_PLATFORM) - -LOCAL_MULTILIB := both -include $(BUILD_SHARED_LIBRARY) - - diff --git a/proprietary/external/trustzone/mtee/gcpu_test/Android.mk b/proprietary/external/trustzone/mtee/gcpu_test/Android.mk deleted file mode 100755 index 6227c700c71325a2141c50af2e7dd49a2929af93..0000000000000000000000000000000000000000 --- a/proprietary/external/trustzone/mtee/gcpu_test/Android.mk +++ /dev/null @@ -1,17 +0,0 @@ -LOCAL_PATH := $(call my-dir) - -include $(CLEAR_VARS) -LOCAL_MODULE := mtee_gcpu_test -LOCAL_SRC_FILES := mtee_gcpu_test.c -LOCAL_MODULE_TAGS := optional -LOCAL_C_INCLUDES += \ - $(call include-path-for, trustzone-uree) - -LOCAL_CFLAGS += -Wall -Wno-unused-parameter -Werror - -#LOCAL_CFLAGS += ${TZ_CFLAG} -#LOCAL_LDFLAGS += --gc-sections -#LOCAL_ASFLAGS += -DASSEMBLY -LOCAL_SHARED_LIBRARIES += libtz_uree -include $(BUILD_EXECUTABLE) - diff --git a/proprietary/external/trustzone/mtee/keymaster1/Android.mk b/proprietary/external/trustzone/mtee/keymaster1/Android.mk deleted file mode 100755 index a04fbae08f66e8dbf98b4b0f44afb268d5a3b5db..0000000000000000000000000000000000000000 --- a/proprietary/external/trustzone/mtee/keymaster1/Android.mk +++ /dev/null @@ -1,54 +0,0 @@ -LOCAL_PATH := $(call my-dir) -include $(CLEAR_VARS) -LOCAL_MODULE := keystore.$(TARGET_BOARD_PLATFORM) -LOCAL_CFLAGS += -fvisibility=hidden -DLOG_TAG=\"KM_UREE\" -LOCAL_MODULE_RELATIVE_PATH := hw -LOCAL_SRC_FILES := \ - android_keymaster.cpp \ - android_keymaster_messages.cpp \ - android_keymaster_utils.cpp \ - authorization_set.cpp \ - keymaster_mtee_api.cpp \ - serializable.cpp \ - keymaster_hal.cpp - -LOCAL_C_INCLUDES += \ - hardware/libhardware/include \ - vendor/mediatek/proprietary/external/trustzone/mtee/include \ - $(LOCAL_PATH)/include \ - $(LOCAL_PATH)/include/keymaster - -LOCAL_SHARED_LIBRARIES += libcrypto liblog libutils libtz_uree - -include $(BUILD_SHARED_LIBRARY) - -ifeq ($(MTK_KEYMASTER_TEST_SUPPORT),yes) -# Unit tests for libkeymaster -include $(CLEAR_VARS) -LOCAL_MODULE := mtee_keymaster_tests -LOCAL_CFLAGS += -DLOG_TAG=\"KM_TEST\" -LOCAL_SRC_FILES := \ - test/keymaster_test.cpp - -LOCAL_C_INCLUDES := \ - $(LOCAL_PATH)/include \ - $(LOCAL_PATH)/test \ - hardware/libhardware/include \ - system/security/softkeymaster/include - -LOCAL_CLANG_CFLAGS += -Wno-error=unused-const-variable -Wno-error=unused-private-field -LOCAL_MODULE_TAGS := tests -LOCAL_SHARED_LIBRARIES := \ - libcrypto \ - libsoftkeymaster \ - libhardware \ - libutils \ - libcutils \ - libtz_uree - -LOCAL_C_INCLUDES += $(LOCAL_PATH)/include/keymaster/ \ - $(LOCAL_PATH)/include/ - -LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk -include $(BUILD_NATIVE_TEST) -endif diff --git a/proprietary/external/trustzone/mtee/mem_app/Android.mk b/proprietary/external/trustzone/mtee/mem_app/Android.mk deleted file mode 100755 index 92346aa67a954df711da094cc127ad19b3e4d38e..0000000000000000000000000000000000000000 --- a/proprietary/external/trustzone/mtee/mem_app/Android.mk +++ /dev/null @@ -1,18 +0,0 @@ -LOCAL_PATH := $(call my-dir) - -include $(CLEAR_VARS) -LOCAL_MODULE := uree_mem -LOCAL_SRC_FILES := mem_app.c -LOCAL_MODULE_TAGS := optional -LOCAL_C_INCLUDES += \ - $(call include-path-for, trustzone-uree) - -LOCAL_CFLAGS += -Wall -Wno-unused-parameter -Werror - -#LOCAL_CFLAGS += ${TZ_CFLAG} -#LOCAL_LDFLAGS += --gc-sections -#LOCAL_ASFLAGS += -DASSEMBLY -#LOCAL_STATIC_LIBRARIES += libc_tz libtest -LOCAL_SHARED_LIBRARIES += libtz_uree -include $(BUILD_EXECUTABLE) - diff --git a/proprietary/external/trustzone/mtee/mtee_logctrl/Android.mk b/proprietary/external/trustzone/mtee/mtee_logctrl/Android.mk deleted file mode 100755 index 17211f6ec09adba2dcebae12fc28cad067155a06..0000000000000000000000000000000000000000 --- a/proprietary/external/trustzone/mtee/mtee_logctrl/Android.mk +++ /dev/null @@ -1,17 +0,0 @@ -LOCAL_PATH := $(call my-dir) - -include $(CLEAR_VARS) -LOCAL_MODULE := mtee_logctrl -LOCAL_SRC_FILES := mtee_logctrl.c -LOCAL_MODULE_TAGS := optional -LOCAL_C_INCLUDES += \ - $(call include-path-for, trustzone-uree) - -LOCAL_CFLAGS += -Wall -Wno-unused-parameter -Werror - -#LOCAL_CFLAGS += ${TZ_CFLAG} -#LOCAL_LDFLAGS += --gc-sections -#LOCAL_ASFLAGS += -DASSEMBLY -LOCAL_SHARED_LIBRARIES += libtz_uree -include $(BUILD_EXECUTABLE) - diff --git a/proprietary/external/trustzone/mtee/rpmb/Android.mk b/proprietary/external/trustzone/mtee/rpmb/Android.mk deleted file mode 100755 index 8cc8a52a4dddaab5fc70c6b6b1808da3c635f0d8..0000000000000000000000000000000000000000 --- a/proprietary/external/trustzone/mtee/rpmb/Android.mk +++ /dev/null @@ -1,47 +0,0 @@ -LOCAL_PATH := $(call my-dir) - -include $(CLEAR_VARS) -LOCAL_MODULE := rpmb_svc -LOCAL_SRC_FILES := rpmb_svc.c \ - rpmb_api.c \ - uree_rpmb.c - -LOCAL_MODULE_TAGS := optional -LOCAL_C_INCLUDES += \ - $(call include-path-for, trustzone-uree) - -LOCAL_CFLAGS += -Wall -Wno-unused-parameter -Werror - -LOCAL_SHARED_LIBRARIES += libtz_uree -LOCAL_SHARED_LIBRARIES += liblog -LOCAL_SHARED_LIBRARIES += libcutils -include $(BUILD_EXECUTABLE) - -include $(CLEAR_VARS) -LOCAL_MODULE := rpmb_test - -LOCAL_SRC_FILES := rpmb_api.c \ - rpmb_test.c \ - uree_rpmb.c - -LOCAL_MODULE_TAGS := optional -LOCAL_C_INCLUDES += \ - $(call include-path-for, trustzone-uree) - -LOCAL_SHARED_LIBRARIES += libtz_uree -LOCAL_SHARED_LIBRARIES += liblog -include $(BUILD_EXECUTABLE) - -include $(CLEAR_VARS) -LOCAL_MODULE := rpmb_key_sts - -LOCAL_SRC_FILES := rpmb_api.c \ - rpmb_key_sts.c \ - -LOCAL_MODULE_TAGS := optional - -LOCAL_C_INCLUDES += \ - $(call include-path-for, trustzone-uree) - -LOCAL_SHARED_LIBRARIES += liblog -include $(BUILD_EXECUTABLE) diff --git a/proprietary/external/trustzone/mtee/test/Android.mk b/proprietary/external/trustzone/mtee/test/Android.mk deleted file mode 100755 index 7c877e0684b872920d5b2e0acf81325111103abe..0000000000000000000000000000000000000000 --- a/proprietary/external/trustzone/mtee/test/Android.mk +++ /dev/null @@ -1,35 +0,0 @@ -LOCAL_PATH := $(call my-dir) - --include $(MTK_PATH_SOURCE)/trustzone/mtk/Setting.mk - -include $(CLEAR_VARS) -LOCAL_MODULE := uree_test -LOCAL_SRC_FILES := test.c -LOCAL_MODULE_TAGS := optional -LOCAL_C_INCLUDES += \ - $(call include-path-for, trustzone-uree) \ - $(MTK_KERNEL_HEADERS) - -LOCAL_CFLAGS += -Wall -Wno-unused-parameter -Werror - -LOCAL_MODULE_STEM_32 := uree_test32 -LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE) -LOCAL_MULTILIB := both - -ifeq ($(TZ_ENABLE_TOMCRYPT_TEST),true) -LOCAL_CFLAGS += -DENABLE_TOMCRYPT_TEST -endif -LOCAL_SHARED_LIBRARIES += libtz_uree -LOCAL_SHARED_LIBRARIES += liblog -include $(BUILD_EXECUTABLE) - -include $(CLEAR_VARS) -LOCAL_MODULE := uree_rng_test -LOCAL_SRC_FILES := uree_rng_test.c -LOCAL_MODULE_TAGS := optional -LOCAL_C_INCLUDES += \ - $(call include-path-for, trustzone-uree) \ - $(MTK_KERNEL_HEADERS) -LOCAL_CFLAGS += -Wall -Wno-unused-parameter -Werror -LOCAL_SHARED_LIBRARIES += libtz_uree -include $(BUILD_EXECUTABLE) diff --git a/proprietary/external/trustzone/mtee/uree/Android.mk b/proprietary/external/trustzone/mtee/uree/Android.mk deleted file mode 100755 index 3d1e1eea55a341b339c846c9208cc27af3f3d8a2..0000000000000000000000000000000000000000 --- a/proprietary/external/trustzone/mtee/uree/Android.mk +++ /dev/null @@ -1,27 +0,0 @@ -LOCAL_PATH := $(call my-dir) - -include $(CLEAR_VARS) - -LOCAL_MODULE := libtz_uree -LOCAL_MODULE_TAGS := optional -LOCAL_SRC_FILES := uree.c \ - uree_mem.c \ - dump_sec_mem.c \ - uree_dbg.c - -LOCAL_C_INCLUDES += \ - $(call include-path-for, trustzone-uree) \ - $(word 1,$(TARGET_BOARD_KERNEL_HEADERS))/trustzone \ - $(TOP)/kernel-3.18/include/trustzone \ - $(MTK_PATH_SOURCE)/external/trustzone/mtee/include/ - -LOCAL_CFLAGS += -Wall -Wno-unused-parameter -Werror -LOCAL_SHARED_LIBRARIES += liblog - - -#LOCAL_CFLAGS += ${TZ_CFLAG} -#LOCAL_LDFLAGS += --gc-sections -#LOCAL_ASFLAGS += -DASSEMBLY -#LOCAL_STATIC_LIBRARIES += libc_tz libtest -include $(BUILD_SHARED_LIBRARY) - diff --git a/proprietary/external/udf/Android.mk b/proprietary/external/udf/Android.mk deleted file mode 100755 index af1e919648ab7915191185d46bf649fc3dc4cc3e..0000000000000000000000000000000000000000 --- a/proprietary/external/udf/Android.mk +++ /dev/null @@ -1,15 +0,0 @@ -LOCAL_PATH := $(call my-dir) - -# ======================================================== -# for LD_PRELOAD -# ======================================================== -ifeq ($(MTK_USER_SPACE_DEBUG_FW),yes) -include $(CLEAR_VARS) -LOCAL_SRC_FILES := init.preload.eng.rc -LOCAL_MODULE := init.preload.rc -LOCAL_MODULE_CLASS := ETC -LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT) -LOCAL_MODULE_TAGS := eng -include $(BUILD_PREBUILT) -endif - diff --git a/proprietary/external/voiceui/Android.mk b/proprietary/external/voiceui/Android.mk deleted file mode 100755 index cef2d6d32e4b079b0e212a2264e8bfaf6ac3fd1c..0000000000000000000000000000000000000000 --- a/proprietary/external/voiceui/Android.mk +++ /dev/null @@ -1,12 +0,0 @@ -LOCAL_PATH := $(my-dir) - -include $(CLEAR_VARS) -LOCAL_MODULE := libvoiceui -LOCAL_MODULE_CLASS := STATIC_LIBRARIES -LOCAL_SRC_FILES_arm := libvoiceui_32.a -LOCAL_SRC_FILES_arm64 := libvoiceui_32.a -#LOCAL_SRC_FILES_arm64 := libvoiceui_64.a -LOCAL_MULTILIB := 32 -LOCAL_MODULE_SUFFIX := .a -include $(BUILD_PREBUILT) - diff --git a/proprietary/external/voiceunlock/Android.mk b/proprietary/external/voiceunlock/Android.mk deleted file mode 100755 index 3e83a80a0c10438029cb79f44f93b94445f75a66..0000000000000000000000000000000000000000 --- a/proprietary/external/voiceunlock/Android.mk +++ /dev/null @@ -1,14 +0,0 @@ -LOCAL_PATH := $(my-dir) - -include $(CLEAR_VARS) - -LOCAL_MODULE := libvoiceunlock -LOCAL_SRC_FILES_arm := libvoiceunlock_32.a -LOCAL_SRC_FILES_arm64 := libvoiceunlock_32.a -#LOCAL_SRC_FILES_arm64 := libvoiceunlock_64.a - - -LOCAL_MODULE_CLASS := STATIC_LIBRARIES -LOCAL_MULTILIB := 32 -LOCAL_MODULE_SUFFIX := .a -include $(BUILD_PREBUILT) diff --git a/proprietary/external/vorbisenc/Android.mk b/proprietary/external/vorbisenc/Android.mk deleted file mode 100755 index aadf7aaef69bc24021c4bd11947e9c50d7022e59..0000000000000000000000000000000000000000 --- a/proprietary/external/vorbisenc/Android.mk +++ /dev/null @@ -1,25 +0,0 @@ -# -# Copyright (C) 2008 The Android Open Source Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -LOCAL_PATH := $(my-dir) -include $(CLEAR_VARS) - -LOCAL_MODULE := libvorbisenc_mtk -LOCAL_MODULE_CLASS := STATIC_LIBRARIES -LOCAL_SRC_FILES_32 := arm/libvorbisenc_mtk.a -LOCAL_SRC_FILES_64 := libvorbisenc_mtk.a -LOCAL_MODULE_SUFFIX := .a -LOCAL_MULTILIB := both -include $(BUILD_PREBUILT) diff --git a/proprietary/external/vsimadaptorclient/Android.mk b/proprietary/external/vsimadaptorclient/Android.mk deleted file mode 100755 index 768696f9d97788b7a87234ef25ebaf668bbf49d3..0000000000000000000000000000000000000000 --- a/proprietary/external/vsimadaptorclient/Android.mk +++ /dev/null @@ -1,24 +0,0 @@ -# Copyright 2006 The Android Open Source Project - - -# =========================================== -# = Configuration of libvsim-adaptor-client = -# =========================================== -LOCAL_PATH:= $(call my-dir) -include $(CLEAR_VARS) - -LOCAL_SRC_FILES:= \ - vsim_adaptor_ipc.c - -LOCAL_SHARED_LIBRARIES := \ - libcutils \ - libc - -LOCAL_LDLIBS:= -llog - -LOCAL_CFLAGS := -DRIL_SHLIB - -LOCAL_MODULE := libvsim-adaptor-client -LOCAL_MODULE_TAGS := eng - -include $(BUILD_SHARED_LIBRARY) diff --git a/proprietary/external/xcap/Android.mk b/proprietary/external/xcap/Android.mk deleted file mode 100755 index 91f314ceee56181fb2e3a8c2559c6e6bd654023a..0000000000000000000000000000000000000000 --- a/proprietary/external/xcap/Android.mk +++ /dev/null @@ -1,16 +0,0 @@ -LOCAL_PATH := $(call my-dir) -include $(CLEAR_VARS) - -LOCAL_JAVA_LIBRARIES := okhttp - -# Include all the java files. -LOCAL_SRC_FILES := $(call all-java-files-under, src) - -LOCAL_MODULE_TAGS := optional - -# The name of the jar file to create. -LOCAL_MODULE := xcap - -# Build a static jar file. -include $(BUILD_STATIC_JAVA_LIBRARY) - diff --git a/proprietary/factory/src/miniui/Android.mk b/proprietary/factory/src/miniui/Android.mk deleted file mode 100755 index 05e95c040580c90eff8471b12b43cac5e251ea28..0000000000000000000000000000000000000000 --- a/proprietary/factory/src/miniui/Android.mk +++ /dev/null @@ -1,65 +0,0 @@ -# Copyright Statement: -# -# This software/firmware and related documentation ("MediaTek Software") are -# protected under relevant copyright laws. The information contained herein -# is confidential and proprietary to MediaTek Inc. and/or its licensors. -# Without the prior written permission of MediaTek inc. and/or its licensors, -# any reproduction, modification, use or disclosure of MediaTek Software, -# and information contained herein, in whole or in part, shall be strictly prohibited. - -# MediaTek Inc. (C) 2010. All rights reserved. -# -# BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES -# THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE") -# RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER ON -# AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT. -# NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE -# SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR -# SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES TO LOOK ONLY TO SUCH -# THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. RECEIVER EXPRESSLY ACKNOWLEDGES -# THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES -# CONTAINED IN MEDIATEK SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK -# SOFTWARE RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR -# STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND -# CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE, -# AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE, -# OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY RECEIVER TO -# MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. -# -# The following software/firmware and/or related documentation ("MediaTek Software") -# have been modified by MediaTek Inc. All revisions are subject to any receiver's -# applicable license agreements with MediaTek Inc. - - -LOCAL_PATH := $(call my-dir) -include $(CLEAR_VARS) - -LOCAL_SRC_FILES := miniui.c graphics.c events.c resources.c - -HAVE_CUST_INC_PATH := $(shell test -d $(MTK_PATH_CUSTOM)/factory/inc && echo yes) - -ifeq ($(HAVE_CUST_INC_PATH),yes) - LOCAL_CUST_INC_PATH := $(MTK_PATH_CUSTOM)/factory/inc -else - LOCAL_CUST_INC_PATH := $(MTK_ROOT)/custom/generic/factory/inc -endif - -LOCAL_C_INCLUDES +=\ - external/libpng\ - external/zlib\ - $(LOCAL_PATH)/../../inc \ - $(MTK_PATH_COMMON)/factory/inc \ - $(LOCAL_CUST_INC_PATH) \ - $(TOPDIR)/system/core/libpixelflinger/include \ - -LOCAL_SHARED_LIBRARIES += libpixelflinger libpng - -include $(LOCAL_PATH)/font.mk - -LOCAL_MODULE := libminiui - -LOCAL_MODULE_TAGS := optional - -include $(BUILD_SHARED_LIBRARY) diff --git a/proprietary/factory/src/mmutil/Android.mk b/proprietary/factory/src/mmutil/Android.mk deleted file mode 100755 index 32e5c7fc4e8391059ed4f78af9ca4f1e7d81d716..0000000000000000000000000000000000000000 --- a/proprietary/factory/src/mmutil/Android.mk +++ /dev/null @@ -1,58 +0,0 @@ -# Copyright Statement: -# -# This software/firmware and related documentation ("MediaTek Software") are -# protected under relevant copyright laws. The information contained herein -# is confidential and proprietary to MediaTek Inc. and/or its licensors. -# Without the prior written permission of MediaTek inc. and/or its licensors, -# any reproduction, modification, use or disclosure of MediaTek Software, -# and information contained herein, in whole or in part, shall be strictly prohibited. - -# MediaTek Inc. (C) 2010. All rights reserved. -# -# BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES -# THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE") -# RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER ON -# AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT. -# NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE -# SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR -# SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES TO LOOK ONLY TO SUCH -# THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. RECEIVER EXPRESSLY ACKNOWLEDGES -# THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES -# CONTAINED IN MEDIATEK SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK -# SOFTWARE RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR -# STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND -# CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE, -# AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE, -# OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY RECEIVER TO -# MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. -# -# The following software/firmware and/or related documentation ("MediaTek Software") -# have been modified by MediaTek Inc. All revisions are subject to any receiver's -# applicable license agreements with MediaTek Inc. - - -LOCAL_PATH := $(call my-dir) -include $(CLEAR_VARS) - -LOCAL_SRC_FILES := \ - ddp_factory.cpp \ - multimediaFactoryTest.cpp - -LOCAL_C_INCLUDES:= \ - $(TOP)/system/core/include/cutils \ - $(MTK_PATH_SOURCE)/factory/inc \ - $(MTK_PATH_SOURCE)/hardware/dpframework/inc - -LOCAL_SHARED_LIBRARIES := \ - libdl \ - libcutils \ - libdpframework - -LOCAL_CFLAGS += -Wno-multichar - -LOCAL_MODULE := libmmfactoryutil -LOCAL_MODULE_TAGS := optional - -include $(BUILD_SHARED_LIBRARY) diff --git a/proprietary/factory/src/mmutil/test/Android.mk b/proprietary/factory/src/mmutil/test/Android.mk deleted file mode 100755 index 671657d7c43fe30c32c84a6058abd7571a08b606..0000000000000000000000000000000000000000 --- a/proprietary/factory/src/mmutil/test/Android.mk +++ /dev/null @@ -1,60 +0,0 @@ -# Copyright Statement: -# -# This software/firmware and related documentation ("MediaTek Software") are -# protected under relevant copyright laws. The information contained herein -# is confidential and proprietary to MediaTek Inc. and/or its licensors. -# Without the prior written permission of MediaTek inc. and/or its licensors, -# any reproduction, modification, use or disclosure of MediaTek Software, -# and information contained herein, in whole or in part, shall be strictly prohibited. - -# MediaTek Inc. (C) 2010. All rights reserved. -# -# BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES -# THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE") -# RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER ON -# AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT. -# NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE -# SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR -# SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES TO LOOK ONLY TO SUCH -# THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. RECEIVER EXPRESSLY ACKNOWLEDGES -# THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES -# CONTAINED IN MEDIATEK SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK -# SOFTWARE RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR -# STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND -# CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE, -# AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE, -# OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY RECEIVER TO -# MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. -# -# The following software/firmware and/or related documentation ("MediaTek Software") -# have been modified by MediaTek Inc. All revisions are subject to any receiver's -# applicable license agreements with MediaTek Inc. - - -# -# mdpd -# -LOCAL_PATH:= $(call my-dir) - -include $(CLEAR_VARS) - -LOCAL_SRC_FILES:= \ - ddpfactory_test.cpp - -LOCAL_SHARED_LIBRARIES := \ - libmmfactoryutil - -LOCAL_C_INCLUDES:= \ - $(MTK_PATH_SOURCE)factory/inc - -LOCAL_CFLAGS += -Wno-multichar - -LOCAL_MODULE := ddpfactory_test - -LOCAL_MODULE_TAGS := optional - -LOCAL_PRELINK_MODULE:=false - -include $(BUILD_EXECUTABLE) diff --git a/proprietary/factory/src/mtdutil/Android.mk b/proprietary/factory/src/mtdutil/Android.mk deleted file mode 100755 index 3da9507af770d35cd215fbe818e8f8d7d8f933d1..0000000000000000000000000000000000000000 --- a/proprietary/factory/src/mtdutil/Android.mk +++ /dev/null @@ -1,47 +0,0 @@ -# Copyright Statement: -# -# This software/firmware and related documentation ("MediaTek Software") are -# protected under relevant copyright laws. The information contained herein -# is confidential and proprietary to MediaTek Inc. and/or its licensors. -# Without the prior written permission of MediaTek inc. and/or its licensors, -# any reproduction, modification, use or disclosure of MediaTek Software, -# and information contained herein, in whole or in part, shall be strictly prohibited. - -# MediaTek Inc. (C) 2010. All rights reserved. -# -# BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES -# THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE") -# RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER ON -# AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT. -# NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE -# SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR -# SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES TO LOOK ONLY TO SUCH -# THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. RECEIVER EXPRESSLY ACKNOWLEDGES -# THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES -# CONTAINED IN MEDIATEK SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK -# SOFTWARE RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR -# STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND -# CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE, -# AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE, -# OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY RECEIVER TO -# MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. -# -# The following software/firmware and/or related documentation ("MediaTek Software") -# have been modified by MediaTek Inc. All revisions are subject to any receiver's -# applicable license agreements with MediaTek Inc. - - -LOCAL_PATH := $(call my-dir) -include $(CLEAR_VARS) - -LOCAL_SRC_FILES := mtdutils.c mounts.c - -LOCAL_C_INCLUDES += $(LOCAL_PATH)/../../inc - -LOCAL_MODULE := libmtdutil - -LOCAL_MODULE_TAGS := optional - -include $(BUILD_STATIC_LIBRARY) diff --git a/proprietary/frameworks/base/tests/ANR/Android.mk b/proprietary/frameworks/base/tests/ANR/Android.mk deleted file mode 100755 index 7e960853bca3b6d48743c1fa4bec7f7a417b4649..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/ANR/Android.mk +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (C) 2008 The Android Open Source Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -LOCAL_PATH:= $(call my-dir) -include $(CLEAR_VARS) - -LOCAL_MODULE_TAGS := tests - -LOCAL_SRC_FILES := $(call all-java-files-under, src)\ - $(call all-java-files-under, core/runner/src) - -LOCAL_JAVA_LIBRARIES := android.test.runner - -#LOCAL_JNI_SHARED_LIBRARIES := libcts_jni - -# Resource unit tests use a private locale and some densities -LOCAL_AAPT_FLAGS = -c xx_YY -c cs -c 32dpi -c 240dpi -c 160dpi - -LOCAL_PACKAGE_NAME := MediatekAnrTestStubs - -include $(BUILD_PACKAGE) - -# Build the test APK using its own makefile, and any other CTS-related packages -include $(call all-makefiles-under,$(LOCAL_PATH)) diff --git a/proprietary/frameworks/base/tests/ANR/Android.mk_ b/proprietary/frameworks/base/tests/ANR/Android.mk_ deleted file mode 100755 index 7e960853bca3b6d48743c1fa4bec7f7a417b4649..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/ANR/Android.mk_ +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (C) 2008 The Android Open Source Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -LOCAL_PATH:= $(call my-dir) -include $(CLEAR_VARS) - -LOCAL_MODULE_TAGS := tests - -LOCAL_SRC_FILES := $(call all-java-files-under, src)\ - $(call all-java-files-under, core/runner/src) - -LOCAL_JAVA_LIBRARIES := android.test.runner - -#LOCAL_JNI_SHARED_LIBRARIES := libcts_jni - -# Resource unit tests use a private locale and some densities -LOCAL_AAPT_FLAGS = -c xx_YY -c cs -c 32dpi -c 240dpi -c 160dpi - -LOCAL_PACKAGE_NAME := MediatekAnrTestStubs - -include $(BUILD_PACKAGE) - -# Build the test APK using its own makefile, and any other CTS-related packages -include $(call all-makefiles-under,$(LOCAL_PATH)) diff --git a/proprietary/frameworks/base/tests/ANR/AndroidManifest.xml b/proprietary/frameworks/base/tests/ANR/AndroidManifest.xml deleted file mode 100755 index 0634d3cac070ccf279d2f42f70f25fb33018d6a1..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/ANR/AndroidManifest.xml +++ /dev/null @@ -1,136 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/proprietary/frameworks/base/tests/ANR/NOTICE b/proprietary/frameworks/base/tests/ANR/NOTICE deleted file mode 100755 index 8de7241cd3394cc99c2a5661349a3ca5268e7575..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/ANR/NOTICE +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - diff --git a/proprietary/frameworks/base/tests/ANR/core/runner/NOTICE b/proprietary/frameworks/base/tests/ANR/core/runner/NOTICE deleted file mode 100755 index 82b3dd266a00043baed7a48e60fa214cde93bb64..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/ANR/core/runner/NOTICE +++ /dev/null @@ -1,23 +0,0 @@ -* Copyright (C) 2009 The Android Open Source Project: -* Copyright (C) 2007 The Android Open Source Project: -* Copyright (C) 2008 The Android Open Source Project: - - - -/* -* Copyright (C) 2011-2014 MediaTek Inc. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -: diff --git a/proprietary/frameworks/base/tests/ANR/core/runner/README b/proprietary/frameworks/base/tests/ANR/core/runner/README deleted file mode 100755 index 37166d8c364b56f7f568def3eadb45914f36d956..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/ANR/core/runner/README +++ /dev/null @@ -1,18 +0,0 @@ -This is ANR manager proguard test apk. - -WHAT IT DOES? -============= -The purpose of this apk is to test if ANRManager.java is proguard or not. - -HOW IT WAS BUILT? -================== -mmm vendor/mediatek/frameworks/base/tests/ANR/ -mmm vendor/mediatek/frameworks/base/tests/ANR/tests/ - -HOW TO USE IT? -============== -adb install -r MediatekAnrTestStubs.apk -adb install -r MediaTekCtsAnrTestCases.apk -adb shell am instrument -w -e class mediatek.app.cts.ANRManagerProGuardTest com.mediatek.cts.anr/android.test.InstrumentationCtsTestRunner - -The majority of source code for this library were written by MediaTek. \ No newline at end of file diff --git a/proprietary/frameworks/base/tests/ANR/core/runner/src/android/test/InstrumentationCtsTestRunner.java b/proprietary/frameworks/base/tests/ANR/core/runner/src/android/test/InstrumentationCtsTestRunner.java deleted file mode 100755 index 4f20a7f51c47d99dcd5a514da0442dbbc79793bd..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/ANR/core/runner/src/android/test/InstrumentationCtsTestRunner.java +++ /dev/null @@ -1,237 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.test; - -import com.android.internal.util.Predicate; -import com.android.internal.util.Predicates; - -import dalvik.annotation.BrokenTest; -import dalvik.annotation.SideEffect; - -import android.app.KeyguardManager; -import android.content.Context; -import android.content.pm.PackageManager; -import android.os.Bundle; -import android.test.suitebuilder.TestMethod; -import android.test.suitebuilder.annotation.HasAnnotation; -import android.util.Log; - -import java.io.File; -import java.lang.reflect.Field; -import java.lang.reflect.Modifier; -import java.util.List; -import java.util.TimeZone; - -import junit.framework.AssertionFailedError; -import junit.framework.Test; -import junit.framework.TestCase; -import junit.framework.TestListener; - -/** - * This test runner extends the default InstrumentationTestRunner. It overrides - * the {@code onCreate(Bundle)} method and sets the system properties necessary - * for many core tests to run. This is needed because there are some core tests - * that need writing access to the file system. We also need to set the harness - * Thread's context ClassLoader. Otherwise some classes and resources will not - * be found. Finally, we add a means to free memory allocated by a TestCase - * after its execution. - * - * @hide - */ -public class InstrumentationCtsTestRunner extends InstrumentationTestRunner { - - /** - * Convenience definition of our log tag. - */ - private static final String TAG = "InstrumentationCtsTestRunner"; - - private static final String REPORT_VALUE_ID = "InstrumentationCtsTestRunner"; - - /** - * True if (and only if) we are running in single-test mode (as opposed to - * batch mode). - */ - private boolean mSingleTest = false; - - @Override - public void onCreate(Bundle arguments) { - // We might want to move this to /sdcard, if is is mounted/writable. - File cacheDir = getTargetContext().getCacheDir(); - - // Set some properties that the core tests absolutely need. - System.setProperty("user.language", "en"); - System.setProperty("user.region", "US"); - - System.setProperty("java.home", cacheDir.getAbsolutePath()); - System.setProperty("user.home", cacheDir.getAbsolutePath()); - System.setProperty("java.io.tmpdir", cacheDir.getAbsolutePath()); - System.setProperty("user.dir", cacheDir.getAbsolutePath()); - System.setProperty("javax.net.ssl.trustStore", - "/etc/security/cacerts.bks"); - - TimeZone.setDefault(TimeZone.getTimeZone("GMT")); - - if (arguments != null) { - String classArg = arguments.getString(ARGUMENT_TEST_CLASS); - mSingleTest = classArg != null && classArg.contains("#"); - } - - // attempt to disable keyguard, if current test has permission to do so - // TODO: move this to a better place, such as InstrumentationTestRunner ? - if (getContext().checkCallingOrSelfPermission(android.Manifest.permission.DISABLE_KEYGUARD) - == PackageManager.PERMISSION_GRANTED) { - Log.i(TAG, "Disabling keyguard"); - KeyguardManager keyguardManager = - (KeyguardManager) getContext().getSystemService(Context.KEYGUARD_SERVICE); - keyguardManager.newKeyguardLock("cts").disableKeyguard(); - } else { - Log.i(TAG, "Test lacks permission to disable keyguard. " + - "UI based tests may fail if keyguard is up"); - } - - super.onCreate(arguments); - } - - @Override - protected AndroidTestRunner getAndroidTestRunner() { - AndroidTestRunner runner = super.getAndroidTestRunner(); - - runner.addTestListener(new TestListener() { - /** - * The last test class we executed code from. - */ - private Class lastClass; - - /** - * The minimum time we expect a test to take. - */ - private static final int MINIMUM_TIME = 100; - - /** - * The start time of our current test in System.currentTimeMillis(). - */ - private long startTime; - - public void startTest(Test test) { - if (test.getClass() != lastClass) { - lastClass = test.getClass(); - printMemory(test.getClass()); - } - - Thread.currentThread().setContextClassLoader( - test.getClass().getClassLoader()); - - startTime = System.currentTimeMillis(); - } - - public void endTest(Test test) { - if (test instanceof TestCase) { - cleanup((TestCase) test); - - /* - * Make sure all tests take at least MINIMUM_TIME to - * complete. If they don't, we wait a bit. The Cupcake - * Binder can't handle too many operations in a very - * short time, which causes headache for the CTS. - */ - long timeTaken = System.currentTimeMillis() - startTime; - - if (timeTaken < MINIMUM_TIME) { - try { - Thread.sleep(MINIMUM_TIME - timeTaken); - } catch (InterruptedException ignored) { - // We don't care. - } - } - } - } - - public void addError(Test test, Throwable t) { - // This space intentionally left blank. - } - - public void addFailure(Test test, AssertionFailedError t) { - // This space intentionally left blank. - } - - /** - * Dumps some memory info. - */ - private void printMemory(Class testClass) { - Runtime runtime = Runtime.getRuntime(); - - long total = runtime.totalMemory(); - long free = runtime.freeMemory(); - long used = total - free; - - Log.d(TAG, "Total memory : " + total); - Log.d(TAG, "Used memory : " + used); - Log.d(TAG, "Free memory : " + free); - Log.d(TAG, "Now executing : " + testClass.getName()); - } - - /** - * Nulls all non-static reference fields in the given test class. - * This method helps us with those test classes that don't have an - * explicit tearDown() method. Normally the garbage collector should - * take care of everything, but since JUnit keeps references to all - * test cases, a little help might be a good idea. - */ - private void cleanup(TestCase test) { - Class clazz = test.getClass(); - - while (clazz != TestCase.class) { - Field[] fields = clazz.getDeclaredFields(); - for (int i = 0; i < fields.length; i++) { - Field f = fields[i]; - if (!f.getType().isPrimitive() && - !Modifier.isStatic(f.getModifiers())) { - try { - f.setAccessible(true); - f.set(test, null); - } catch (Exception ignored) { - // Nothing we can do about it. - } - } - } - - clazz = clazz.getSuperclass(); - } - } - - }); - - return runner; - } - - @Override - List> getBuilderRequirements() { - List> builderRequirements = - super.getBuilderRequirements(); - - Predicate brokenTestPredicate = - Predicates.not(new HasAnnotation(BrokenTest.class)); - builderRequirements.add(brokenTestPredicate); - - if (!mSingleTest) { - Predicate sideEffectPredicate = - Predicates.not(new HasAnnotation(SideEffect.class)); - builderRequirements.add(sideEffectPredicate); - } - return builderRequirements; - } -} diff --git a/proprietary/frameworks/base/tests/ANR/res/color/color1.xml b/proprietary/frameworks/base/tests/ANR/res/color/color1.xml deleted file mode 100755 index 87034fa2aeb0574083807f0c668fb7b20aecd698..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/ANR/res/color/color1.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - diff --git a/proprietary/frameworks/base/tests/ANR/res/drawable/size_48x48.jpg b/proprietary/frameworks/base/tests/ANR/res/drawable/size_48x48.jpg deleted file mode 100755 index 5c2291e3e580c9b6bfbafccd6f75ea472ecf6141..0000000000000000000000000000000000000000 Binary files a/proprietary/frameworks/base/tests/ANR/res/drawable/size_48x48.jpg and /dev/null differ diff --git a/proprietary/frameworks/base/tests/ANR/res/values-12key-63x57/configVarying.xml b/proprietary/frameworks/base/tests/ANR/res/values-12key-63x57/configVarying.xml deleted file mode 100755 index 5229f28f2dff385dba3d78e2aaa96d0e18da729c..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/ANR/res/values-12key-63x57/configVarying.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - simple 12key 63x57 - - bag 12key 63x57 - - diff --git a/proprietary/frameworks/base/tests/ANR/res/values-12key-dpad/configVarying.xml b/proprietary/frameworks/base/tests/ANR/res/values-12key-dpad/configVarying.xml deleted file mode 100755 index 4622574ca5fc60929bb1df4241fa883701a35489..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/ANR/res/values-12key-dpad/configVarying.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - simple 12key dpad - - bag 12key dpad - - diff --git a/proprietary/frameworks/base/tests/ANR/res/values-12key/configVarying.xml b/proprietary/frameworks/base/tests/ANR/res/values-12key/configVarying.xml deleted file mode 100755 index 38174d7aa0e83eb1d55b2f0348ed38b2d89217f4..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/ANR/res/values-12key/configVarying.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - simple 12key - - bag 12key - - diff --git a/proprietary/frameworks/base/tests/ANR/res/values-240dpi/configVarying.xml b/proprietary/frameworks/base/tests/ANR/res/values-240dpi/configVarying.xml deleted file mode 100755 index 3b437998c3d5e735f16a2e5511bbecb838fc3f1e..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/ANR/res/values-240dpi/configVarying.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - simple 240dpi - - bag 240dpi - - diff --git a/proprietary/frameworks/base/tests/ANR/res/values-32dpi-keysexposed/configVarying.xml b/proprietary/frameworks/base/tests/ANR/res/values-32dpi-keysexposed/configVarying.xml deleted file mode 100755 index 67dd4a5b8f124f213fdeb67ad5759eb02379a45e..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/ANR/res/values-32dpi-keysexposed/configVarying.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - simple 32dpi keysexposed - - bag 32dpi keysexposed - - diff --git a/proprietary/frameworks/base/tests/ANR/res/values-32dpi-stylus/configVarying.xml b/proprietary/frameworks/base/tests/ANR/res/values-32dpi-stylus/configVarying.xml deleted file mode 100755 index 948784a25945256f0b11842633c89a265425193e..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/ANR/res/values-32dpi-stylus/configVarying.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - simple 32dpi stylus - - bag 32dpi stylus - - diff --git a/proprietary/frameworks/base/tests/ANR/res/values-32dpi/configVarying.xml b/proprietary/frameworks/base/tests/ANR/res/values-32dpi/configVarying.xml deleted file mode 100755 index f903f0fdf7a101e1cf7656f53fd59329c24b191e..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/ANR/res/values-32dpi/configVarying.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - simple 32dpi - - bag 32dpi - - diff --git a/proprietary/frameworks/base/tests/ANR/res/values-480x320/configVarying.xml b/proprietary/frameworks/base/tests/ANR/res/values-480x320/configVarying.xml deleted file mode 100755 index ade144bbcb53f62ae5c372a0ecafd3f17b125725..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/ANR/res/values-480x320/configVarying.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - simple 480x320 - - bag 480x320 - - diff --git a/proprietary/frameworks/base/tests/ANR/res/values-640x400/configVarying.xml b/proprietary/frameworks/base/tests/ANR/res/values-640x400/configVarying.xml deleted file mode 100755 index 30332c0967b0ee55144b2a9e0845efaae7155976..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/ANR/res/values-640x400/configVarying.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - simple 640x400 - - bag 640x400 - - diff --git a/proprietary/frameworks/base/tests/ANR/res/values-cs/strings.xml b/proprietary/frameworks/base/tests/ANR/res/values-cs/strings.xml deleted file mode 100755 index 396bebd4e081b28ce0da7bba2b1b51cf4b1181e5..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/ANR/res/values-cs/strings.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - A Czech dog - Few Czech dogs - Some Czech dogs - - - diff --git a/proprietary/frameworks/base/tests/ANR/res/values-dpad-63x57/configVarying.xml b/proprietary/frameworks/base/tests/ANR/res/values-dpad-63x57/configVarying.xml deleted file mode 100755 index 6b93c7d14f42c878921dab8181131783746ab285..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/ANR/res/values-dpad-63x57/configVarying.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - simple dpad 63x57 - - bag dpad 63x57 - - diff --git a/proprietary/frameworks/base/tests/ANR/res/values-dpad/configVarying.xml b/proprietary/frameworks/base/tests/ANR/res/values-dpad/configVarying.xml deleted file mode 100755 index 0b0760fa133c4dc0eb5263f34346e95aa47e369e..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/ANR/res/values-dpad/configVarying.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - simple dpad - - bag dpad - - diff --git a/proprietary/frameworks/base/tests/ANR/res/values-fr-rFR/configVarying.xml b/proprietary/frameworks/base/tests/ANR/res/values-fr-rFR/configVarying.xml deleted file mode 100755 index 5ecac7caff8adc75437536118e0e2ede7f2dbd02..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/ANR/res/values-fr-rFR/configVarying.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - simple fr FR - - bag fr FR - - diff --git a/proprietary/frameworks/base/tests/ANR/res/values-fr/configVarying.xml b/proprietary/frameworks/base/tests/ANR/res/values-fr/configVarying.xml deleted file mode 100755 index 8413b5a7008693ce6e7a1ec2bf3c3e78ae584fdd..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/ANR/res/values-fr/configVarying.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - simple fr - - bag fr - - diff --git a/proprietary/frameworks/base/tests/ANR/res/values-keysexposed-12key/configVarying.xml b/proprietary/frameworks/base/tests/ANR/res/values-keysexposed-12key/configVarying.xml deleted file mode 100755 index 311d5db5726801820e4c3b8e367c64e28533dea3..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/ANR/res/values-keysexposed-12key/configVarying.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - simple keysexposed 12key - - bag keysexposed 12key - - diff --git a/proprietary/frameworks/base/tests/ANR/res/values-keysexposed-dpad/configVarying.xml b/proprietary/frameworks/base/tests/ANR/res/values-keysexposed-dpad/configVarying.xml deleted file mode 100755 index 7c6caeb1dcd7d630ca432d74714355411e9b814e..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/ANR/res/values-keysexposed-dpad/configVarying.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - simple keysexposed dpad - - bag keysexposed dpad - - diff --git a/proprietary/frameworks/base/tests/ANR/res/values-keysexposed/configVarying.xml b/proprietary/frameworks/base/tests/ANR/res/values-keysexposed/configVarying.xml deleted file mode 100755 index befd5352df0f6fde3ffe5fc4172fcdf79edfdb34..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/ANR/res/values-keysexposed/configVarying.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - simple keysexposed - - bag keysexposed - - diff --git a/proprietary/frameworks/base/tests/ANR/res/values-land/configVarying.xml b/proprietary/frameworks/base/tests/ANR/res/values-land/configVarying.xml deleted file mode 100755 index d5ece199bfed254960eada34260819c6a1fbbf07..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/ANR/res/values-land/configVarying.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - simple landscape - - bag landscape - - diff --git a/proprietary/frameworks/base/tests/ANR/res/values-large/configVarying.xml b/proprietary/frameworks/base/tests/ANR/res/values-large/configVarying.xml deleted file mode 100755 index 7b2df7c1d11122e84772904817e9d7eef88b7375..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/ANR/res/values-large/configVarying.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - simple large - - bag large - - large - diff --git a/proprietary/frameworks/base/tests/ANR/res/values-mcc110-xx/configVarying.xml b/proprietary/frameworks/base/tests/ANR/res/values-mcc110-xx/configVarying.xml deleted file mode 100755 index 82e24355d035bb424e4f050925913a4adbde2e39..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/ANR/res/values-mcc110-xx/configVarying.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - simple mcc110 xx - - bag mcc110 xx - - diff --git a/proprietary/frameworks/base/tests/ANR/res/values-mcc111-mnc222/configVarying.xml b/proprietary/frameworks/base/tests/ANR/res/values-mcc111-mnc222/configVarying.xml deleted file mode 100755 index 7f85a14f2e9fffecad5480832812edb2d523200b..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/ANR/res/values-mcc111-mnc222/configVarying.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - simple mcc111 mnc222 - - bag mcc111 mnc222 - - diff --git a/proprietary/frameworks/base/tests/ANR/res/values-mcc111-xx-rYY/configVarying.xml b/proprietary/frameworks/base/tests/ANR/res/values-mcc111-xx-rYY/configVarying.xml deleted file mode 100755 index 6b094dc1683246f8b3054e3cd654cff43cf5db50..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/ANR/res/values-mcc111-xx-rYY/configVarying.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - simple mcc111 xx-rYY - - bag mcc111 xx-rYY - - diff --git a/proprietary/frameworks/base/tests/ANR/res/values-mcc111-xx/configVarying.xml b/proprietary/frameworks/base/tests/ANR/res/values-mcc111-xx/configVarying.xml deleted file mode 100755 index 6d01bcee8aed2868ddaefe88c097ce3d1d38d997..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/ANR/res/values-mcc111-xx/configVarying.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - simple mcc111 xx - - bag mcc111 xx - - diff --git a/proprietary/frameworks/base/tests/ANR/res/values-mcc111/configVarying.xml b/proprietary/frameworks/base/tests/ANR/res/values-mcc111/configVarying.xml deleted file mode 100755 index 656c2bdce32b3fe692fbbcdb6ca10512220cb661..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/ANR/res/values-mcc111/configVarying.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - simple mcc111 - - bag mcc111 - - diff --git a/proprietary/frameworks/base/tests/ANR/res/values-mcc112/configVarying.xml b/proprietary/frameworks/base/tests/ANR/res/values-mcc112/configVarying.xml deleted file mode 100755 index 9c05d77b6d7b7425efc453d623c095c21461fe75..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/ANR/res/values-mcc112/configVarying.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - simple mcc112 - - bag mcc112 - - diff --git a/proprietary/frameworks/base/tests/ANR/res/values-mnc220-xx/configVarying.xml b/proprietary/frameworks/base/tests/ANR/res/values-mnc220-xx/configVarying.xml deleted file mode 100755 index fbc78882d8aa5d3142238aff54bf3926ada27cdc..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/ANR/res/values-mnc220-xx/configVarying.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - simple mnc220 xx - - bag mnc220 xx - - diff --git a/proprietary/frameworks/base/tests/ANR/res/values-mnc222-32dpi/configVarying.xml b/proprietary/frameworks/base/tests/ANR/res/values-mnc222-32dpi/configVarying.xml deleted file mode 100755 index 03bea33ae2d07af0ca3bfaaf600990748e01935b..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/ANR/res/values-mnc222-32dpi/configVarying.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - simple mnc222 32dpi - - bag mnc222 32dpi - - diff --git a/proprietary/frameworks/base/tests/ANR/res/values-mnc222-square/configVarying.xml b/proprietary/frameworks/base/tests/ANR/res/values-mnc222-square/configVarying.xml deleted file mode 100755 index 4a64117de261e12731421ea74680e80b217eb01d..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/ANR/res/values-mnc222-square/configVarying.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - simple mnc222 square - - bag mnc222 square - - diff --git a/proprietary/frameworks/base/tests/ANR/res/values-mnc222-xx/configVarying.xml b/proprietary/frameworks/base/tests/ANR/res/values-mnc222-xx/configVarying.xml deleted file mode 100755 index 80570f549e35756f1626494a301e4f54ea99e7a9..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/ANR/res/values-mnc222-xx/configVarying.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - simple mnc222 xx - - bag mnc222 xx - - diff --git a/proprietary/frameworks/base/tests/ANR/res/values-mnc222/configVarying.xml b/proprietary/frameworks/base/tests/ANR/res/values-mnc222/configVarying.xml deleted file mode 100755 index 54bb47e6083a5f22e269703ca443c11e3a23be93..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/ANR/res/values-mnc222/configVarying.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - simple mnc222 - - bag mnc222 - - diff --git a/proprietary/frameworks/base/tests/ANR/res/values-mnc223/configVarying.xml b/proprietary/frameworks/base/tests/ANR/res/values-mnc223/configVarying.xml deleted file mode 100755 index 8936cbcb09bfc54ab5c83bbcc021d799d8178397..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/ANR/res/values-mnc223/configVarying.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - simple mnc223 - - bag mnc223 - - diff --git a/proprietary/frameworks/base/tests/ANR/res/values-nokeys/configVarying.xml b/proprietary/frameworks/base/tests/ANR/res/values-nokeys/configVarying.xml deleted file mode 100755 index e0b23bcf603a30ae3b4c8b5cf3d871e14703cbb0..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/ANR/res/values-nokeys/configVarying.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - simple nokeys - - bag nokeys - - diff --git a/proprietary/frameworks/base/tests/ANR/res/values-nonav/configVarying.xml b/proprietary/frameworks/base/tests/ANR/res/values-nonav/configVarying.xml deleted file mode 100755 index 1ec8520729a366a7a4a39ac418d4fb972fc773c2..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/ANR/res/values-nonav/configVarying.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - simple nonav - - bag nonav - - diff --git a/proprietary/frameworks/base/tests/ANR/res/values-normal/configVarying.xml b/proprietary/frameworks/base/tests/ANR/res/values-normal/configVarying.xml deleted file mode 100755 index b45ee49dddf90b7a510afcfcc7ec04c6328b9d99..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/ANR/res/values-normal/configVarying.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - simple normal - - bag normal - - normal - diff --git a/proprietary/frameworks/base/tests/ANR/res/values-notouch/configVarying.xml b/proprietary/frameworks/base/tests/ANR/res/values-notouch/configVarying.xml deleted file mode 100755 index ed0833b09310f20f6e1e67dfcbe2323b47682520..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/ANR/res/values-notouch/configVarying.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - simple notouch - - bag notouch - - diff --git a/proprietary/frameworks/base/tests/ANR/res/values-small/configVarying.xml b/proprietary/frameworks/base/tests/ANR/res/values-small/configVarying.xml deleted file mode 100755 index 15a9f8f1bb9feac4de815afb333c222762a620ee..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/ANR/res/values-small/configVarying.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - simple small - - bag small - - small - diff --git a/proprietary/frameworks/base/tests/ANR/res/values-square-32dpi/configVarying.xml b/proprietary/frameworks/base/tests/ANR/res/values-square-32dpi/configVarying.xml deleted file mode 100755 index f205f46fccf37d968dcbfc6530f4e9c18422b96f..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/ANR/res/values-square-32dpi/configVarying.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - simple square 32dpi - - bag square 32dpi - - diff --git a/proprietary/frameworks/base/tests/ANR/res/values-square-stylus/configVarying.xml b/proprietary/frameworks/base/tests/ANR/res/values-square-stylus/configVarying.xml deleted file mode 100755 index 861c21590b4d238b3d885fde1e47327eafab031c..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/ANR/res/values-square-stylus/configVarying.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - simple square stylus - - bag square stylus - - diff --git a/proprietary/frameworks/base/tests/ANR/res/values-square/configVarying.xml b/proprietary/frameworks/base/tests/ANR/res/values-square/configVarying.xml deleted file mode 100755 index 055fd35153273e00f05f1a8701c318543e2226e9..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/ANR/res/values-square/configVarying.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - simple square - - bag square - - diff --git a/proprietary/frameworks/base/tests/ANR/res/values-stylus-12key/configVarying.xml b/proprietary/frameworks/base/tests/ANR/res/values-stylus-12key/configVarying.xml deleted file mode 100755 index 47db444dfefad1849499f6aa29fd3411a924c9b8..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/ANR/res/values-stylus-12key/configVarying.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - simple stylus 12key - - bag stylus 12key - - diff --git a/proprietary/frameworks/base/tests/ANR/res/values-stylus-keysexposed/configVarying.xml b/proprietary/frameworks/base/tests/ANR/res/values-stylus-keysexposed/configVarying.xml deleted file mode 100755 index cf5598f6267856308dd2d50daf6cc3da33a818e8..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/ANR/res/values-stylus-keysexposed/configVarying.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - simple stylus keysexposed - - bag stylus keysexposed - - diff --git a/proprietary/frameworks/base/tests/ANR/res/values-stylus/configVarying.xml b/proprietary/frameworks/base/tests/ANR/res/values-stylus/configVarying.xml deleted file mode 100755 index 862c2bcd7ef45b9ae1c374f2a8a157720120f2b0..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/ANR/res/values-stylus/configVarying.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - simple stylus - - bag stylus - - diff --git a/proprietary/frameworks/base/tests/ANR/res/values-v10/strings.xml b/proprietary/frameworks/base/tests/ANR/res/values-v10/strings.xml deleted file mode 100755 index 6cd55fa2a3e95c03e208feca0873747c82252658..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/ANR/res/values-v10/strings.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - v10cur - diff --git a/proprietary/frameworks/base/tests/ANR/res/values-v11/strings.xml b/proprietary/frameworks/base/tests/ANR/res/values-v11/strings.xml deleted file mode 100755 index d4d75ff6f69397ce9833f3dcce558e8a50905a4e..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/ANR/res/values-v11/strings.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - v11cur - diff --git a/proprietary/frameworks/base/tests/ANR/res/values-v12/strings.xml b/proprietary/frameworks/base/tests/ANR/res/values-v12/strings.xml deleted file mode 100755 index ab421fa29b141c7f551615fd3275cbb2007b478a..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/ANR/res/values-v12/strings.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - v12cur - diff --git a/proprietary/frameworks/base/tests/ANR/res/values-v13/strings.xml b/proprietary/frameworks/base/tests/ANR/res/values-v13/strings.xml deleted file mode 100755 index d71936a3635298a177fe518b6985234b52d785b6..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/ANR/res/values-v13/strings.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - v13cur - v13old - diff --git a/proprietary/frameworks/base/tests/ANR/res/values-v3/strings.xml b/proprietary/frameworks/base/tests/ANR/res/values-v3/strings.xml deleted file mode 100755 index a4d012abb24de3948118ac9cc0cc7ddeda9e0ddd..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/ANR/res/values-v3/strings.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - v3cur - v3 - diff --git a/proprietary/frameworks/base/tests/ANR/res/values-v4/strings.xml b/proprietary/frameworks/base/tests/ANR/res/values-v4/strings.xml deleted file mode 100755 index e6d414a5898cdc0e997ac0e2ed8ede5ebfa0817d..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/ANR/res/values-v4/strings.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - v4cur - diff --git a/proprietary/frameworks/base/tests/ANR/res/values-v5/strings.xml b/proprietary/frameworks/base/tests/ANR/res/values-v5/strings.xml deleted file mode 100755 index ef3a564658b743b1ddfb9c8bb688d964105b75a2..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/ANR/res/values-v5/strings.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - v5cur - diff --git a/proprietary/frameworks/base/tests/ANR/res/values-v6/strings.xml b/proprietary/frameworks/base/tests/ANR/res/values-v6/strings.xml deleted file mode 100755 index fb1f15dff66a67bd155c6093b31e4549f8819b36..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/ANR/res/values-v6/strings.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - v6cur - diff --git a/proprietary/frameworks/base/tests/ANR/res/values-v7/strings.xml b/proprietary/frameworks/base/tests/ANR/res/values-v7/strings.xml deleted file mode 100755 index 4c3df45b5b1010b068f0ea38bf9ee4a5d6dda480..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/ANR/res/values-v7/strings.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - v7cur - diff --git a/proprietary/frameworks/base/tests/ANR/res/values-v8/strings.xml b/proprietary/frameworks/base/tests/ANR/res/values-v8/strings.xml deleted file mode 100755 index b4e1d88c15ee1328ca7bd576e5e2cf16161a2821..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/ANR/res/values-v8/strings.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - v8cur - diff --git a/proprietary/frameworks/base/tests/ANR/res/values-v9/strings.xml b/proprietary/frameworks/base/tests/ANR/res/values-v9/strings.xml deleted file mode 100755 index a03ea12b24764a4829486ac4dcdfbc431c3f3ade..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/ANR/res/values-v9/strings.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - v9cur - diff --git a/proprietary/frameworks/base/tests/ANR/res/values-wheel/configVarying.xml b/proprietary/frameworks/base/tests/ANR/res/values-wheel/configVarying.xml deleted file mode 100755 index 64173a899cfb90440e55d331c08458fed780d352..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/ANR/res/values-wheel/configVarying.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - simple wheel - - bag wheel - - diff --git a/proprietary/frameworks/base/tests/ANR/res/values-xlarge/configVarying.xml b/proprietary/frameworks/base/tests/ANR/res/values-xlarge/configVarying.xml deleted file mode 100755 index fb9cad7c78f7da633e9568a7c9fceb110b63888a..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/ANR/res/values-xlarge/configVarying.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - simple xlarge - - bag xlarge - - xlarge - diff --git a/proprietary/frameworks/base/tests/ANR/res/values-xx-32dpi/configVarying.xml b/proprietary/frameworks/base/tests/ANR/res/values-xx-32dpi/configVarying.xml deleted file mode 100755 index dc17c6b2dbaa34cb575c997788ee42fec068a33f..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/ANR/res/values-xx-32dpi/configVarying.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - simple xx 32dpi - - bag xx 32dpi - - diff --git a/proprietary/frameworks/base/tests/ANR/res/values-xx-rYY/configVarying.xml b/proprietary/frameworks/base/tests/ANR/res/values-xx-rYY/configVarying.xml deleted file mode 100755 index 903d008aa0214d38f940e91208b266ac37142628..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/ANR/res/values-xx-rYY/configVarying.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - simple xx-rYY - - bag xx-rYY - - diff --git a/proprietary/frameworks/base/tests/ANR/res/values-xx-square/configVarying.xml b/proprietary/frameworks/base/tests/ANR/res/values-xx-square/configVarying.xml deleted file mode 100755 index 6ef5d431f299821c2fe56cbad2923e48b44787ac..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/ANR/res/values-xx-square/configVarying.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - simple xx square - - bag xx square - - diff --git a/proprietary/frameworks/base/tests/ANR/res/values-xx/configVarying.xml b/proprietary/frameworks/base/tests/ANR/res/values-xx/configVarying.xml deleted file mode 100755 index 191e4f763a3cc0fd4eba07717851c2eeb1d5b839..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/ANR/res/values-xx/configVarying.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - simple xx - - bag xx - - diff --git a/proprietary/frameworks/base/tests/ANR/res/values/arrays.xml b/proprietary/frameworks/base/tests/ANR/res/values/arrays.xml deleted file mode 100755 index 71e013317f3bf9c91f3ad260c014d325a7687b02..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/ANR/res/values/arrays.xml +++ /dev/null @@ -1,57 +0,0 @@ - - - - - 101 - - - zero - 1 - @string/reference - - - - 0 - 1 - @integer/reference - - - - Easy - Medium - Hard - - - - Test String 1 - Test String 2 - Test String 3 - - - - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - - diff --git a/proprietary/frameworks/base/tests/ANR/res/values/attrs.xml b/proprietary/frameworks/base/tests/ANR/res/values/attrs.xml deleted file mode 100755 index 97938933925bee9b8f3bfd62e12d84c7320b66f2..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/ANR/res/values/attrs.xml +++ /dev/null @@ -1,128 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/proprietary/frameworks/base/tests/ANR/res/values/bools.xml b/proprietary/frameworks/base/tests/ANR/res/values/bools.xml deleted file mode 100755 index f119cda25a81f8489c157882d190be576f109495..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/ANR/res/values/bools.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - true - false - diff --git a/proprietary/frameworks/base/tests/ANR/res/values/colors.xml b/proprietary/frameworks/base/tests/ANR/res/values/colors.xml deleted file mode 100755 index f3cc3255e58e96c02d8288a2c1aab696b2814719..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/ANR/res/values/colors.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - #7f00 - #770000ff - #77ffffff - #77ffff00 - #ff00ff00 - #ffff0000 - #ff0000ff - diff --git a/proprietary/frameworks/base/tests/ANR/res/values/configVarying.xml b/proprietary/frameworks/base/tests/ANR/res/values/configVarying.xml deleted file mode 100755 index de1b09eebd84d5ac43c3dfc151c7884b8d283cee..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/ANR/res/values/configVarying.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - simple default - - bag default - - default - default - default - default - diff --git a/proprietary/frameworks/base/tests/ANR/res/values/dimens.xml b/proprietary/frameworks/base/tests/ANR/res/values/dimens.xml deleted file mode 100755 index 2a8f76e5a564e7f9615c1446538f13b29282027c..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/ANR/res/values/dimens.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - 100% - 1% - .1% - .01% - 0% - 1.1% - 100.1% - 25510% - 25610% - 6553510% - 6553610% - - 100%p - 1%p - .1%p - .01%p - 0%p - 1.1%p - 100.1%p - 25510%p - 25610%p - 6553510%p - 6553610%p - - diff --git a/proprietary/frameworks/base/tests/ANR/res/values/ids.xml b/proprietary/frameworks/base/tests/ANR/res/values/ids.xml deleted file mode 100755 index 30e081bba1abd91047309468967566e4bea86046..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/ANR/res/values/ids.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - diff --git a/proprietary/frameworks/base/tests/ANR/res/values/resources_test.xml b/proprietary/frameworks/base/tests/ANR/res/values/resources_test.xml deleted file mode 100755 index 91c2c4aa92dd75ce738e5b954bdb84d25de83d45..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/ANR/res/values/resources_test.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - 84dp - - 63dp - - 48px - 64dip - - A dog - Some dogs - - #003B3B3B - 10 - diff --git a/proprietary/frameworks/base/tests/ANR/res/values/strings.xml b/proprietary/frameworks/base/tests/ANR/res/values/strings.xml deleted file mode 100755 index a779b47adec563bd7938a72a65d040577a5528dd..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/ANR/res/values/strings.xml +++ /dev/null @@ -1,172 +0,0 @@ - - - - - Test Granted - Used for running CTS tests, for testing operations - where we have the permission. - Test Dynamic - Used for running CTS tests, for testing adding - dynamic permissions. - Test Denied - Used for running CTS tests, for testing operations - where we do not have the permission. - 1. click start. \n2. if above image shaked, then press pass button, - else press failed button. - Hello! Text view! - This is a hint. - This is a string for testing hint of textview. - App/Forwarding - $$$ - Go - Back - - Press back button and notice we don\'t see the previous activity. - - testing - DialogTest - Country - Name - Test Dialog without theme - Test Dialog with theme - Test AlertDialog - Test AlertDialog with theme - Test DatePickerDialog - Test DatePickerDialog with theme - Test TimePickerDialog - Test TimePickerDialog with theme - Test onStart() and onStop() - Test AlertDialog deprecated - Test AlertDialog callback - Test AlertDialog setview - Test AlertDialog deprecated with Message - Test AlertDialog with theme - Test AlertDialog cancelable - Test AlertDialog can\'n cancelable - Test Dialog cancelable - Test Dialog not cancelable - Hello, World! - Hello, Android! - Name: - Password: - Positive - Negative - Neutral - Notify - testing - first - second - third - Very long to make the string out of the screen - Test Chronometer - AM - PM - ViewGroup test - ViewAnimator test - OK - Cancel - This is %s string. - This is test string. - Choose different animations - Alpha animation - Scale animation - Rotate animation - Translate animation - Animation set - Layout animation - Grid layout animation - text1 - text2 - metadata text - horizontal 1 - horizontal 2 - horizontal 3 - vertical 1 - vertical 2 - vertical 3 - here - 100 - true - #fff - 100.0 - 100px - 100% - Format[] - Format[%d] - Format[%3$d,%2$s] - checkboxpref_key - title of preference - summary of preference - summary on of preference - summary off of preference - checkboxpref_depend - depend title of preference - depend summary of preference - edittextpref_key - default value of preference - title of edit text preference - summary of edit text preference - dialog title of edit text preference - text of edit text preference - listpref_key - title of list preference - summary of list preference - dialog title of list preference - Easy - Medium - Hard - Footer view - Header view - title of dialog preference - dialog title of dialog preference - dialogpref_key - default value of dialog preference - summary of dialog preference - message of dialog preference - Sure - Cancel - pref_key - title of preference - summary of preference - pref_depend_key - depend title of preference - depend summary of preference - android.intent.action.PREFERENCE - def_pref_key - default preference - This is default preference of cts - view 1 - view 2 - view 3 - view 4 - view 5 - view 6 - view 7 - view 8 - view 9 - view 10 - view 11 - view 12 - view 13 - Country: - Symbol: - No such country registered - base - base - base - Android CTS - Android CTS - diff --git a/proprietary/frameworks/base/tests/ANR/res/values/styles.xml b/proprietary/frameworks/base/tests/ANR/res/values/styles.xml deleted file mode 100755 index 8e9c8306e63faac137017d781802e80b66b2218c..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/ANR/res/values/styles.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/proprietary/frameworks/base/tests/content/res/xml/alias.xml b/proprietary/frameworks/base/tests/content/res/xml/alias.xml deleted file mode 100755 index f88f3dc4299568de641a8e040d08cabfc8e567fd..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/content/res/xml/alias.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - diff --git a/proprietary/frameworks/base/tests/content/res/xml/anim_list_correct.xml b/proprietary/frameworks/base/tests/content/res/xml/anim_list_correct.xml deleted file mode 100755 index 660aa96e96a102c25d2d81dc52d60a52a40a01ad..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/content/res/xml/anim_list_correct.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - diff --git a/proprietary/frameworks/base/tests/content/res/xml/anim_list_missing_item_drawable.xml b/proprietary/frameworks/base/tests/content/res/xml/anim_list_missing_item_drawable.xml deleted file mode 100755 index 99052f4f0a2426a7dddd52e31064f1eea3ca1ca4..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/content/res/xml/anim_list_missing_item_drawable.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - diff --git a/proprietary/frameworks/base/tests/content/res/xml/anim_list_missing_item_duration.xml b/proprietary/frameworks/base/tests/content/res/xml/anim_list_missing_item_duration.xml deleted file mode 100755 index e3986c2f5dfcc083514ba856733ec19932bbf668..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/content/res/xml/anim_list_missing_item_duration.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - diff --git a/proprietary/frameworks/base/tests/content/res/xml/anim_list_missing_list_attrs.xml b/proprietary/frameworks/base/tests/content/res/xml/anim_list_missing_list_attrs.xml deleted file mode 100755 index 25d2dfec1dc326535e39501a8fa3d6083a5a4869..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/content/res/xml/anim_list_missing_list_attrs.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - diff --git a/proprietary/frameworks/base/tests/content/res/xml/authenticator.xml b/proprietary/frameworks/base/tests/content/res/xml/authenticator.xml deleted file mode 100755 index 1e298b133b5dbe1569af0dc59ac746491ec653f5..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/content/res/xml/authenticator.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/proprietary/frameworks/base/tests/content/res/xml/base_attributes.xml b/proprietary/frameworks/base/tests/content/res/xml/base_attributes.xml deleted file mode 100755 index adb44de32e2e101af692c59ebb96522a3c778449..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/content/res/xml/base_attributes.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - diff --git a/proprietary/frameworks/base/tests/content/res/xml/bitmapdrawable.xml b/proprietary/frameworks/base/tests/content/res/xml/bitmapdrawable.xml deleted file mode 100755 index f9001aa9e4821540f83b335622379950e060cf39..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/content/res/xml/bitmapdrawable.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/proprietary/frameworks/base/tests/content/res/xml/colors.xml b/proprietary/frameworks/base/tests/content/res/xml/colors.xml deleted file mode 100755 index 8c44a667aec3cb8c53e424d7c7b9b31a8de57048..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/content/res/xml/colors.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - #ff00ff00 - #ffff0000 - #ff0000ff - - diff --git a/proprietary/frameworks/base/tests/content/res/xml/drawable_test.xml b/proprietary/frameworks/base/tests/content/res/xml/drawable_test.xml deleted file mode 100755 index f2a2e5d2ed20a0e8b9538ab08978cbdd0193c13f..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/content/res/xml/drawable_test.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - diff --git a/proprietary/frameworks/base/tests/content/res/xml/extra.xml b/proprietary/frameworks/base/tests/content/res/xml/extra.xml deleted file mode 100755 index b3bffb4ce403616af81e7f9a973a2eba75b25b40..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/content/res/xml/extra.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - diff --git a/proprietary/frameworks/base/tests/content/res/xml/input_extras.xml b/proprietary/frameworks/base/tests/content/res/xml/input_extras.xml deleted file mode 100755 index ce5eb5eea0dddbd3730fadeccfb17512920e1d37..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/content/res/xml/input_extras.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - diff --git a/proprietary/frameworks/base/tests/content/res/xml/intentfilter.xml b/proprietary/frameworks/base/tests/content/res/xml/intentfilter.xml deleted file mode 100755 index 7ed3a534112ae83c6128973dbef1d2eaf7c36067..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/content/res/xml/intentfilter.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - diff --git a/proprietary/frameworks/base/tests/content/res/xml/layerdrawable.xml b/proprietary/frameworks/base/tests/content/res/xml/layerdrawable.xml deleted file mode 100755 index 9bb1268f6d717f5407b5476fbf8ea96c8f3bb5c8..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/content/res/xml/layerdrawable.xml +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/proprietary/frameworks/base/tests/content/res/xml/layout.xml b/proprietary/frameworks/base/tests/content/res/xml/layout.xml deleted file mode 100755 index 6bcb27deaa1bb39f3477bd149f718b6968bd3cdc..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/content/res/xml/layout.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/proprietary/frameworks/base/tests/content/res/xml/level_list_correct.xml b/proprietary/frameworks/base/tests/content/res/xml/level_list_correct.xml deleted file mode 100755 index 241ec16f1e2c1c42def95a96fc3ae38167080a86..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/content/res/xml/level_list_correct.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - diff --git a/proprietary/frameworks/base/tests/content/res/xml/level_list_missing_item_drawable.xml b/proprietary/frameworks/base/tests/content/res/xml/level_list_missing_item_drawable.xml deleted file mode 100755 index 506b10f952600e87690fad93badd3b1f1cc87c8f..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/content/res/xml/level_list_missing_item_drawable.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - diff --git a/proprietary/frameworks/base/tests/content/res/xml/level_list_missing_item_minlevel_maxlevel.xml b/proprietary/frameworks/base/tests/content/res/xml/level_list_missing_item_minlevel_maxlevel.xml deleted file mode 100755 index f77bfd5cd4d020224b083176f7e9bc3207904e2f..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/content/res/xml/level_list_missing_item_minlevel_maxlevel.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - diff --git a/proprietary/frameworks/base/tests/content/res/xml/merge.xml b/proprietary/frameworks/base/tests/content/res/xml/merge.xml deleted file mode 100755 index 710e9040aa2b4b1be0b2198b0f877c4ff079b839..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/content/res/xml/merge.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - - - diff --git a/proprietary/frameworks/base/tests/content/res/xml/metadata.xml b/proprietary/frameworks/base/tests/content/res/xml/metadata.xml deleted file mode 100755 index 336b931db7c918b373355f4e0e40005388885b27..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/content/res/xml/metadata.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - diff --git a/proprietary/frameworks/base/tests/content/res/xml/method.xml b/proprietary/frameworks/base/tests/content/res/xml/method.xml deleted file mode 100755 index 763faa5ca636c8b624b129dc9c30859e738cdc67..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/content/res/xml/method.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - diff --git a/proprietary/frameworks/base/tests/content/res/xml/pm_test.xml b/proprietary/frameworks/base/tests/content/res/xml/pm_test.xml deleted file mode 100755 index 4db24cf3246512619a82cb57a1c61e6c8ef285e1..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/content/res/xml/pm_test.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - diff --git a/proprietary/frameworks/base/tests/content/res/xml/preferences_from_intent.xml b/proprietary/frameworks/base/tests/content/res/xml/preferences_from_intent.xml deleted file mode 100755 index 0911403138173f8ad0c6db2d3c8a96c4363c281b..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/content/res/xml/preferences_from_intent.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - diff --git a/proprietary/frameworks/base/tests/content/res/xml/preferences_from_resource.xml b/proprietary/frameworks/base/tests/content/res/xml/preferences_from_resource.xml deleted file mode 100755 index d954032f456a71e8823743ab78993677d67fd3c7..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/content/res/xml/preferences_from_resource.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - diff --git a/proprietary/frameworks/base/tests/content/res/xml/scaledrawable.xml b/proprietary/frameworks/base/tests/content/res/xml/scaledrawable.xml deleted file mode 100755 index d8d5f73bfdb3c3f20a61787d66569811326d29c7..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/content/res/xml/scaledrawable.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - - - diff --git a/proprietary/frameworks/base/tests/content/res/xml/searchable.xml b/proprietary/frameworks/base/tests/content/res/xml/searchable.xml deleted file mode 100755 index f526341b5570ac30598579a8098d87a6efcd9233..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/content/res/xml/searchable.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - diff --git a/proprietary/frameworks/base/tests/content/res/xml/selector_correct.xml b/proprietary/frameworks/base/tests/content/res/xml/selector_correct.xml deleted file mode 100755 index 917833f2ecaee544e2cc6f2fe6f4d47a3222c281..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/content/res/xml/selector_correct.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - diff --git a/proprietary/frameworks/base/tests/content/res/xml/selector_missing_item_drawable.xml b/proprietary/frameworks/base/tests/content/res/xml/selector_missing_item_drawable.xml deleted file mode 100755 index 35bef42245f8d0e2efa8e31ec64cfb4cf6d46d0e..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/content/res/xml/selector_missing_item_drawable.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - diff --git a/proprietary/frameworks/base/tests/content/res/xml/selector_missing_selector_attrs.xml b/proprietary/frameworks/base/tests/content/res/xml/selector_missing_selector_attrs.xml deleted file mode 100755 index 87ccc3c26b893edc89898440965aa5b4d61e4c44..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/content/res/xml/selector_missing_selector_attrs.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - diff --git a/proprietary/frameworks/base/tests/content/res/xml/syncadapter.xml b/proprietary/frameworks/base/tests/content/res/xml/syncadapter.xml deleted file mode 100755 index 1c0bb72dc03baa01f97631819a09780f015816bc..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/content/res/xml/syncadapter.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - diff --git a/proprietary/frameworks/base/tests/content/res/xml/test_color.xml b/proprietary/frameworks/base/tests/content/res/xml/test_color.xml deleted file mode 100755 index 97f7dec9a00ffe8466e5720d4140fcd0222a16ee..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/content/res/xml/test_color.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - #ff00ff00 - #ffff0000 - #ff0000ff - diff --git a/proprietary/frameworks/base/tests/content/src/android/content/cts/DummyProvider.java b/proprietary/frameworks/base/tests/content/src/android/content/cts/DummyProvider.java deleted file mode 100755 index b4345195153a444a5100ec1fe0925535c8e8feda..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/content/src/android/content/cts/DummyProvider.java +++ /dev/null @@ -1,201 +0,0 @@ -/* - * Copyright (C) 2009 The Android Open Source Project. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.content.cts; - -import dalvik.annotation.TestTargetClass; - -import android.content.ContentProvider; -import android.content.ContentValues; -import android.content.Context; -import android.content.UriMatcher; -import android.database.Cursor; -import android.database.sqlite.SQLiteDatabase; -import android.database.sqlite.SQLiteOpenHelper; -import android.net.Uri; - -/** - * A simple content provider for AsyncQueryHandlerTest and ContentQueryMapTest. - * - * @see AsyncQueryHandlerTest - * @see ContentQueryMapTest - */ -@TestTargetClass(ContentProvider.class) -public class DummyProvider extends ContentProvider { - private static final String MOCK_OPERATION = "mockOperation"; - - private static final String DATABASE_NAME = "dummy.db"; - private static final String NAME_VALUE_TABLE = "name_value"; - - private DatabaseHelper mDbHelper; - private static UriMatcher sMatcher = new UriMatcher(UriMatcher.NO_MATCH); - - private static final int MATCH_NAME_VALUE = 1; - private static final int MATCH_MOCK_OPERATION = 2; - - public static final long MOCK_OPERATION_SLEEP_TIME = 2000; - - public static final String AUTHORITY = "android.content.cts.dummyprovider"; - public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY); - public static final Uri CONTENT_URI_MOCK_OPERATION = Uri.withAppendedPath(CONTENT_URI, - MOCK_OPERATION); - - public static final String _ID = "_id"; - public static final String NAME = "name"; - public static final String VALUE = "value"; - - static { - sMatcher.addURI(AUTHORITY, null, MATCH_NAME_VALUE); - sMatcher.addURI(AUTHORITY, MOCK_OPERATION, MATCH_MOCK_OPERATION); - } - - /* - * (non-Javadoc) - * @see android.content.ContentProvider#onCreate() - */ - @Override - public boolean onCreate() { - mDbHelper = new DatabaseHelper(getContext()); - return true; - } - - private class DatabaseHelper extends SQLiteOpenHelper { - private static final int DATABASE_VERSION = 1; - - DatabaseHelper(Context context) { - super(context, DATABASE_NAME, null, DATABASE_VERSION); - } - - @Override - public void onCreate(SQLiteDatabase db) { - // create an empty name_value table - db.execSQL("CREATE TABLE " + NAME_VALUE_TABLE + " (" + _ID + " INTEGER PRIMARY KEY," - + NAME + " TEXT," + VALUE + " TEXT" + ");"); - } - - @Override - public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { - } - } - - /* - * (non-Javadoc) - * @see android.content.ContentProvider#insert(android.net.Uri, - * android.content.ContentValues) - */ - @Override - public Uri insert(Uri uri, ContentValues values) { - String tbName = getTableName(uri); - if (tbName == null) { - return null; - } - SQLiteDatabase db = mDbHelper.getWritableDatabase(); - db.insert(tbName, VALUE, values); - getContext().getContentResolver().notifyChange(uri, null); - return uri; - } - - /* - * (non-Javadoc) - * @see android.content.ContentProvider#query(android.net.Uri, - * java.lang.String[], java.lang.String, java.lang.String[], - * java.lang.String) - */ - @Override - public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, - String sortOrder) { - String tbName = getTableName(uri); - if (tbName == null) { - return null; - } - SQLiteDatabase db = mDbHelper.getReadableDatabase(); - Cursor c = db.query(tbName, projection, selection, selectionArgs, null, null, sortOrder); - c.setNotificationUri(getContext().getContentResolver(), uri); - return c; - } - - private String getTableName(Uri uri) { - switch (sMatcher.match(uri)) { - case MATCH_NAME_VALUE: - return NAME_VALUE_TABLE; - case MATCH_MOCK_OPERATION: - doMockOperation(); - return null; - default: - throw new UnsupportedOperationException(); - } - } - - /** - * Simulate a long-running DB operation by sleeping. - */ - private void doMockOperation() { - long time = System.currentTimeMillis(); - long target = time + MOCK_OPERATION_SLEEP_TIME; - while (time < target) { - try { - Thread.sleep(target - time); - } catch (InterruptedException ignored) { - // ignore and continue sleeping, since a true long-running DB operation would not - // be affected by interrupt() either - } - time = System.currentTimeMillis(); - } - } - - /* - * (non-Javadoc) - * @see android.content.ContentProvider#update(android.net.Uri, - * android.content.ContentValues, java.lang.String, java.lang.String[]) - */ - @Override - public int update(Uri uri, ContentValues values, String selection, String[] selectionArgs) { - String tbName = getTableName(uri); - if (tbName == null) { - return 0; - } - SQLiteDatabase db = mDbHelper.getWritableDatabase(); - int count = db.update(tbName, values, selection, selectionArgs); - getContext().getContentResolver().notifyChange(uri, null); - return count; - } - - /* - * (non-Javadoc) - * @see android.content.ContentProvider#delete(android.net.Uri, - * java.lang.String, java.lang.String[]) - */ - @Override - public int delete(Uri uri, String selection, String[] selectionArgs) { - String tbName = getTableName(uri); - if (tbName == null) { - return 0; - } - SQLiteDatabase db = mDbHelper.getWritableDatabase(); - int count = db.delete(tbName, selection, selectionArgs); - getContext().getContentResolver().notifyChange(uri, null); - return count; - } - - /* - * (non-Javadoc) - * @see android.content.ContentProvider#getType(android.net.Uri) - */ - @Override - public String getType(Uri uri) { - return null; - } -} diff --git a/proprietary/frameworks/base/tests/content/src/android/content/cts/MockAccountAuthenticator.java b/proprietary/frameworks/base/tests/content/src/android/content/cts/MockAccountAuthenticator.java deleted file mode 100755 index 9a1b5b3baab405612411e6170c0d8950a95af629..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/content/src/android/content/cts/MockAccountAuthenticator.java +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Copyright (C) 2010 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.content.cts; - -import android.accounts.AbstractAccountAuthenticator; -import android.accounts.Account; -import android.accounts.AccountAuthenticatorResponse; -import android.accounts.AccountManager; -import android.accounts.NetworkErrorException; -import android.content.Context; -import android.os.Bundle; - -public class MockAccountAuthenticator extends AbstractAccountAuthenticator { - - private static MockAccountAuthenticator sMockAuthenticator = null; - public static final String ACCOUNT_NAME = "android.content.cts.account.name"; - public static final String ACCOUNT_TYPE = "android.content.cts.account.type"; - public static final String ACCOUNT_PASSWORD = "android.content.cts.account.password"; - public static final String AUTH_TOKEN = "mockAuthToken"; - public static final String AUTH_TOKEN_LABEL = "mockAuthTokenLabel"; - - public MockAccountAuthenticator(Context context) { - super(context); - } - - private Bundle createResultBundle() { - Bundle result = new Bundle(); - result.putString(AccountManager.KEY_ACCOUNT_NAME, ACCOUNT_NAME); - result.putString(AccountManager.KEY_ACCOUNT_TYPE, ACCOUNT_TYPE); - result.putString(AccountManager.KEY_AUTHTOKEN, AUTH_TOKEN); - - return result; - } - - @Override - public Bundle addAccount(AccountAuthenticatorResponse response, String accountType, - String authTokenType, String[] requiredFeatures, Bundle options) - throws NetworkErrorException { - return createResultBundle(); - } - - @Override - public Bundle editProperties(AccountAuthenticatorResponse response, String accountType) { - return createResultBundle(); - } - - @Override - public Bundle updateCredentials(AccountAuthenticatorResponse response, Account account, - String authTokenType, Bundle options) throws NetworkErrorException { - return createResultBundle(); - } - - @Override - public Bundle confirmCredentials(AccountAuthenticatorResponse response, Account account, - Bundle options) throws NetworkErrorException { - - Bundle result = new Bundle(); - result.putBoolean(AccountManager.KEY_BOOLEAN_RESULT, true); - return result; - } - - @Override - public Bundle getAuthToken(AccountAuthenticatorResponse response, Account account, - String authTokenType, Bundle options) throws NetworkErrorException { - return createResultBundle(); - } - - @Override - public String getAuthTokenLabel(String authTokenType) { - return AUTH_TOKEN_LABEL; - } - - @Override - public Bundle hasFeatures(AccountAuthenticatorResponse response, Account account, - String[] features) throws NetworkErrorException { - - Bundle result = new Bundle(); - result.putBoolean(AccountManager.KEY_BOOLEAN_RESULT, true); - return result; - } - - public static synchronized MockAccountAuthenticator getMockAuthenticator(Context context) { - if (null == sMockAuthenticator) { - sMockAuthenticator = new MockAccountAuthenticator(context); - } - return sMockAuthenticator; - } - -} diff --git a/proprietary/frameworks/base/tests/content/src/android/content/cts/MockAccountService.java b/proprietary/frameworks/base/tests/content/src/android/content/cts/MockAccountService.java deleted file mode 100755 index a076d777c9848321b059b3f8f0035047140bdbfd..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/content/src/android/content/cts/MockAccountService.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (C) 2010 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.content.cts; - -import android.app.Service; -import android.content.Intent; -import android.os.IBinder; - -/** - * a basic Mock Service for wrapping the MockAccountAuthenticator - */ -public class MockAccountService extends Service { - - @Override - public IBinder onBind(Intent intent) { - return MockAccountAuthenticator.getMockAuthenticator(this).getIBinder(); - } -} diff --git a/proprietary/frameworks/base/tests/content/src/android/content/cts/MockContentProvider.java b/proprietary/frameworks/base/tests/content/src/android/content/cts/MockContentProvider.java deleted file mode 100755 index de82c0d0839a3c93f62d0634dd69c1d9eed946d8..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/content/src/android/content/cts/MockContentProvider.java +++ /dev/null @@ -1,417 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.content.cts; - -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.OutputStreamWriter; -import java.io.PrintWriter; -import java.io.UnsupportedEncodingException; -import java.util.HashMap; - -import android.content.ContentProvider; -import android.content.ContentUris; -import android.content.ContentValues; -import android.content.Context; -import android.content.UriMatcher; -import android.content.ContentProvider.PipeDataWriter; -import android.content.res.AssetFileDescriptor; -import android.database.Cursor; -import android.database.SQLException; -import android.database.sqlite.SQLiteDatabase; -import android.database.sqlite.SQLiteOpenHelper; -import android.database.sqlite.SQLiteQueryBuilder; -import android.net.Uri; -import android.os.Bundle; -import android.os.CancellationSignal; -import android.os.ParcelFileDescriptor; -import android.text.TextUtils; -import android.util.Log; - -public class MockContentProvider extends ContentProvider - implements PipeDataWriter { - - private SQLiteOpenHelper mOpenHelper; - - private static final String DEFAULT_AUTHORITY = "ctstest"; - private static final String DEFAULT_DBNAME = "ctstest.db"; - private static final int DBVERSION = 2; - - private static final int TESTTABLE1 = 1; - private static final int TESTTABLE1_ID = 2; - private static final int TESTTABLE1_CROSS = 3; - private static final int TESTTABLE2 = 4; - private static final int TESTTABLE2_ID = 5; - private static final int SELF_ID = 6; - private static final int CRASH_ID = 6; - - private final String mAuthority; - private final String mDbName; - private final UriMatcher URL_MATCHER; - private HashMap CTSDBTABLE1_LIST_PROJECTION_MAP; - private HashMap CTSDBTABLE2_LIST_PROJECTION_MAP; - - private static class DatabaseHelper extends SQLiteOpenHelper { - - DatabaseHelper(Context context, String dbname) { - super(context, dbname, null, DBVERSION); - } - - @Override - public void onCreate(SQLiteDatabase db) { - db.execSQL("CREATE TABLE TestTable1 (" - + "_id INTEGER PRIMARY KEY, " + "key TEXT, " + "value INTEGER" - + ");"); - - db.execSQL("CREATE TABLE TestTable2 (" - + "_id INTEGER PRIMARY KEY, " + "key TEXT, " + "value INTEGER" - + ");"); - } - - @Override - public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { - db.execSQL("DROP TABLE IF EXISTS TestTable1"); - db.execSQL("DROP TABLE IF EXISTS TestTable2"); - onCreate(db); - } - } - - public MockContentProvider() { - this(DEFAULT_AUTHORITY, DEFAULT_DBNAME); - } - - public MockContentProvider(String authority, String dbName) { - mAuthority = authority; - mDbName = dbName; - - URL_MATCHER = new UriMatcher(UriMatcher.NO_MATCH); - URL_MATCHER.addURI(mAuthority, "testtable1", TESTTABLE1); - URL_MATCHER.addURI(mAuthority, "testtable1/#", TESTTABLE1_ID); - URL_MATCHER.addURI(mAuthority, "testtable1/cross", TESTTABLE1_CROSS); - URL_MATCHER.addURI(mAuthority, "testtable2", TESTTABLE2); - URL_MATCHER.addURI(mAuthority, "testtable2/#", TESTTABLE2_ID); - URL_MATCHER.addURI(mAuthority, "self", SELF_ID); - URL_MATCHER.addURI(mAuthority, "crash", CRASH_ID); - - CTSDBTABLE1_LIST_PROJECTION_MAP = new HashMap(); - CTSDBTABLE1_LIST_PROJECTION_MAP.put("_id", "_id"); - CTSDBTABLE1_LIST_PROJECTION_MAP.put("key", "key"); - CTSDBTABLE1_LIST_PROJECTION_MAP.put("value", "value"); - - CTSDBTABLE2_LIST_PROJECTION_MAP = new HashMap(); - CTSDBTABLE2_LIST_PROJECTION_MAP.put("_id", "_id"); - CTSDBTABLE2_LIST_PROJECTION_MAP.put("key", "key"); - CTSDBTABLE2_LIST_PROJECTION_MAP.put("value", "value"); - } - - @Override - public boolean onCreate() { - mOpenHelper = new DatabaseHelper(getContext(), mDbName); - if (android.provider.Settings.System.getInt(getContext().getContentResolver(), - "__cts_crash_on_launch", 0) != 0) { - // The test case wants us to crash our process on first launch. - // Well, okay then! - Log.i("MockContentProvider", "TEST IS CRASHING SELF, CROSS FINGERS!"); - android.provider.Settings.System.putInt(getContext().getContentResolver(), - "__cts_crash_on_launch", 0); - android.os.Process.killProcess(android.os.Process.myPid()); - } - return true; - } - - @Override - public int delete(Uri uri, String selection, String[] selectionArgs) { - SQLiteDatabase db = mOpenHelper.getWritableDatabase(); - String segment; - int count; - - switch (URL_MATCHER.match(uri)) { - case TESTTABLE1: - if (null == selection) { - // get the count when remove all rows - selection = "1"; - } - count = db.delete("TestTable1", selection, selectionArgs); - break; - case TESTTABLE1_ID: - segment = uri.getPathSegments().get(1); - count = db.delete("TestTable1", "_id=" + segment + - (!TextUtils.isEmpty(selection) ? " AND (" + selection + ')' : ""), - selectionArgs); - break; - case TESTTABLE2: - count = db.delete("TestTable2", selection, selectionArgs); - break; - case TESTTABLE2_ID: - segment = uri.getPathSegments().get(1); - count = db.delete("TestTable2", "_id=" + segment + - (!TextUtils.isEmpty(selection) ? " AND (" + selection + ')' : ""), - selectionArgs); - break; - case SELF_ID: - // Wha...? Delete ME?!? O.K.! - Log.i("MockContentProvider", "Delete self requested!"); - count = 1; - android.os.Process.killProcess(android.os.Process.myPid()); - break; - default: - throw new IllegalArgumentException("Unknown URL " + uri); - } - - getContext().getContentResolver().notifyChange(uri, null); - return count; - } - - @Override - public String getType(Uri uri) { - switch (URL_MATCHER.match(uri)) { - case TESTTABLE1: - return "vnd.android.cursor.dir/com.android.content.testtable1"; - case TESTTABLE1_ID: - return "vnd.android.cursor.item/com.android.content.testtable1"; - case TESTTABLE1_CROSS: - return "vnd.android.cursor.cross/com.android.content.testtable1"; - case TESTTABLE2: - return "vnd.android.cursor.dir/com.android.content.testtable2"; - case TESTTABLE2_ID: - return "vnd.android.cursor.item/com.android.content.testtable2"; - - default: - throw new IllegalArgumentException("Unknown URL " + uri); - } - } - - @Override - public Uri insert(Uri uri, ContentValues initialValues) { - long rowID; - ContentValues values; - String table; - Uri testUri; - - if (initialValues != null) - values = new ContentValues(initialValues); - else - values = new ContentValues(); - - if (values.containsKey("value") == false) - values.put("value", -1); - - switch (URL_MATCHER.match(uri)) { - case TESTTABLE1: - table = "TestTable1"; - testUri = Uri.parse("content://" + mAuthority + "/testtable1"); - break; - case TESTTABLE2: - table = "TestTable2"; - testUri = Uri.parse("content://" + mAuthority + "/testtable2"); - break; - default: - throw new IllegalArgumentException("Unknown URL " + uri); - } - - SQLiteDatabase db = mOpenHelper.getWritableDatabase(); - rowID = db.insert(table, "key", values); - - if (rowID > 0) { - Uri url = ContentUris.withAppendedId(testUri, rowID); - getContext().getContentResolver().notifyChange(url, null); - return url; - } - - throw new SQLException("Failed to insert row into " + uri); - } - - @Override - public Cursor query(Uri uri, String[] projection, String selection, - String[] selectionArgs, String sortOrder) { - return query(uri, projection, selection, selectionArgs, sortOrder, null); - } - - @Override - public Cursor query(Uri uri, String[] projection, String selection, - String[] selectionArgs, String sortOrder, CancellationSignal cancellationSignal) { - - SQLiteQueryBuilder qb = new SQLiteQueryBuilder(); - - switch (URL_MATCHER.match(uri)) { - case TESTTABLE1: - qb.setTables("TestTable1"); - qb.setProjectionMap(CTSDBTABLE1_LIST_PROJECTION_MAP); - break; - - case TESTTABLE1_ID: - qb.setTables("TestTable1"); - qb.appendWhere("_id=" + uri.getPathSegments().get(1)); - break; - - case TESTTABLE1_CROSS: - // Create a ridiculous cross-product of the test table. This is done - // to create an artificially long-running query to enable us to test - // remote query cancellation in ContentResolverTest. - qb.setTables("TestTable1 a, TestTable1 b, TestTable1 c, TestTable1 d, TestTable1 e"); - break; - - case TESTTABLE2: - qb.setTables("TestTable2"); - qb.setProjectionMap(CTSDBTABLE2_LIST_PROJECTION_MAP); - break; - - case TESTTABLE2_ID: - qb.setTables("TestTable2"); - qb.appendWhere("_id=" + uri.getPathSegments().get(1)); - break; - - case CRASH_ID: - if (android.provider.Settings.System.getInt(getContext().getContentResolver(), - "__cts_crash_on_launch", 0) != 0) { - // The test case wants us to crash while querying. - // Well, okay then! - Log.i("MockContentProvider", "TEST IS CRASHING SELF, CROSS FINGERS!"); - android.provider.Settings.System.putInt(getContext().getContentResolver(), - "__cts_crash_on_launch", 0); - android.os.Process.killProcess(android.os.Process.myPid()); - } - qb.setTables("TestTable1"); - qb.setProjectionMap(CTSDBTABLE1_LIST_PROJECTION_MAP); - break; - - default: - throw new IllegalArgumentException("Unknown URL " + uri); - } - - /* If no sort order is specified use the default */ - String orderBy; - if (TextUtils.isEmpty(sortOrder)) - orderBy = "_id"; - else - orderBy = sortOrder; - - SQLiteDatabase db = mOpenHelper.getReadableDatabase(); - Cursor c = qb.query(db, projection, selection, selectionArgs, null, null, orderBy, - null, cancellationSignal); - - c.setNotificationUri(getContext().getContentResolver(), uri); - return c; - } - - @Override - public int update(Uri uri, ContentValues values, String selection, - String[] selectionArgs) { - SQLiteDatabase db = mOpenHelper.getWritableDatabase(); - String segment; - int count; - - switch (URL_MATCHER.match(uri)) { - case TESTTABLE1: - count = db.update("TestTable1", values, selection, selectionArgs); - break; - - case TESTTABLE1_ID: - segment = uri.getPathSegments().get(1); - count = db.update("TestTable1", values, "_id=" + segment + - (!TextUtils.isEmpty(selection) ? " AND (" + selection + ')' : ""), - selectionArgs); - break; - - case TESTTABLE2: - count = db.update("TestTable2", values, selection, selectionArgs); - break; - - case TESTTABLE2_ID: - segment = uri.getPathSegments().get(1); - count = db.update("TestTable2", values, "_id=" + segment + - (!TextUtils.isEmpty(selection) ? " AND (" + selection + ')' : ""), - selectionArgs); - break; - - default: - throw new IllegalArgumentException("Unknown URL " + uri); - } - - getContext().getContentResolver().notifyChange(uri, null); - return count; - } - - @Override - public AssetFileDescriptor openAssetFile(Uri uri, String mode) throws FileNotFoundException { - switch (URL_MATCHER.match(uri)) { - case CRASH_ID: - if (android.provider.Settings.System.getInt(getContext().getContentResolver(), - "__cts_crash_on_launch", 0) != 0) { - // The test case wants us to crash while querying. - // Well, okay then! - Log.i("MockContentProvider", "TEST IS CRASHING SELF, CROSS FINGERS!"); - android.provider.Settings.System.putInt(getContext().getContentResolver(), - "__cts_crash_on_launch", 0); - android.os.Process.killProcess(android.os.Process.myPid()); - } - return new AssetFileDescriptor( - openPipeHelper(uri, null, null, - "This is the openAssetFile test data!", this), 0, - AssetFileDescriptor.UNKNOWN_LENGTH); - - default: - return super.openAssetFile(uri, mode); - } - } - - @Override - public AssetFileDescriptor openTypedAssetFile(Uri uri, String mimeTypeFilter, Bundle opts) - throws FileNotFoundException { - switch (URL_MATCHER.match(uri)) { - case CRASH_ID: - if (android.provider.Settings.System.getInt(getContext().getContentResolver(), - "__cts_crash_on_launch", 0) != 0) { - // The test case wants us to crash while querying. - // Well, okay then! - Log.i("MockContentProvider", "TEST IS CRASHING SELF, CROSS FINGERS!"); - android.provider.Settings.System.putInt(getContext().getContentResolver(), - "__cts_crash_on_launch", 0); - android.os.Process.killProcess(android.os.Process.myPid()); - } - return new AssetFileDescriptor( - openPipeHelper(uri, null, null, - "This is the openTypedAssetFile test data!", this), 0, - AssetFileDescriptor.UNKNOWN_LENGTH); - - default: - return super.openTypedAssetFile(uri, mimeTypeFilter, opts); - } - } - - @Override - public void writeDataToPipe(ParcelFileDescriptor output, Uri uri, String mimeType, Bundle opts, - String args) { - FileOutputStream fout = new FileOutputStream(output.getFileDescriptor()); - PrintWriter pw = null; - try { - pw = new PrintWriter(new OutputStreamWriter(fout, "UTF-8")); - pw.print(args); - } catch (UnsupportedEncodingException e) { - Log.w("MockContentProvider", "Ooops", e); - } finally { - if (pw != null) { - pw.flush(); - } - try { - fout.close(); - } catch (IOException e) { - } - } - } -} diff --git a/proprietary/frameworks/base/tests/content/src/android/content/cts/MockRemoteContentProvider.java b/proprietary/frameworks/base/tests/content/src/android/content/cts/MockRemoteContentProvider.java deleted file mode 100755 index fc43701901cb2faf1083b6b08b0c9bc8a29699d1..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/content/src/android/content/cts/MockRemoteContentProvider.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (C) 2012 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.content.cts; - -public class MockRemoteContentProvider extends MockContentProvider { - public MockRemoteContentProvider() { - super("remotectstest", "remotectstest.db"); - } -} diff --git a/proprietary/frameworks/base/tests/content/src/android/content/cts/MockSyncAdapter.java b/proprietary/frameworks/base/tests/content/src/android/content/cts/MockSyncAdapter.java deleted file mode 100755 index df24749df0e0fc831101ef3c33aedbd94f4ffd17..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/content/src/android/content/cts/MockSyncAdapter.java +++ /dev/null @@ -1,136 +0,0 @@ -/* - * Copyright (C) 2010 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.content.cts; - -import android.accounts.Account; -import android.content.ContentResolver; -import android.content.ISyncAdapter; -import android.content.ISyncContext; -import android.os.Bundle; -import android.os.RemoteException; - -import java.util.ArrayList; -import java.util.concurrent.CountDownLatch; - -public class MockSyncAdapter extends ISyncAdapter.Stub { - - private static MockSyncAdapter sSyncAdapter = null; - - private ArrayList mAccounts = new ArrayList(); - private String mAuthority; - private Bundle mExtras; - private boolean mInitialized; - private boolean mStartSync; - private boolean mCancelSync; - private CountDownLatch mLatch; - - public ArrayList getAccounts() { - return mAccounts; - } - - public String getAuthority() { - return mAuthority; - } - - public Bundle getExtras() { - return mExtras; - } - - public boolean isInitialized() { - return mInitialized; - } - - public boolean isStartSync() { - return mStartSync; - } - - public boolean isCancelSync() { - return mCancelSync; - } - - public void clearData() { - mAccounts.clear(); - mAuthority = null; - mExtras = null; - mInitialized = false; - mStartSync = false; - mCancelSync = false; - mLatch = null; - } - - public void setLatch(CountDownLatch mLatch) { - this.mLatch = mLatch; - } - - public void startSync(ISyncContext syncContext, String authority, Account account, - Bundle extras) throws RemoteException { - - mAccounts.add(account); - mAuthority = authority; - mExtras = extras; - - if (null != extras && extras.getBoolean(ContentResolver.SYNC_EXTRAS_INITIALIZE)) { - mInitialized = true; - mStartSync = false; - mCancelSync = false; - } else { - mInitialized = false; - mStartSync = true; - mCancelSync = false; - } - - if (null != mLatch) { - mLatch.countDown(); - } - } - - public void cancelSync(ISyncContext syncContext) throws RemoteException { - mAccounts.clear(); - mAuthority = null; - mExtras = null; - - mInitialized = false; - mStartSync = false; - mCancelSync = true; - - if (null != mLatch) { - mLatch.countDown(); - } - } - - public void initialize(android.accounts.Account account, java.lang.String authority) - throws android.os.RemoteException { - - mAccounts.add(account); - mAuthority = authority; - - mInitialized = true; - mStartSync = false; - mCancelSync = false; - - if (null != mLatch) { - mLatch.countDown(); - } - } - - public static MockSyncAdapter getMockSyncAdapter() { - if (null == sSyncAdapter) { - sSyncAdapter = new MockSyncAdapter(); - } - return sSyncAdapter; - } -} diff --git a/proprietary/frameworks/base/tests/content/src/android/content/cts/MockSyncAdapterService.java b/proprietary/frameworks/base/tests/content/src/android/content/cts/MockSyncAdapterService.java deleted file mode 100755 index 4dcf6daff36d33e3b9f70c2a7622fa242a6af7be..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/content/src/android/content/cts/MockSyncAdapterService.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (C) 2010 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.content.cts; - -import android.app.Service; -import android.content.Intent; -import android.os.IBinder; - -public class MockSyncAdapterService extends Service { - @Override - public IBinder onBind(Intent intent) { - return MockSyncAdapter.getMockSyncAdapter(); - } -} diff --git a/proprietary/frameworks/base/tests/content/src/android/cts/util/PollingCheck.java b/proprietary/frameworks/base/tests/content/src/android/cts/util/PollingCheck.java deleted file mode 100755 index be6b0b064af8110591d7bddde5f3df8b231dc088..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/content/src/android/cts/util/PollingCheck.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (C) 2012 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.cts.util; - -import java.util.concurrent.Callable; - -import junit.framework.Assert; - -public abstract class PollingCheck { - private static final long TIME_SLICE = 50; - private long mTimeout = 3000; - - public PollingCheck() { - } - - public PollingCheck(long timeout) { - mTimeout = timeout; - } - - protected abstract boolean check(); - - public void run() { - if (check()) { - return; - } - - long timeout = mTimeout; - while (timeout > 0) { - try { - Thread.sleep(TIME_SLICE); - } catch (InterruptedException e) { - Assert.fail("unexpected InterruptedException"); - } - - if (check()) { - return; - } - - timeout -= TIME_SLICE; - } - - Assert.fail("unexpected timeout"); - } - - public static void check(CharSequence message, long timeout, Callable condition) - throws Exception { - while (timeout > 0) { - if (condition.call()) { - return; - } - - Thread.sleep(TIME_SLICE); - timeout -= TIME_SLICE; - } - - Assert.fail(message.toString()); - } -} diff --git a/proprietary/frameworks/base/tests/content/tests/Android.mk b/proprietary/frameworks/base/tests/content/tests/Android.mk deleted file mode 100755 index 6584803faab13195e906975467fd64a5c565bb7c..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/content/tests/Android.mk +++ /dev/null @@ -1,33 +0,0 @@ -# Copyright (C) 2008 The Android Open Source Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -LOCAL_PATH:= $(call my-dir) - -include $(CLEAR_VARS) - -# don't include this package in any target -LOCAL_MODULE_TAGS := optional -# and when built explicitly put it in the data partition -LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS) - -LOCAL_JAVA_LIBRARIES := android.test.runner - -LOCAL_SRC_FILES := $(call all-java-files-under, src) - -LOCAL_PACKAGE_NAME := MediaTekCtsContentTestCases - -LOCAL_INSTRUMENTATION_FOR := MediaTekContentTestStubs - - -include $(BUILD_PACKAGE) diff --git a/proprietary/frameworks/base/tests/content/tests/Android.mk_ b/proprietary/frameworks/base/tests/content/tests/Android.mk_ deleted file mode 100755 index 6584803faab13195e906975467fd64a5c565bb7c..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/content/tests/Android.mk_ +++ /dev/null @@ -1,33 +0,0 @@ -# Copyright (C) 2008 The Android Open Source Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -LOCAL_PATH:= $(call my-dir) - -include $(CLEAR_VARS) - -# don't include this package in any target -LOCAL_MODULE_TAGS := optional -# and when built explicitly put it in the data partition -LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS) - -LOCAL_JAVA_LIBRARIES := android.test.runner - -LOCAL_SRC_FILES := $(call all-java-files-under, src) - -LOCAL_PACKAGE_NAME := MediaTekCtsContentTestCases - -LOCAL_INSTRUMENTATION_FOR := MediaTekContentTestStubs - - -include $(BUILD_PACKAGE) diff --git a/proprietary/frameworks/base/tests/content/tests/AndroidManifest.xml b/proprietary/frameworks/base/tests/content/tests/AndroidManifest.xml deleted file mode 100755 index cece10aafc84e7958782e2c5d0a7f961f429bd1c..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/content/tests/AndroidManifest.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - diff --git a/proprietary/frameworks/base/tests/content/tests/NOTICE b/proprietary/frameworks/base/tests/content/tests/NOTICE deleted file mode 100755 index 07ac62763c586ad861dbeaf3001038e903f9f401..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/content/tests/NOTICE +++ /dev/null @@ -1,30 +0,0 @@ -* Copyright (C) 2009 The Android Open Source Project: - - - -* Copyright (C) 2008 The Android Open Source Project: - - - -* Copyright (C) 2010 The Android Open Source Project: - - - -/* -* Copyright (C) 2011-2014 MediaTek Inc. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -: - \ No newline at end of file diff --git a/proprietary/frameworks/base/tests/content/tests/README b/proprietary/frameworks/base/tests/content/tests/README deleted file mode 100755 index 0de833bd55e9f04b09f22d712c51e9ca2d28508b..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/content/tests/README +++ /dev/null @@ -1,19 +0,0 @@ -Test cases for android frameworks content provider module - -WHAT IT DOES? -============= -MediaTekCtsContentTestCases.apk is a test case application for content provider - -The test cases are most come from Android CTS test cases - -HOW IT WAS BUILT? -================== -make 'vendor/mediatek/proprietary/frameworks/base/tests/content/tests' folder to get -test apk - -HOW TO USE IT? -============== -After build MediaTekCtsContentTestCases.apk, install to phone with -MediaTekContentTestStubs.apk, and run command: -'adb shell am instrument -w com.mediatek.content/android.test.InstrumentationTestRunner' -to get result diff --git a/proprietary/frameworks/base/tests/content/tests/src/mediatek/content/cts/AsyncQueryHandlerTest.java b/proprietary/frameworks/base/tests/content/tests/src/mediatek/content/cts/AsyncQueryHandlerTest.java deleted file mode 100755 index 856b3bd6b570443fa02c9a0137e778531785d013..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/content/tests/src/mediatek/content/cts/AsyncQueryHandlerTest.java +++ /dev/null @@ -1,509 +0,0 @@ -/* - * Copyright (C) 2009 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -package android.content.cts; - - -import android.content.AsyncQueryHandler; -import android.content.ContentResolver; -import android.content.ContentValues; -import android.database.Cursor; -import android.net.Uri; -import android.os.Handler; -import android.os.HandlerThread; -import android.os.Looper; -import android.test.AndroidTestCase; - -/** - * Test {@link AsyncQueryHandler} and {@link WorkerHandler}}. - * - * @see DummyProvider - */ -public class AsyncQueryHandlerTest extends AndroidTestCase { - private static final long TEST_TIME_OUT = DummyProvider.MOCK_OPERATION_SLEEP_TIME + 5000; - - private static final int INSERT_TOKEN_1 = 100; - private static final int INSERT_TOKEN_2 = 101; - private static final int QUERY_TOKEN_1 = 200; - private static final int QUERY_TOKEN_2 = 201; - private static final int MOCK_QUERY_TOKEN = 202; - private static final int DELETE_TOKEN_1 = 300; - private static final int DELETE_TOKEN_2 = 301; - private static final int UPDATE_TOKEN_1 = 400; - private static final int UPDATE_TOKEN_2 = 401; - - private static final Object INSERT_COOKIE = "insert cookie"; - private static final Object QUERY_COOKIE = "query cookie"; - private static final Object DELETE_COOKIE = "delete cookie"; - private static final Object UPDATE_COOKIE = "update cookie"; - - private static final String NAME0 = "name0"; - private static final String NAME1 = "name1"; - private static final String NAME2 = "name2"; - private static final String NAME3 = "name3"; - private static final String NAME4 = "name4"; - - private static final int NAME_COLUMN_INDEX = 1; - - private static final boolean CANCELABLE = true; - private static final boolean NO_CANCEL = false; - - private static final String[] PROJECTIONS = new String[] { - DummyProvider._ID, DummyProvider.NAME}; - - private static final String ORDER_BY = "_id ASC"; - private static final int ORIGINAL_ROW_COUNT = 3; - - private MockAsyncQueryHandler mAsyncHandler; - private ContentResolver mResolver; - - @Override - protected void setUp() throws Exception { - super.setUp(); - - mResolver = mContext.getContentResolver(); - - ContentValues values0 = new ContentValues(); - values0.put(DummyProvider.NAME, NAME0); - mResolver.insert(DummyProvider.CONTENT_URI, values0); - - ContentValues values1 = new ContentValues(); - values1.put(DummyProvider.NAME, NAME1); - mResolver.insert(DummyProvider.CONTENT_URI, values1); - - ContentValues values2 = new ContentValues(); - values2.put(DummyProvider.NAME, NAME2); - mResolver.insert(DummyProvider.CONTENT_URI, values2); - } - - @Override - protected void tearDown() throws Exception { - mResolver.delete(DummyProvider.CONTENT_URI, null, null); - - super.tearDown(); - } - - public void testConstructor() { - new AsyncQueryHandler(mResolver) { }; - - new AsyncQueryHandler(null) { }; - } - - public void testStartInsert() throws InterruptedException { - final ContentValues values1 = new ContentValues(); - values1.put(DummyProvider.NAME, NAME3); - final ContentValues values2 = new ContentValues(); - values2.put(DummyProvider.NAME, NAME4); - - mAsyncHandler = createAsyncQueryHandlerSync(); - assertFalse(mAsyncHandler.hadInserted(0)); - - // insert without cancelling. - startInsert(INSERT_TOKEN_1, INSERT_COOKIE, DummyProvider.CONTENT_URI, values1, NO_CANCEL); - - assertTrue(mAsyncHandler.hadInserted(TEST_TIME_OUT)); - assertEquals(INSERT_TOKEN_1, mAsyncHandler.getToken()); - assertEquals(INSERT_COOKIE, mAsyncHandler.getCookie()); - assertEquals(DummyProvider.CONTENT_URI, (Uri) mAsyncHandler.getResult()); - - mAsyncHandler.reset(); - // insert will be cancelled. - startInsert(INSERT_TOKEN_2, INSERT_COOKIE, DummyProvider.CONTENT_URI, values2, CANCELABLE); - mAsyncHandler.cancelOperation(INSERT_TOKEN_2); - assertFalse(mAsyncHandler.hadInserted(TEST_TIME_OUT)); - - // only value1 has been inserted. - Cursor cursor = null; - try { - cursor = mResolver.query(DummyProvider.CONTENT_URI, PROJECTIONS, null, null, ORDER_BY); - assertEquals(ORIGINAL_ROW_COUNT + 1, cursor.getCount()); - cursor.moveToLast(); - assertEquals(NAME3, cursor.getString(NAME_COLUMN_INDEX)); - } finally { - if (cursor != null) { - cursor.close(); - } - } - } - - public void testStartQuery() throws InterruptedException { - mAsyncHandler = createAsyncQueryHandlerSync(); - assertFalse(mAsyncHandler.hadQueried(0)); - - // query without cancelling. - startQuery(QUERY_TOKEN_1, QUERY_COOKIE, DummyProvider.CONTENT_URI, - PROJECTIONS, null, null, ORDER_BY, NO_CANCEL); - - assertTrue(mAsyncHandler.hadQueried(TEST_TIME_OUT)); - assertEquals(QUERY_TOKEN_1, mAsyncHandler.getToken()); - assertEquals(QUERY_COOKIE, mAsyncHandler.getCookie()); - Cursor cursor = (Cursor) mAsyncHandler.getResult(); - assertNotNull(cursor); - try { - assertEquals(ORIGINAL_ROW_COUNT, cursor.getCount()); - assertEquals(2, cursor.getColumnCount()); - cursor.moveToFirst(); - assertEquals(NAME0, cursor.getString(NAME_COLUMN_INDEX)); - - cursor.moveToNext(); - assertEquals(NAME1, cursor.getString(NAME_COLUMN_INDEX)); - - cursor.moveToNext(); - assertEquals(NAME2, cursor.getString(NAME_COLUMN_INDEX)); - } finally { - cursor.close(); - } - - // query will be cancelled. - mAsyncHandler.reset(); - startQuery(QUERY_TOKEN_2, QUERY_COOKIE, DummyProvider.CONTENT_URI, - PROJECTIONS, null, null, ORDER_BY, CANCELABLE); - mAsyncHandler.cancelOperation(QUERY_TOKEN_2); - assertFalse(mAsyncHandler.hadQueried(TEST_TIME_OUT)); - } - - public void testStartUpdate() throws InterruptedException { - final ContentValues values1 = new ContentValues(); - values1.put(DummyProvider.NAME, NAME3); - final ContentValues values2 = new ContentValues(); - values2.put(DummyProvider.NAME, NAME4); - - mAsyncHandler = createAsyncQueryHandlerSync(); - assertFalse(mAsyncHandler.hadUpdated(0)); - - // update without cancelling. - startUpdate(UPDATE_TOKEN_1, UPDATE_COOKIE, DummyProvider.CONTENT_URI, values1, - DummyProvider.NAME + "=?", new String[] { NAME0 }, NO_CANCEL); - - assertTrue(mAsyncHandler.hadUpdated(TEST_TIME_OUT)); - assertEquals(UPDATE_TOKEN_1, mAsyncHandler.getToken()); - assertEquals(UPDATE_COOKIE, mAsyncHandler.getCookie()); - assertEquals(1, ((Integer) mAsyncHandler.getResult()).intValue()); - - mAsyncHandler.reset(); - // update will be cancelled. - startUpdate(UPDATE_TOKEN_2, UPDATE_COOKIE, DummyProvider.CONTENT_URI, values2, - DummyProvider.NAME + "=?", new String[] { NAME1 }, CANCELABLE); - mAsyncHandler.cancelOperation(UPDATE_TOKEN_2); - assertFalse(mAsyncHandler.hadUpdated(TEST_TIME_OUT)); - - // only values has been updated. - Cursor cursor = null; - try { - cursor = mResolver.query(DummyProvider.CONTENT_URI, PROJECTIONS, null, null, ORDER_BY); - assertEquals(ORIGINAL_ROW_COUNT, cursor.getCount()); - cursor.moveToFirst(); - assertEquals(NAME3, cursor.getString(NAME_COLUMN_INDEX)); - - cursor.moveToNext(); - assertEquals(NAME1, cursor.getString(NAME_COLUMN_INDEX)); - - cursor.moveToNext(); - assertEquals(NAME2, cursor.getString(NAME_COLUMN_INDEX)); - } finally { - if (cursor != null) { - cursor.close(); - } - } - } - - public void testStartDelete() throws InterruptedException { - mAsyncHandler = createAsyncQueryHandlerSync(); - assertFalse(mAsyncHandler.hadDeleted(0)); - - // delete without cancelling. - startDelete(DELETE_TOKEN_1, DELETE_COOKIE, DummyProvider.CONTENT_URI, - DummyProvider.NAME + "=?", new String[] { NAME0 }, NO_CANCEL); - - assertTrue(mAsyncHandler.hadDeleted(TEST_TIME_OUT)); - assertEquals(DELETE_TOKEN_1, mAsyncHandler.getToken()); - assertEquals(DELETE_COOKIE, mAsyncHandler.getCookie()); - assertEquals(1, ((Integer) mAsyncHandler.getResult()).intValue()); - - mAsyncHandler.reset(); - // delete will be cancelled - startDelete(DELETE_TOKEN_2, DELETE_COOKIE, DummyProvider.CONTENT_URI, - DummyProvider.NAME + "=?", new String[] { NAME1 }, CANCELABLE); - mAsyncHandler.cancelOperation(DELETE_TOKEN_2); - assertFalse(mAsyncHandler.hadDeleted(TEST_TIME_OUT)); - - // only NAME0 has been deleted. - Cursor cursor = null; - try { - cursor = mResolver.query(DummyProvider.CONTENT_URI, PROJECTIONS, null, null, ORDER_BY); - assertEquals(ORIGINAL_ROW_COUNT - 1, cursor.getCount()); - cursor.moveToFirst(); - assertEquals(NAME1, cursor.getString(NAME_COLUMN_INDEX)); - - cursor.moveToNext(); - assertEquals(NAME2, cursor.getString(NAME_COLUMN_INDEX)); - } finally { - if (cursor != null) { - cursor.close(); - } - } - } - - public void testCreateHandler() { - MockAsyncQueryHandler wrapper = new MockAsyncQueryHandler(mResolver); - Handler result = wrapper.createHandler(Looper.myLooper()); - assertNotNull(result); - assertSame(Looper.myLooper(), result.getLooper()); - - try { - wrapper.createHandler(null); - fail("Should throw NullPointerException if param looper is null"); - } catch (NullPointerException e) { - } - } - - private void startQuery(int token, Object cookie, Uri uri, String[] projection, - String selection, String[] selectionArgs, String orderBy, boolean cancelable) { - if (cancelable) { - mAsyncHandler.injectMockQuery(); - } - mAsyncHandler.startQuery(token, cookie, uri, projection, - selection, selectionArgs, orderBy); - } - - private void startInsert(int token, Object cookie, Uri uri, - ContentValues initialValues, boolean cancelable) { - if (cancelable) { - mAsyncHandler.injectMockQuery(); - } - mAsyncHandler.startInsert(token, cookie, uri, initialValues); - } - - private void startUpdate(int token, Object cookie, Uri uri, ContentValues values, - String selection, String[] selectionArgs, boolean cancelable) { - if (cancelable) { - mAsyncHandler.injectMockQuery(); - } - mAsyncHandler.startUpdate(token, cookie, uri, values, selection, selectionArgs); - } - - private void startDelete(int token, Object cookie, Uri uri, String selection, - String[] selectionArgs, boolean cancelable) { - if (cancelable) { - mAsyncHandler.injectMockQuery(); - } - mAsyncHandler.startDelete(token, cookie, uri, selection, selectionArgs); - } - - private static class MockAsyncQueryHandler extends AsyncQueryHandler { - private boolean mHadInserted; - private boolean mHadDeleted; - private boolean mHadQueried; - private boolean mHadUpdated; - - private int mToken; - private Object mCookie; - private Object mResult; - - public MockAsyncQueryHandler(ContentResolver cr) { - super(cr); - } - - @Override - protected Handler createHandler(Looper looper) { - return super.createHandler(looper); - } - - /** - * Injects a mock query operation which does nothing except make queue busy so that - * following operations should be cancelled successfully. - */ - private void injectMockQuery() { - // we have to call super.startQuery here. - super.startQuery(MOCK_QUERY_TOKEN, QUERY_COOKIE, - DummyProvider.CONTENT_URI_MOCK_OPERATION, PROJECTIONS, null, null, ORDER_BY); - } - - @Override - protected void onDeleteComplete(int token, Object cookie, int result) { - super.onDeleteComplete(token, cookie, result); - mToken = token; - mCookie = cookie; - mResult = Integer.valueOf(result); - synchronized (this) { - mHadDeleted = true; - notify(); - } - } - - @Override - protected void onInsertComplete(int token, Object cookie, Uri uri) { - super.onInsertComplete(token, cookie, uri); - mToken = token; - mCookie = cookie; - mResult = uri; - synchronized (this) { - mHadInserted = true; - notify(); - } - } - - @Override - protected void onQueryComplete(int token, Object cookie, Cursor cursor) { - super.onQueryComplete(token, cookie, cursor); - if (token == MOCK_QUERY_TOKEN) { - // ignore mock query operation - return; - } - mToken = token; - mCookie = cookie; - mResult = cursor; - synchronized (this) { - mHadQueried = true; - notify(); - } - } - - @Override - protected void onUpdateComplete(int token, Object cookie, int result) { - super.onUpdateComplete(token, cookie, result); - mToken = token; - mCookie = cookie; - mResult = Integer.valueOf(result); - synchronized (this) { - mHadUpdated = true; - notify(); - } - } - - public synchronized boolean hadInserted(long timeout) throws InterruptedException { - synchronized (this) { - // do not wait if timeout is 0 - if (timeout > 0 && !mHadInserted) { - wait(timeout); - } - } - return mHadInserted; - } - - public synchronized boolean hadUpdated(long timeout) throws InterruptedException { - // do not wait if timeout is 0 - if (timeout > 0 && !mHadUpdated) { - wait(timeout); - } - return mHadUpdated; - } - - public synchronized boolean hadDeleted(long timeout) throws InterruptedException { - // do not wait if timeout is 0 - if (timeout > 0 && !mHadDeleted) { - wait(timeout); - } - return mHadDeleted; - } - - public synchronized boolean hadQueried(long timeout) throws InterruptedException { - // do not wait if timeout is 0 - if (timeout > 0 && !mHadQueried) { - wait(timeout); - } - return mHadQueried; - } - - public int getToken() { - return mToken; - } - - public Object getCookie() { - return mCookie; - } - - public Object getResult() { - return mResult; - } - - public void reset() { - mHadInserted = false; - mHadDeleted = false; - mHadQueried = false; - mHadUpdated = false; - mToken = 0; - mCookie = null; - mResult = null; - } - } - - private MockAsyncQueryHandler createAsyncQueryHandlerSync() throws InterruptedException { - SyncRunnable sr = new SyncRunnable(new Runnable() { - public void run() { - mAsyncHandler = new MockAsyncQueryHandler(mResolver); - } - }); - TestHandlerThread t = new TestHandlerThread(sr); - t.start(); - sr.waitForComplete(); - return mAsyncHandler; - } - - /** - * The Class TestHandlerThread. Convenience for created AsyncQueryHandler - * object on the handler thread. - */ - private static class TestHandlerThread extends HandlerThread { - private Runnable mTarget; - - public TestHandlerThread(Runnable target) { - super("AsyncQueryHandlerTestHandlerThread"); - mTarget = target; - } - - @Override - protected void onLooperPrepared() { - super.onLooperPrepared(); - if (mTarget != null) { - mTarget.run(); - } - } - } - - /** - * The Class SyncRunnable. The object of this class make the thread wait - * until the target finished - */ - private static final class SyncRunnable implements Runnable { - /** The target. */ - private final Runnable mTarget; - - /** true if the target is completed. */ - private boolean mHadCompleted; - - public SyncRunnable(Runnable target) { - mTarget = target; - } - - public void run() { - if (mTarget != null) { - mTarget.run(); - } - - synchronized (this) { - mHadCompleted = true; - notifyAll(); - } - } - - public synchronized void waitForComplete() throws InterruptedException { - if (!mHadCompleted) { - wait(TEST_TIME_OUT); - } - } - } -} diff --git a/proprietary/frameworks/base/tests/content/tests/src/mediatek/content/cts/ContentProviderTest.java b/proprietary/frameworks/base/tests/content/tests/src/mediatek/content/cts/ContentProviderTest.java deleted file mode 100755 index 5ced37ca255582cc5cb9027ca06456d5ee6fa398..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/content/tests/src/mediatek/content/cts/ContentProviderTest.java +++ /dev/null @@ -1,349 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -package android.content.cts; - -import android.content.ContentProvider; -import android.content.ContentResolver; -import android.content.ContentValues; -import android.content.Context; -import android.content.pm.ProviderInfo; -import android.database.Cursor; -import android.database.sqlite.SQLiteDatabase; -import android.net.Uri; -import android.os.ParcelFileDescriptor; -import android.test.AndroidTestCase; - -import com.android.cts.stub.R; - -import java.io.File; -import java.io.FileNotFoundException; -import java.io.IOException; - -/** - * Test {@link ContentProvider}. - */ -public class ContentProviderTest extends AndroidTestCase { - private static final String TEST_PACKAGE_NAME = "com.android.cts.stub"; - private static final String TEST_FILE_NAME = "testFile.tmp"; - private static final String TEST_DB_NAME = "test.db"; - - @Override - protected void tearDown() throws Exception { - mContext.deleteDatabase(TEST_DB_NAME); - mContext.deleteFile(TEST_FILE_NAME); - super.tearDown(); - } - - public void testOpenAssetFile() throws IOException { - MockContentProvider mockContentProvider = new MockContentProvider(); - Uri uri = Uri.parse(ContentResolver.SCHEME_ANDROID_RESOURCE + - "://" + TEST_PACKAGE_NAME + "/" + R.raw.testimage); - - try { - mockContentProvider.openAssetFile(uri, "r"); - fail("Should always throw out FileNotFoundException!"); - } catch (FileNotFoundException e) { - } - - try { - mockContentProvider.openFile(null, null); - fail("Should always throw out FileNotFoundException!"); - } catch (FileNotFoundException e) { - } - } - - public void testAttachInfo() { - MockContentProvider mockContentProvider = new MockContentProvider(); - - ProviderInfo info1 = new ProviderInfo(); - info1.readPermission = "android.permission.READ_SMS"; - info1.writePermission = "android.permission.WRITE_SMS"; - mockContentProvider.attachInfo(getContext(), info1); - assertSame(getContext(), mockContentProvider.getContext()); - assertEquals(info1.readPermission, mockContentProvider.getReadPermission()); - assertEquals(info1.writePermission, mockContentProvider.getWritePermission()); - - ProviderInfo info2 = new ProviderInfo(); - info2.readPermission = "android.permission.READ_CONTACTS"; - info2.writePermission = "android.permission.WRITE_CONTACTS"; - mockContentProvider.attachInfo(null, info2); - assertSame(getContext(), mockContentProvider.getContext()); - assertEquals(info1.readPermission, mockContentProvider.getReadPermission()); - assertEquals(info1.writePermission, mockContentProvider.getWritePermission()); - - mockContentProvider = new MockContentProvider(); - mockContentProvider.attachInfo(null, null); - assertNull(mockContentProvider.getContext()); - assertNull(mockContentProvider.getReadPermission()); - assertNull(mockContentProvider.getWritePermission()); - - mockContentProvider.attachInfo(null, info2); - assertNull(mockContentProvider.getContext()); - assertEquals(info2.readPermission, mockContentProvider.getReadPermission()); - assertEquals(info2.writePermission, mockContentProvider.getWritePermission()); - - mockContentProvider.attachInfo(getContext(), info1); - assertSame(getContext(), mockContentProvider.getContext()); - assertEquals(info1.readPermission, mockContentProvider.getReadPermission()); - assertEquals(info1.writePermission, mockContentProvider.getWritePermission()); - } - - public void testBulkInsert() { - MockContentProvider mockContentProvider = new MockContentProvider(); - - int count = 2; - ContentValues[] values = new ContentValues[count]; - for (int i = 0; i < count; i++) { - values[i] = new ContentValues(); - } - Uri uri = Uri.parse("content://browser/bookmarks"); - assertEquals(count, mockContentProvider.bulkInsert(uri, values)); - assertEquals(count, mockContentProvider.getInsertCount()); - - mockContentProvider = new MockContentProvider(); - try { - assertEquals(count, mockContentProvider.bulkInsert(null, values)); - } finally { - assertEquals(count, mockContentProvider.getInsertCount()); - } - } - - public void testGetContext() { - MockContentProvider mockContentProvider = new MockContentProvider(); - assertNull(mockContentProvider.getContext()); - - mockContentProvider.attachInfo(getContext(), null); - assertSame(getContext(), mockContentProvider.getContext()); - mockContentProvider.attachInfo(null, null); - assertSame(getContext(), mockContentProvider.getContext()); - } - - public void testAccessReadPermission() { - MockContentProvider mockContentProvider = new MockContentProvider(); - assertNull(mockContentProvider.getReadPermission()); - - String expected = "android.permission.READ_CONTACTS"; - mockContentProvider.setReadPermissionWrapper(expected); - assertEquals(expected, mockContentProvider.getReadPermission()); - - expected = "android.permission.READ_SMS"; - mockContentProvider.setReadPermissionWrapper(expected); - assertEquals(expected, mockContentProvider.getReadPermission()); - - mockContentProvider.setReadPermissionWrapper(null); - assertNull(mockContentProvider.getReadPermission()); - } - - public void testAccessWritePermission() { - MockContentProvider mockContentProvider = new MockContentProvider(); - assertNull(mockContentProvider.getWritePermission()); - - String expected = "android.permission.WRITE_CONTACTS"; - mockContentProvider.setWritePermissionWrapper(expected); - assertEquals(expected, mockContentProvider.getWritePermission()); - - expected = "android.permission.WRITE_SMS"; - mockContentProvider.setWritePermissionWrapper(expected); - assertEquals(expected, mockContentProvider.getWritePermission()); - - mockContentProvider.setWritePermissionWrapper(null); - assertNull(mockContentProvider.getWritePermission()); - } - - public void testIsTemporary() { - MockContentProvider mockContentProvider = new MockContentProvider(); - assertFalse(mockContentProvider.isTemporary()); - } - - public void testOpenFile() { - MockContentProvider mockContentProvider = new MockContentProvider(); - - try { - Uri uri = Uri.parse("content://test"); - mockContentProvider.openFile(uri, "r"); - fail("Should always throw out FileNotFoundException!"); - } catch (FileNotFoundException e) { - } - - try { - mockContentProvider.openFile(null, null); - fail("Should always throw out FileNotFoundException!"); - } catch (FileNotFoundException e) { - } - } - - public void testOpenFileHelper() throws IOException { - - // create a temporary File - mContext.openFileOutput(TEST_FILE_NAME, Context.MODE_PRIVATE).close(); - File file = mContext.getFileStreamPath(TEST_FILE_NAME); - assertTrue(file.exists()); - - ContentProvider cp = new OpenFileContentProvider(file.getAbsolutePath(), TEST_DB_NAME); - - Uri uri = Uri.parse("content://test"); - assertNotNull(cp.openFile(uri, "r")); - - try { - uri = Uri.parse("content://test"); - cp.openFile(uri, "wrong"); - fail("Should throw IllegalArgumentException for bad mode!"); - } catch (IllegalArgumentException e) { - } - - // delete the temporary file - file.delete(); - - try { - uri = Uri.parse("content://test"); - cp.openFile(uri, "r"); - fail("Should throw FileNotFoundException!"); - } catch (FileNotFoundException e) { - } - - try { - cp.openFile((Uri) null, "r"); - fail("Should always throw FileNotFoundException!"); - } catch (FileNotFoundException e) { - } - } - - public void testOnConfigurationChanged() { - // cannot trigger this callback reliably - } - - public void testOnLowMemory() { - // cannot trigger this callback reliably - } - - public void testGetIContentProvider() { - MockContentProvider mockContentProvider = new MockContentProvider(); - - assertNotNull(mockContentProvider.getIContentProvider()); - } - - private class MockContentProvider extends ContentProvider { - private int mInsertCount = 0; - - @Override - public int delete(Uri uri, String selection, String[] selectionArgs) { - return 0; - } - - @Override - public String getType(Uri uri) { - return null; - } - - @Override - public Uri insert(Uri uri, ContentValues values) { - mInsertCount++; - return null; - } - - public int getInsertCount() { - return mInsertCount; - } - - @Override - public Cursor query(Uri uri, String[] projection, String selection, - String[] selectionArgs, String sortOrder) { - return null; - } - - @Override - public int update(Uri uri, ContentValues values, String selection, - String[] selectionArgs) { - return 0; - } - - @Override - public boolean onCreate() { - return false; - } - - // wrapper or override for the protected methods - public void setReadPermissionWrapper(String permission) { - super.setReadPermission(permission); - } - - public void setWritePermissionWrapper(String permission) { - super.setWritePermission(permission); - } - - @Override - protected boolean isTemporary() { - return super.isTemporary(); - } - - public ParcelFileDescriptor openFileHelperWrapper(Uri uri, String mode) - throws FileNotFoundException { - return super.openFileHelper(uri, mode); - } - } - - /** - * This provider implements openFile() using ContentProvider.openFileHelper(). - */ - private class OpenFileContentProvider extends ContentProvider { - private SQLiteDatabase mDb; - - OpenFileContentProvider(String fileName, String dbName) { - // delete the database if it already exists - mContext.deleteDatabase(dbName); - mDb = mContext.openOrCreateDatabase(dbName, Context.MODE_PRIVATE, null); - mDb.execSQL("CREATE TABLE files ( _data TEXT );"); - mDb.execSQL("INSERT INTO files VALUES ( \"" + fileName + "\");"); - } - - @Override - public int delete(Uri uri, String selection, String[] selectionArgs) { - throw new RuntimeException("not implemented"); - } - - @Override - public String getType(Uri uri) { - throw new RuntimeException("not implemented"); - } - - @Override - public Uri insert(Uri uri, ContentValues values) { - throw new RuntimeException("not implemented"); - } - - @Override - public boolean onCreate() { - return true; - } - - @Override - public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, - String sortOrder) { - return mDb.query("files", projection, selection, selectionArgs, null, null, null); - } - - @Override - public int update(Uri uri, ContentValues values, String selection, String[] selectionArgs) { - throw new RuntimeException("not implemented"); - } - - @Override - public ParcelFileDescriptor openFile(Uri uri, String mode) throws FileNotFoundException { - return openFileHelper(uri, mode); - } - } -} diff --git a/proprietary/frameworks/base/tests/content/tests/src/mediatek/content/cts/ContentQueryMapTest.java b/proprietary/frameworks/base/tests/content/tests/src/mediatek/content/cts/ContentQueryMapTest.java deleted file mode 100755 index 34ecd607cceac4b6c99e653266653839b3773dc3..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/content/tests/src/mediatek/content/cts/ContentQueryMapTest.java +++ /dev/null @@ -1,373 +0,0 @@ -/* - * Copyright (C) 2009 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -package android.content.cts; - - -import android.content.ContentQueryMap; -import android.content.ContentResolver; -import android.content.ContentValues; -import android.database.Cursor; -import android.os.Handler; -import android.os.HandlerThread; -import android.os.Looper; -import android.test.AndroidTestCase; - -import java.util.Map; -import java.util.Observable; -import java.util.Observer; - -/** - * Test {@link ContentQueryMap}. - */ -public class ContentQueryMapTest extends AndroidTestCase { - private static final int TEST_TIME_OUT = 5000; - - private static final String NAME0 = "name0"; - private static final String VALUE0 = "value0"; - private static final String NAME1 = "name1"; - private static final String VALUE1 = "value1"; - private static final String NAME2 = "name2"; - private static final String VALUE2 = "value2"; - private static final String NAME3 = "name3"; - private static final String VALUE3 = "value3"; - - private static final String[] PROJECTIONS = new String[] { - DummyProvider.NAME, DummyProvider.VALUE}; - - private static final int ORIGINAL_ROW_COUNT = 2; - private ContentResolver mResolver; - private Cursor mCursor; - private ContentQueryMap mContentQueryMap; - - @Override - protected void setUp() throws Exception { - super.setUp(); - mResolver = mContext.getContentResolver(); - - ContentValues values0 = new ContentValues(); - values0.put(DummyProvider.NAME, NAME0); - values0.put(DummyProvider.VALUE, VALUE0); - mResolver.insert(DummyProvider.CONTENT_URI, values0); - - ContentValues values1 = new ContentValues(); - values1.put(DummyProvider.NAME, NAME1); - values1.put(DummyProvider.VALUE, VALUE1); - mResolver.insert(DummyProvider.CONTENT_URI, values1); - - mCursor = mResolver.query(DummyProvider.CONTENT_URI, PROJECTIONS, null, null, null); - assertNotNull(mCursor); - } - - @Override - protected void tearDown() throws Exception { - if (mContentQueryMap != null) { - mContentQueryMap.close(); - mContentQueryMap = null; - } - if (mCursor != null) { - mCursor.close(); - mCursor = null; - } - - mResolver.delete(DummyProvider.CONTENT_URI, null, null); - - super.tearDown(); - } - - public void testConstructor() { - new ContentQueryMap(mCursor, DummyProvider.NAME, true, null); - - new ContentQueryMap(mCursor, DummyProvider.VALUE, false, new Handler()); - - try { - new ContentQueryMap(mCursor, null, false, new Handler()); - fail("Should throw NullPointerException if param columnNameOfKey is null"); - } catch (NullPointerException e) { - } - - try { - new ContentQueryMap(null, DummyProvider.NAME, false, new Handler()); - fail("Should throw NullPointerException if param cursor is null"); - } catch (NullPointerException e) { - } - } - - public void testGetRows() { - // handler can be null - mContentQueryMap = new ContentQueryMap(mCursor, DummyProvider.NAME, true, null); - Map rows = mContentQueryMap.getRows(); - assertEquals(ORIGINAL_ROW_COUNT, rows.size()); - assertTrue(rows.containsKey(NAME0)); - assertEquals(VALUE0, rows.get(NAME0).getAsString(DummyProvider.VALUE)); - assertTrue(rows.containsKey(NAME1)); - assertEquals(VALUE1, rows.get(NAME1).getAsString(DummyProvider.VALUE)); - mContentQueryMap.close(); - - // the mCursor has been close - mContentQueryMap = new ContentQueryMap(mCursor, DummyProvider.NAME, false, new Handler()); - rows = mContentQueryMap.getRows(); - assertFalse(rows.containsKey(NAME0)); - mContentQueryMap.requery(); - rows = mContentQueryMap.getRows(); - assertFalse(rows.containsKey(NAME0)); - } - - public void testRequery() { - // Disable the keepUpdated to make sure requery() will not be called - // from somewhere else - mContentQueryMap = new ContentQueryMap(mCursor, DummyProvider.NAME, false, null); - ContentValues contentValues = mContentQueryMap.getValues(NAME0); - assertNotNull(contentValues); - assertEquals(VALUE0, contentValues.getAsString(DummyProvider.VALUE)); - - contentValues = mContentQueryMap.getValues(NAME1); - assertNotNull(contentValues); - assertEquals(VALUE1, contentValues.getAsString(DummyProvider.VALUE)); - - contentValues = mContentQueryMap.getValues(NAME2); - assertNull(contentValues); - - // update NAME0 and VALUE0 - ContentValues values = new ContentValues(); - values.put(DummyProvider.NAME, NAME2); - values.put(DummyProvider.VALUE, VALUE2); - mResolver.update(DummyProvider.CONTENT_URI, values, - DummyProvider.NAME + " = '" + NAME0 + "'", null); - mContentQueryMap.requery(); - - contentValues = mContentQueryMap.getValues(NAME0); - assertNull(contentValues); - - contentValues = mContentQueryMap.getValues(NAME1); - assertNotNull(contentValues); - assertEquals(VALUE1, contentValues.getAsString(DummyProvider.VALUE)); - - contentValues = mContentQueryMap.getValues(NAME2); - assertNotNull(contentValues); - assertEquals(VALUE2, contentValues.getAsString(DummyProvider.VALUE)); - } - - public void testSetKeepUpdated() throws InterruptedException { - MockObserver observer = new MockObserver(); - - // keepUpdated is false - mContentQueryMap = new ContentQueryMap(mCursor, DummyProvider.NAME, false, null); - mContentQueryMap.addObserver(observer); - assertFalse(observer.hadUpdated(0)); - - ContentValues contentValues = mContentQueryMap.getValues(NAME0); - assertNotNull(contentValues); - assertEquals(VALUE0, contentValues.getAsString(DummyProvider.VALUE)); - contentValues = mContentQueryMap.getValues(NAME2); - assertNull(contentValues); - - // update NAME0 and VALUE0 - ContentValues values = new ContentValues(); - values.put(DummyProvider.NAME, NAME2); - values.put(DummyProvider.VALUE, VALUE2); - mResolver.update(DummyProvider.CONTENT_URI, values, - DummyProvider.NAME + " = '" + NAME0 + "'", null); - - // values have not been updated - assertFalse(observer.hadUpdated(0)); - contentValues = mContentQueryMap.getValues(NAME0); - assertNotNull(contentValues); - assertEquals(VALUE0, contentValues.getAsString(DummyProvider.VALUE)); - contentValues = mContentQueryMap.getValues(NAME2); - assertNull(contentValues); - - // have to update manually - mContentQueryMap.requery(); - assertTrue(observer.hadUpdated(0)); - assertSame(mContentQueryMap, observer.getObservable()); - - contentValues = mContentQueryMap.getValues(NAME0); - assertNull(contentValues); - contentValues = mContentQueryMap.getValues(NAME2); - assertNotNull(contentValues); - assertEquals(VALUE2, contentValues.getAsString(DummyProvider.VALUE)); - - observer.reset(); - contentValues = mContentQueryMap.getValues(NAME3); - assertNull(contentValues); - new Thread(new Runnable() { - public void run() { - Looper.prepare(); - mContentQueryMap.setKeepUpdated(true); - synchronized (ContentQueryMapTest.this) { - //listener is ready, release the sender thread - ContentQueryMapTest.this.notify(); - } - Looper.loop(); - } - }).start(); - synchronized (this) { - wait(TEST_TIME_OUT); - } //wait the listener to be ready before launching onChange event - - // insert NAME3 and VALUE3 - values = new ContentValues(); - values.put(DummyProvider.NAME, NAME3); - values.put(DummyProvider.VALUE, VALUE3); - mResolver.insert(DummyProvider.CONTENT_URI, values); - - // should be updated automatically - assertTrue(observer.hadUpdated(TEST_TIME_OUT)); - assertSame(mContentQueryMap, observer.getObservable()); - contentValues = mContentQueryMap.getValues(NAME3); - assertNotNull(contentValues); - assertEquals(VALUE3, contentValues.getAsString(DummyProvider.VALUE)); - - observer.reset(); - new Thread(new Runnable() { - public void run() { - Looper.prepare(); - mContentQueryMap.setKeepUpdated(false); - synchronized (ContentQueryMapTest.this) { - //listener is ready, release the sender thread - ContentQueryMapTest.this.notify(); - } - Looper.loop(); - } - }).start(); - synchronized (this) { - wait(TEST_TIME_OUT); - } //wait the listener to be ready before launching onChange event - // update NAME3 and VALUE3 - values = new ContentValues(); - values.put(DummyProvider.NAME, NAME0); - values.put(DummyProvider.VALUE, VALUE0); - mResolver.update(DummyProvider.CONTENT_URI, values, - DummyProvider.NAME + " = '" + NAME3 + "'", null); - - // values have not been updated - assertFalse(observer.hadUpdated(TEST_TIME_OUT)); - contentValues = mContentQueryMap.getValues(NAME3); - assertNotNull(contentValues); - assertEquals(VALUE3, contentValues.getAsString(DummyProvider.VALUE)); - } - - public void testSetKeepUpdatedWithHandler() throws InterruptedException { - MockObserver observer = new MockObserver(); - HandlerThread thread = new HandlerThread("testSetKeepUpdatedWithHandler"); - thread.start(); - Handler handler = new Handler(thread.getLooper()); - // keepUpdated is false - mContentQueryMap = new ContentQueryMap(mCursor, DummyProvider.NAME, false, handler); - mContentQueryMap.addObserver(observer); - assertFalse(observer.hadUpdated(0)); - - ContentValues contentValues = mContentQueryMap.getValues(NAME0); - assertNotNull(contentValues); - assertEquals(VALUE0, contentValues.getAsString(DummyProvider.VALUE)); - contentValues = mContentQueryMap.getValues(NAME2); - assertNull(contentValues); - - // update NAME0 and VALUE0 - ContentValues values = new ContentValues(); - values.put(DummyProvider.NAME, NAME2); - values.put(DummyProvider.VALUE, VALUE2); - mResolver.update(DummyProvider.CONTENT_URI, values, - DummyProvider.NAME + " = '" + NAME0 + "'", null); - - // values have not been updated - assertFalse(observer.hadUpdated(TEST_TIME_OUT)); - contentValues = mContentQueryMap.getValues(NAME0); - assertNotNull(contentValues); - assertEquals(VALUE0, contentValues.getAsString(DummyProvider.VALUE)); - contentValues = mContentQueryMap.getValues(NAME2); - assertNull(contentValues); - - // have to update manually - mContentQueryMap.requery(); - assertTrue(observer.hadUpdated(0)); - assertSame(mContentQueryMap, observer.getObservable()); - - contentValues = mContentQueryMap.getValues(NAME0); - assertNull(contentValues); - contentValues = mContentQueryMap.getValues(NAME2); - assertNotNull(contentValues); - assertEquals(VALUE2, contentValues.getAsString(DummyProvider.VALUE)); - - observer.reset(); - contentValues = mContentQueryMap.getValues(NAME3); - assertNull(contentValues); - mContentQueryMap.setKeepUpdated(true); - - // insert NAME3 and VALUE3 - values = new ContentValues(); - values.put(DummyProvider.NAME, NAME3); - values.put(DummyProvider.VALUE, VALUE3); - mResolver.insert(DummyProvider.CONTENT_URI, values); - - // should be updated automatically - assertTrue(observer.hadUpdated(TEST_TIME_OUT)); - assertSame(mContentQueryMap, observer.getObservable()); - contentValues = mContentQueryMap.getValues(NAME3); - assertNotNull(contentValues); - assertEquals(VALUE3, contentValues.getAsString(DummyProvider.VALUE)); - - observer.reset(); - mContentQueryMap.setKeepUpdated(false); - // update NAME3 and VALUE3 - values = new ContentValues(); - values.put(DummyProvider.NAME, NAME0); - values.put(DummyProvider.VALUE, VALUE0); - mResolver.update(DummyProvider.CONTENT_URI, values, - DummyProvider.NAME + " = '" + NAME3 + "'", null); - - // values have not been updated - assertFalse(observer.hadUpdated(TEST_TIME_OUT)); - contentValues = mContentQueryMap.getValues(NAME3); - assertNotNull(contentValues); - assertEquals(VALUE3, contentValues.getAsString(DummyProvider.VALUE)); - } - - public void testGetValuesBoundary() { - mContentQueryMap = new ContentQueryMap(mCursor, DummyProvider.NAME, false, null); - assertNull(mContentQueryMap.getValues(null)); - assertNull(mContentQueryMap.getValues("")); - } - - private static final class MockObserver implements Observer { - private boolean mHadUpdated = false; - private Observable mObservable; - - public void reset() { - mHadUpdated = false; - mObservable = null; - } - - public synchronized void update(Observable observable, Object data) { - mObservable = observable; - mHadUpdated = true; - notify(); - } - - public Observable getObservable() { - return mObservable; - } - - public synchronized boolean hadUpdated(long timeout) throws InterruptedException { - // do not wait if timeout is 0 - if (timeout > 0 && !mHadUpdated) { - wait(timeout); - } - return mHadUpdated; - } - } -} diff --git a/proprietary/frameworks/base/tests/content/tests/src/mediatek/content/cts/ContentResolverTest.java b/proprietary/frameworks/base/tests/content/tests/src/mediatek/content/cts/ContentResolverTest.java deleted file mode 100755 index 2f6d996eaed02e68a296a391de856f7a3eeaa4bd..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/content/tests/src/mediatek/content/cts/ContentResolverTest.java +++ /dev/null @@ -1,1061 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.content.cts; - -import com.android.cts.stub.R; - - -import android.accounts.Account; -import android.content.ContentProviderClient; -import android.content.ContentResolver; -import android.content.ContentValues; -import android.content.Context; -import android.content.res.AssetFileDescriptor; -import android.cts.util.PollingCheck; -import android.database.ContentObserver; -import android.database.Cursor; -import android.net.Uri; -import android.os.Bundle; -import android.os.CancellationSignal; -import android.os.OperationCanceledException; -import android.os.ParcelFileDescriptor; -import android.os.RemoteException; -import android.test.AndroidTestCase; -import android.util.Log; - -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.OutputStream; - -public class ContentResolverTest extends AndroidTestCase { - private final static String COLUMN_ID_NAME = "_id"; - private final static String COLUMN_KEY_NAME = "key"; - private final static String COLUMN_VALUE_NAME = "value"; - - private static final String AUTHORITY = "ctstest"; - private static final Uri TABLE1_URI = Uri.parse("content://" + AUTHORITY + "/testtable1/"); - private static final Uri TABLE1_CROSS_URI = - Uri.parse("content://" + AUTHORITY + "/testtable1/cross"); - private static final Uri TABLE2_URI = Uri.parse("content://" + AUTHORITY + "/testtable2/"); - private static final Uri SELF_URI = Uri.parse("content://" + AUTHORITY + "/self/"); - private static final Uri CRASH_URI = Uri.parse("content://" + AUTHORITY + "/crash/"); - - private static final String REMOTE_AUTHORITY = "remotectstest"; - private static final Uri REMOTE_TABLE1_URI = Uri.parse("content://" - + REMOTE_AUTHORITY + "/testtable1/"); - private static final Uri REMOTE_SELF_URI = Uri.parse("content://" - + REMOTE_AUTHORITY + "/self/"); - private static final Uri REMOTE_CRASH_URI = Uri.parse("content://" - + REMOTE_AUTHORITY + "/crash/"); - - private static final Account ACCOUNT = new Account("cts", "cts"); - - private static final String KEY1 = "key1"; - private static final String KEY2 = "key2"; - private static final String KEY3 = "key3"; - private static final int VALUE1 = 1; - private static final int VALUE2 = 2; - private static final int VALUE3 = 3; - - private static final String TEST_PACKAGE_NAME = "com.android.cts.stub"; - - private Context mContext; - private ContentResolver mContentResolver; - private Cursor mCursor; - - @Override - protected void setUp() throws Exception { - super.setUp(); - - mContext = getContext(); - mContentResolver = mContext.getContentResolver(); - - android.provider.Settings.System.putInt(mContentResolver, "__cts_crash_on_launch", 0); - - // add three rows to database when every test case start. - ContentValues values = new ContentValues(); - - values.put(COLUMN_KEY_NAME, KEY1); - values.put(COLUMN_VALUE_NAME, VALUE1); - mContentResolver.insert(TABLE1_URI, values); - mContentResolver.insert(REMOTE_TABLE1_URI, values); - - values.put(COLUMN_KEY_NAME, KEY2); - values.put(COLUMN_VALUE_NAME, VALUE2); - mContentResolver.insert(TABLE1_URI, values); - mContentResolver.insert(REMOTE_TABLE1_URI, values); - - values.put(COLUMN_KEY_NAME, KEY3); - values.put(COLUMN_VALUE_NAME, VALUE3); - mContentResolver.insert(TABLE1_URI, values); - mContentResolver.insert(REMOTE_TABLE1_URI, values); - } - - @Override - protected void tearDown() throws Exception { - mContentResolver.delete(TABLE1_URI, null, null); - if (null != mCursor && !mCursor.isClosed()) { - mCursor.close(); - } - mContentResolver.delete(REMOTE_TABLE1_URI, null, null); - if (null != mCursor && !mCursor.isClosed()) { - mCursor.close(); - } - super.tearDown(); - } - - public void testConstructor() { - assertNotNull(mContentResolver); - } - - public void testCrashOnLaunch() { - // This test is going to make sure that the platform deals correctly - // with a content provider process going away while a client is waiting - // for it to come up. - // First, we need to make sure our provider process is gone. Goodbye! - ContentProviderClient client = mContentResolver.acquireContentProviderClient( - REMOTE_AUTHORITY); - // We are going to do something wrong here... release the client first, - // so the act of killing it doesn't kill our own process. - client.release(); - try { - client.delete(REMOTE_SELF_URI, null, null); - } catch (RemoteException e) { - } - // Now make sure the thing is actually gone. - boolean gone = true; - try { - client.getType(REMOTE_TABLE1_URI); - gone = false; - } catch (RemoteException e) { - } - if (!gone) { - fail("Content provider process is not gone!"); - } - try { - android.provider.Settings.System.putInt(mContentResolver, "__cts_crash_on_launch", 1); - String type1 = mContentResolver.getType(REMOTE_TABLE1_URI); - assertEquals(android.provider.Settings.System.getInt(mContentResolver, - "__cts_crash_on_launch", 0), 0); - assertTrue(type1.startsWith(ContentResolver.CURSOR_DIR_BASE_TYPE, 0)); - } finally { - android.provider.Settings.System.putInt(mContentResolver, "__cts_crash_on_launch", 0); - } - } - - public void testUnstableToStableRefs() { - // Get an unstable refrence on the remote content provider. - ContentProviderClient uClient = mContentResolver.acquireUnstableContentProviderClient( - REMOTE_AUTHORITY); - // Verify we can access it. - String type1 = mContentResolver.getType(REMOTE_TABLE1_URI); - assertTrue(type1.startsWith(ContentResolver.CURSOR_DIR_BASE_TYPE, 0)); - - // Get a stable reference on the remote content provider. - ContentProviderClient sClient = mContentResolver.acquireContentProviderClient( - REMOTE_AUTHORITY); - // Verify we can still access it. - type1 = mContentResolver.getType(REMOTE_TABLE1_URI); - assertTrue(type1.startsWith(ContentResolver.CURSOR_DIR_BASE_TYPE, 0)); - - // Release unstable reference. - uClient.release(); - // Verify we can still access it. - type1 = mContentResolver.getType(REMOTE_TABLE1_URI); - assertTrue(type1.startsWith(ContentResolver.CURSOR_DIR_BASE_TYPE, 0)); - - // Release stable reference, removing last ref. - sClient.release(); - // Kill it. Note that a bug at this point where it causes our own - // process to be killed will result in the entire test failing. - try { - Log.i("ContentResolverTest", - "Killing remote client -- if test process goes away, that is why!"); - uClient.delete(REMOTE_SELF_URI, null, null); - } catch (RemoteException e) { - } - // Make sure the remote client is actually gone. - boolean gone = true; - try { - sClient.getType(REMOTE_TABLE1_URI); - gone = false; - } catch (RemoteException e) { - } - if (!gone) { - fail("Content provider process is not gone!"); - } - } - - public void testStableToUnstableRefs() { - // Get a stable reference on the remote content provider. - ContentProviderClient sClient = mContentResolver.acquireContentProviderClient( - REMOTE_AUTHORITY); - // Verify we can still access it. - String type1 = mContentResolver.getType(REMOTE_TABLE1_URI); - assertTrue(type1.startsWith(ContentResolver.CURSOR_DIR_BASE_TYPE, 0)); - - // Get an unstable refrence on the remote content provider. - ContentProviderClient uClient = mContentResolver.acquireUnstableContentProviderClient( - REMOTE_AUTHORITY); - // Verify we can access it. - type1 = mContentResolver.getType(REMOTE_TABLE1_URI); - assertTrue(type1.startsWith(ContentResolver.CURSOR_DIR_BASE_TYPE, 0)); - - // Release stable reference, leaving only an unstable ref. - sClient.release(); - - // Kill it. Note that a bug at this point where it causes our own - // process to be killed will result in the entire test failing. - try { - Log.i("ContentResolverTest", - "Killing remote client -- if test process goes away, that is why!"); - uClient.delete(REMOTE_SELF_URI, null, null); - } catch (RemoteException e) { - } - // Make sure the remote client is actually gone. - boolean gone = true; - try { - uClient.getType(REMOTE_TABLE1_URI); - gone = false; - } catch (RemoteException e) { - } - if (!gone) { - fail("Content provider process is not gone!"); - } - - // Release unstable reference. - uClient.release(); - } - - public void testGetType() { - String type1 = mContentResolver.getType(TABLE1_URI); - assertTrue(type1.startsWith(ContentResolver.CURSOR_DIR_BASE_TYPE, 0)); - - String type2 = mContentResolver.getType(TABLE2_URI); - assertTrue(type2.startsWith(ContentResolver.CURSOR_DIR_BASE_TYPE, 0)); - - Uri invalidUri = Uri.parse("abc"); - assertNull(mContentResolver.getType(invalidUri)); - - try { - mContentResolver.getType(null); - fail("did not throw NullPointerException when Uri is null."); - } catch (NullPointerException e) { - //expected. - } - } - - public void testUnstableGetType() { - // Get an unstable refrence on the remote content provider. - ContentProviderClient client = mContentResolver.acquireUnstableContentProviderClient( - REMOTE_AUTHORITY); - // Verify we can access it. - String type1 = mContentResolver.getType(REMOTE_TABLE1_URI); - assertTrue(type1.startsWith(ContentResolver.CURSOR_DIR_BASE_TYPE, 0)); - - // Kill it. Note that a bug at this point where it causes our own - // process to be killed will result in the entire test failing. - try { - Log.i("ContentResolverTest", - "Killing remote client -- if test process goes away, that is why!"); - client.delete(REMOTE_SELF_URI, null, null); - } catch (RemoteException e) { - } - // Make sure the remote client is actually gone. - boolean gone = true; - try { - client.getType(REMOTE_TABLE1_URI); - gone = false; - } catch (RemoteException e) { - } - if (!gone) { - fail("Content provider process is not gone!"); - } - - // Now the remote client is gone, can we recover? - // Release our old reference. - client.release(); - // Get a new reference. - client = mContentResolver.acquireUnstableContentProviderClient(REMOTE_AUTHORITY); - // Verify we can access it. - type1 = mContentResolver.getType(REMOTE_TABLE1_URI); - assertTrue(type1.startsWith(ContentResolver.CURSOR_DIR_BASE_TYPE, 0)); - } - - public void testQuery() { - mCursor = mContentResolver.query(TABLE1_URI, null, null, null, null); - - assertNotNull(mCursor); - assertEquals(3, mCursor.getCount()); - assertEquals(3, mCursor.getColumnCount()); - - mCursor.moveToLast(); - assertEquals(3, mCursor.getInt(mCursor.getColumnIndexOrThrow(COLUMN_ID_NAME))); - assertEquals(KEY3, mCursor.getString(mCursor.getColumnIndexOrThrow(COLUMN_KEY_NAME))); - assertEquals(VALUE3, mCursor.getInt(mCursor.getColumnIndexOrThrow(COLUMN_VALUE_NAME))); - - mCursor.moveToPrevious(); - assertEquals(2, mCursor.getInt(mCursor.getColumnIndexOrThrow(COLUMN_ID_NAME))); - assertEquals(KEY2, mCursor.getString(mCursor.getColumnIndexOrThrow(COLUMN_KEY_NAME))); - assertEquals(VALUE2, mCursor.getInt(mCursor.getColumnIndexOrThrow(COLUMN_VALUE_NAME))); - mCursor.close(); - - String selection = COLUMN_ID_NAME + "=1"; - mCursor = mContentResolver.query(TABLE1_URI, null, selection, null, null); - assertNotNull(mCursor); - assertEquals(1, mCursor.getCount()); - assertEquals(3, mCursor.getColumnCount()); - - mCursor.moveToFirst(); - assertEquals(1, mCursor.getInt(mCursor.getColumnIndexOrThrow(COLUMN_ID_NAME))); - assertEquals(KEY1, mCursor.getString(mCursor.getColumnIndexOrThrow(COLUMN_KEY_NAME))); - assertEquals(VALUE1, mCursor.getInt(mCursor.getColumnIndexOrThrow(COLUMN_VALUE_NAME))); - mCursor.close(); - - selection = COLUMN_KEY_NAME + "=\"" + KEY3 + "\""; - mCursor = mContentResolver.query(TABLE1_URI, null, selection, null, null); - assertNotNull(mCursor); - assertEquals(1, mCursor.getCount()); - assertEquals(3, mCursor.getColumnCount()); - - mCursor.moveToFirst(); - assertEquals(3, mCursor.getInt(mCursor.getColumnIndexOrThrow(COLUMN_ID_NAME))); - assertEquals(KEY3, mCursor.getString(mCursor.getColumnIndexOrThrow(COLUMN_KEY_NAME))); - assertEquals(VALUE3, mCursor.getInt(mCursor.getColumnIndexOrThrow(COLUMN_VALUE_NAME))); - mCursor.close(); - - try { - mContentResolver.query(null, null, null, null, null); - fail("did not throw NullPointerException when uri is null."); - } catch (NullPointerException e) { - //expected. - } - } - - public void testCrashingQuery() { - try { - android.provider.Settings.System.putInt(mContentResolver, "__cts_crash_on_launch", 1); - mCursor = mContentResolver.query(REMOTE_CRASH_URI, null, null, null, null); - assertEquals(android.provider.Settings.System.getInt(mContentResolver, - "__cts_crash_on_launch", 0), 0); - } finally { - android.provider.Settings.System.putInt(mContentResolver, "__cts_crash_on_launch", 0); - } - - assertNotNull(mCursor); - assertEquals(3, mCursor.getCount()); - assertEquals(3, mCursor.getColumnCount()); - - mCursor.moveToLast(); - assertEquals(3, mCursor.getInt(mCursor.getColumnIndexOrThrow(COLUMN_ID_NAME))); - assertEquals(KEY3, mCursor.getString(mCursor.getColumnIndexOrThrow(COLUMN_KEY_NAME))); - assertEquals(VALUE3, mCursor.getInt(mCursor.getColumnIndexOrThrow(COLUMN_VALUE_NAME))); - - mCursor.moveToPrevious(); - assertEquals(2, mCursor.getInt(mCursor.getColumnIndexOrThrow(COLUMN_ID_NAME))); - assertEquals(KEY2, mCursor.getString(mCursor.getColumnIndexOrThrow(COLUMN_KEY_NAME))); - assertEquals(VALUE2, mCursor.getInt(mCursor.getColumnIndexOrThrow(COLUMN_VALUE_NAME))); - mCursor.close(); - } - - public void testCancelableQuery_WhenNotCanceled_ReturnsResultSet() { - CancellationSignal cancellationSignal = new CancellationSignal(); - - Cursor cursor = mContentResolver.query(TABLE1_URI, null, null, null, null, - cancellationSignal); - assertEquals(3, cursor.getCount()); - cursor.close(); - } - - public void testCancelableQuery_WhenCanceledBeforeQuery_ThrowsImmediately() { - CancellationSignal cancellationSignal = new CancellationSignal(); - cancellationSignal.cancel(); - - try { - mContentResolver.query(TABLE1_URI, null, null, null, null, cancellationSignal); - fail("Expected OperationCanceledException"); - } catch (OperationCanceledException ex) { - // expected - } - } - - public void testCancelableQuery_WhenCanceledDuringLongRunningQuery_CancelsQueryAndThrows() { - // Populate a table with a bunch of integers. - mContentResolver.delete(TABLE1_URI, null, null); - ContentValues values = new ContentValues(); - for (int i = 0; i < 100; i++) { - values.put(COLUMN_KEY_NAME, i); - values.put(COLUMN_VALUE_NAME, i); - mContentResolver.insert(TABLE1_URI, values); - } - - for (int i = 0; i < 5; i++) { - final CancellationSignal cancellationSignal = new CancellationSignal(); - Thread cancellationThread = new Thread() { - @Override - public void run() { - try { - Thread.sleep(300); - } catch (InterruptedException ex) { - } - cancellationSignal.cancel(); - } - }; - try { - // Build an unsatisfiable 5-way cross-product query over 100 values but - // produces no output. This should force SQLite to loop for a long time - // as it tests 10^10 combinations. - cancellationThread.start(); - - final long startTime = System.nanoTime(); - try { - mContentResolver.query(TABLE1_CROSS_URI, null, - "a.value + b.value + c.value + d.value + e.value > 1000000", - null, null, cancellationSignal); - fail("Expected OperationCanceledException"); - } catch (OperationCanceledException ex) { - // expected - } - - // We want to confirm that the query really was running and then got - // canceled midway. - final long waitTime = System.nanoTime() - startTime; - if (waitTime > 150 * 1000000L && waitTime < 600 * 1000000L) { - return; // success! - } - } finally { - try { - cancellationThread.join(); - } catch (InterruptedException e) { - } - } - } - - // Occasionally we might miss the timing deadline due to factors in the - // environment, but if after several trials we still couldn't demonstrate - // that the query was canceled, then the test must be broken. - fail("Could not prove that the query actually canceled midway during execution."); - } - - public void testOpenInputStream() throws IOException { - final Uri uri = Uri.parse(ContentResolver.SCHEME_ANDROID_RESOURCE + - "://" + TEST_PACKAGE_NAME + "/" + R.drawable.pass); - - InputStream is = mContentResolver.openInputStream(uri); - assertNotNull(is); - is.close(); - - final Uri invalidUri = Uri.parse("abc"); - try { - mContentResolver.openInputStream(invalidUri); - fail("did not throw FileNotFoundException when uri is invalid."); - } catch (FileNotFoundException e) { - //expected. - } - } - - public void testOpenOutputStream() throws IOException { - Uri uri = Uri.parse(ContentResolver.SCHEME_FILE + "://" + - getContext().getCacheDir().getAbsolutePath() + - "/temp.jpg"); - OutputStream os = mContentResolver.openOutputStream(uri); - assertNotNull(os); - os.close(); - - os = mContentResolver.openOutputStream(uri, "wa"); - assertNotNull(os); - os.close(); - - uri = Uri.parse(ContentResolver.SCHEME_ANDROID_RESOURCE + - "://" + TEST_PACKAGE_NAME + "/" + R.raw.testimage); - try { - mContentResolver.openOutputStream(uri); - fail("did not throw FileNotFoundException when scheme is not accepted."); - } catch (FileNotFoundException e) { - //expected. - } - - try { - mContentResolver.openOutputStream(uri, "w"); - fail("did not throw FileNotFoundException when scheme is not accepted."); - } catch (FileNotFoundException e) { - //expected. - } - - Uri invalidUri = Uri.parse("abc"); - try { - mContentResolver.openOutputStream(invalidUri); - fail("did not throw FileNotFoundException when uri is invalid."); - } catch (FileNotFoundException e) { - //expected. - } - - try { - mContentResolver.openOutputStream(invalidUri, "w"); - fail("did not throw FileNotFoundException when uri is invalid."); - } catch (FileNotFoundException e) { - //expected. - } - } - - public void testOpenAssetFileDescriptor() throws IOException { - Uri uri = Uri.parse(ContentResolver.SCHEME_ANDROID_RESOURCE + - "://" + TEST_PACKAGE_NAME + "/" + R.raw.testimage); - - AssetFileDescriptor afd = mContentResolver.openAssetFileDescriptor(uri, "r"); - assertNotNull(afd); - afd.close(); - - try { - mContentResolver.openAssetFileDescriptor(uri, "d"); - fail("did not throw FileNotFoundException when mode is unknown."); - } catch (FileNotFoundException e) { - //expected. - } - - Uri invalidUri = Uri.parse("abc"); - try { - mContentResolver.openAssetFileDescriptor(invalidUri, "r"); - fail("did not throw FileNotFoundException when uri is invalid."); - } catch (FileNotFoundException e) { - //expected. - } - } - - private String consumeAssetFileDescriptor(AssetFileDescriptor afd) - throws IOException { - FileInputStream stream = null; - try { - stream = afd.createInputStream(); - InputStreamReader reader = new InputStreamReader(stream, "UTF-8"); - - // Got it... copy the stream into a local string and return it. - StringBuilder builder = new StringBuilder(128); - char[] buffer = new char[8192]; - int len; - while ((len = reader.read(buffer)) > 0) { - builder.append(buffer, 0, len); - } - return builder.toString(); - - } finally { - if (stream != null) { - try { - stream.close(); - } catch (IOException e) { - } - } - } - - } - - public void testCrashingOpenAssetFileDescriptor() throws IOException { - AssetFileDescriptor afd = null; - try { - android.provider.Settings.System.putInt(mContentResolver, "__cts_crash_on_launch", 1); - afd = mContentResolver.openAssetFileDescriptor(REMOTE_CRASH_URI, "rw"); - assertEquals(android.provider.Settings.System.getInt(mContentResolver, - "__cts_crash_on_launch", 0), 0); - assertNotNull(afd); - String str = consumeAssetFileDescriptor(afd); - afd = null; - assertEquals(str, "This is the openAssetFile test data!"); - } finally { - android.provider.Settings.System.putInt(mContentResolver, "__cts_crash_on_launch", 0); - if (afd != null) { - afd.close(); - } - } - - // Make sure a content provider crash at this point won't hurt us. - ContentProviderClient uClient = mContentResolver.acquireUnstableContentProviderClient( - REMOTE_AUTHORITY); - // Kill it. Note that a bug at this point where it causes our own - // process to be killed will result in the entire test failing. - try { - Log.i("ContentResolverTest", - "Killing remote client -- if test process goes away, that is why!"); - uClient.delete(REMOTE_SELF_URI, null, null); - } catch (RemoteException e) { - } - uClient.release(); - } - - public void testCrashingOpenTypedAssetFileDescriptor() throws IOException { - AssetFileDescriptor afd = null; - try { - android.provider.Settings.System.putInt(mContentResolver, "__cts_crash_on_launch", 1); - afd = mContentResolver.openTypedAssetFileDescriptor( - REMOTE_CRASH_URI, "text/plain", null); - assertEquals(android.provider.Settings.System.getInt(mContentResolver, - "__cts_crash_on_launch", 0), 0); - assertNotNull(afd); - String str = consumeAssetFileDescriptor(afd); - afd = null; - assertEquals(str, "This is the openTypedAssetFile test data!"); - } finally { - android.provider.Settings.System.putInt(mContentResolver, "__cts_crash_on_launch", 0); - if (afd != null) { - afd.close(); - } - } - - // Make sure a content provider crash at this point won't hurt us. - ContentProviderClient uClient = mContentResolver.acquireUnstableContentProviderClient( - REMOTE_AUTHORITY); - // Kill it. Note that a bug at this point where it causes our own - // process to be killed will result in the entire test failing. - try { - Log.i("ContentResolverTest", - "Killing remote client -- if test process goes away, that is why!"); - uClient.delete(REMOTE_SELF_URI, null, null); - } catch (RemoteException e) { - } - uClient.release(); - } - - public void testOpenFileDescriptor() throws IOException { - Uri uri = Uri.parse(ContentResolver.SCHEME_FILE + "://" + - getContext().getCacheDir().getAbsolutePath() + - "/temp.jpg"); - ParcelFileDescriptor pfd = mContentResolver.openFileDescriptor(uri, "w"); - assertNotNull(pfd); - pfd.close(); - - try { - mContentResolver.openFileDescriptor(uri, "d"); - fail("did not throw IllegalArgumentException when mode is unknown."); - } catch (IllegalArgumentException e) { - //expected. - } - - Uri invalidUri = Uri.parse("abc"); - try { - mContentResolver.openFileDescriptor(invalidUri, "w"); - fail("did not throw FileNotFoundException when uri is invalid."); - } catch (FileNotFoundException e) { - //expected. - } - - uri = Uri.parse(ContentResolver.SCHEME_ANDROID_RESOURCE + - "://" + TEST_PACKAGE_NAME + "/" + R.raw.testimage); - try { - mContentResolver.openFileDescriptor(uri, "w"); - fail("did not throw FileNotFoundException when scheme is not accepted."); - } catch (FileNotFoundException e) { - //expected. - } - } - - public void testInsert() { - String key4 = "key4"; - String key5 = "key5"; - int value4 = 4; - int value5 = 5; - String key4Selection = COLUMN_KEY_NAME + "=\"" + key4 + "\""; - - mCursor = mContentResolver.query(TABLE1_URI, null, key4Selection, null, null); - assertEquals(0, mCursor.getCount()); - mCursor.close(); - - ContentValues values = new ContentValues(); - values.put(COLUMN_KEY_NAME, key4); - values.put(COLUMN_VALUE_NAME, value4); - Uri uri = mContentResolver.insert(TABLE1_URI, values); - assertNotNull(uri); - - mCursor = mContentResolver.query(TABLE1_URI, null, key4Selection, null, null); - assertNotNull(mCursor); - assertEquals(1, mCursor.getCount()); - - mCursor.moveToFirst(); - assertEquals(4, mCursor.getInt(mCursor.getColumnIndexOrThrow(COLUMN_ID_NAME))); - assertEquals(key4, mCursor.getString(mCursor.getColumnIndexOrThrow(COLUMN_KEY_NAME))); - assertEquals(value4, mCursor.getInt(mCursor.getColumnIndexOrThrow(COLUMN_VALUE_NAME))); - mCursor.close(); - - values.put(COLUMN_KEY_NAME, key5); - values.put(COLUMN_VALUE_NAME, value5); - uri = mContentResolver.insert(TABLE1_URI, values); - assertNotNull(uri); - - // check returned uri - mCursor = mContentResolver.query(uri, null, null, null, null); - assertNotNull(mCursor); - assertEquals(1, mCursor.getCount()); - - mCursor.moveToLast(); - assertEquals(5, mCursor.getInt(mCursor.getColumnIndexOrThrow(COLUMN_ID_NAME))); - assertEquals(key5, mCursor.getString(mCursor.getColumnIndexOrThrow(COLUMN_KEY_NAME))); - assertEquals(value5, mCursor.getInt(mCursor.getColumnIndexOrThrow(COLUMN_VALUE_NAME))); - mCursor.close(); - - try { - mContentResolver.insert(null, values); - fail("did not throw NullPointerException when uri is null."); - } catch (NullPointerException e) { - //expected. - } - } - - public void testBulkInsert() { - String key4 = "key4"; - String key5 = "key5"; - int value4 = 4; - int value5 = 5; - - mCursor = mContentResolver.query(TABLE1_URI, null, null, null, null); - assertNotNull(mCursor); - assertEquals(3, mCursor.getCount()); - mCursor.close(); - - ContentValues[] cvs = new ContentValues[2]; - cvs[0] = new ContentValues(); - cvs[0].put(COLUMN_KEY_NAME, key4); - cvs[0].put(COLUMN_VALUE_NAME, value4); - - cvs[1] = new ContentValues(); - cvs[1].put(COLUMN_KEY_NAME, key5); - cvs[1].put(COLUMN_VALUE_NAME, value5); - - assertEquals(2, mContentResolver.bulkInsert(TABLE1_URI, cvs)); - mCursor = mContentResolver.query(TABLE1_URI, null, null, null, null); - assertNotNull(mCursor); - assertEquals(5, mCursor.getCount()); - - mCursor.moveToLast(); - assertEquals(5, mCursor.getInt(mCursor.getColumnIndexOrThrow(COLUMN_ID_NAME))); - assertEquals(key5, mCursor.getString(mCursor.getColumnIndexOrThrow(COLUMN_KEY_NAME))); - assertEquals(value5, mCursor.getInt(mCursor.getColumnIndexOrThrow(COLUMN_VALUE_NAME))); - - mCursor.moveToPrevious(); - assertEquals(4, mCursor.getInt(mCursor.getColumnIndexOrThrow(COLUMN_ID_NAME))); - assertEquals(key4, mCursor.getString(mCursor.getColumnIndexOrThrow(COLUMN_KEY_NAME))); - assertEquals(value4, mCursor.getInt(mCursor.getColumnIndexOrThrow(COLUMN_VALUE_NAME))); - mCursor.close(); - - try { - mContentResolver.bulkInsert(null, cvs); - fail("did not throw NullPointerException when uri is null."); - } catch (NullPointerException e) { - //expected. - } - } - - public void testDelete() { - mCursor = mContentResolver.query(TABLE1_URI, null, null, null, null); - assertNotNull(mCursor); - assertEquals(3, mCursor.getCount()); - mCursor.close(); - - assertEquals(3, mContentResolver.delete(TABLE1_URI, null, null)); - mCursor = mContentResolver.query(TABLE1_URI, null, null, null, null); - assertNotNull(mCursor); - assertEquals(0, mCursor.getCount()); - mCursor.close(); - - // add three rows to database. - ContentValues values = new ContentValues(); - values.put(COLUMN_KEY_NAME, KEY1); - values.put(COLUMN_VALUE_NAME, VALUE1); - mContentResolver.insert(TABLE1_URI, values); - - values.put(COLUMN_KEY_NAME, KEY2); - values.put(COLUMN_VALUE_NAME, VALUE2); - mContentResolver.insert(TABLE1_URI, values); - - values.put(COLUMN_KEY_NAME, KEY3); - values.put(COLUMN_VALUE_NAME, VALUE3); - mContentResolver.insert(TABLE1_URI, values); - - // test delete row using selection - String selection = COLUMN_ID_NAME + "=2"; - assertEquals(1, mContentResolver.delete(TABLE1_URI, selection, null)); - - mCursor = mContentResolver.query(TABLE1_URI, null, null, null, null); - assertNotNull(mCursor); - assertEquals(2, mCursor.getCount()); - - mCursor.moveToFirst(); - assertEquals(1, mCursor.getInt(mCursor.getColumnIndexOrThrow(COLUMN_ID_NAME))); - assertEquals(KEY1, mCursor.getString(mCursor.getColumnIndexOrThrow(COLUMN_KEY_NAME))); - assertEquals(VALUE1, mCursor.getInt(mCursor.getColumnIndexOrThrow(COLUMN_VALUE_NAME))); - - mCursor.moveToNext(); - assertEquals(3, mCursor.getInt(mCursor.getColumnIndexOrThrow(COLUMN_ID_NAME))); - assertEquals(KEY3, mCursor.getString(mCursor.getColumnIndexOrThrow(COLUMN_KEY_NAME))); - assertEquals(VALUE3, mCursor.getInt(mCursor.getColumnIndexOrThrow(COLUMN_VALUE_NAME))); - mCursor.close(); - - selection = COLUMN_VALUE_NAME + "=3"; - assertEquals(1, mContentResolver.delete(TABLE1_URI, selection, null)); - - mCursor = mContentResolver.query(TABLE1_URI, null, null, null, null); - assertNotNull(mCursor); - assertEquals(1, mCursor.getCount()); - - mCursor.moveToFirst(); - assertEquals(1, mCursor.getInt(mCursor.getColumnIndexOrThrow(COLUMN_ID_NAME))); - assertEquals(KEY1, mCursor.getString(mCursor.getColumnIndexOrThrow(COLUMN_KEY_NAME))); - assertEquals(VALUE1, mCursor.getInt(mCursor.getColumnIndexOrThrow(COLUMN_VALUE_NAME))); - mCursor.close(); - - selection = COLUMN_KEY_NAME + "=\"" + KEY1 + "\""; - assertEquals(1, mContentResolver.delete(TABLE1_URI, selection, null)); - - mCursor = mContentResolver.query(TABLE1_URI, null, null, null, null); - assertNotNull(mCursor); - assertEquals(0, mCursor.getCount()); - mCursor.close(); - - try { - mContentResolver.delete(null, null, null); - fail("did not throw NullPointerException when uri is null."); - } catch (NullPointerException e) { - //expected. - } - } - - public void testUpdate() { - ContentValues values = new ContentValues(); - String key10 = "key10"; - String key20 = "key20"; - int value10 = 10; - int value20 = 20; - - values.put(COLUMN_KEY_NAME, key10); - values.put(COLUMN_VALUE_NAME, value10); - - // test update all the rows. - assertEquals(3, mContentResolver.update(TABLE1_URI, values, null, null)); - mCursor = mContentResolver.query(TABLE1_URI, null, null, null, null); - assertNotNull(mCursor); - assertEquals(3, mCursor.getCount()); - - mCursor.moveToFirst(); - assertEquals(1, mCursor.getInt(mCursor.getColumnIndexOrThrow(COLUMN_ID_NAME))); - assertEquals(key10, mCursor.getString(mCursor.getColumnIndexOrThrow(COLUMN_KEY_NAME))); - assertEquals(value10, mCursor.getInt(mCursor.getColumnIndexOrThrow(COLUMN_VALUE_NAME))); - - mCursor.moveToNext(); - assertEquals(2, mCursor.getInt(mCursor.getColumnIndexOrThrow(COLUMN_ID_NAME))); - assertEquals(key10, mCursor.getString(mCursor.getColumnIndexOrThrow(COLUMN_KEY_NAME))); - assertEquals(value10, mCursor.getInt(mCursor.getColumnIndexOrThrow(COLUMN_VALUE_NAME))); - - mCursor.moveToLast(); - assertEquals(3, mCursor.getInt(mCursor.getColumnIndexOrThrow(COLUMN_ID_NAME))); - assertEquals(key10, mCursor.getString(mCursor.getColumnIndexOrThrow(COLUMN_KEY_NAME))); - assertEquals(value10, mCursor.getInt(mCursor.getColumnIndexOrThrow(COLUMN_VALUE_NAME))); - mCursor.close(); - - // test update one row using selection. - String selection = COLUMN_ID_NAME + "=1"; - values.put(COLUMN_KEY_NAME, key20); - values.put(COLUMN_VALUE_NAME, value20); - - assertEquals(1, mContentResolver.update(TABLE1_URI, values, selection, null)); - mCursor = mContentResolver.query(TABLE1_URI, null, null, null, null); - assertNotNull(mCursor); - assertEquals(3, mCursor.getCount()); - - mCursor.moveToFirst(); - assertEquals(1, mCursor.getInt(mCursor.getColumnIndexOrThrow(COLUMN_ID_NAME))); - assertEquals(key20, mCursor.getString(mCursor.getColumnIndexOrThrow(COLUMN_KEY_NAME))); - assertEquals(value20, mCursor.getInt(mCursor.getColumnIndexOrThrow(COLUMN_VALUE_NAME))); - - mCursor.moveToNext(); - assertEquals(2, mCursor.getInt(mCursor.getColumnIndexOrThrow(COLUMN_ID_NAME))); - assertEquals(key10, mCursor.getString(mCursor.getColumnIndexOrThrow(COLUMN_KEY_NAME))); - assertEquals(value10, mCursor.getInt(mCursor.getColumnIndexOrThrow(COLUMN_VALUE_NAME))); - - mCursor.moveToLast(); - assertEquals(3, mCursor.getInt(mCursor.getColumnIndexOrThrow(COLUMN_ID_NAME))); - assertEquals(key10, mCursor.getString(mCursor.getColumnIndexOrThrow(COLUMN_KEY_NAME))); - assertEquals(value10, mCursor.getInt(mCursor.getColumnIndexOrThrow(COLUMN_VALUE_NAME))); - mCursor.close(); - - try { - mContentResolver.update(null, values, null, null); - fail("did not throw NullPointerException when uri is null."); - } catch (NullPointerException e) { - //expected. - } - - // javadoc says it will throw NullPointerException when values are null, - // but actually, it throws IllegalArgumentException here. - try { - mContentResolver.update(TABLE1_URI, null, null, null); - fail("did not throw IllegalArgumentException when values are null."); - } catch (IllegalArgumentException e) { - //expected. - } - } - - public void testRegisterContentObserver() { - final MockContentObserver mco = new MockContentObserver(); - - mContentResolver.registerContentObserver(TABLE1_URI, true, mco); - assertFalse(mco.hadOnChanged()); - - ContentValues values = new ContentValues(); - values.put(COLUMN_KEY_NAME, "key10"); - values.put(COLUMN_VALUE_NAME, 10); - mContentResolver.update(TABLE1_URI, values, null, null); - new PollingCheck() { - @Override - protected boolean check() { - return mco.hadOnChanged(); - } - } .run(); - - mco.reset(); - mContentResolver.unregisterContentObserver(mco); - assertFalse(mco.hadOnChanged()); - mContentResolver.update(TABLE1_URI, values, null, null); - - assertFalse(mco.hadOnChanged()); - - try { - mContentResolver.registerContentObserver(null, false, mco); - fail("did not throw NullPointerException or IllegalArgumentException when uri is null."); - } catch (NullPointerException e) { - //expected. - } catch (IllegalArgumentException e) { - // also expected - } - - try { - mContentResolver.registerContentObserver(TABLE1_URI, false, null); - fail("did not throw NullPointerException when register null content observer."); - } catch (NullPointerException e) { - //expected. - } - - try { - mContentResolver.unregisterContentObserver(null); - fail("did not throw NullPointerException when unregister null content observer."); - } catch (NullPointerException e) { - //expected. - } - } - - public void testNotifyChange1() { - final MockContentObserver mco = new MockContentObserver(); - - mContentResolver.registerContentObserver(TABLE1_URI, true, mco); - assertFalse(mco.hadOnChanged()); - - mContentResolver.notifyChange(TABLE1_URI, mco); - new PollingCheck() { - @Override - protected boolean check() { - return mco.hadOnChanged(); - } - } .run(); - - mContentResolver.unregisterContentObserver(mco); - } - - public void testNotifyChange2() { - final MockContentObserver mco = new MockContentObserver(); - - mContentResolver.registerContentObserver(TABLE1_URI, true, mco); - assertFalse(mco.hadOnChanged()); - - mContentResolver.notifyChange(TABLE1_URI, mco, false); - new PollingCheck() { - @Override - protected boolean check() { - return mco.hadOnChanged(); - } - } .run(); - - mContentResolver.unregisterContentObserver(mco); - } - - public void testStartCancelSync() { - Bundle extras = new Bundle(); - - extras.putBoolean(ContentResolver.SYNC_EXTRAS_MANUAL, true); - - ContentResolver.requestSync(ACCOUNT, AUTHORITY, extras); - //FIXME: how to get the result to assert. - - ContentResolver.cancelSync(ACCOUNT, AUTHORITY); - //FIXME: how to assert. - } - - public void testStartSyncFailure() { - try { - ContentResolver.requestSync(null, null, null); - fail("did not throw IllegalArgumentException when extras is null."); - } catch (IllegalArgumentException e) { - //expected. - } - } - - public void testValidateSyncExtrasBundle() { - Bundle extras = new Bundle(); - extras.putInt("Integer", 20); - extras.putLong("Long", 10L); - extras.putBoolean("Boolean", true); - extras.putFloat("Float", 5.5f); - extras.putDouble("Double", 2.5); - extras.putString("String", "cts"); - extras.putCharSequence("CharSequence", null); - - ContentResolver.validateSyncExtrasBundle(extras); - - extras.putChar("Char", 'a'); // type Char is invalid - try { - ContentResolver.validateSyncExtrasBundle(extras); - fail("did not throw IllegalArgumentException when extras is invalide."); - } catch (IllegalArgumentException e) { - //expected. - } - } - - private class MockContentObserver extends ContentObserver { - private boolean mHadOnChanged = false; - - public MockContentObserver() { - super(null); - } - - @Override - public boolean deliverSelfNotifications() { - return true; - } - - @Override - public synchronized void onChange(boolean selfChange) { - super.onChange(selfChange); - mHadOnChanged = true; - } - - public synchronized boolean hadOnChanged() { - return mHadOnChanged; - } - - public synchronized void reset() { - mHadOnChanged = false; - } - } -} diff --git a/proprietary/frameworks/base/tests/content/tests/src/mediatek/content/cts/ContentUrisTest.java b/proprietary/frameworks/base/tests/content/tests/src/mediatek/content/cts/ContentUrisTest.java deleted file mode 100755 index 7bd0084d384a31c7dffce383a321c076352b13d6..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/content/tests/src/mediatek/content/cts/ContentUrisTest.java +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.content.cts; - -import android.content.ContentUris; -import android.net.Uri; -import android.net.Uri.Builder; -import android.test.AndroidTestCase; - -public class ContentUrisTest extends AndroidTestCase { - private static final String AUTHORITY = "ctstest"; - private static final String PATH1 = "testPath1"; - private static final String PATH2 = "testPath2"; - - private static final int CODE1 = 1; - private static final int CODE2 = 2; - - private Uri uri1 = Uri.parse("content://" + AUTHORITY + "/" + PATH1); - private Uri uri2 = Uri.parse("content://" + AUTHORITY + "/" + PATH2); - - public void testConstructor() { - new ContentUris(); - } - - public void testParseId() { - Uri result = ContentUris.withAppendedId(uri1, CODE1); - assertEquals(CODE1, ContentUris.parseId(result)); - - result = ContentUris.withAppendedId(uri2, CODE2); - assertEquals(CODE2, ContentUris.parseId(result)); - - // no code in Uri - assertEquals(-1, ContentUris.parseId(Uri.parse(""))); - } - - public void testParseIdFailure() { - try { - ContentUris.parseId(uri1); - fail("There should be a NumberFormatException thrown out."); - } catch (NumberFormatException e) { - //expected, test success. - } - - Uri uri = Uri.fromParts("abc", "123", null); - ContentUris.parseId(uri); - - try { - ContentUris.parseId(null); - fail("There should be a NullPointerException thrown out."); - } catch (NullPointerException e) { - // expected, test success. - } - } - - public void testWithAppendedId() { - String expected = "content://" + AUTHORITY + "/" + PATH1 + "/" + CODE1; - Uri actually; - - assertNotNull(actually = ContentUris.withAppendedId(uri1, CODE1)); - assertEquals(expected, actually.toString()); - - expected = "content://" + AUTHORITY + "/" + PATH2 + "/" + CODE2; - assertNotNull(actually = ContentUris.withAppendedId(uri2, CODE2)); - assertEquals(expected, actually.toString()); - } - - public void testWithAppendedIdFailure() { - try { - ContentUris.withAppendedId(null, -1); - fail("There should be a NullPointerException thrown out."); - } catch (NullPointerException e) { - // expected, test success. - } - } - - public void testAppendId() { - String expected = "content://" + AUTHORITY + "/" + PATH1 + "/" + CODE1; - Builder actually; - Builder b = uri1.buildUpon(); - - assertNotNull(actually = ContentUris.appendId(b, CODE1)); - assertEquals(expected, actually.toString()); - - expected = "content://" + AUTHORITY + "/" + PATH2 + "/" + CODE2; - b = uri2.buildUpon(); - - assertNotNull(actually = ContentUris.appendId(b, CODE2)); - assertEquals(expected, actually.toString()); - } - - public void testAppendIdFailure() { - try { - ContentUris.appendId(null, -1); - fail("There should be a NullPointerException thrown out."); - } catch (NullPointerException e) { - // expected, test success. - } - } -} diff --git a/proprietary/frameworks/base/tests/content/tests/src/mediatek/content/cts/ContentValuesTest.java b/proprietary/frameworks/base/tests/content/tests/src/mediatek/content/cts/ContentValuesTest.java deleted file mode 100755 index 267ba5f5d3fd81a8a9b2495001b62f6d00058927..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/content/tests/src/mediatek/content/cts/ContentValuesTest.java +++ /dev/null @@ -1,508 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.content.cts; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Map; -import java.util.Set; - -import android.content.ContentValues; -import android.os.Parcel; -import android.test.AndroidTestCase; - -public class ContentValuesTest extends AndroidTestCase { - ContentValues mContentValues; - - @Override - protected void setUp() throws Exception { - super.setUp(); - mContentValues = new ContentValues(); - } - - public void testConstructor() { - new ContentValues(); - new ContentValues(5); - new ContentValues(mContentValues); - - try { - new ContentValues(-1); - fail("There should be a IllegalArgumentException thrown out."); - } catch (IllegalArgumentException e) { - // expected, test success. - } - - try { - new ContentValues(null); - fail("There should be a NullPointerException thrown out."); - } catch (NullPointerException e) { - // expected, test success. - } - } - - public void testValueSet() { - Set> map; - assertNotNull(map = mContentValues.valueSet()); - assertTrue(map.isEmpty()); - - mContentValues.put("Long", 10L); - mContentValues.put("Integer", 201); - - assertNotNull(map = mContentValues.valueSet()); - assertFalse(map.isEmpty()); - assertEquals(2, map.size()); - } - - public void testPutNull() { - mContentValues.putNull("key"); - assertNull(mContentValues.get("key")); - - mContentValues.putNull("value"); - assertNull(mContentValues.get("value")); - - mContentValues.putNull(""); - assertNull(mContentValues.get("")); - - // input null as param - mContentValues.putNull(null); - } - - public void testGetAsLong() { - Long expected = 10L; - mContentValues.put("Long", expected); - assertEquals(expected, mContentValues.getAsLong("Long")); - - expected = -1000L; - mContentValues.put("Long", expected); - assertEquals(expected, mContentValues.getAsLong("Long")); - - // input null as param - assertNull(mContentValues.getAsLong(null)); - } - - public void testGetAsByte() { - Byte expected = 'a'; - mContentValues.put("Byte", expected); - assertEquals(expected, mContentValues.getAsByte("Byte")); - - expected = 'z'; - mContentValues.put("Byte", expected); - assertEquals(expected, mContentValues.getAsByte("Byte")); - - // input null as param - assertNull(mContentValues.getAsByte(null)); - } - - public void testGetAsInteger() { - Integer expected = 20; - mContentValues.put("Integer", expected); - assertEquals(expected, mContentValues.getAsInteger("Integer")); - - expected = -20000; - mContentValues.put("Integer", expected); - assertEquals(expected, mContentValues.getAsInteger("Integer")); - - // input null as param - assertNull(mContentValues.getAsInteger(null)); - } - - public void testSize() { - assertEquals(0, mContentValues.size()); - - mContentValues.put("Integer", 10); - mContentValues.put("Long", 10L); - assertEquals(2, mContentValues.size()); - - mContentValues.put("String", "b"); - mContentValues.put("Boolean", false); - assertEquals(4, mContentValues.size()); - - mContentValues.clear(); - assertEquals(0, mContentValues.size()); - } - - public void testGetAsShort() { - Short expected = 20; - mContentValues.put("Short", expected); - assertEquals(expected, mContentValues.getAsShort("Short")); - - expected = -200; - mContentValues.put("Short", expected); - assertEquals(expected, mContentValues.getAsShort("Short")); - - // input null as param - assertNull(mContentValues.getAsShort(null)); - } - - public void testHashCode() { - assertEquals(0, mContentValues.hashCode()); - - mContentValues.put("Float", 2.2F); - mContentValues.put("Short", 12); - assertTrue(0 != mContentValues.hashCode()); - - int hashcode = mContentValues.hashCode(); - mContentValues.remove("Short"); - assertTrue(hashcode != mContentValues.hashCode()); - - mContentValues.put("Short", 12); - assertTrue(hashcode == mContentValues.hashCode()); - - mContentValues.clear(); - assertEquals(0, mContentValues.hashCode()); - } - - public void testGetAsFloat() { - Float expected = 1.0F; - mContentValues.put("Float", expected); - assertEquals(expected, mContentValues.getAsFloat("Float")); - - expected = -5.5F; - mContentValues.put("Float", expected); - assertEquals(expected, mContentValues.getAsFloat("Float")); - - // input null as param - assertNull(mContentValues.getAsFloat(null)); - } - - public void testGetAsBoolean() { - mContentValues.put("Boolean", true); - assertTrue(mContentValues.getAsBoolean("Boolean")); - - mContentValues.put("Boolean", false); - assertFalse(mContentValues.getAsBoolean("Boolean")); - - // input null as param - assertNull(mContentValues.getAsBoolean(null)); - } - - public void testToString() { - assertNotNull(mContentValues.toString()); - - mContentValues.put("Float", 1.1F); - assertNotNull(mContentValues.toString()); - assertTrue(mContentValues.toString().length() > 0); - } - - public void testGet() { - Object expected = "android"; - mContentValues.put("Object", "android"); - assertSame(expected, mContentValues.get("Object")); - - expected = 20; - mContentValues.put("Object", 20); - assertSame(expected, mContentValues.get("Object")); - - // input null as params - assertNull(mContentValues.get(null)); - } - - public void testEquals() { - mContentValues.put("Boolean", false); - mContentValues.put("String", "string"); - - ContentValues cv = new ContentValues(); - cv.put("Boolean", false); - cv.put("String", "string"); - - assertTrue(mContentValues.equals(cv)); - } - - public void testEqualsFailure() { - // the target object is not an instance of ContentValues. - assertFalse(mContentValues.equals(new String())); - - // the two object is not equals - mContentValues.put("Boolean", false); - mContentValues.put("String", "string"); - - ContentValues cv = new ContentValues(); - cv.put("Boolean", true); - cv.put("String", "111"); - - assertFalse(mContentValues.equals(cv)); - } - - public void testGetAsDouble() { - Double expected = 10.2; - mContentValues.put("Double", expected); - assertEquals(expected, mContentValues.getAsDouble("Double")); - - expected = -15.4; - mContentValues.put("Double", expected); - assertEquals(expected, mContentValues.getAsDouble("Double")); - - // input null as params - assertNull(mContentValues.getAsDouble(null)); - } - - public void testPutString() { - String expected = "cts"; - mContentValues.put("String", expected); - assertSame(expected, mContentValues.getAsString("String")); - - expected = "android"; - mContentValues.put("String", expected); - assertSame(expected, mContentValues.getAsString("String")); - - // input null as params - mContentValues.put(null, (String) null); - } - - public void testPutByte() { - Byte expected = 'a'; - mContentValues.put("Byte", expected); - assertSame(expected, mContentValues.getAsByte("Byte")); - - expected = 'z'; - mContentValues.put("Byte", expected); - assertSame(expected, mContentValues.getAsByte("Byte")); - - // input null as params - mContentValues.put(null, (Byte) null); - } - - public void testPutShort() { - Short expected = 20; - mContentValues.put("Short", expected); - assertEquals(expected, mContentValues.getAsShort("Short")); - - expected = -200; - mContentValues.put("Short", expected); - assertEquals(expected, mContentValues.getAsShort("Short")); - - // input null as params - mContentValues.put(null, (Short) null); - } - - public void testPutInteger() { - Integer expected = 20; - mContentValues.put("Integer", expected); - assertEquals(expected, mContentValues.getAsInteger("Integer")); - - expected = -20000; - mContentValues.put("Integer", expected); - assertEquals(expected, mContentValues.getAsInteger("Integer")); - - // input null as params - mContentValues.put(null, (Integer) null); - } - - public void testPutLong() { - Long expected = 10L; - mContentValues.put("Long", expected); - assertEquals(expected, mContentValues.getAsLong("Long")); - - expected = -1000L; - mContentValues.put("Long", expected); - assertEquals(expected, mContentValues.getAsLong("Long")); - - // input null as params - mContentValues.put(null, (Long) null); - } - - public void testPutFloat() { - Float expected = 1.0F; - mContentValues.put("Float", expected); - assertEquals(expected, mContentValues.getAsFloat("Float")); - - expected = -5.5F; - mContentValues.put("Float", expected); - assertEquals(expected, mContentValues.getAsFloat("Float")); - - // input null as params - mContentValues.put(null, (Float) null); - } - - public void testPutDouble() { - Double expected = 10.2; - mContentValues.put("Double", expected); - assertEquals(expected, mContentValues.getAsDouble("Double")); - - expected = -15.4; - mContentValues.put("Double", expected); - assertEquals(expected, mContentValues.getAsDouble("Double")); - - // input null as params - mContentValues.put(null, (Double) null); - } - - public void testPutBoolean() { - // set the expected value - mContentValues.put("Boolean", true); - assertTrue(mContentValues.getAsBoolean("Boolean")); - - mContentValues.put("Boolean", false); - assertFalse(mContentValues.getAsBoolean("Boolean")); - - // input null as params - mContentValues.put(null, (Boolean) null); - } - - public void testPutByteArray() { - byte[] expected = new byte[] {'1', '2', '3', '4'}; - mContentValues.put("byte[]", expected); - assertSame(expected, mContentValues.getAsByteArray("byte[]")); - - // input null as params - mContentValues.put(null, (byte[]) null); - } - - public void testContainsKey() { - mContentValues.put("Double", 10.2); - mContentValues.put("Float", 1.0F); - - assertTrue(mContentValues.containsKey("Double")); - assertTrue(mContentValues.containsKey("Float")); - - assertFalse(mContentValues.containsKey("abc")); - assertFalse(mContentValues.containsKey("cts")); - - // input null as param - assertFalse(mContentValues.containsKey(null)); - } - - public void testClear() { - assertEquals(0, mContentValues.size()); - - mContentValues.put("Double", 10.2); - mContentValues.put("Float", 1.0F); - assertEquals(2, mContentValues.size()); - - mContentValues.clear(); - assertEquals(0, mContentValues.size()); - } - - @SuppressWarnings("deprecation") - public void testAccessStringArrayList() { - // set the expected value - ArrayList expected = new ArrayList(); - expected.add(0, "cts"); - expected.add(1, "android"); - - mContentValues.putStringArrayList("StringArrayList", expected); - assertSame(expected, mContentValues.getStringArrayList("StringArrayList")); - - // input null as params - mContentValues.putStringArrayList(null, null); - assertNull(mContentValues.getStringArrayList(null)); - } - - public void testRemove() { - assertEquals(0, mContentValues.size()); - - mContentValues.put("Double", 10.2); - mContentValues.put("Float", 1.0F); - mContentValues.put("Integer", -11); - mContentValues.put("Boolean", false); - assertEquals(4, mContentValues.size()); - - mContentValues.remove("Integer"); - assertEquals(3, mContentValues.size()); - - mContentValues.remove("Double"); - assertEquals(2, mContentValues.size()); - - mContentValues.remove("Boolean"); - assertEquals(1, mContentValues.size()); - - mContentValues.remove("Float"); - assertEquals(0, mContentValues.size()); - - // remove null - mContentValues.remove(null); - } - - public void testGetAsString() { - String expected = "cts"; - mContentValues.put("String", expected); - assertSame(expected, mContentValues.getAsString("String")); - - expected = "android"; - mContentValues.put("String", expected); - assertSame(expected, mContentValues.getAsString("String")); - - // input null as param - assertNull(mContentValues.getAsString(null)); - } - - public void testGetAsByteArray() { - byte[] expected = new byte[] {'1', '2', '3', '4'}; - mContentValues.put("byte[]", expected); - assertSame(expected, mContentValues.getAsByteArray("byte[]")); - - // input null as param - assertNull(mContentValues.getAsByteArray(null)); - } - - @SuppressWarnings({ "unchecked" }) - public void testWriteToParcel() { - Parcel p = Parcel.obtain(); - - mContentValues.put("Integer", -110); - mContentValues.put("String", "cts"); - mContentValues.put("Boolean", false); - - mContentValues.writeToParcel(p, 0); - - p.setDataPosition(0); - HashMap values = p.readHashMap(ClassLoader.getSystemClassLoader()); - assertNotNull(values); - assertEquals(3, values.size()); - - assertEquals(-110, values.get("Integer")); - assertEquals("cts", values.get("String")); - assertEquals(false, values.get("Boolean")); - } - - public void testWriteToParcelFailure() { - try { - mContentValues.writeToParcel(null, -1); - fail("There should be a NullPointerException thrown out."); - } catch (NullPointerException e) { - // expected, test success. - } - } - - public void testDescribeContents() { - assertEquals(0, mContentValues.describeContents()); - } - - public void testPutAll() { - assertEquals(0, mContentValues.size()); - - mContentValues.put("Integer", -11); - assertEquals(1, mContentValues.size()); - - ContentValues cv = new ContentValues(); - cv.put("String", "cts"); - cv.put("Boolean", true); - assertEquals(2, cv.size()); - - mContentValues.putAll(cv); - assertEquals(3, mContentValues.size()); - } - - public void testPutAllFailure() { - try { - mContentValues.putAll(null); - fail("There should be a NullPointerException thrown out."); - } catch (NullPointerException e) { - // expected, test success. - } - } -} diff --git a/proprietary/frameworks/base/tests/content/tests/src/mediatek/content/cts/SharedPreferencesTest.java b/proprietary/frameworks/base/tests/content/tests/src/mediatek/content/cts/SharedPreferencesTest.java deleted file mode 100755 index 98f55d5bab459c7d20123d75b22f16ac501576d1..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/content/tests/src/mediatek/content/cts/SharedPreferencesTest.java +++ /dev/null @@ -1,339 +0,0 @@ -/* - * Copyright (C) 2010 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.content.cts; - - - -import android.app.QueuedWork; -import android.content.Context; -import android.content.ContextWrapper; -import android.content.SharedPreferences; -import android.os.StrictMode; -import android.preference.PreferenceManager; -import android.test.AndroidTestCase; -import android.util.Log; - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; -import java.util.Random; - -/** - * Test {@link SharedPreferences}. - */ -public class SharedPreferencesTest extends AndroidTestCase { - private static final String TAG = "SharedPreferencesTest"; - - private Context mContext; - private ContextWrapper mContextWrapper; - - private File mPrefsFile; - - @Override - protected void setUp() throws Exception { - super.setUp(); - mContext = getContext(); - mContextWrapper = new ContextWrapper(mContext); - - SharedPreferences prefs = getPrefs(); - prefs.edit().clear().commit(); - - // Duplicated from ContextImpl.java. Not ideal, but there wasn't a better - // way to reach into Context{Wrapper,Impl} to ask where this file lives. - mPrefsFile = new File("/data/data/com.android.cts.stub/shared_prefs", - "com.android.cts.stub_preferences.xml"); - mPrefsFile.delete(); - } - - private SharedPreferences getPrefs() { - return PreferenceManager.getDefaultSharedPreferences(mContext); - } - - public void testNoFileInitially() { - assertFalse(mPrefsFile.exists()); - } - - public void testCommitCreatesFiles() { - SharedPreferences prefs = getPrefs(); - assertFalse(mPrefsFile.exists()); - prefs.edit().putString("foo", "bar").commit(); - assertTrue(mPrefsFile.exists()); - } - - public void testDefaults() { - SharedPreferences prefs = getPrefs(); - String key = "not-set"; - assertFalse(prefs.contains(key)); - assertEquals(0, prefs.getAll().size()); - assertTrue(prefs.getAll().isEmpty()); - assertEquals(false, prefs.getBoolean(key, false)); - assertEquals(true, prefs.getBoolean(key, true)); - assertEquals(0.5f, prefs.getFloat(key, 0.5f)); - assertEquals(123, prefs.getInt(key, 123)); - assertEquals(999L, prefs.getLong(key, 999L)); - assertEquals("default", prefs.getString(key, "default")); - } - - private abstract class RedundantWriteTest { - // Do some initial operation on editor. No commit needed. - public abstract void setUp(SharedPreferences.Editor editor); - - // Do some later operation on editor (e.g. a redundant edit). - // No commit needed. - public abstract void subsequentEdit(SharedPreferences.Editor editor); - - public boolean expectingMutation() { - return false; - } - - // Tests that a redundant edit after an initital setup doesn't - // result in a duplicate write-out to disk. - public final void test() throws Exception { - SharedPreferences prefs = getPrefs(); - SharedPreferences.Editor editor; - - assertFalse(mPrefsFile.exists()); - prefs.edit().commit(); - assertTrue(mPrefsFile.exists()); - - editor = prefs.edit(); - setUp(editor); - editor.commit(); - long modtimeMillis1 = mPrefsFile.lastModified(); - - // Wait a second and modify the preferences in a dummy, - // redundant way. Wish I could inject a clock or disk mock - // here, but can't. Instead relying on checking modtime of - // file on disk. - Thread.sleep(1000); // ms - - editor = prefs.edit(); - subsequentEdit(editor); - editor.commit(); - - long modtimeMillis2 = mPrefsFile.lastModified(); - assertEquals(expectingMutation(), modtimeMillis1 != modtimeMillis2); - } - }; - - public void testRedundantBoolean() throws Exception { - new RedundantWriteTest() { - public void setUp(SharedPreferences.Editor editor) { - editor.putBoolean("foo", true); - } - public void subsequentEdit(SharedPreferences.Editor editor) { - editor.putBoolean("foo", true); - } - } .test(); - } - - public void testRedundantString() throws Exception { - new RedundantWriteTest() { - public void setUp(SharedPreferences.Editor editor) { - editor.putString("foo", "bar"); - } - public void subsequentEdit(SharedPreferences.Editor editor) { - editor.putString("foo", "bar"); - } - } .test(); - } - - public void testNonRedundantString() throws Exception { - new RedundantWriteTest() { - public void setUp(SharedPreferences.Editor editor) { - editor.putString("foo", "bar"); - } - public void subsequentEdit(SharedPreferences.Editor editor) { - editor.putString("foo", "baz"); - } - public boolean expectingMutation() { - return true; - } - } .test(); - } - - public void testRedundantClear() throws Exception { - new RedundantWriteTest() { - public void setUp(SharedPreferences.Editor editor) { - editor.clear(); - } - public void subsequentEdit(SharedPreferences.Editor editor) { - editor.clear(); - } - } .test(); - } - - public void testNonRedundantClear() throws Exception { - new RedundantWriteTest() { - public void setUp(SharedPreferences.Editor editor) { - editor.putString("foo", "bar"); - } - public void subsequentEdit(SharedPreferences.Editor editor) { - editor.clear(); - } - public boolean expectingMutation() { - return true; - } - } .test(); - } - - public void testRedundantRemove() throws Exception { - new RedundantWriteTest() { - public void setUp(SharedPreferences.Editor editor) { - editor.putString("foo", "bar"); - } - public void subsequentEdit(SharedPreferences.Editor editor) { - editor.remove("not-exist-key"); - } - } .test(); - } - - public void testRedundantCommitWritesFileIfNotAlreadyExisting() { - SharedPreferences prefs = getPrefs(); - assertFalse(mPrefsFile.exists()); - prefs.edit().putString("foo", "bar").commit(); - assertTrue(mPrefsFile.exists()); - - // Delete the file out from under it. (not sure why this - // would happen in practice, but perhaps the app did it for - // some reason...) - mPrefsFile.delete(); - - // And verify that a redundant edit (which would otherwise not - // write do disk), still does write to disk if the file isn't - // there. - prefs.edit().putString("foo", "bar").commit(); - assertTrue(mPrefsFile.exists()); - } - - public void testTorture() { - Map expectedMap = new HashMap(); - Random rand = new Random(); - - SharedPreferences prefs = mContext.getSharedPreferences("torture", Context.MODE_PRIVATE); - prefs.edit().clear().commit(); - - for (int i = 0; i < 100; i++) { - prefs = mContext.getSharedPreferences("torture", Context.MODE_PRIVATE); - assertEquals(expectedMap, prefs.getAll()); - - String key = new Integer(rand.nextInt(25)).toString(); - String value = new Integer(i).toString(); - SharedPreferences.Editor editor = prefs.edit(); - - if (rand.nextInt(100) < 85) { - Log.d(TAG, "Setting " + key + "=" + value); - editor.putString(key, value); - expectedMap.put(key, value); - } else { - Log.d(TAG, "Removing " + key); - editor.remove(key); - expectedMap.remove(key); - } - - // Use apply on most, but commit some too. - if (rand.nextInt(100) < 85) { - Log.d(TAG, "apply."); - editor.apply(); - } else { - Log.d(TAG, "commit."); - editor.commit(); - } - - assertEquals(expectedMap, prefs.getAll()); - } - } - - // Checks that an in-memory commit doesn't mutate a data structure - // still being used while writing out to disk. - public void testTorture2() { - Random rand = new Random(); - - for (int fi = 0; fi < 100; fi++) { - String prefsName = "torture_" + fi; - SharedPreferences prefs = mContext.getSharedPreferences(prefsName, Context.MODE_PRIVATE); - prefs.edit().clear().commit(); - Map expectedMap = new HashMap(); - - for (int applies = 0; applies < 3; applies++) { - SharedPreferences.Editor editor = prefs.edit(); - for (int n = 0; n < 1000; n++) { - String key = new Integer(rand.nextInt(25)).toString(); - String value = new Integer(n).toString(); - editor.putString(key, value); - expectedMap.put(key, value); - } - editor.apply(); - } - QueuedWork.waitToFinish(); - - String clonePrefsName = prefsName + "_clone"; - File prefsFile = mContext.getSharedPrefsFile(prefsName); - File prefsFileClone = mContext.getSharedPrefsFile(clonePrefsName); - prefsFileClone.delete(); - try { - FileOutputStream fos = new FileOutputStream(prefsFileClone); - FileInputStream fis = new FileInputStream(prefsFile); - byte buf[] = new byte[1024]; - int n; - while ((n = fis.read(buf)) > 0) { - fos.write(buf, 0, n); - } - fis.close(); - fos.close(); - } catch (IOException e) { - } - - SharedPreferences clonePrefs = mContext.getSharedPreferences( - clonePrefsName, Context.MODE_PRIVATE); - assertEquals(expectedMap, clonePrefs.getAll()); - - prefsFile.delete(); - prefsFileClone.delete(); - } - } - - public void testModeMultiProcess() { - // Pre-load it. - mContext.getSharedPreferences("multiprocessTest", 0); - - final StrictMode.ThreadPolicy oldPolicy = StrictMode.getThreadPolicy(); - try { - StrictMode.ThreadPolicy diskReadDeath = - new StrictMode.ThreadPolicy.Builder().detectDiskReads().penaltyDeath().build(); - StrictMode.setThreadPolicy(diskReadDeath); - - // This shouldn't hit disk. (it was already pre-loaded above) - mContext.getSharedPreferences("multiprocessTest", 0); - - boolean didRead = false; - // This SHOULD hit disk. (multi-process flag is set) - try { - mContext.getSharedPreferences("multiprocessTest", Context.MODE_MULTI_PROCESS); - fail(); // we shouldn't get here. - } catch (StrictMode.StrictModeViolation e) { - didRead = true; - } - assertTrue(didRead); - } finally { - StrictMode.setThreadPolicy(oldPolicy); - } - } -} diff --git a/proprietary/frameworks/base/tests/content/tests/src/mediatek/content/cts/UriMatcherTest.java b/proprietary/frameworks/base/tests/content/tests/src/mediatek/content/cts/UriMatcherTest.java deleted file mode 100755 index 61d641cf661f94c9810090ff9694079cab28c6e2..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/content/tests/src/mediatek/content/cts/UriMatcherTest.java +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.content.cts; - -import android.content.UriMatcher; -import android.net.Uri; -import android.test.AndroidTestCase; - -public class UriMatcherTest extends AndroidTestCase { - UriMatcher mUriMatcher; - - private static final String sAuthority = "ctstest"; - private static final String sPath1 = "testPath1"; - private static final String sPath2 = "testPath2"; - private static final String sPath3 = "testPath3"; - private static final String sPath4 = "testPath4"; - - private static final int sCode1 = 1; - private static final int sCode2 = 2; - private static final int sCode3 = 3; - private static final int sCode4 = 4; - - private Uri uri1 = Uri.parse("content://" + sAuthority + "/" + sPath1); - private Uri uri2 = Uri.parse("content://" + sAuthority + "/" + sPath2); - private Uri uri3 = Uri.parse("content://" + sAuthority + "/" + sPath3); - private Uri uri4 = Uri.parse("content://" + sAuthority + "/" + sPath4); - - @Override - protected void setUp() throws Exception { - super.setUp(); - mUriMatcher = new UriMatcher(UriMatcher.NO_MATCH); - } - - public void testConstructor() { - new UriMatcher(UriMatcher.NO_MATCH); - } - - public void testMatch() { - mUriMatcher.addURI(sAuthority, sPath1, sCode1); - mUriMatcher.addURI(sAuthority, sPath2, sCode2); - mUriMatcher.addURI(sAuthority, sPath3, sCode3); - mUriMatcher.addURI(sAuthority, sPath4, sCode4); - - assertEquals(sCode1, mUriMatcher.match(uri1)); - assertEquals(sCode2, mUriMatcher.match(uri2)); - assertEquals(sCode3, mUriMatcher.match(uri3)); - assertEquals(sCode4, mUriMatcher.match(uri4)); - - //test unknown uri - Uri unknown = Uri.parse("abc"); - assertEquals(-1, mUriMatcher.match(unknown)); - } - - public void testMatchFailure() { - try { - mUriMatcher.match(null); - fail("There should be a NullPointerException thrown out."); - } catch (NullPointerException e) { - //expected, test success. - } - } - - public void testAddURI() { - assertEquals(-1, mUriMatcher.match(uri1)); - assertEquals(-1, mUriMatcher.match(uri2)); - assertEquals(-1, mUriMatcher.match(uri3)); - assertEquals(-1, mUriMatcher.match(uri4)); - - mUriMatcher.addURI(sAuthority, sPath1, sCode1); - mUriMatcher.addURI(sAuthority, sPath2, sCode2); - mUriMatcher.addURI(sAuthority, sPath3, sCode3); - mUriMatcher.addURI(sAuthority, sPath4, sCode4); - - assertEquals(sCode1, mUriMatcher.match(uri1)); - assertEquals(sCode2, mUriMatcher.match(uri2)); - assertEquals(sCode3, mUriMatcher.match(uri3)); - assertEquals(sCode4, mUriMatcher.match(uri4)); - } - - public void testAddURIFailure() { - try { - mUriMatcher.addURI(null, null, -1); - fail("There should be an IllegalArgumentException thrown out."); - } catch (IllegalArgumentException e) { - //expected, test success. - } - } -} diff --git a/proprietary/frameworks/base/tests/database/Android.mk b/proprietary/frameworks/base/tests/database/Android.mk deleted file mode 100755 index 5bc487775da801d7788b66d2ca9ca9c7fe4d01b4..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/database/Android.mk +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (C) 2008 The Android Open Source Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -LOCAL_PATH:= $(call my-dir) -include $(CLEAR_VARS) - -LOCAL_MODULE_TAGS := tests - -LOCAL_SRC_FILES := $(call all-java-files-under, src)\ - $(call all-java-files-under, core/runner/src)\ - -LOCAL_JAVA_LIBRARIES := android.test.runner - -#LOCAL_JNI_SHARED_LIBRARIES := mtklibcts_jni - -# Resource unit tests use a private locale and some densities -LOCAL_AAPT_FLAGS = -c xx_YY -c cs -c 32dpi -c 240dpi -c 160dpi - -LOCAL_PACKAGE_NAME := MediaTekDatabaseaTestStubs - -include $(BUILD_PACKAGE) - -# Build the test APK using its own makefile, and any other CTS-related packages -include $(call all-makefiles-under,$(LOCAL_PATH)) diff --git a/proprietary/frameworks/base/tests/database/Android.mk_ b/proprietary/frameworks/base/tests/database/Android.mk_ deleted file mode 100755 index 5bc487775da801d7788b66d2ca9ca9c7fe4d01b4..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/database/Android.mk_ +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (C) 2008 The Android Open Source Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -LOCAL_PATH:= $(call my-dir) -include $(CLEAR_VARS) - -LOCAL_MODULE_TAGS := tests - -LOCAL_SRC_FILES := $(call all-java-files-under, src)\ - $(call all-java-files-under, core/runner/src)\ - -LOCAL_JAVA_LIBRARIES := android.test.runner - -#LOCAL_JNI_SHARED_LIBRARIES := mtklibcts_jni - -# Resource unit tests use a private locale and some densities -LOCAL_AAPT_FLAGS = -c xx_YY -c cs -c 32dpi -c 240dpi -c 160dpi - -LOCAL_PACKAGE_NAME := MediaTekDatabaseaTestStubs - -include $(BUILD_PACKAGE) - -# Build the test APK using its own makefile, and any other CTS-related packages -include $(call all-makefiles-under,$(LOCAL_PATH)) diff --git a/proprietary/frameworks/base/tests/database/AndroidManifest.xml b/proprietary/frameworks/base/tests/database/AndroidManifest.xml deleted file mode 100755 index 2deaf2a259ed004f850df4e82cd61343b3bc8f56..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/database/AndroidManifest.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - diff --git a/proprietary/frameworks/base/tests/database/NOTICE b/proprietary/frameworks/base/tests/database/NOTICE deleted file mode 100755 index 77b50a488ce97ab1388bd5844afa4e590b0baf18..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/database/NOTICE +++ /dev/null @@ -1,30 +0,0 @@ -* Copyright (C) 2008 The Android Open Source Project: - - - -* Copyright (C) 2007 The Android Open Source Project: - - - -* Copyright (C) 2009 The Android Open Source Project: - - - -/* -* Copyright (C) 2011-2014 MediaTek Inc. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -: - \ No newline at end of file diff --git a/proprietary/frameworks/base/tests/database/README b/proprietary/frameworks/base/tests/database/README deleted file mode 100755 index 79ef47255011eaabb757258cab0c1cc257f8691b..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/database/README +++ /dev/null @@ -1,22 +0,0 @@ -Test cases stubs for android frameworks database module - -WHAT IT DOES? -============= -MediaTekDatabaseaTestStubs.apk is a test case stubs for database -test cases. - -It provide test stubs for MediaTekDatabaseaTestStubs.apk - -The test cases are most come from Android CTS test cases - -HOW IT WAS BUILT? -================== -make 'vendor/mediatek/proprietary/frameworks/base/tests/database/' folder to get -test apk. - -HOW TO USE IT? -============== -After build MediaTekDatabaseaTestStubs.apk, install to phone with -MediaTekDatabaseaTestStubs.apk, and run command: -'adb shell am instrument -w com.mediatek.cts.database/android.test.InstrumentationTestRunner' -to get result. diff --git a/proprietary/frameworks/base/tests/database/src/android/database/cts/AbstractCursorTest.java b/proprietary/frameworks/base/tests/database/src/android/database/cts/AbstractCursorTest.java deleted file mode 100755 index 125c4585068ab51087929018320eceda232ed912..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/database/src/android/database/cts/AbstractCursorTest.java +++ /dev/null @@ -1,615 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.database.cts; - - -import android.content.Context; -import android.database.AbstractCursor; -import android.database.CharArrayBuffer; -import android.database.ContentObserver; -import android.database.CursorIndexOutOfBoundsException; -import android.database.CursorWindow; -import android.database.DataSetObserver; -import android.database.sqlite.SQLiteDatabase; -import android.net.Uri; -import android.os.Bundle; -import android.test.InstrumentationTestCase; - -import java.io.File; -import java.util.ArrayList; -import java.util.Random; - -/** - * Test {@link AbstractCursor}. - */ -public class AbstractCursorTest extends InstrumentationTestCase { - private static final int POSITION0 = 0; - private static final int POSITION1 = 1; - private static final int ROW_MAX = 10; - private static final int DATA_COUNT = 10; - private static final String[] COLUMN_NAMES1 = new String[] { - "_id", // 0 - "number" // 1 - }; - private static final String[] COLUMN_NAMES = new String[] { "name", "number", "profit" }; - private TestAbstractCursor mTestAbstractCursor; - private Object mLockObj = new Object(); - - private SQLiteDatabase mDatabase; - private File mDatabaseFile; - private AbstractCursor mDatabaseCursor; - - @Override - protected void setUp() throws Exception { - super.setUp(); - - setupDatabase(); - ArrayList list = createTestList(ROW_MAX, COLUMN_NAMES.length); - mTestAbstractCursor = new TestAbstractCursor(COLUMN_NAMES, list); - } - - @Override - protected void tearDown() throws Exception { - mDatabaseCursor.close(); - mTestAbstractCursor.close(); - mDatabase.close(); - if (mDatabaseFile.exists()) { - mDatabaseFile.delete(); - } - super.tearDown(); - } - - public void testConstructor() { - TestAbstractCursor abstractCursor = new TestAbstractCursor(); - assertEquals(-1, abstractCursor.getPosition()); - } - - public void testGetBlob() { - try { - mTestAbstractCursor.getBlob(0); - fail("getBlob should throws a UnsupportedOperationException here"); - } catch (UnsupportedOperationException e) { - // expected - } - } - - public void testRegisterDataSetObserver() { - MockDataSetObserver datasetObserver = new MockDataSetObserver(); - - try { - mDatabaseCursor.unregisterDataSetObserver(datasetObserver); - fail("Can't unregister DataSetObserver before it is registered."); - } catch (IllegalStateException e) { - // expected - } - - mDatabaseCursor.registerDataSetObserver(datasetObserver); - - try { - mDatabaseCursor.registerDataSetObserver(datasetObserver); - fail("Can't register DataSetObserver twice before unregister it."); - } catch (IllegalStateException e) { - // expected - } - - mDatabaseCursor.unregisterDataSetObserver(datasetObserver); - mDatabaseCursor.registerDataSetObserver(datasetObserver); - } - - public void testRegisterContentObserver() { - MockContentObserver contentObserver = new MockContentObserver(); - - try { - mDatabaseCursor.unregisterContentObserver(contentObserver); - fail("Can't unregister ContentObserver before it is registered."); - } catch (IllegalStateException e) { - // expected - } - - mDatabaseCursor.registerContentObserver(contentObserver); - - try { - mDatabaseCursor.registerContentObserver(contentObserver); - fail("Can't register DataSetObserver twice before unregister it."); - } catch (IllegalStateException e) { - // expected - } - - mDatabaseCursor.unregisterContentObserver(contentObserver); - mDatabaseCursor.registerContentObserver(contentObserver); - } - - public void testSetNotificationUri() { - String MOCK_URI = "content://abstractrcursortest/testtable"; - mDatabaseCursor.setNotificationUri(getInstrumentation().getContext().getContentResolver(), - Uri.parse(MOCK_URI)); - } - - public void testRespond() { - Bundle b = new Bundle(); - Bundle bundle = mDatabaseCursor.respond(b); - assertSame(Bundle.EMPTY, bundle); - - bundle = mDatabaseCursor.respond(null); - assertSame(Bundle.EMPTY, bundle); - } - - public void testRequery() { - MockDataSetObserver mock = new MockDataSetObserver(); - mDatabaseCursor.registerDataSetObserver(mock); - assertFalse(mock.hadCalledOnChanged()); - mDatabaseCursor.requery(); - assertTrue(mock.hadCalledOnChanged()); - } - - public void testOnChange() throws InterruptedException { - MockContentObserver mock = new MockContentObserver(); - mTestAbstractCursor.registerContentObserver(mock); - assertFalse(mock.hadCalledOnChange()); - mTestAbstractCursor.onChange(true); - synchronized (mLockObj) { - if (!mock.hadCalledOnChange()) { - mLockObj.wait(5000); - } - } - assertTrue(mock.hadCalledOnChange()); - } - - public void testOnMove() { - mTestAbstractCursor.resetOnMoveRet(); - assertFalse(mTestAbstractCursor.getOnMoveRet()); - mTestAbstractCursor.moveToFirst(); - mTestAbstractCursor.moveToPosition(5); - assertTrue(mTestAbstractCursor.getOnMoveRet()); - assertEquals(0, mTestAbstractCursor.getOldPos()); - assertEquals(5, mTestAbstractCursor.getNewPos()); - } - - public void testMoveToPrevious() { - // Test moveToFirst, isFirst, moveToNext, getPosition - assertTrue(mDatabaseCursor.moveToFirst()); - assertTrue(mDatabaseCursor.isFirst()); - assertEquals(0, mDatabaseCursor.getPosition()); - assertTrue(mDatabaseCursor.moveToNext()); - assertEquals(1, mDatabaseCursor.getPosition()); - assertFalse(mDatabaseCursor.isFirst()); - assertTrue(mDatabaseCursor.moveToNext()); - assertEquals(2, mDatabaseCursor.getPosition()); - - // invoke moveToPosition with a number larger than row count. - assertFalse(mDatabaseCursor.moveToPosition(30000)); - assertEquals(mDatabaseCursor.getCount(), mDatabaseCursor.getPosition()); - - assertFalse(mDatabaseCursor.moveToPosition(-1)); - assertEquals(-1, mDatabaseCursor.getPosition()); - assertTrue(mDatabaseCursor.isBeforeFirst()); - - mDatabaseCursor.moveToPosition(5); - assertEquals(5, mDatabaseCursor.getPosition()); - - // Test moveToPrevious - assertTrue(mDatabaseCursor.moveToPrevious()); - assertEquals(4, mDatabaseCursor.getPosition()); - assertTrue(mDatabaseCursor.moveToPrevious()); - assertEquals(3, mDatabaseCursor.getPosition()); - assertTrue(mDatabaseCursor.moveToPrevious()); - assertEquals(2, mDatabaseCursor.getPosition()); - - // Test moveToLast, isLast, moveToPrevius, isAfterLast. - assertFalse(mDatabaseCursor.isLast()); - assertTrue(mDatabaseCursor.moveToLast()); - assertTrue(mDatabaseCursor.isLast()); - assertFalse(mDatabaseCursor.isAfterLast()); - - assertFalse(mDatabaseCursor.moveToNext()); - assertTrue(mDatabaseCursor.isAfterLast()); - assertFalse(mDatabaseCursor.moveToNext()); - assertTrue(mDatabaseCursor.isAfterLast()); - assertFalse(mDatabaseCursor.isLast()); - assertTrue(mDatabaseCursor.moveToPrevious()); - assertTrue(mDatabaseCursor.isLast()); - assertTrue(mDatabaseCursor.moveToPrevious()); - assertFalse(mDatabaseCursor.isLast()); - - // Test move(int). - mDatabaseCursor.moveToFirst(); - assertEquals(0, mDatabaseCursor.getPosition()); - assertFalse(mDatabaseCursor.move(-1)); - assertEquals(-1, mDatabaseCursor.getPosition()); - assertTrue(mDatabaseCursor.move(1)); - assertEquals(0, mDatabaseCursor.getPosition()); - - assertTrue(mDatabaseCursor.move(5)); - assertEquals(5, mDatabaseCursor.getPosition()); - assertTrue(mDatabaseCursor.move(-1)); - assertEquals(4, mDatabaseCursor.getPosition()); - - mDatabaseCursor.moveToLast(); - assertTrue(mDatabaseCursor.isLast()); - assertFalse(mDatabaseCursor.isAfterLast()); - assertFalse(mDatabaseCursor.move(1)); - assertFalse(mDatabaseCursor.isLast()); - assertTrue(mDatabaseCursor.isAfterLast()); - assertTrue(mDatabaseCursor.move(-1)); - assertTrue(mDatabaseCursor.isLast()); - assertFalse(mDatabaseCursor.isAfterLast()); - } - - public void testIsClosed() { - assertFalse(mDatabaseCursor.isClosed()); - mDatabaseCursor.close(); - assertTrue(mDatabaseCursor.isClosed()); - } - - public void testGetWindow() { - CursorWindow window = new CursorWindow(false); - assertEquals(0, window.getNumRows()); - // fill window from position 0 - mDatabaseCursor.fillWindow(0, window); - - assertNotNull(mDatabaseCursor.getWindow()); - assertEquals(mDatabaseCursor.getCount(), window.getNumRows()); - - while (mDatabaseCursor.moveToNext()) { - assertEquals(mDatabaseCursor.getInt(POSITION1), - window.getInt(mDatabaseCursor.getPosition(), POSITION1)); - } - window.clear(); - } - - public void testGetWantsAllOnMoveCalls() { - assertFalse(mDatabaseCursor.getWantsAllOnMoveCalls()); - } - - public void testIsFieldUpdated() { - mTestAbstractCursor.moveToFirst(); - assertFalse(mTestAbstractCursor.isFieldUpdated(0)); - } - - public void testGetUpdatedField() { - mTestAbstractCursor.moveToFirst(); - assertNull(mTestAbstractCursor.getUpdatedField(0)); - } - - public void testGetExtras() { - assertSame(Bundle.EMPTY, mDatabaseCursor.getExtras()); - } - - public void testGetCount() { - assertEquals(DATA_COUNT, mDatabaseCursor.getCount()); - } - - public void testGetColumnNames() { - String[] names = mDatabaseCursor.getColumnNames(); - assertEquals(COLUMN_NAMES1.length, names.length); - - for (int i = 0; i < COLUMN_NAMES1.length; i++) { - assertEquals(COLUMN_NAMES1[i], names[i]); - } - } - - public void testGetColumnName() { - assertEquals(COLUMN_NAMES1[0], mDatabaseCursor.getColumnName(0)); - assertEquals(COLUMN_NAMES1[1], mDatabaseCursor.getColumnName(1)); - } - - public void testGetColumnIndexOrThrow() { - final String COLUMN_FAKE = "fake_name"; - assertEquals(POSITION0, mDatabaseCursor.getColumnIndex(COLUMN_NAMES1[POSITION0])); - assertEquals(POSITION1, mDatabaseCursor.getColumnIndex(COLUMN_NAMES1[POSITION1])); - assertEquals(POSITION0, mDatabaseCursor.getColumnIndexOrThrow(COLUMN_NAMES1[POSITION0])); - assertEquals(POSITION1, mDatabaseCursor.getColumnIndexOrThrow(COLUMN_NAMES1[POSITION1])); - - try { - mDatabaseCursor.getColumnIndexOrThrow(COLUMN_FAKE); - fail("IllegalArgumentException expected, but not thrown"); - } catch (IllegalArgumentException expected) { - // expected - } - } - - public void testGetColumnIndex() { - assertEquals(POSITION0, mDatabaseCursor.getColumnIndex(COLUMN_NAMES1[POSITION0])); - assertEquals(POSITION1, mDatabaseCursor.getColumnIndex(COLUMN_NAMES1[POSITION1])); - } - - public void testGetColumnCount() { - assertEquals(COLUMN_NAMES1.length, mDatabaseCursor.getColumnCount()); - } - - public void testDeactivate() { - MockDataSetObserver mock = new MockDataSetObserver(); - mDatabaseCursor.registerDataSetObserver(mock); - assertFalse(mock.hadCalledOnInvalid()); - mDatabaseCursor.deactivate(); - assertTrue(mock.hadCalledOnInvalid()); - } - - public void testCopyStringToBuffer() { - CharArrayBuffer ca = new CharArrayBuffer(1000); - mTestAbstractCursor.moveToFirst(); - mTestAbstractCursor.copyStringToBuffer(0, ca); - CursorWindow window = new CursorWindow(false); - mTestAbstractCursor.fillWindow(0, window); - - StringBuffer sb = new StringBuffer(); - sb.append(window.getString(0, 0)); - String str = mTestAbstractCursor.getString(0); - assertEquals(str.length(), ca.sizeCopied); - assertEquals(sb.toString(), new String(ca.data, 0, ca.sizeCopied)); - } - - public void testCheckPosition() { - // Test with position = -1. - try { - mTestAbstractCursor.checkPosition(); - fail("copyStringToBuffer() should throws CursorIndexOutOfBoundsException here."); - } catch (CursorIndexOutOfBoundsException e) { - // expected - } - - // Test with position = count. - assertTrue(mTestAbstractCursor.moveToPosition(mTestAbstractCursor.getCount() - 1)); - mTestAbstractCursor.checkPosition(); - - try { - assertFalse(mTestAbstractCursor.moveToPosition(mTestAbstractCursor.getCount())); - assertEquals(mTestAbstractCursor.getCount(), mTestAbstractCursor.getPosition()); - mTestAbstractCursor.checkPosition(); - fail("copyStringToBuffer() should throws CursorIndexOutOfBoundsException here."); - } catch (CursorIndexOutOfBoundsException e) { - // expected - } - } - - @SuppressWarnings("unchecked") - private static ArrayList createTestList(int rows, int cols) { - ArrayList list = new ArrayList(); - Random ran = new Random(); - - for (int i = 0; i < rows; i++) { - ArrayList col = new ArrayList(); - list.add(col); - - for (int j = 0; j < cols; j++) { - // generate random number - Integer r = ran.nextInt(); - col.add(r); - } - } - - return list; - } - - private void setupDatabase() { - File dbDir = getInstrumentation().getTargetContext().getDir("tests", - Context.MODE_WORLD_WRITEABLE); - mDatabaseFile = new File(dbDir, "database_test.db"); - if (mDatabaseFile.exists()) { - mDatabaseFile.delete(); - } - mDatabase = SQLiteDatabase.openOrCreateDatabase(mDatabaseFile.getPath(), null); - assertNotNull(mDatabaseFile); - mDatabase.execSQL("CREATE TABLE test1 (_id INTEGER PRIMARY KEY, number TEXT);"); - generateData(); - mDatabaseCursor = (AbstractCursor) mDatabase.query("test1", null, null, null, null, null, - null); - } - - private void generateData() { - for (int i = 0; i < DATA_COUNT; i++) { - mDatabase.execSQL("INSERT INTO test1 (number) VALUES ('" + i + "');"); - } - } - - private class TestAbstractCursor extends AbstractCursor { - private boolean mOnMoveReturnValue; - private int mOldPosition; - private int mNewPosition; - private String[] mColumnNames; - private ArrayList[] mRows; - private boolean mHadCalledOnChange = false; - - public TestAbstractCursor() { - super(); - } - @SuppressWarnings("unchecked") - public TestAbstractCursor(String[] columnNames, ArrayList rows) { - int colCount = columnNames.length; - boolean foundID = false; - mRowIdColumnIndex = 0; - - // Add an _id column if not in columnNames - for (int i = 0; i < colCount; ++i) { - if (columnNames[i].compareToIgnoreCase("_id") == 0) { - mColumnNames = columnNames; - foundID = true; - break; - } - } - - if (!foundID) { - mColumnNames = new String[colCount + 1]; - System.arraycopy(columnNames, 0, mColumnNames, 0, columnNames.length); - mColumnNames[colCount] = "_id"; - } - - int rowCount = rows.size(); - mRows = new ArrayList[rowCount]; - - for (int i = 0; i < rowCount; ++i) { - mRows[i] = rows.get(i); - - if (!foundID) { - mRows[i].add(Long.valueOf(i)); - } - } - } - - public boolean getOnMoveRet() { - return mOnMoveReturnValue; - } - - public void resetOnMoveRet() { - mOnMoveReturnValue = false; - } - - public int getOldPos() { - return mOldPosition; - } - - public int getNewPos() { - return mNewPosition; - } - - @Override - public boolean onMove(int oldPosition, int newPosition) { - mOnMoveReturnValue = super.onMove(oldPosition, newPosition); - mOldPosition = oldPosition; - mNewPosition = newPosition; - return mOnMoveReturnValue; - } - - @Override - public int getCount() { - return mRows.length; - } - - @Override - public String[] getColumnNames() { - return mColumnNames; - } - - @Override - public String getString(int columnIndex) { - Object cell = mRows[mPos].get(columnIndex); - return (cell == null) ? null : cell.toString(); - } - - @Override - public short getShort(int columnIndex) { - Number num = (Number) mRows[mPos].get(columnIndex); - return num.shortValue(); - } - - @Override - public int getInt(int columnIndex) { - Number num = (Number) mRows[mPos].get(columnIndex); - return num.intValue(); - } - - @Override - public long getLong(int columnIndex) { - Number num = (Number) mRows[mPos].get(columnIndex); - return num.longValue(); - } - - @Override - public float getFloat(int columnIndex) { - Number num = (Number) mRows[mPos].get(columnIndex); - return num.floatValue(); - } - - @Override - public double getDouble(int columnIndex) { - Number num = (Number) mRows[mPos].get(columnIndex); - return num.doubleValue(); - } - - @Override - public boolean isNull(int column) { - return false; - } - - public boolean hadCalledOnChange() { - return mHadCalledOnChange; - } - - // the following are protected methods - @Override - protected void checkPosition() { - super.checkPosition(); - } - - @Override - protected Object getUpdatedField(int columnIndex) { - return super.getUpdatedField(columnIndex); - } - - @Override - protected boolean isFieldUpdated(int columnIndex) { - return super.isFieldUpdated(columnIndex); - } - - @Override - protected void onChange(boolean selfChange) { - super.onChange(selfChange); - mHadCalledOnChange = true; - } - } - - private class MockContentObserver extends ContentObserver { - public boolean mHadCalledOnChange; - - public MockContentObserver() { - super(null); - } - - @Override - public void onChange(boolean selfChange) { - super.onChange(selfChange); - mHadCalledOnChange = true; - synchronized (mLockObj) { - mLockObj.notify(); - } - } - - @Override - public boolean deliverSelfNotifications() { - return true; - } - - public boolean hadCalledOnChange() { - return mHadCalledOnChange; - } - } - - private class MockDataSetObserver extends DataSetObserver { - private boolean mHadCalledOnChanged; - private boolean mHadCalledOnInvalid; - - @Override - public void onChanged() { - super.onChanged(); - mHadCalledOnChanged = true; - } - - @Override - public void onInvalidated() { - super.onInvalidated(); - mHadCalledOnInvalid = true; - } - - public boolean hadCalledOnChanged() { - return mHadCalledOnChanged; - } - - public boolean hadCalledOnInvalid() { - return mHadCalledOnInvalid; - } - } -} diff --git a/proprietary/frameworks/base/tests/database/src/android/database/cts/AbstractCursor_SelfContentObserverTest.java b/proprietary/frameworks/base/tests/database/src/android/database/cts/AbstractCursor_SelfContentObserverTest.java deleted file mode 100755 index b555c4cd2ffe00e736ced6c1f164278685527185..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/database/src/android/database/cts/AbstractCursor_SelfContentObserverTest.java +++ /dev/null @@ -1,144 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package android.database.cts; - -import android.database.AbstractCursor; -import android.test.AndroidTestCase; - -public class AbstractCursor_SelfContentObserverTest extends AndroidTestCase { - - public void testConstructor() { - MockAbstractCursor mac = new MockAbstractCursor(); - mac.getMockSelfContentObserver(); - } - - public void testDeliverSelfNotifications() { - MockAbstractCursor mac = new MockAbstractCursor(); - MockAbstractCursor.MockSelfContentObserver msc = mac.getMockSelfContentObserver(); - assertFalse(msc.deliverSelfNotifications()); - } - - public void testOnChange() { - MockAbstractCursor mockCursor = new MockAbstractCursor(); - MockAbstractCursor.MockSelfContentObserver msc = mockCursor.getMockSelfContentObserver(); - mockCursor.registerContentObserver(msc); - // here, the directly call of AbstractCurso#onChange is intended to test - // SelfContentObserver#onChange - mockCursor.onChange(false); - assertTrue(msc.mIsOnChangeCalled); - assertFalse(msc.mOnChangeResult); - - msc.mIsOnChangeCalled = false; - mockCursor.onChange(true); - assertFalse(msc.mIsOnChangeCalled); - assertFalse(msc.mOnChangeResult); - - msc.mIsOnChangeCalled = false; - msc.setDeliverSelfNotificationsValue(true); - mockCursor.onChange(true); - assertTrue(msc.mIsOnChangeCalled); - assertTrue(msc.mOnChangeResult); - } - - class MockAbstractCursor extends AbstractCursor { - - @Override - public String[] getColumnNames() { - return null; - } - - @Override - public int getCount() { - return 0; - } - - @Override - public double getDouble(int column) { - return 0; - } - - @Override - public float getFloat(int column) { - return 0; - } - - @Override - public int getInt(int column) { - return 0; - } - - @Override - public long getLong(int column) { - return 0; - } - - @Override - public short getShort(int column) { - return 0; - } - - @Override - public String getString(int column) { - return null; - } - - @Override - public boolean isNull(int column) { - return false; - } - - public MockSelfContentObserver getMockSelfContentObserver() { - return new MockSelfContentObserver(new MockAbstractCursor()); - } - - @Override - public void onChange(boolean selfChange) { - super.onChange(selfChange); - } - - public class MockSelfContentObserver extends AbstractCursor.SelfContentObserver { - - public MockAbstractCursor mMockAbstractCursor; - public boolean mIsOnChangeCalled; - public boolean mOnChangeResult; - private boolean mIsTrue; - public MockSelfContentObserver(AbstractCursor cursor) { - super(cursor); - mMockAbstractCursor = (MockAbstractCursor) cursor; - } - - @Override - public void onChange(boolean selfChange) { - super.onChange(selfChange); - mOnChangeResult = selfChange; - mIsOnChangeCalled = true; - } - - @Override - public boolean deliverSelfNotifications() { - if (mIsTrue) { - return true; - } - return super.deliverSelfNotifications(); - } - - public void setDeliverSelfNotificationsValue(boolean isTrue) { - mIsTrue = isTrue; - } - } - } - -} diff --git a/proprietary/frameworks/base/tests/database/src/android/database/cts/AbstractWindowedCursorTest.java b/proprietary/frameworks/base/tests/database/src/android/database/cts/AbstractWindowedCursorTest.java deleted file mode 100755 index 40b9ffa4d3729f78bd8a52091e097056097c2b99..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/database/src/android/database/cts/AbstractWindowedCursorTest.java +++ /dev/null @@ -1,245 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.database.cts; - -import java.util.Arrays; - -import android.database.AbstractWindowedCursor; -import android.database.CharArrayBuffer; -import android.database.CursorIndexOutOfBoundsException; -import android.database.CursorWindow; -import android.database.StaleDataException; -import android.test.InstrumentationTestCase; - -public class AbstractWindowedCursorTest extends InstrumentationTestCase { - private static final String TEST_STRING = "TESTSTRING"; - private static final int COLUMN_INDEX0 = 0; - private static final int COLUMN_INDEX1 = 1; - private static final int ROW_INDEX0 = 0; - private static final int TEST_COLUMN_COUNT = 7; - private MockAbstractWindowedCursor mCursor; - private CursorWindow mWindow; - - @Override - protected void setUp() throws Exception { - super.setUp(); - - mCursor = new MockAbstractWindowedCursor(); - mWindow = new CursorWindow(false); - } - - @Override - protected void tearDown() throws Exception { - mCursor.close(); - mWindow.close(); - super.tearDown(); - } - - public void testIsNull() { - mCursor.setWindow(mWindow); - - assertTrue(mWindow.setNumColumns(TEST_COLUMN_COUNT)); - mCursor.moveToFirst(); - assertTrue(mCursor.isNull(COLUMN_INDEX0)); - assertTrue(mWindow.allocRow()); - - String str = "abcdefg"; - assertTrue(mWindow.putString(str, ROW_INDEX0, COLUMN_INDEX0)); - assertFalse(mCursor.isNull(COLUMN_INDEX0)); - } - - public void testIsBlob() { - mCursor.setWindow(mWindow); - assertTrue(mWindow.setNumColumns(TEST_COLUMN_COUNT)); - assertTrue(mWindow.allocRow()); - - mCursor.moveToFirst(); - assertFalse(mCursor.isBlob(COLUMN_INDEX0)); - - String str = "abcdefg"; - assertTrue(mWindow.putString(str, ROW_INDEX0, COLUMN_INDEX0)); - assertTrue(mWindow.putBlob(new byte[10], ROW_INDEX0, COLUMN_INDEX1)); - assertTrue(mCursor.isBlob(COLUMN_INDEX1)); - } - - public void testHasWindow() { - assertFalse(mCursor.hasWindow()); - assertNull(mCursor.getWindow()); - - mCursor.setWindow(mWindow); - assertTrue(mCursor.hasWindow()); - assertSame(mWindow, mCursor.getWindow()); - - mCursor.setWindow(null); - assertFalse(mCursor.hasWindow()); - assertNull(mCursor.getWindow()); - } - - public void testGetString() { - mCursor.setWindow(mWindow); - assertTrue(mWindow.setNumColumns(TEST_COLUMN_COUNT)); - assertTrue(mWindow.allocRow()); - - mCursor.moveToFirst(); - String str = "abcdefg"; - assertTrue(mWindow.putString(str, ROW_INDEX0, COLUMN_INDEX0)); - assertEquals(str, mCursor.getString(COLUMN_INDEX0)); - } - - public void testGetShort() { - mCursor.setWindow(mWindow); - assertTrue(mWindow.setNumColumns(TEST_COLUMN_COUNT)); - assertTrue(mWindow.allocRow()); - - mCursor.moveToFirst(); - short shortNumber = 10; - assertTrue(mWindow.putLong((long) shortNumber, ROW_INDEX0, COLUMN_INDEX0)); - assertEquals(shortNumber, mCursor.getShort(COLUMN_INDEX0)); - } - - public void testGetLong() { - mCursor.setWindow(mWindow); - assertTrue(mWindow.setNumColumns(TEST_COLUMN_COUNT)); - assertTrue(mWindow.allocRow()); - - mCursor.moveToFirst(); - long longNumber = 10; - assertTrue(mWindow.putLong(longNumber, ROW_INDEX0, COLUMN_INDEX0)); - assertEquals(longNumber, mCursor.getLong(COLUMN_INDEX0)); - } - - public void testGetInt() { - mCursor.setWindow(mWindow); - assertTrue(mWindow.setNumColumns(TEST_COLUMN_COUNT)); - assertTrue(mWindow.allocRow()); - - mCursor.moveToFirst(); - int intNumber = 10; - assertTrue(mWindow.putLong((long) intNumber, ROW_INDEX0, COLUMN_INDEX0)); - assertEquals(intNumber, mCursor.getInt(COLUMN_INDEX0)); - } - - public void testGetFloat() { - mCursor.setWindow(mWindow); - assertTrue(mWindow.setNumColumns(TEST_COLUMN_COUNT)); - assertTrue(mWindow.allocRow()); - - mCursor.moveToFirst(); - float f1oatNumber = 1.26f; - assertTrue(mWindow.putDouble((double) f1oatNumber, ROW_INDEX0, COLUMN_INDEX0)); - assertEquals(f1oatNumber, mCursor.getFloat(COLUMN_INDEX0)); - } - - public void testGetDouble() { - mCursor.setWindow(mWindow); - assertTrue(mWindow.setNumColumns(TEST_COLUMN_COUNT)); - assertTrue(mWindow.allocRow()); - - double db1 = 1.26; - assertTrue(mWindow.putDouble(db1, ROW_INDEX0, COLUMN_INDEX0)); - - double db2 = mWindow.getDouble(ROW_INDEX0, COLUMN_INDEX0); - assertEquals(db1, db2); - - mCursor.moveToFirst(); - double cd = mCursor.getDouble(COLUMN_INDEX0); - assertEquals(db1, cd); - } - - public void testGetBlob() { - byte TEST_VALUE = 3; - byte BLOB_SIZE = 100; - assertTrue(mWindow.setNumColumns(TEST_COLUMN_COUNT)); - assertTrue(mWindow.allocRow()); - assertTrue(mWindow.putString("", ROW_INDEX0, COLUMN_INDEX0)); - - byte[] blob = new byte[BLOB_SIZE]; - Arrays.fill(blob, TEST_VALUE); - assertTrue(mWindow.putBlob(blob, ROW_INDEX0, COLUMN_INDEX1)); - - mCursor.setWindow(mWindow); - mCursor.moveToFirst(); - - byte[] targetBuffer = mCursor.getBlob(COLUMN_INDEX1); - assertEquals(BLOB_SIZE, targetBuffer.length); - assertTrue(Arrays.equals(blob, targetBuffer)); - } - - public void testCopyStringToBuffer() { - assertTrue(mWindow.setNumColumns(TEST_COLUMN_COUNT)); - assertTrue(mWindow.allocRow()); - assertTrue(mWindow.putString(TEST_STRING, ROW_INDEX0, COLUMN_INDEX0)); - assertTrue(mWindow.putString("", ROW_INDEX0, COLUMN_INDEX1)); - - mCursor.setWindow(mWindow); - mCursor.moveToFirst(); - - CharArrayBuffer charArrayBuffer = new CharArrayBuffer(TEST_STRING.length()); - - mCursor.copyStringToBuffer(COLUMN_INDEX0, charArrayBuffer); - assertEquals(TEST_STRING.length(), charArrayBuffer.sizeCopied); - assertTrue(Arrays.equals(TEST_STRING.toCharArray(), charArrayBuffer.data)); - - Arrays.fill(charArrayBuffer.data, '\0'); - mCursor.copyStringToBuffer(COLUMN_INDEX1, charArrayBuffer); - assertEquals(0, charArrayBuffer.sizeCopied); - } - - public void testCheckPosition() { - try { - mCursor.checkPosition(); - fail("testCheckPosition failed"); - } catch (CursorIndexOutOfBoundsException e) { - // expected - } - - try { - assertTrue(mCursor.moveToPosition(mCursor.getCount() - 1)); - mCursor.checkPosition(); - fail("testCheckPosition failed"); - } catch (StaleDataException e) { - // expected - } - - assertTrue(mCursor.moveToPosition(mCursor.getCount() - 1)); - mCursor.setWindow(mWindow); - mCursor.checkPosition(); - } - - private class MockAbstractWindowedCursor extends AbstractWindowedCursor { - - public MockAbstractWindowedCursor() { - } - - @Override - public String[] getColumnNames() { - return new String[] { - "col1", "col2", "col3" - }; - } - - @Override - public int getCount() { - return 1; - } - - @Override - protected void checkPosition() { - super.checkPosition(); - } - } -} diff --git a/proprietary/frameworks/base/tests/database/src/android/database/cts/CharArrayBufferTest.java b/proprietary/frameworks/base/tests/database/src/android/database/cts/CharArrayBufferTest.java deleted file mode 100755 index 63d8cdde53f30f01e03e7522d924ac79d2acf8f5..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/database/src/android/database/cts/CharArrayBufferTest.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package android.database.cts; - - -import android.database.CharArrayBuffer; -import android.test.AndroidTestCase; - -public class CharArrayBufferTest extends AndroidTestCase { - public void testCharArrayBuffer() { - CharArrayBuffer charArrayBuffer; - - charArrayBuffer = new CharArrayBuffer(0); - assertEquals(0, charArrayBuffer.data.length); - charArrayBuffer.data = new char[100]; - assertEquals(100, charArrayBuffer.data.length); - - assertEquals(100, (new CharArrayBuffer(100)).data.length); - - assertNull((new CharArrayBuffer(null)).data); - - char[] expectedData = new char[100]; - assertSame(expectedData, (new CharArrayBuffer(expectedData)).data); - } -} diff --git a/proprietary/frameworks/base/tests/database/src/android/database/cts/ContentObservableTest.java b/proprietary/frameworks/base/tests/database/src/android/database/cts/ContentObservableTest.java deleted file mode 100755 index 13a75a128995e5cbd04b37bfce1d78f9298545a6..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/database/src/android/database/cts/ContentObservableTest.java +++ /dev/null @@ -1,156 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.database.cts; - - -import android.database.ContentObservable; -import android.database.ContentObserver; -import android.net.Uri; -import android.test.InstrumentationTestCase; - -public class ContentObservableTest extends InstrumentationTestCase { - private static final Uri CONTENT_URI = Uri.parse("content://uri"); - - ContentObservable mContentObservable; - MyContentObserver mObserver; - - @Override - protected void setUp() throws Exception { - super.setUp(); - - mContentObservable = new ContentObservable(); - mObserver = new MyContentObserver(); - } - - public void testNotifyChange() { - mContentObservable.registerObserver(mObserver); - mObserver.resetStatus(); - assertFalse(mObserver.hasChanged()); - mContentObservable.notifyChange(false); - assertTrue(mObserver.hasChanged()); - - try { - mContentObservable.registerObserver(mObserver); - fail("Re-registering observer did not cause exception."); - } catch (IllegalStateException expected) { - // expected - } - - try { - mContentObservable.registerObserver(null); - fail("Registering null observer did not cause exception."); - } catch (IllegalArgumentException expected) { - // expected - } - - MyContentObserver second = new MyContentObserver(); - mContentObservable.registerObserver(second); - - mContentObservable.unregisterObserver(mObserver); - mObserver.resetStatus(); - assertFalse(mObserver.hasChanged()); - mContentObservable.notifyChange(false); - assertFalse(mObserver.hasChanged()); - assertTrue(second.hasChanged()); - } - - public void testDispatchChange() { - mContentObservable.registerObserver(mObserver); - mObserver.resetStatus(); - assertFalse(mObserver.hasChanged()); - mContentObservable.dispatchChange(false); - assertTrue(mObserver.hasChanged()); - assertNull(mObserver.getUri()); - - mObserver.resetStatus(); - assertFalse(mObserver.hasChanged()); - mContentObservable.dispatchChange(true); - assertFalse(mObserver.hasChanged()); - mObserver.setDeliverSelfNotifications(true); - mContentObservable.dispatchChange(true); - assertTrue(mObserver.hasChanged()); - assertNull(mObserver.getUri()); - - mContentObservable.unregisterObserver(mObserver); - mObserver.resetStatus(); - assertFalse(mObserver.hasChanged()); - mContentObservable.dispatchChange(false); - assertFalse(mObserver.hasChanged()); - } - - public void testDispatchChangeWithUri() { - mContentObservable.registerObserver(mObserver); - mObserver.resetStatus(); - assertFalse(mObserver.hasChanged()); - mContentObservable.dispatchChange(false, CONTENT_URI); - assertTrue(mObserver.hasChanged()); - assertEquals(CONTENT_URI, mObserver.getUri()); - - mObserver.resetStatus(); - assertFalse(mObserver.hasChanged()); - mContentObservable.dispatchChange(true, CONTENT_URI); - assertFalse(mObserver.hasChanged()); - mObserver.setDeliverSelfNotifications(true); - mContentObservable.dispatchChange(true, CONTENT_URI); - assertTrue(mObserver.hasChanged()); - assertEquals(CONTENT_URI, mObserver.getUri()); - - mContentObservable.unregisterObserver(mObserver); - mObserver.resetStatus(); - assertFalse(mObserver.hasChanged()); - mContentObservable.dispatchChange(false, CONTENT_URI); - assertFalse(mObserver.hasChanged()); - } - - private static class MyContentObserver extends ContentObserver { - private boolean mHasChanged = false; - private boolean mDeliverSelfNotifications = false; - private Uri mUri; - - public MyContentObserver() { - super(null); - } - - @Override - public void onChange(boolean selfChange, Uri uri) { - super.onChange(selfChange, uri); - mHasChanged = true; - mUri = uri; - } - - public boolean deliverSelfNotifications() { - return mDeliverSelfNotifications ; - } - - protected boolean hasChanged() { - return mHasChanged; - } - - protected void resetStatus() { - mHasChanged = false; - mUri = null; - } - - protected void setDeliverSelfNotifications(boolean b) { - mDeliverSelfNotifications = b; - } - - protected Uri getUri() { - return mUri; - } - } -} diff --git a/proprietary/frameworks/base/tests/database/src/android/database/cts/ContentObserverTest.java b/proprietary/frameworks/base/tests/database/src/android/database/cts/ContentObserverTest.java deleted file mode 100755 index eca3475b4e861e154b4eeaafc252e908470b8c9c..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/database/src/android/database/cts/ContentObserverTest.java +++ /dev/null @@ -1,215 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.database.cts; - - -import android.database.ContentObserver; -import android.net.Uri; -import android.os.Handler; -import android.os.HandlerThread; -import android.os.Looper; -import android.test.InstrumentationTestCase; - -public class ContentObserverTest extends InstrumentationTestCase { - private static final Uri CONTENT_URI = Uri.parse("content://uri"); - - public void testContentObserver() throws InterruptedException { - // Test constructor with null handler, dispatchChange will directly invoke onChange. - MyContentObserver contentObserver; - contentObserver = new MyContentObserver(null); - assertFalse(contentObserver.hasChanged()); - assertFalse(contentObserver.getSelfChangeState()); - contentObserver.dispatchChange(true); - assertTrue(contentObserver.hasChanged()); - assertTrue(contentObserver.getSelfChangeState()); - - contentObserver.resetStatus(); - contentObserver.setSelfChangeState(true); - assertFalse(contentObserver.hasChanged()); - assertTrue(contentObserver.getSelfChangeState()); - contentObserver.dispatchChange(false); - assertTrue(contentObserver.hasChanged()); - assertFalse(contentObserver.getSelfChangeState()); - - HandlerThread ht = new HandlerThread(getClass().getName()); - ht.start(); - Looper looper = ht.getLooper(); - Handler handler = new Handler(looper); - final long timeout = 1000L; - - contentObserver = new MyContentObserver(handler); - assertFalse(contentObserver.hasChanged()); - assertFalse(contentObserver.getSelfChangeState()); - contentObserver.dispatchChange(true); - assertTrue(contentObserver.hasChanged(timeout)); - assertTrue(contentObserver.getSelfChangeState()); - - contentObserver.resetStatus(); - contentObserver.setSelfChangeState(true); - assertFalse(contentObserver.hasChanged()); - assertTrue(contentObserver.getSelfChangeState()); - contentObserver.dispatchChange(false); - assertTrue(contentObserver.hasChanged(timeout)); - assertFalse(contentObserver.getSelfChangeState()); - - looper.quit(); - } - - public void testContentObserverWithUri() throws InterruptedException { - // Test constructor with null handler, dispatchChange will directly invoke onChange. - MyContentObserverWithUri contentObserver; - contentObserver = new MyContentObserverWithUri(null); - assertFalse(contentObserver.hasChanged()); - assertFalse(contentObserver.getSelfChangeState()); - contentObserver.dispatchChange(true, CONTENT_URI); - assertTrue(contentObserver.hasChanged()); - assertTrue(contentObserver.getSelfChangeState()); - assertEquals(CONTENT_URI, contentObserver.getUri()); - - contentObserver.resetStatus(); - contentObserver.setSelfChangeState(true); - assertFalse(contentObserver.hasChanged()); - assertTrue(contentObserver.getSelfChangeState()); - contentObserver.dispatchChange(false, CONTENT_URI); - assertTrue(contentObserver.hasChanged()); - assertFalse(contentObserver.getSelfChangeState()); - assertEquals(CONTENT_URI, contentObserver.getUri()); - - HandlerThread ht = new HandlerThread(getClass().getName()); - ht.start(); - Looper looper = ht.getLooper(); - Handler handler = new Handler(looper); - final long timeout = 1000L; - - contentObserver = new MyContentObserverWithUri(handler); - assertFalse(contentObserver.hasChanged()); - assertFalse(contentObserver.getSelfChangeState()); - contentObserver.dispatchChange(true, CONTENT_URI); - assertTrue(contentObserver.hasChanged(timeout)); - assertTrue(contentObserver.getSelfChangeState()); - assertEquals(CONTENT_URI, contentObserver.getUri()); - - contentObserver.resetStatus(); - contentObserver.setSelfChangeState(true); - assertFalse(contentObserver.hasChanged()); - assertTrue(contentObserver.getSelfChangeState()); - contentObserver.dispatchChange(false, CONTENT_URI); - assertTrue(contentObserver.hasChanged(timeout)); - assertFalse(contentObserver.getSelfChangeState()); - assertEquals(CONTENT_URI, contentObserver.getUri()); - - looper.quit(); - } - - public void testDeliverSelfNotifications() { - MyContentObserver contentObserver = new MyContentObserver(null); - assertFalse(contentObserver.deliverSelfNotifications()); - } - - private static class MyContentObserver extends ContentObserver { - private boolean mHasChanged; - private boolean mSelfChange; - - public MyContentObserver(Handler handler) { - super(handler); - } - - @Override - public void onChange(boolean selfChange) { - super.onChange(selfChange); - synchronized (this) { - mHasChanged = true; - mSelfChange = selfChange; - notifyAll(); - } - } - - protected synchronized boolean hasChanged(long timeout) throws InterruptedException { - if (!mHasChanged) { - wait(timeout); - } - return mHasChanged; - } - - protected boolean hasChanged() { - return mHasChanged; - } - - protected void resetStatus() { - mHasChanged = false; - mSelfChange = false; - } - - protected boolean getSelfChangeState() { - return mSelfChange; - } - - protected void setSelfChangeState(boolean state) { - mSelfChange = state; - } - } - - private static class MyContentObserverWithUri extends ContentObserver { - private boolean mHasChanged; - private boolean mSelfChange; - private Uri mUri; - - public MyContentObserverWithUri(Handler handler) { - super(handler); - } - - @Override - public void onChange(boolean selfChange, Uri uri) { - super.onChange(selfChange, uri); - synchronized (this) { - mHasChanged = true; - mSelfChange = selfChange; - mUri = uri; - notifyAll(); - } - } - - protected synchronized boolean hasChanged(long timeout) throws InterruptedException { - if (!mHasChanged) { - wait(timeout); - } - return mHasChanged; - } - - protected boolean hasChanged() { - return mHasChanged; - } - - protected void resetStatus() { - mHasChanged = false; - mSelfChange = false; - mUri = null; - } - - protected boolean getSelfChangeState() { - return mSelfChange; - } - - protected void setSelfChangeState(boolean state) { - mSelfChange = state; - } - - protected Uri getUri() { - return mUri; - } - } -} diff --git a/proprietary/frameworks/base/tests/database/src/android/database/cts/CursorIndexOutOfBoundsExceptionTest.java b/proprietary/frameworks/base/tests/database/src/android/database/cts/CursorIndexOutOfBoundsExceptionTest.java deleted file mode 100755 index f84d967b28cb5459b16468f4d2384323dbfdcc71..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/database/src/android/database/cts/CursorIndexOutOfBoundsExceptionTest.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.database.cts; - -import android.database.CursorIndexOutOfBoundsException; -import android.test.AndroidTestCase; - -public class CursorIndexOutOfBoundsExceptionTest extends AndroidTestCase { - - public void testConstructors() { - int INDEX = 100; - int SIZE = 99; - String expected1 = "Expected exception message"; - String expected2 = "Index " + INDEX + " requested, with a size of " + SIZE; - // Test CursorIndexOutOfBoundsException(String) - try { - throw new CursorIndexOutOfBoundsException(null); - } catch (CursorIndexOutOfBoundsException e) { - assertNull(e.getMessage()); - } - - try { - throw new CursorIndexOutOfBoundsException(expected1); - } catch (CursorIndexOutOfBoundsException e) { - assertEquals(expected1, e.getMessage()); - } - - // Test CursorIndexOutOfBoundsException(int, int) - try { - throw new CursorIndexOutOfBoundsException(INDEX, SIZE); - } catch (CursorIndexOutOfBoundsException e) { - assertEquals(expected2, e.getMessage()); - } - } -} diff --git a/proprietary/frameworks/base/tests/database/src/android/database/cts/CursorJoinerTest.java b/proprietary/frameworks/base/tests/database/src/android/database/cts/CursorJoinerTest.java deleted file mode 100755 index 48315882256e64c10102873b42c65a167a45bff7..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/database/src/android/database/cts/CursorJoinerTest.java +++ /dev/null @@ -1,250 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.database.cts; - - -import android.content.Context; -import android.database.Cursor; -import android.database.CursorJoiner; -import android.database.CursorJoiner.Result; -import android.database.sqlite.SQLiteDatabase; -import android.test.AndroidTestCase; - -import java.io.File; - -public class CursorJoinerTest extends AndroidTestCase { - - private static final int TEST_ITEM_COUNT = 10; - private static final int DEFAULT_TABLE1_VALUE_BEGINS = 1; - private static final int DEFAULT_TABLE2_VALUE_BEGINS = 11; - private static final int EQUAL_START = 18; - // Every table has 7 unique numbers, and 3 other numbers they all have. - private static final int UNIQUE_COUNT = 7; - private static final int MAX_VALUE = 20; - private static final int EQUAL_VALUE_COUNT = MAX_VALUE - EQUAL_START + 1; - private static final String TABLE_NAME_1 = "test1"; - private static final String TABLE_NAME_2 = "test2"; - private static final String TABLE1_COLUMNS = " number TEXT"; - private static final String TABLE2_COLUMNS = " number TEXT, int_number INTEGER"; - - private SQLiteDatabase mDatabase; - private File mDatabaseFile; - - @Override - protected void setUp() throws Exception { - super.setUp(); - setupDatabase(); - } - - @Override - protected void tearDown() throws Exception { - mDatabase.close(); - mDatabaseFile.delete(); - super.tearDown(); - } - - public void testCursorJoinerAndIterator() { - Cursor cursor1 = getCursor(TABLE_NAME_1, null, null); - Cursor cursor2 = getCursor(TABLE_NAME_2, null, null); - // Test with different length ColumenNAmes - try { - new CursorJoiner(cursor1, cursor1.getColumnNames(), cursor2, cursor2.getColumnNames()); - fail("CursorJoiner's constructor should throws IllegalArgumentException here."); - } catch (IllegalArgumentException e) { - //expected - } - closeCursor(cursor1); - closeCursor(cursor2); - - String[] columnNames = new String[] { "number" }; - cursor1 = getCursor(TABLE_NAME_1, null, columnNames); - cursor2 = getCursor(TABLE_NAME_2, null, columnNames); - - CursorJoiner cursorJoiner = new CursorJoiner(cursor1, cursor1.getColumnNames(), cursor2, - cursor2.getColumnNames()); - - // Test remove() - try { - cursorJoiner.remove(); - fail("remove() should throws UnsupportedOperationException here"); - } catch (UnsupportedOperationException e) { - // expected - } - - assertEquals(TEST_ITEM_COUNT, cursor1.getCount()); - assertEquals(TEST_ITEM_COUNT, cursor2.getCount()); - - // Test iterator - for (CursorJoiner.Result joinResult : cursorJoiner) { - switch (joinResult) { - case LEFT: - // Add the values into table test1 which table test1 possess and table test2 don't. - assertTrue(cursor1.getString(0).compareTo(cursor2.getString(0)) < 0); - addValueIntoTable(TABLE_NAME_2, cursor1.getString(0)); - break; - case RIGHT: - // Add the values into table test2 which table test2 possess and table test1 don't. - assertTrue(cursor1.getString(0).compareTo(cursor2.getString(0)) > 0); - addValueIntoTable(TABLE_NAME_1, cursor2.getString(0)); - break; - case BOTH: - // Delete the values table test1 and test2 both possess. - assertEquals(cursor1.getString(0), cursor2.getString(0)); - deleteValueFromTable(TABLE_NAME_1, cursor1.getString(0)); - deleteValueFromTable(TABLE_NAME_2, cursor2.getString(0)); - break; - } - } - cursor1.requery(); - cursor2.requery(); - - // Finally, two tables's number columns have the same contents - assertEquals(UNIQUE_COUNT * 2, cursor1.getCount()); - assertEquals(UNIQUE_COUNT * 2, cursor2.getCount()); - - // For every table, merged with the other one's unique numbers, and deleted the originally - // mutual same numbers(EQUAL_START~MAX_VALUE); - cursor1.moveToFirst(); - cursor2.moveToFirst(); - for (int i = 0; i < UNIQUE_COUNT; i++) { - assertEquals(getOrderNumberString(DEFAULT_TABLE1_VALUE_BEGINS + i, MAX_VALUE), - cursor1.getString(0)); - assertEquals(cursor1.getString(0), cursor2.getString(0)); - cursor1.moveToNext(); - cursor2.moveToNext(); - } - closeCursor(cursor2); - closeCursor(cursor1); - } - - public void testNext() { - String[] columnNames = new String[] { "number" }; - Cursor cursor1 = getCursor(TABLE_NAME_1, null, columnNames); - Cursor cursor2 = getCursor(TABLE_NAME_2, null, columnNames); - - // For cursor1 , values are '01'~'07' and 'EQUAL_START'~'MAX_VALUE' - assertEquals(TEST_ITEM_COUNT, cursor1.getCount()); - // For cursor2 , values are '11'~'17' and 'EQUAL_START'~'MAX_VALUE' - assertEquals(TEST_ITEM_COUNT, cursor2.getCount()); - CursorJoiner cursorJoiner = new CursorJoiner(cursor1, cursor1.getColumnNames(), cursor2, - cursor2.getColumnNames()); - for (int i = 0; i < UNIQUE_COUNT; i++) { - // For cursor1, value 1~7 result value as LEFT to cursor2 value '11' - assertTrue(cursorJoiner.hasNext()); - assertEquals(Result.LEFT, cursorJoiner.next()); - assertEquals(getOrderNumberString(DEFAULT_TABLE1_VALUE_BEGINS + i, MAX_VALUE), cursor1 - .getString(0)); - assertEquals(getOrderNumberString(DEFAULT_TABLE2_VALUE_BEGINS, MAX_VALUE), cursor2 - .getString(0)); - } - for (int i = 0; i < UNIQUE_COUNT; i++) { - // For cursor2, value 11~17 result a value as LEFT to cursor1 value '18' - assertTrue(cursorJoiner.hasNext()); - assertEquals(Result.RIGHT, cursorJoiner.next()); - assertEquals(getOrderNumberString(EQUAL_START, MAX_VALUE), cursor1.getString(0)); - assertEquals(getOrderNumberString(DEFAULT_TABLE2_VALUE_BEGINS + i, MAX_VALUE), cursor2 - .getString(0)); - } - for (int i = 0; i < EQUAL_VALUE_COUNT; i++) { - // For cursor1 and cursor2, value 18~20 result a value as BOTH - assertTrue(cursorJoiner.hasNext()); - assertEquals(Result.BOTH, cursorJoiner.next()); - assertEquals(getOrderNumberString(EQUAL_START + i, MAX_VALUE), cursor1.getString(0)); - assertEquals(getOrderNumberString(EQUAL_START + i, MAX_VALUE), cursor2.getString(0)); - } - closeCursor(cursor1); - closeCursor(cursor2); - } - - /** - * This function accepts integer maxValue to determine max length of number. - * Return a converted decimal number string of input integer parameter 'value', - * according to the max length, '0' will be placeholder(s). - * For example: if max length is 2, 1 -> '01', 10 -> '10'. - * @param value - * @param maxValue - * @return - */ - private String getOrderNumberString(int value, int maxValue) { - // Convert decimal number as string, '0' as placeholder - int maxLength = Integer.toString(maxValue).length(); - int basicLength = Integer.toString(value).length(); - String placeHolders = ""; - for (int i = 0; i < (maxLength - basicLength); i++) { - placeHolders += "0"; - } - return placeHolders + Integer.toString(value); - } - - private void initializeTables() { - // Add 1 to 7 into Table1 - addValuesIntoTable(TABLE_NAME_1, DEFAULT_TABLE1_VALUE_BEGINS, - DEFAULT_TABLE1_VALUE_BEGINS + UNIQUE_COUNT - 1); - // Add 18 to 20 into Table1 - addValuesIntoTable(TABLE_NAME_1, DEFAULT_TABLE2_VALUE_BEGINS + UNIQUE_COUNT, MAX_VALUE); - // Add 11 to 17 into Table2 - addValuesIntoTable(TABLE_NAME_2, DEFAULT_TABLE2_VALUE_BEGINS, - DEFAULT_TABLE2_VALUE_BEGINS + UNIQUE_COUNT - 1); - // Add 18 to 20 into Table2 - addValuesIntoTable(TABLE_NAME_2, DEFAULT_TABLE2_VALUE_BEGINS + UNIQUE_COUNT, MAX_VALUE); - } - - private void setupDatabase() { - File dbDir = getContext().getDir("tests", Context.MODE_PRIVATE); - mDatabaseFile = new File(dbDir, "database_test.db"); - if (mDatabaseFile.exists()) { - mDatabaseFile.delete(); - } - mDatabase = SQLiteDatabase.openOrCreateDatabase(mDatabaseFile.getPath(), null); - assertNotNull(mDatabaseFile); - createTable(TABLE_NAME_1, TABLE1_COLUMNS); - createTable(TABLE_NAME_2, TABLE2_COLUMNS); - initializeTables(); - } - - private void closeCursor(Cursor cursor) { - if (null != cursor) { - cursor.close(); - cursor = null; - } - } - - private void createTable(String tableName, String columnNames) { - String sql = "Create TABLE " + tableName + " (_id INTEGER PRIMARY KEY, " + columnNames - + " );"; - mDatabase.execSQL(sql); - } - - private void addValuesIntoTable(String tableName, int start, int end) { - for (int i = start; i <= end; i++) { - mDatabase.execSQL("INSERT INTO " + tableName + "(number) VALUES ('" - + getOrderNumberString(i, MAX_VALUE) + "');"); - } - } - - private void addValueIntoTable(String tableName, String value) { - mDatabase.execSQL("INSERT INTO " + tableName + "(number) VALUES ('" + value + "');"); - } - - private void deleteValueFromTable(String tableName, String value) { - mDatabase.execSQL("DELETE FROM " + tableName + " WHERE number = '" + value + "';"); - } - - private Cursor getCursor(String tableName, String selection, String[] columnNames) { - return mDatabase.query(tableName, columnNames, selection, null, null, null, "number"); - } -} diff --git a/proprietary/frameworks/base/tests/database/src/android/database/cts/CursorWindowTest.java b/proprietary/frameworks/base/tests/database/src/android/database/cts/CursorWindowTest.java deleted file mode 100755 index 65ce3fd950a7f51e3f753ebd11aae1bcc4a99017..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/database/src/android/database/cts/CursorWindowTest.java +++ /dev/null @@ -1,434 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.database.cts; - -import android.database.CharArrayBuffer; -import android.database.CursorWindow; -import android.database.MatrixCursor; -import android.database.sqlite.SQLiteException; -import android.os.Parcel; -import android.test.AndroidTestCase; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Random; - -public class CursorWindowTest extends AndroidTestCase { - - private static final String TEST_STRING = "Test String"; - - public void testWriteCursorToWindow() throws Exception { - // create cursor - String[] colNames = new String[]{"_id", "name", "number", "profit"}; - int colsize = colNames.length; - ArrayList> list = createTestList(10, colsize); - MatrixCursor cursor = new MatrixCursor(colNames, list.size()); - for (ArrayList row : list) { - cursor.addRow(row); - } - - // fill window - CursorWindow window = new CursorWindow(false); - cursor.fillWindow(0, window); - - // read from cursor window - for (int i = 0; i < list.size(); i++) { - ArrayList col = list.get(i); - for (int j = 0; j < colsize; j++) { - String s = window.getString(i, j); - int r2 = col.get(j); - int r1 = Integer.parseInt(s); - assertEquals(r2, r1); - } - } - - // test cursor window handle startpos != 0 - window.clear(); - cursor.fillWindow(1, window); - // read from cursor from window - for (int i = 1; i < list.size(); i++) { - ArrayList col = list.get(i); - for (int j = 0; j < colsize; j++) { - String s = window.getString(i, j); - int r2 = col.get(j); - int r1 = Integer.parseInt(s); - assertEquals(r2, r1); - } - } - - // Clear the window and make sure it's empty - window.clear(); - assertEquals(0, window.getNumRows()); - } - - public void testNull() { - CursorWindow window = getOneByOneWindow(); - - // Put in a null value and read it back as various types - assertTrue(window.putNull(0, 0)); - assertNull(window.getString(0, 0)); - assertEquals(0, window.getLong(0, 0)); - assertEquals(0.0, window.getDouble(0, 0)); - assertNull(window.getBlob(0, 0)); - } - - public void testEmptyString() { - CursorWindow window = getOneByOneWindow(); - - // put size 0 string and read it back as various types - assertTrue(window.putString("", 0, 0)); - assertEquals("", window.getString(0, 0)); - assertEquals(0, window.getLong(0, 0)); - assertEquals(0.0, window.getDouble(0, 0)); - } - - public void testConstructors() { - int TEST_NUMBER = 5; - CursorWindow cursorWindow; - - // Test constructor with 'true' input, and getStartPosition should return 0 - cursorWindow = new CursorWindow(true); - assertEquals(0, cursorWindow.getStartPosition()); - - // Test constructor with 'false' input - cursorWindow = new CursorWindow(false); - assertEquals(0, cursorWindow.getStartPosition()); - - // Test newFromParcel - Parcel parcel = Parcel.obtain(); - cursorWindow = new CursorWindow(true); - cursorWindow.setStartPosition(TEST_NUMBER); - cursorWindow.setNumColumns(1); - cursorWindow.allocRow(); - cursorWindow.putString(TEST_STRING, TEST_NUMBER, 0); - cursorWindow.writeToParcel(parcel, 0); - - parcel.setDataPosition(0); - cursorWindow = CursorWindow.CREATOR.createFromParcel(parcel); - assertEquals(TEST_NUMBER, cursorWindow.getStartPosition()); - assertEquals(TEST_STRING, cursorWindow.getString(TEST_NUMBER, 0)); - } - - public void testDataStructureOperations() { - CursorWindow cursorWindow = new CursorWindow(true); - - // Test with normal values - assertTrue(cursorWindow.setNumColumns(0)); - // If the column has been set to zero, can't put String. - assertFalse(cursorWindow.putString(TEST_STRING, 0, 0)); - - // Test allocRow(). - assertTrue(cursorWindow.allocRow()); - assertEquals(1, cursorWindow.getNumRows()); - assertTrue(cursorWindow.allocRow()); - assertEquals(2, cursorWindow.getNumRows()); - // Though allocate a row, but the column number is still 0, so can't putString. - assertFalse(cursorWindow.putString(TEST_STRING, 0, 0)); - - // Test freeLstRow - cursorWindow.freeLastRow(); - assertEquals(1, cursorWindow.getNumRows()); - cursorWindow.freeLastRow(); - assertEquals(0, cursorWindow.getNumRows()); - - cursorWindow = new CursorWindow(true); - assertTrue(cursorWindow.setNumColumns(6)); - assertTrue(cursorWindow.allocRow()); - // Column number set to negative number, so now can put values. - assertTrue(cursorWindow.putString(TEST_STRING, 0, 0)); - assertEquals(TEST_STRING, cursorWindow.getString(0, 0)); - - // Test with negative value - assertFalse(cursorWindow.setNumColumns(-1)); - - // Test with reference limitation - cursorWindow.releaseReference(); - try { - cursorWindow.setNumColumns(5); - fail("setNumColumns() should throws IllegalStateException here."); - } catch (IllegalStateException e) { - // expected - } - - // Test close(), close will also minus references, that will lead acquireReference() - // related operation failed. - cursorWindow.close(); - try { - cursorWindow.acquireReference(); - fail("setNumColumns() should throws IllegalStateException here."); - } catch (IllegalStateException e) { - // expected - } - } - - public void testAccessDataValues() { - final long NUMBER_LONG_INTEGER = (long) 0xaabbccddffL; - final long NUMBER_INTEGER = (int) NUMBER_LONG_INTEGER; - final long NUMBER_SHORT = (short) NUMBER_INTEGER; - final float NUMBER_FLOAT_SCIENCE = 7.332952E11f; - final double NUMBER_DOUBLE_SCIENCE = 7.33295205887E11; - final String NUMBER_FLOAT_SCIENCE_STRING = "7.332952E11"; - final String NUMBER_DOUBLE_SCIENCE_STRING = "7.33295205887E11"; - final String NUMBER_FLOAT_SCIENCE_STRING2 = "7.33295e+11"; - - byte[] originalBlob = new byte[Byte.MAX_VALUE]; - for (int i = 0; i < Byte.MAX_VALUE; i++) { - originalBlob[i] = (byte) i; - } - - CursorWindow cursorWindow = new CursorWindow(true); - cursorWindow.setNumColumns(5); - cursorWindow.allocRow(); - - // Test putString, getString, getLong, getInt, isBlob - assertTrue(cursorWindow.putString(Long.toString(NUMBER_LONG_INTEGER), 0, 0)); - assertEquals(Long.toString(NUMBER_LONG_INTEGER), cursorWindow.getString(0, 0)); - assertEquals(NUMBER_LONG_INTEGER, cursorWindow.getLong(0, 0)); - assertEquals(NUMBER_INTEGER, cursorWindow.getInt(0, 0)); - assertEquals(NUMBER_SHORT, cursorWindow.getShort(0, 0)); - // Converting of Float, there would be some little precision differences. So just compare - // first 6 digits. - assertEquals(NUMBER_FLOAT_SCIENCE_STRING.substring(0, 6), Float.toString( - cursorWindow.getFloat(0, 0)).substring(0, 6)); - assertEquals(NUMBER_DOUBLE_SCIENCE_STRING, Double.toString(cursorWindow.getDouble(0, 0))); - assertFalse(cursorWindow.isNull(0, 0)); - assertFalse(cursorWindow.isBlob(0, 0)); - - // Test null String - assertTrue(cursorWindow.putString("", 0, 0)); - assertEquals("", cursorWindow.getString(0, 0)); - assertEquals(0, cursorWindow.getLong(0, 0)); - assertEquals(0, cursorWindow.getInt(0, 0)); - assertEquals(0, cursorWindow.getShort(0, 0)); - assertEquals(0.0, cursorWindow.getDouble(0, 0)); - assertEquals(0.0f, cursorWindow.getFloat(0, 0), 0.00000001f); - assertFalse(cursorWindow.isNull(0, 0)); - assertFalse(cursorWindow.isBlob(0, 0)); - - // Test putNull, getString, getLong, getDouble, getBlob, getInd, getShort, getFloat, - // isBlob. - assertTrue(cursorWindow.putNull(0, 1)); - assertNull(cursorWindow.getString(0, 1)); - assertEquals(0, cursorWindow.getLong(0, 1)); - assertEquals(0, cursorWindow.getInt(0, 1)); - assertEquals(0, cursorWindow.getShort(0, 1)); - assertEquals(0.0, cursorWindow.getDouble(0, 1)); - assertEquals(0.0f, cursorWindow.getFloat(0, 1), 0.00000001f); - assertNull(cursorWindow.getBlob(0, 1)); - assertTrue(cursorWindow.isNull(0, 1)); - // If the field is null, isBlob will return true. - assertTrue(cursorWindow.isBlob(0, 1)); - - // Test putLong, getLong, getInt, getString , getShort, getFloat, getDouble, isBlob. - assertTrue(cursorWindow.putLong(NUMBER_LONG_INTEGER, 0, 2)); - assertEquals(NUMBER_LONG_INTEGER, cursorWindow.getLong(0, 2)); - assertEquals(NUMBER_INTEGER, cursorWindow.getInt(0, 2)); - assertEquals(Long.toString(NUMBER_LONG_INTEGER), cursorWindow.getString(0, 2)); - assertEquals(NUMBER_SHORT, cursorWindow.getShort(0, 2)); - assertEquals(NUMBER_FLOAT_SCIENCE, cursorWindow.getFloat(0, 2), 0.00000001f); - assertEquals(NUMBER_DOUBLE_SCIENCE, cursorWindow.getDouble(0, 2), 0.00000001); - try { - cursorWindow.getBlob(0, 2); - fail("Can't get Blob from a Integer value."); - } catch (SQLiteException e) { - // expected - } - assertFalse(cursorWindow.isNull(0, 2)); - assertFalse(cursorWindow.isBlob(0, 2)); - - // Test putDouble - assertTrue(cursorWindow.putDouble(NUMBER_DOUBLE_SCIENCE, 0, 3)); - assertEquals(NUMBER_LONG_INTEGER, cursorWindow.getLong(0, 3)); - assertEquals(NUMBER_INTEGER, cursorWindow.getInt(0, 3)); - // Converting from Double to String, there would be some little precision differences. So - // Just compare first 6 digits. - assertEquals(NUMBER_FLOAT_SCIENCE_STRING2.substring(0, 6), cursorWindow.getString(0, 3) - .substring(0, 6)); - assertEquals(NUMBER_SHORT, cursorWindow.getShort(0, 3)); - assertEquals(NUMBER_FLOAT_SCIENCE, cursorWindow.getFloat(0, 3), 0.00000001f); - assertEquals(NUMBER_DOUBLE_SCIENCE, cursorWindow.getDouble(0, 3), 0.00000001); - try { - cursorWindow.getBlob(0, 3); - fail("Can't get Blob from a Double value."); - } catch (SQLiteException e) { - // expected - } - assertFalse(cursorWindow.isNull(0, 3)); - assertFalse(cursorWindow.isBlob(0, 3)); - - // Test putBlob - assertTrue(cursorWindow.putBlob(originalBlob, 0, 4)); - byte[] targetBlob = cursorWindow.getBlob(0, 4); - assertTrue(Arrays.equals(originalBlob, targetBlob)); - assertFalse(cursorWindow.isNull(0, 4)); - // Test isBlob - assertTrue(cursorWindow.isBlob(0, 4)); - } - - public void testCopyStringToBuffer() { - int DEFAULT_ARRAY_LENGTH = 64; - String baseString = "0123456789"; - String expectedString = ""; - // Create a 60 characters string. - for (int i = 0; i < 6; i++) { - expectedString += baseString; - } - CharArrayBuffer charArrayBuffer = new CharArrayBuffer(null); - CursorWindow cursorWindow = new CursorWindow(true); - cursorWindow.setNumColumns(2); - cursorWindow.allocRow(); - - assertEquals(null, charArrayBuffer.data); - cursorWindow.putString(expectedString, 0, 0); - cursorWindow.copyStringToBuffer(0, 0, charArrayBuffer); - assertNotNull(charArrayBuffer.data); - // By default, if the field's string is shorter than 64, array will be allocated as 64. - assertEquals(DEFAULT_ARRAY_LENGTH, charArrayBuffer.data.length); - assertEquals(expectedString, - new String(charArrayBuffer.data, 0, charArrayBuffer.sizeCopied)); - - // Test in case of string is longer than 64, - expectedString += baseString; - charArrayBuffer = new CharArrayBuffer(null); - cursorWindow.putString(expectedString, 0, 1); - cursorWindow.copyStringToBuffer(0, 1, charArrayBuffer); - assertNotNull(charArrayBuffer.data); - // If the string is longer than 64, array will be allocated as needed(longer than 64). - assertEquals(expectedString, - new String(charArrayBuffer.data, 0, charArrayBuffer.sizeCopied)); - assertEquals(70, expectedString.length()); - assertEquals(expectedString.length(), charArrayBuffer.data.length); - } - - public void testAccessStartPosition() { - final int TEST_POSITION_1 = 0; - final int TEST_POSITION_2 = 3; - - CursorWindow cursorWindow = new CursorWindow(true); - fillCursorTestContents(cursorWindow, 5); - - // Test setStartPosition - assertEquals(TEST_POSITION_1, cursorWindow.getStartPosition()); - assertEquals(3, cursorWindow.getInt(3, 0)); - assertEquals(TEST_STRING + "3", cursorWindow.getString(3, 1)); - assertEquals(4, cursorWindow.getInt(4, 0)); - assertEquals(TEST_STRING + "4", cursorWindow.getString(4, 1)); - cursorWindow.setStartPosition(TEST_POSITION_2); - - assertEquals(TEST_POSITION_2, cursorWindow.getStartPosition()); - - assertEquals(0, cursorWindow.getInt(3, 0)); - assertEquals(TEST_STRING + "0", cursorWindow.getString(3, 1)); - assertEquals(1, cursorWindow.getInt(4, 0)); - assertEquals(TEST_STRING + "1", cursorWindow.getString(4, 1)); - try { - cursorWindow.getBlob(0, 0); - fail("Row number is smaller than startPosition, will cause a IllegalStateException."); - } catch (IllegalStateException e) { - // expected - } - } - - public void testClearAndOnAllReferencesReleased() { - MockCursorWindow cursorWindow = new MockCursorWindow(true); - - assertEquals(0, cursorWindow.getNumRows()); - fillCursorTestContents(cursorWindow, 10); - assertEquals(10, cursorWindow.getNumRows()); - assertEquals(0, cursorWindow.getStartPosition()); - cursorWindow.setStartPosition(5); - assertEquals(5, cursorWindow.getStartPosition()); - - // Test clear(). a complete calling process of cursorWindow has a perfect acquiring and - // releasing pair, so the references number will be equal at the begin and the end. - assertFalse(cursorWindow.hasReleasedAllReferences()); - cursorWindow.clear(); - assertEquals(0, cursorWindow.getNumRows()); - assertEquals(0, cursorWindow.getStartPosition()); - assertFalse(cursorWindow.hasReleasedAllReferences()); - - // Test onAllReferencesReleased. - // By default, cursorWindow's reference is 1, when it reachs 0, onAllReferencesReleased - // be invoked. - cursorWindow = new MockCursorWindow(true); - cursorWindow.releaseReference(); - assertTrue(cursorWindow.hasReleasedAllReferences()); - } - - public void testDescribeContents() { - CursorWindow cursorWindow = new CursorWindow(true); - assertEquals(0, cursorWindow.describeContents()); - } - - private class MockCursorWindow extends CursorWindow { - private boolean mHasReleasedAllReferences = false; - - public MockCursorWindow(boolean localWindow) { - super(localWindow); - } - - @Override - protected void onAllReferencesReleased() { - super.onAllReferencesReleased(); - mHasReleasedAllReferences = true; - } - - public boolean hasReleasedAllReferences() { - return mHasReleasedAllReferences; - } - - public void resetStatus() { - mHasReleasedAllReferences = false; - } - } - - private void fillCursorTestContents(CursorWindow cursorWindow, int length) { - cursorWindow.clear(); - cursorWindow.setStartPosition(0); - cursorWindow.setNumColumns(2); - for (int i = 0; i < length; i++) { - cursorWindow.allocRow(); - cursorWindow.putLong(i, i, 0); - cursorWindow.putString(TEST_STRING + i, i, 1); - } - } - - private static ArrayList> createTestList(int rows, int cols) { - ArrayList> list = new ArrayList>(); - Random generator = new Random(); - - for (int i = 0; i < rows; i++) { - ArrayList col = new ArrayList(); - list.add(col); - for (int j = 0; j < cols; j++) { - // generate random number - col.add(j == 0 ? i : generator.nextInt()); - } - } - return list; - } - - /** - * The method comes from unit_test CursorWindowTest. - */ - private CursorWindow getOneByOneWindow() { - CursorWindow window = new CursorWindow(false); - assertTrue(window.setNumColumns(1)); - assertTrue(window.allocRow()); - return window; - } -} diff --git a/proprietary/frameworks/base/tests/database/src/android/database/cts/CursorWrapperTest.java b/proprietary/frameworks/base/tests/database/src/android/database/cts/CursorWrapperTest.java deleted file mode 100755 index 7cf7cc0ae558bd4c854b95d257eb89d7aea62f59..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/database/src/android/database/cts/CursorWrapperTest.java +++ /dev/null @@ -1,527 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.database.cts; - - -import android.content.Context; -import android.database.CharArrayBuffer; -import android.database.ContentObserver; -import android.database.Cursor; -import android.database.CursorWrapper; -import android.database.DataSetObserver; -import android.database.StaleDataException; -import android.database.sqlite.SQLiteDatabase; -import android.os.Bundle; -import android.os.Handler; -import android.test.AndroidTestCase; - -import java.io.File; -import java.util.Arrays; - -public class CursorWrapperTest extends AndroidTestCase { - - private static final String FIRST_NUMBER = "123"; - private static final String SECOND_NUMBER = "5555"; - private static final int TESTVALUE1 = 199; - private static final int TESTVALUE2 = 200; - private static final String[] NUMBER_PROJECTION = new String[] { - "_id", // 0 - "number" // 1 - }; - private static final int DEFAULT_RECORD_COUNT = 2; - private static final int DEFAULT_COLUMN_COUNT = 2; - - private SQLiteDatabase mDatabase; - private File mDatabaseFile; - private Cursor mCursor; - - private static final int CURRENT_DATABASE_VERSION = 42; - - @Override - protected void setUp() throws Exception { - super.setUp(); - setupDatabase(); - } - - @Override - protected void tearDown() throws Exception { - closeDatabase(); - super.tearDown(); - } - - public void testConstrucotorAndClose() { - CursorWrapper cursorWrapper = new CursorWrapper(getCursor()); - - assertTrue(cursorWrapper.requery()); - cursorWrapper.deactivate(); - cursorWrapper.move(1); - assertEquals(DEFAULT_RECORD_COUNT, cursorWrapper.getCount()); - - assertFalse(cursorWrapper.isClosed()); - assertTrue(cursorWrapper.requery()); - cursorWrapper.close(); - assertTrue(cursorWrapper.isClosed()); - assertFalse(cursorWrapper.requery()); - } - - private Cursor getCursor() { - Cursor cursor = mDatabase.query("test1", NUMBER_PROJECTION, null, null, null, null, null); - return cursor; - } - - public void testGetCount() { - CursorWrapper cursorWrapper = new CursorWrapper(getCursor()); - int defaultCount = cursorWrapper.getCount(); - - // Add two records into the table. - addWithValue(mDatabase, TESTVALUE1); - int expected = defaultCount + 1; - assertTrue(cursorWrapper.requery()); - assertEquals(expected, cursorWrapper.getCount()); - addWithValue(mDatabase, TESTVALUE2); - expected += 1; - assertTrue(cursorWrapper.requery()); - assertEquals(expected, cursorWrapper.getCount()); - - // Delete previous two records which have been added just now. - deleteWithValue(mDatabase, TESTVALUE1); - assertTrue(cursorWrapper.requery()); - assertEquals(defaultCount + 1, cursorWrapper.getCount()); - deleteWithValue(mDatabase, TESTVALUE2); - assertTrue(cursorWrapper.requery()); - assertEquals(defaultCount, cursorWrapper.getCount()); - - // Continue to delete all the records - deleteAllRecords(mDatabase); - assertTrue(cursorWrapper.requery()); - assertEquals(0, cursorWrapper.getCount()); - - cursorWrapper.close(); - assertFalse(cursorWrapper.requery()); - - // Restore original database status - rebuildDatabase(); - } - - public void testDeactivate() throws IllegalStateException { - CursorWrapper cursorWrapper = new CursorWrapper(getCursor()); - MockObserver observer = new MockObserver(); - - // one DataSetObserver can't unregistered before it had been registered. - try { - cursorWrapper.unregisterDataSetObserver(observer); - fail("testUnregisterDataSetObserver failed"); - } catch (IllegalStateException e) { - } - - // Before registering, observer can't be notified. - assertFalse(observer.hasInvalidated()); - cursorWrapper.moveToLast(); - cursorWrapper.deactivate(); - assertFalse(observer.hasInvalidated()); - - // Test with registering DataSetObserver - assertTrue(cursorWrapper.requery()); - cursorWrapper.registerDataSetObserver(observer); - assertFalse(observer.hasInvalidated()); - cursorWrapper.moveToLast(); - assertEquals(Integer.parseInt(SECOND_NUMBER), cursorWrapper.getInt(1)); - cursorWrapper.deactivate(); - // deactivate method can invoke invalidate() method, can be observed by DataSetObserver. - assertTrue(observer.hasInvalidated()); - // After deactivating, the cursor can not provide values from database record. - try { - cursorWrapper.getInt(1); - fail("After deactivating, cursor cannot execute getting value operations."); - } catch (StaleDataException e) { - } - - // Can't register a same observer twice before unregister it. - try { - cursorWrapper.registerDataSetObserver(observer); - fail("testRegisterDataSetObserver failed"); - } catch (IllegalStateException e) { - } - - // After runegistering, observer can't be notified. - cursorWrapper.unregisterDataSetObserver(observer); - observer.resetStatus(); - assertFalse(observer.hasInvalidated()); - cursorWrapper.moveToLast(); - cursorWrapper.deactivate(); - assertFalse(observer.hasInvalidated()); - - // one DataSetObserver can't be unregistered twice continuously. - try { - cursorWrapper.unregisterDataSetObserver(observer); - fail("testUnregisterDataSetObserver failed"); - } catch (IllegalStateException e) { - } - } - - public void testGettingColumnInfos() { - CursorWrapper cursorWrapper = new CursorWrapper(getCursor()); - - assertEquals(DEFAULT_COLUMN_COUNT, cursorWrapper.getColumnCount()); - - // Test getColumnIndex - assertEquals(0, cursorWrapper.getColumnIndex("_id")); - assertEquals(1, cursorWrapper.getColumnIndex("number")); - assertEquals(-1, cursorWrapper.getColumnIndex("NON_EXISTENCE")); - - // Test getColumnIndexOrThrow - assertEquals(0, cursorWrapper.getColumnIndexOrThrow("_id")); - assertEquals(1, cursorWrapper.getColumnIndexOrThrow("number")); - try { - cursorWrapper.getColumnIndexOrThrow("NON_EXISTENCE"); - fail("getColumnIndexOrThrow should throws IllegalArgumentException if the column" - + "does not exist"); - } catch (IllegalArgumentException e) { - } - - assertEquals("_id", cursorWrapper.getColumnName(0)); - assertEquals("number", cursorWrapper.getColumnName(1)); - - String[] columnNames = cursorWrapper.getColumnNames(); - assertEquals(DEFAULT_COLUMN_COUNT, cursorWrapper.getColumnCount()); - assertEquals("_id", columnNames[0]); - assertEquals("number", columnNames[1]); - cursorWrapper.close(); - } - - public void testPositioning() { - CursorWrapper cursorWrapper = new CursorWrapper(getCursor()); - - // There are totally 2 records. - // At first, the cursor is at beginning position: -1 - // Test isBeforeFirst, getPosition, isFirst - assertTrue(cursorWrapper.isBeforeFirst()); - assertEquals(-1, cursorWrapper.getPosition()); - assertFalse(cursorWrapper.isFirst()); - - // Test moveToNext - assertTrue(cursorWrapper.moveToNext()); - assertEquals(0, cursorWrapper.getPosition()); - assertTrue(cursorWrapper.isFirst()); - - // Test isLast - assertFalse(cursorWrapper.isLast()); - assertTrue(cursorWrapper.moveToNext()); - assertEquals(1, cursorWrapper.getPosition()); - assertTrue(cursorWrapper.isLast()); - - // move to the end - // Test isLast and isAfterLast - assertFalse(cursorWrapper.moveToNext()); - assertFalse(cursorWrapper.isLast()); - assertTrue(cursorWrapper.isAfterLast()); - assertEquals(2, cursorWrapper.getPosition()); - - // Test move(int) - assertTrue(cursorWrapper.move(-1)); - assertEquals(1, cursorWrapper.getPosition()); - assertTrue(cursorWrapper.move(-1)); - assertEquals(0, cursorWrapper.getPosition()); - // While reach the edge, function will return false - assertFalse(cursorWrapper.move(-1)); - assertEquals(-1, cursorWrapper.getPosition()); - assertTrue(cursorWrapper.move(2)); - assertEquals(1, cursorWrapper.getPosition()); - // While reach the edge, function will return false - assertFalse(cursorWrapper.move(1)); - assertTrue(cursorWrapper.isAfterLast()); - - // Test moveToPrevious() - assertEquals(2, cursorWrapper.getPosition()); - assertTrue(cursorWrapper.moveToPrevious()); - assertEquals(1, cursorWrapper.getPosition()); - assertTrue(cursorWrapper.moveToPrevious()); - assertEquals(0, cursorWrapper.getPosition()); - // While reach the edge, function will return false - assertFalse(cursorWrapper.moveToPrevious()); - assertEquals(-1, cursorWrapper.getPosition()); - assertTrue(cursorWrapper.isBeforeFirst()); - - // Test moveToPosition - // While reach the edge, function will return false - assertFalse(cursorWrapper.moveToPosition(2)); - assertEquals(2, cursorWrapper.getPosition()); - // While reach the edge, function will return false - assertFalse(cursorWrapper.moveToPosition(-1)); - assertEquals(-1, cursorWrapper.getPosition()); - assertTrue(cursorWrapper.moveToPosition(1)); - assertEquals(1, cursorWrapper.getPosition()); - assertTrue(cursorWrapper.moveToPosition(0)); - assertEquals(0, cursorWrapper.getPosition()); - - // Test moveToFirst and moveToFirst - assertFalse(cursorWrapper.isLast()); - assertTrue(cursorWrapper.moveToLast()); - assertEquals(1, cursorWrapper.getPosition()); - assertTrue(cursorWrapper.isLast()); - assertFalse(cursorWrapper.isFirst()); - assertTrue(cursorWrapper.moveToFirst()); - assertEquals(0, cursorWrapper.getPosition()); - assertTrue(cursorWrapper.isFirst()); - cursorWrapper.close(); - } - - public void testGettingValues() { - final byte NUMBER_BLOB_UNIT = 99; - final String STRING_TEXT = "Test String"; - final String STRING_TEXT2 = "Test String2"; - final double NUMBER_DOUBLE = Double.MAX_VALUE; - final double NUMBER_FLOAT = (float) NUMBER_DOUBLE; - final long NUMBER_LONG_INTEGER = 0xaabbccddffL; - final long NUMBER_INTEGER = (int) NUMBER_LONG_INTEGER; - final long NUMBER_SHORT = (short) NUMBER_INTEGER; - - assertTrue(NUMBER_DOUBLE != NUMBER_FLOAT); - assertTrue(NUMBER_LONG_INTEGER != NUMBER_INTEGER); - assertTrue(NUMBER_LONG_INTEGER != (short) NUMBER_SHORT); - assertTrue(NUMBER_INTEGER != (int) NUMBER_SHORT); - - // create table - mDatabase.execSQL("CREATE TABLE test2 (_id INTEGER PRIMARY KEY, string_text TEXT," - + "double_number REAL, int_number INTEGER, blob_data BLOB);"); - // insert blob and other values - Object[] args = new Object[4]; - byte[] originalBlob = new byte[1000]; - Arrays.fill(originalBlob, NUMBER_BLOB_UNIT); - args[0] = STRING_TEXT; - args[1] = NUMBER_DOUBLE; - args[2] = NUMBER_LONG_INTEGER; - args[3] = originalBlob; - - // Insert record. - String sql = "INSERT INTO test2 (string_text, double_number, int_number, blob_data)" - + "VALUES (?,?,?,?)"; - mDatabase.execSQL(sql, args); - // use cursor to access blob - Cursor cursor = mDatabase.query("test2", null, null, null, null, null, null); - - // Test getColumnCount - CursorWrapper cursorWrapper = new CursorWrapper(getCursor()); - assertEquals(DEFAULT_COLUMN_COUNT, cursorWrapper.getColumnCount()); - cursorWrapper.close(); - cursorWrapper = new CursorWrapper(cursor); - assertEquals(5, cursorWrapper.getColumnCount()); - - cursorWrapper.moveToNext(); - int columnBlob = cursorWrapper.getColumnIndexOrThrow("blob_data"); - int columnString = cursorWrapper.getColumnIndexOrThrow("string_text"); - int columnDouble = cursorWrapper.getColumnIndexOrThrow("double_number"); - int columnInteger = cursorWrapper.getColumnIndexOrThrow("int_number"); - - // Test getting value methods. - byte[] targetBlob = cursorWrapper.getBlob(columnBlob); - assertTrue(Arrays.equals(originalBlob, targetBlob)); - - assertEquals(STRING_TEXT, cursorWrapper.getString(columnString)); - - assertEquals(NUMBER_DOUBLE, cursorWrapper.getDouble(columnDouble), 0.000000000001); - - assertEquals(NUMBER_FLOAT, cursorWrapper.getFloat(columnDouble), 0.000000000001f); - - assertEquals(NUMBER_LONG_INTEGER, cursorWrapper.getLong(columnInteger)); - - assertEquals(NUMBER_INTEGER, cursorWrapper.getInt(columnInteger)); - - assertEquals(NUMBER_SHORT, cursorWrapper.getShort(columnInteger)); - - // Test isNull(int). - assertFalse(cursorWrapper.isNull(columnBlob)); - sql = "INSERT INTO test2 (string_text) VALUES ('" + STRING_TEXT2 + "')"; - mDatabase.execSQL(sql); - cursorWrapper.close(); - cursor = mDatabase.query("test2", null, null, null, null, null, null); - cursorWrapper = new CursorWrapper(cursor); - cursorWrapper.moveToPosition(1); - assertTrue(cursorWrapper.isNull(columnBlob)); - - mDatabase.execSQL("DROP TABLE test2"); - } - - public void testGetExtras() { - CursorWrapper cursor = new CursorWrapper(getCursor()); - Bundle bundle = cursor.getExtras(); - assertSame(Bundle.EMPTY, bundle); - } - - public void testCopyStringToBuffer() { - CharArrayBuffer charArrayBuffer = new CharArrayBuffer(1000); - Cursor cursor = getCursor(); - - CursorWrapper cursorWrapper = new CursorWrapper(cursor); - cursorWrapper.moveToFirst(); - - assertEquals(0, charArrayBuffer.sizeCopied); - cursorWrapper.copyStringToBuffer(0, charArrayBuffer); - String string = new String(charArrayBuffer.data); - assertTrue(charArrayBuffer.sizeCopied > 0); - assertEquals("1", string.substring(0, charArrayBuffer.sizeCopied)); - - cursorWrapper.copyStringToBuffer(1, charArrayBuffer); - string = new String(charArrayBuffer.data); - assertTrue(charArrayBuffer.sizeCopied > 0); - assertEquals(FIRST_NUMBER, string.substring(0, charArrayBuffer.sizeCopied)); - - cursorWrapper.moveToNext(); - cursorWrapper.copyStringToBuffer(1, charArrayBuffer); - string = new String(charArrayBuffer.data); - assertTrue(charArrayBuffer.sizeCopied > 0); - assertEquals(SECOND_NUMBER, string.substring(0, charArrayBuffer.sizeCopied)); - cursorWrapper.close(); - } - - public void testRespond() { - Bundle b = new Bundle(); - CursorWrapper cursorWrapper = new CursorWrapper(getCursor()); - Bundle bundle = cursorWrapper.respond(b); - assertSame(Bundle.EMPTY, bundle); - cursorWrapper.close(); - } - - public void testGetWantsAllOnMoveCalls() { - CursorWrapper cursorWrapper = new CursorWrapper(getCursor()); - assertFalse(cursorWrapper.getWantsAllOnMoveCalls()); - cursorWrapper.close(); - } - - public void testContentObsererOperations() throws IllegalStateException { - CursorWrapper cursorWrapper = new CursorWrapper(getCursor()); - MockContentObserver observer = new MockContentObserver(null); - - // Can't unregister a Observer before it has been registered. - try { - cursorWrapper.unregisterContentObserver(observer); - fail("testUnregisterContentObserver failed"); - } catch (IllegalStateException e) { - assertTrue(true); - } - - cursorWrapper.registerContentObserver(observer); - - // Can't register a same observer twice before unregister it. - try { - cursorWrapper.registerContentObserver(observer); - fail("testRegisterContentObserver failed"); - } catch (IllegalStateException e) { - } - - cursorWrapper.unregisterContentObserver(observer); - // one Observer can be registered again after it has been unregistered. - cursorWrapper.registerContentObserver(observer); - - cursorWrapper.unregisterContentObserver(observer); - - try { - cursorWrapper.unregisterContentObserver(observer); - fail("testUnregisterContentObserver failed"); - } catch (IllegalStateException e) { - } - cursorWrapper.close(); - } - - private class MockContentObserver extends ContentObserver { - - public MockContentObserver(Handler handler) { - super(handler); - } - } - - private void deleteWithValue(SQLiteDatabase database, int value) { - database.execSQL("DELETE FROM test1 WHERE number = " + value + ";"); - } - - private void addWithValue(SQLiteDatabase database, int value) { - database.execSQL("INSERT INTO test1 (number) VALUES ('" + value + "');"); - } - - private void deleteAllRecords(SQLiteDatabase database) { - database.delete("test1", null, null); - } - - private void setupDatabase() { - File dbDir = getContext().getDir("tests", Context.MODE_PRIVATE); - /* don't use the same database name as the one in super class - * this class's setUp() method deletes a database file just opened by super.setUp(). - * that can cause corruption in database in the following situation: - * super.setUp() creates the database, inserts some data into it. - * this class setUp() deletes just the database file but not the associated - * database files such as wal, shm files. - * solution is to have this class delete the whole database directory. - * better yet, this class shouldn't extend DatabaseCursortest at all. - * TODO: fix this bogus cts class hierarchy - */ - mDatabaseFile = new File(dbDir, "cursor_test.db"); - if (mDatabaseFile.exists()) { - mDatabaseFile.delete(); - } - mDatabase = SQLiteDatabase.openOrCreateDatabase(mDatabaseFile.getPath(), null); - assertNotNull(mDatabase); - mDatabase.setVersion(CURRENT_DATABASE_VERSION); - mDatabase.execSQL("CREATE TABLE test1 (_id INTEGER PRIMARY KEY, number TEXT);"); - mDatabase.execSQL("INSERT INTO test1 (number) VALUES ('" + FIRST_NUMBER + "');"); - mDatabase.execSQL("INSERT INTO test1 (number) VALUES ('" + SECOND_NUMBER + "');"); - mCursor = getCursor(); - } - - private void closeDatabase() { - if (null != mCursor) { - mCursor.close(); - mCursor = null; - } - mDatabase.close(); - mDatabaseFile.delete(); - } - - private void rebuildDatabase() { - closeDatabase(); - setupDatabase(); - } - - private class MockObserver extends DataSetObserver { - private boolean mHasChanged = false; - private boolean mHasInvalidated = false; - - @Override - public void onChanged() { - super.onChanged(); - mHasChanged = true; - } - - @Override - public void onInvalidated() { - super.onInvalidated(); - mHasInvalidated = true; - } - - protected void resetStatus() { - mHasChanged = false; - mHasInvalidated = false; - } - - protected boolean hasChanged() { - return mHasChanged; - } - - protected boolean hasInvalidated() { - return mHasInvalidated; - } - } -} diff --git a/proprietary/frameworks/base/tests/database/src/android/database/cts/DataSetObservableTest.java b/proprietary/frameworks/base/tests/database/src/android/database/cts/DataSetObservableTest.java deleted file mode 100755 index 026fb7e9af061b7975c59473e8a02faa168ab398..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/database/src/android/database/cts/DataSetObservableTest.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.database.cts; - -import android.database.DataSetObservable; -import android.database.DataSetObserver; -import android.test.AndroidTestCase; - -public class DataSetObservableTest extends AndroidTestCase { - - public void testNotifyMethods() { - DataSetObservable dataSetObservalbe = new DataSetObservable(); - MockDataSetObserver dataSetObserver1 = new MockDataSetObserver(); - MockDataSetObserver dataSetObserver2 = new MockDataSetObserver(); - - dataSetObservalbe.registerObserver(dataSetObserver1); - dataSetObservalbe.registerObserver(dataSetObserver2); - - assertFalse(dataSetObserver1.hasChanged()); - assertFalse(dataSetObserver2.hasChanged()); - dataSetObservalbe.notifyChanged(); - assertTrue(dataSetObserver1.hasChanged()); - assertTrue(dataSetObserver2.hasChanged()); - - assertFalse(dataSetObserver1.hasInvalidated()); - assertFalse(dataSetObserver2.hasInvalidated()); - dataSetObservalbe.notifyInvalidated(); - assertTrue(dataSetObserver1.hasInvalidated()); - assertTrue(dataSetObserver2.hasInvalidated()); - - // After unregistering, all the observers can not be notified. - dataSetObservalbe.unregisterAll(); - dataSetObserver1.resetStatus(); - dataSetObserver2.resetStatus(); - - // notifyChanged is not working on dataSetObserver1 & 2 anymore. - dataSetObservalbe.notifyChanged(); - assertFalse(dataSetObserver1.hasChanged()); - assertFalse(dataSetObserver2.hasChanged()); - - // notifyInvalidated is not working on dataSetObserver1 & 2 anymore. - dataSetObservalbe.notifyInvalidated(); - assertFalse(dataSetObserver1.hasInvalidated()); - assertFalse(dataSetObserver2.hasInvalidated()); - } - - private class MockDataSetObserver extends DataSetObserver { - private boolean mHasChanged = false; - private boolean mHasInvalidated = false; - - @Override - public void onChanged() { - super.onChanged(); - mHasChanged = true; - } - - @Override - public void onInvalidated() { - super.onInvalidated(); - mHasInvalidated = true; - } - - protected boolean hasChanged() { - return mHasChanged; - } - - protected boolean hasInvalidated() { - return mHasInvalidated; - } - - protected void resetStatus() { - mHasChanged = false; - mHasInvalidated = false; - } - } -} diff --git a/proprietary/frameworks/base/tests/database/src/android/database/cts/DataSetObserverTest.java b/proprietary/frameworks/base/tests/database/src/android/database/cts/DataSetObserverTest.java deleted file mode 100755 index 9107b7038d6d76f1b75aa50d7a2207315630346e..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/database/src/android/database/cts/DataSetObserverTest.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.database.cts; - -import android.database.DataSetObserver; -import android.test.AndroidTestCase; - -public class DataSetObserverTest extends AndroidTestCase { - public void testOnChanged() { - MockDataSetObserver dataSetObserver = new MockDataSetObserver(); - dataSetObserver.onChanged(); - } - - public void testOnInvalidated() { - MockDataSetObserver dataSetObserver = new MockDataSetObserver(); - dataSetObserver.onInvalidated(); - } - - private class MockDataSetObserver extends DataSetObserver { - } -} diff --git a/proprietary/frameworks/base/tests/database/src/android/database/cts/DatabaseCursorTest.java b/proprietary/frameworks/base/tests/database/src/android/database/cts/DatabaseCursorTest.java deleted file mode 100755 index e581b436fa40859c6b7771c2a26e2bdf8570c50e..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/database/src/android/database/cts/DatabaseCursorTest.java +++ /dev/null @@ -1,505 +0,0 @@ -/* - * Copyright (C) 2007 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.database.cts; - -import android.content.ContentValues; -import android.content.Context; -import android.database.Cursor; -import android.database.CursorIndexOutOfBoundsException; -import android.database.CursorWrapper; -import android.database.DataSetObserver; -import android.database.DatabaseUtils; -import android.database.sqlite.SQLiteCursor; -import android.database.sqlite.SQLiteCursorDriver; -import android.database.sqlite.SQLiteDatabase; -import android.database.sqlite.SQLiteQuery; -import android.os.Looper; -import android.test.AndroidTestCase; -import android.test.PerformanceTestCase; -import android.test.suitebuilder.annotation.LargeTest; -import android.test.suitebuilder.annotation.MediumTest; -import android.util.Log; - -import java.io.File; -import java.util.Arrays; -import java.util.Random; - -public class DatabaseCursorTest extends AndroidTestCase implements PerformanceTestCase { - private static final String sString1 = "this is a test"; - private static final String sString2 = "and yet another test"; - private static final String sString3 = "this string is a little longer, but still a test"; - - private static final int CURRENT_DATABASE_VERSION = 42; - private SQLiteDatabase mDatabase; - private File mDatabaseFile; - protected static final int TYPE_CURSOR = 0; - protected static final int TYPE_CURSORWRAPPER = 1; - private int mTestType = TYPE_CURSOR; - - @Override - protected void setUp() throws Exception { - super.setUp(); - File dbDir = getContext().getDir("tests", Context.MODE_PRIVATE); - mDatabaseFile = new File(dbDir, "database_test.db"); - if (mDatabaseFile.exists()) { - mDatabaseFile.delete(); - } - mDatabase = SQLiteDatabase.openOrCreateDatabase(mDatabaseFile.getPath(), null); - assertNotNull(mDatabase); - mDatabase.setVersion(CURRENT_DATABASE_VERSION); - } - - @Override - protected void tearDown() throws Exception { - mDatabase.close(); - mDatabaseFile.delete(); - super.tearDown(); - } - - public void setupTestType(int testType) { - mTestType = testType; - } - - private Cursor getTestCursor(Cursor cursor) { - switch (mTestType) { - case TYPE_CURSORWRAPPER: - return new CursorWrapper(cursor); - case TYPE_CURSOR: - default: - return cursor; - } - } - - public boolean isPerformanceOnly() { - return false; - } - - // These test can only be run once. - public int startPerformance(Intermediates intermediates) { - return 1; - } - - private void populateDefaultTable() { - mDatabase.execSQL("CREATE TABLE test (_id INTEGER PRIMARY KEY, data TEXT);"); - - mDatabase.execSQL("INSERT INTO test (data) VALUES ('" + sString1 + "');"); - mDatabase.execSQL("INSERT INTO test (data) VALUES ('" + sString2 + "');"); - mDatabase.execSQL("INSERT INTO test (data) VALUES ('" + sString3 + "');"); - } - - @MediumTest - public void testBlob() throws Exception { - // create table - mDatabase.execSQL( - "CREATE TABLE test (_id INTEGER PRIMARY KEY, s TEXT, d REAL, l INTEGER, b BLOB);"); - // insert blob - Object[] args = new Object[4]; - - byte[] blob = new byte[1000]; - byte value = 99; - Arrays.fill(blob, value); - args[3] = blob; - - String s = new String("text"); - args[0] = s; - Double d = 99.9; - args[1] = d; - Long l = (long) 1000; - args[2] = l; - - String sql = "INSERT INTO test (s, d, l, b) VALUES (?,?,?,?)"; - mDatabase.execSQL(sql, args); - // use cursor to access blob - - Cursor testCursor = mDatabase.query("test", null, null, null, null, null, null); - - testCursor.moveToNext(); - ContentValues cv = new ContentValues(); - DatabaseUtils.cursorRowToContentValues(testCursor, cv); - - int bCol = testCursor.getColumnIndexOrThrow("b"); - int sCol = testCursor.getColumnIndexOrThrow("s"); - int dCol = testCursor.getColumnIndexOrThrow("d"); - int lCol = testCursor.getColumnIndexOrThrow("l"); - byte[] cBlob = testCursor.getBlob(bCol); - assertTrue(Arrays.equals(blob, cBlob)); - assertEquals(s, testCursor.getString(sCol)); - assertEquals((double) d, testCursor.getDouble(dCol)); - assertEquals((long) l, testCursor.getLong(lCol)); - } - - @MediumTest - public void testRealColumns() throws Exception { - mDatabase.execSQL("CREATE TABLE test (_id INTEGER PRIMARY KEY, data REAL);"); - ContentValues values = new ContentValues(); - values.put("data", 42.11); - long id = mDatabase.insert("test", "data", values); - assertTrue(id > 0); - Cursor testCursor = getTestCursor(mDatabase.rawQuery("SELECT data FROM test", null)); - assertNotNull(testCursor); - assertTrue(testCursor.moveToFirst()); - assertEquals(42.11, testCursor.getDouble(0)); - testCursor.close(); - } - - @MediumTest - public void testCursor1() throws Exception { - populateDefaultTable(); - - Cursor testCursor = getTestCursor(mDatabase.query("test", null, null, null, null, null, - null)); - - int dataColumn = testCursor.getColumnIndexOrThrow("data"); - - // The cursor should ignore text before the last period when looking for a column. (This - // is a temporary hack in all implementations of getColumnIndex.) - int dataColumn2 = testCursor.getColumnIndexOrThrow("junk.data"); - assertEquals(dataColumn, dataColumn2); - - assertSame(3, testCursor.getCount()); - - assertTrue(testCursor.isBeforeFirst()); - - try { - testCursor.getInt(0); - fail("CursorIndexOutOfBoundsException expected"); - } catch (CursorIndexOutOfBoundsException ex) { - // expected - } - - testCursor.moveToNext(); - assertEquals(1, testCursor.getInt(0)); - - String s = testCursor.getString(dataColumn); - assertEquals(sString1, s); - - testCursor.moveToNext(); - s = testCursor.getString(dataColumn); - assertEquals(sString2, s); - - testCursor.moveToNext(); - s = testCursor.getString(dataColumn); - assertEquals(sString3, s); - - testCursor.moveToPosition(-1); - testCursor.moveToNext(); - s = testCursor.getString(dataColumn); - assertEquals(sString1, s); - - testCursor.moveToPosition(2); - s = testCursor.getString(dataColumn); - assertEquals(sString3, s); - - int i; - - for (testCursor.moveToFirst(), i = 0; !testCursor.isAfterLast(); - testCursor.moveToNext(), i++) { - testCursor.getInt(0); - } - - assertEquals(3, i); - - try { - testCursor.getInt(0); - fail("CursorIndexOutOfBoundsException expected"); - } catch (CursorIndexOutOfBoundsException ex) { - // expected - } - testCursor.close(); - } - - @MediumTest - public void testCursor2() throws Exception { - populateDefaultTable(); - - Cursor testCursor = getTestCursor(mDatabase.query("test", null, "_id > 1000", null, null, - null, null)); - assertEquals(0, testCursor.getCount()); - assertTrue(testCursor.isBeforeFirst()); - - try { - testCursor.getInt(0); - fail("CursorIndexOutOfBoundsException expected"); - } catch (CursorIndexOutOfBoundsException ex) { - // expected - } - - int i; - for (testCursor.moveToFirst(), i = 0; !testCursor.isAfterLast(); - testCursor.moveToNext(), i++) { - testCursor.getInt(0); - } - assertEquals(0, i); - try { - testCursor.getInt(0); - fail("CursorIndexOutOfBoundsException expected"); - } catch (CursorIndexOutOfBoundsException ex) { - // expected - } - testCursor.close(); - } - - @MediumTest - public void testLargeField() throws Exception { - mDatabase.execSQL("CREATE TABLE test (_id INTEGER PRIMARY KEY, data TEXT);"); - - StringBuilder sql = new StringBuilder(2100); - sql.append("INSERT INTO test (data) VALUES ('"); - Random random = new Random(System.currentTimeMillis()); - StringBuilder randomString = new StringBuilder(1979); - for (int i = 0; i < 1979; i++) { - randomString.append((random.nextInt() & 0xf) % 10); - } - sql.append(randomString); - sql.append("');"); - mDatabase.execSQL(sql.toString()); - - Cursor testCursor = getTestCursor(mDatabase.query("test", null, null, null, null, null, - null)); - assertNotNull(testCursor); - assertEquals(1, testCursor.getCount()); - - assertTrue(testCursor.moveToFirst()); - assertEquals(0, testCursor.getPosition()); - String largeString = testCursor.getString(testCursor.getColumnIndexOrThrow("data")); - assertNotNull(largeString); - assertEquals(randomString.toString(), largeString); - testCursor.close(); - } - - private class TestObserver extends DataSetObserver { - int total; - SQLiteCursor c; - boolean quit = false; - - public TestObserver(int total_, SQLiteCursor cursor) { - c = cursor; - total = total_; - } - - @Override - public void onChanged() { - int count = c.getCount(); - if (total == count) { - int i = 0; - while (c.moveToNext()) { - assertEquals(i, c.getInt(1)); - i++; - } - assertEquals(count, i); - quit = true; - Looper.myLooper().quit(); - } - } - - @Override - public void onInvalidated() { - } - } - - @LargeTest - public void testManyRowsLong() throws Exception { - mDatabase.beginTransaction(); - final int count = 9000; - try { - mDatabase.execSQL("CREATE TABLE test (_id INTEGER PRIMARY KEY, data INT);"); - - for (int i = 0; i < count; i++) { - mDatabase.execSQL("INSERT INTO test (data) VALUES (" + i + ");"); - } - mDatabase.setTransactionSuccessful(); - } finally { - mDatabase.endTransaction(); - } - - Cursor testCursor = getTestCursor(mDatabase.query("test", new String[] { "data" }, - null, null, null, null, null)); - assertNotNull(testCursor); - - int i = 0; - while (testCursor.moveToNext()) { - assertEquals(i, testCursor.getInt(0)); - i++; - } - assertEquals(count, i); - assertEquals(count, testCursor.getCount()); - - Log.d("testManyRows", "count " + Integer.toString(i)); - testCursor.close(); - } - - @LargeTest - public void testManyRowsTxt() throws Exception { - mDatabase.execSQL("CREATE TABLE test (_id INTEGER PRIMARY KEY, data TEXT);"); - StringBuilder sql = new StringBuilder(2100); - sql.append("INSERT INTO test (data) VALUES ('"); - Random random = new Random(System.currentTimeMillis()); - StringBuilder randomString = new StringBuilder(1979); - for (int i = 0; i < 1979; i++) { - randomString.append((random.nextInt() & 0xf) % 10); - } - sql.append(randomString); - sql.append("');"); - - // if cursor window size changed, adjust this value too - final int count = 600; // more than two fillWindow needed - for (int i = 0; i < count; i++) { - mDatabase.execSQL(sql.toString()); - } - - Cursor testCursor = getTestCursor(mDatabase.query("test", new String[] { "data" }, null, - null, null, null, null)); - assertNotNull(testCursor); - - int i = 0; - while (testCursor.moveToNext()) { - assertEquals(randomString.toString(), testCursor.getString(0)); - i++; - } - assertEquals(count, i); - assertEquals(count, testCursor.getCount()); - testCursor.close(); - } - - @LargeTest - public void testManyRowsTxtLong() throws Exception { - mDatabase.execSQL("CREATE TABLE test (_id INTEGER PRIMARY KEY, txt TEXT, data INT);"); - - Random random = new Random(System.currentTimeMillis()); - StringBuilder randomString = new StringBuilder(1979); - for (int i = 0; i < 1979; i++) { - randomString.append((random.nextInt() & 0xf) % 10); - } - - // if cursor window size changed, adjust this value too - final int count = 600; - for (int i = 0; i < count; i++) { - StringBuilder sql = new StringBuilder(2100); - sql.append("INSERT INTO test (txt, data) VALUES ('"); - sql.append(randomString); - sql.append("','"); - sql.append(i); - sql.append("');"); - mDatabase.execSQL(sql.toString()); - } - - Cursor testCursor = getTestCursor(mDatabase.query("test", new String[] { "txt", "data" }, - null, null, null, null, null)); - assertNotNull(testCursor); - - int i = 0; - while (testCursor.moveToNext()) { - assertEquals(randomString.toString(), testCursor.getString(0)); - assertEquals(i, testCursor.getInt(1)); - i++; - } - assertEquals(count, i); - assertEquals(count, testCursor.getCount()); - testCursor.close(); - } - - @MediumTest - public void testRequery() throws Exception { - populateDefaultTable(); - - Cursor testCursor = getTestCursor(mDatabase.rawQuery("SELECT * FROM test", null)); - assertNotNull(testCursor); - assertEquals(3, testCursor.getCount()); - testCursor.deactivate(); - testCursor.requery(); - assertEquals(3, testCursor.getCount()); - testCursor.close(); - } - - @MediumTest - public void testRequeryWithSelection() throws Exception { - populateDefaultTable(); - - Cursor testCursor = getTestCursor( - mDatabase.rawQuery("SELECT data FROM test WHERE data = '" + sString1 + "'", - null)); - assertNotNull(testCursor); - assertEquals(1, testCursor.getCount()); - assertTrue(testCursor.moveToFirst()); - assertEquals(sString1, testCursor.getString(0)); - testCursor.deactivate(); - testCursor.requery(); - assertEquals(1, testCursor.getCount()); - assertTrue(testCursor.moveToFirst()); - assertEquals(sString1, testCursor.getString(0)); - testCursor.close(); - } - - @MediumTest - public void testRequeryWithSelectionArgs() throws Exception { - populateDefaultTable(); - - Cursor testCursor = getTestCursor(mDatabase.rawQuery("SELECT data FROM test WHERE data = ?", - new String[] { sString1 })); - assertNotNull(testCursor); - assertEquals(1, testCursor.getCount()); - assertTrue(testCursor.moveToFirst()); - assertEquals(sString1, testCursor.getString(0)); - testCursor.deactivate(); - testCursor.requery(); - assertEquals(1, testCursor.getCount()); - assertTrue(testCursor.moveToFirst()); - assertEquals(sString1, testCursor.getString(0)); - testCursor.close(); - } - - @MediumTest - public void testRequeryWithAlteredSelectionArgs() throws Exception { - /** - * Test the ability of a subclass of SQLiteCursor to change its query arguments. - */ - populateDefaultTable(); - - SQLiteDatabase.CursorFactory factory = new SQLiteDatabase.CursorFactory() { - public Cursor newCursor(SQLiteDatabase db, SQLiteCursorDriver masterQuery, - String editTable, SQLiteQuery query) { - return new SQLiteCursor(db, masterQuery, editTable, query) { - @Override - public boolean requery() { - setSelectionArguments(new String[] { "2" }); - return super.requery(); - } - }; - } - }; - Cursor testCursor = getTestCursor(mDatabase.rawQueryWithFactory(factory, - "SELECT data FROM test WHERE _id <= ?", - new String[] { "1" }, null)); - assertNotNull(testCursor); - assertEquals(1, testCursor.getCount()); - assertTrue(testCursor.moveToFirst()); - assertEquals(sString1, testCursor.getString(0)); - - // Our hacked requery() changes the query arguments in the cursor. - testCursor.requery(); - - assertEquals(2, testCursor.getCount()); - assertTrue(testCursor.moveToFirst()); - assertEquals(sString1, testCursor.getString(0)); - assertTrue(testCursor.moveToNext()); - assertEquals(sString2, testCursor.getString(0)); - - // Test that setting query args on a deactivated cursor also works. - testCursor.deactivate(); - testCursor.requery(); - } -} diff --git a/proprietary/frameworks/base/tests/database/src/android/database/cts/DatabaseUtilsTest.java b/proprietary/frameworks/base/tests/database/src/android/database/cts/DatabaseUtilsTest.java deleted file mode 100755 index b593449918acb76827fee2847545f6739e24e064..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/database/src/android/database/cts/DatabaseUtilsTest.java +++ /dev/null @@ -1,678 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.database.cts; - - -import android.content.ContentValues; -import android.content.Context; -import android.database.Cursor; -import android.database.DatabaseUtils; -import android.database.DatabaseUtils.InsertHelper; -import android.database.sqlite.SQLiteAbortException; -import android.database.sqlite.SQLiteDatabase; -import android.database.sqlite.SQLiteDoneException; -import android.database.sqlite.SQLiteException; -import android.database.sqlite.SQLiteStatement; -import android.os.Parcel; -import android.os.ParcelFileDescriptor; -import android.test.AndroidTestCase; -import android.test.MoreAsserts; - -import java.io.ByteArrayOutputStream; -import java.io.File; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.InputStream; -import java.io.PrintStream; -import java.util.Locale; - -public class DatabaseUtilsTest extends AndroidTestCase { - private SQLiteDatabase mDatabase; - private File mDatabaseFile; - private static final String[] TEST_PROJECTION = new String[] { - "_id", // 0 - "name", // 1 - "age", // 2 - "address" // 3 - }; - private static final String TABLE_NAME = "test"; - private Locale mLocale; - - @Override - protected void setUp() throws Exception { - super.setUp(); - File dbDir = getContext().getDir("tests", Context.MODE_PRIVATE); - mDatabaseFile = new File(dbDir, "database_test.db"); - if (mDatabaseFile.exists()) { - mDatabaseFile.delete(); - } - mDatabase = SQLiteDatabase.openOrCreateDatabase(mDatabaseFile.getPath(), null); - assertNotNull(mDatabase); - mDatabase.execSQL("CREATE TABLE " + TABLE_NAME + " (_id INTEGER PRIMARY KEY, " + - "name TEXT, age INTEGER, address TEXT);"); - mDatabase.execSQL( - "CREATE TABLE blob_test (_id INTEGER PRIMARY KEY, name TEXT, data BLOB)"); - mLocale = DatabaseUtils.getCollatorLocale(); - } - - @Override - protected void tearDown() throws Exception { - mDatabase.close(); - mDatabaseFile.delete(); - DatabaseUtils.setCollatorLocale(mLocale); - super.tearDown(); - } - - public void testAppendEscapedSQLString() { - String expected = "name='Mike'"; - StringBuilder sb = new StringBuilder("name="); - DatabaseUtils.appendEscapedSQLString(sb, "Mike"); - assertEquals(expected, sb.toString()); - - expected = "'name=''Mike'''"; - sb = new StringBuilder(); - DatabaseUtils.appendEscapedSQLString(sb, "name='Mike'"); - assertEquals(expected, sb.toString()); - } - - public void testSqlEscapeString() { - String expected = "'Jack'"; - assertEquals(expected, DatabaseUtils.sqlEscapeString("Jack")); - } - - public void testAppendValueToSql() { - String expected = "address='LA'"; - StringBuilder sb = new StringBuilder("address="); - DatabaseUtils.appendValueToSql(sb, "LA"); - assertEquals(expected, sb.toString()); - - expected = "address=NULL"; - sb = new StringBuilder("address="); - DatabaseUtils.appendValueToSql(sb, null); - assertEquals(expected, sb.toString()); - - expected = "flag=1"; - sb = new StringBuilder("flag="); - DatabaseUtils.appendValueToSql(sb, true); - assertEquals(expected, sb.toString()); - } - - public void testBindObjectToProgram() { - String name = "Mike"; - int age = 21; - String address = "LA"; - - // at the beginning, there are no records in the database. - Cursor cursor = mDatabase.query(TABLE_NAME, TEST_PROJECTION, - null, null, null, null, null); - assertNotNull(cursor); - assertEquals(0, cursor.getCount()); - - String sql = "INSERT INTO " + TABLE_NAME + " (name, age, address) VALUES (?, ?, ?);"; - SQLiteStatement statement = mDatabase.compileStatement(sql); - DatabaseUtils.bindObjectToProgram(statement, 1, name); - DatabaseUtils.bindObjectToProgram(statement, 2, age); - DatabaseUtils.bindObjectToProgram(statement, 3, address); - statement.execute(); - statement.close(); - - cursor = mDatabase.query(TABLE_NAME, TEST_PROJECTION, null, null, null, null, null); - assertNotNull(cursor); - assertEquals(1, cursor.getCount()); - cursor.moveToFirst(); - assertEquals(name, cursor.getString(1)); - assertEquals(age, cursor.getInt(2)); - assertEquals(address, cursor.getString(3)); - } - - public void testCreateDbFromSqlStatements() { - String dbName = "ExampleName"; - String sqls = "CREATE TABLE " + TABLE_NAME + " (_id INTEGER PRIMARY KEY, name TEXT);\n" - + "INSERT INTO " + TABLE_NAME + " (name) VALUES ('Mike');\n"; - DatabaseUtils.createDbFromSqlStatements(getContext(), dbName, 1, sqls); - - SQLiteDatabase db = getContext().openOrCreateDatabase(dbName, 0, null); - final String[] PROJECTION = new String[] { - "_id", // 0 - "name" // 1 - }; - Cursor cursor = db.query(TABLE_NAME, PROJECTION, null, null, null, null, null); - assertNotNull(cursor); - assertEquals(1, cursor.getCount()); - cursor.moveToFirst(); - assertEquals("Mike", cursor.getString(1)); - getContext().deleteDatabase(dbName); - } - - public void testCursorDoubleToContentValues() { - mDatabase.execSQL("INSERT INTO " + TABLE_NAME + " (name, age, address)" + - " VALUES ('Mike', '20', 'LA');"); - Cursor cursor = mDatabase.query(TABLE_NAME, TEST_PROJECTION, - null, null, null, null, null); - assertNotNull(cursor); - - ContentValues contentValues = new ContentValues(); - String key = "key"; - cursor.moveToFirst(); - DatabaseUtils.cursorDoubleToContentValues(cursor, "age", contentValues, key); - assertEquals(20.0, contentValues.getAsDouble(key)); - - DatabaseUtils.cursorDoubleToContentValues(cursor, "Error Field Name", contentValues, key); - assertNull(contentValues.getAsDouble(key)); - - DatabaseUtils.cursorDoubleToContentValues(cursor, "name", contentValues, key); - assertEquals(0.0, contentValues.getAsDouble(key)); - } - - public void testCursorDoubleToCursorValues() { - mDatabase.execSQL("INSERT INTO " + TABLE_NAME + " (name, age, address)" + - " VALUES ('Mike', '20', 'LA');"); - Cursor cursor = mDatabase.query(TABLE_NAME, TEST_PROJECTION, - null, null, null, null, null); - assertNotNull(cursor); - - ContentValues contentValues = new ContentValues(); - cursor.moveToFirst(); - DatabaseUtils.cursorDoubleToCursorValues(cursor, "age", contentValues); - assertEquals(20.0, contentValues.getAsDouble("age")); - - DatabaseUtils.cursorDoubleToCursorValues(cursor, "Error Field Name", contentValues); - assertNull(contentValues.getAsDouble("Error Field Name")); - - DatabaseUtils.cursorDoubleToCursorValues(cursor, "name", contentValues); - assertEquals(0.0, contentValues.getAsDouble("name")); - } - - public void testCursorIntToContentValues() { - mDatabase.execSQL("INSERT INTO " + TABLE_NAME + " (name, age, address)" + - " VALUES ('Mike', '20', 'LA');"); - Cursor cursor = mDatabase.query(TABLE_NAME, TEST_PROJECTION, null, null, null, null, null); - assertNotNull(cursor); - - ContentValues contentValues = new ContentValues(); - String key = "key"; - cursor.moveToFirst(); - DatabaseUtils.cursorIntToContentValues(cursor, "age", contentValues, key); - assertEquals(Integer.valueOf(20), contentValues.getAsInteger(key)); - - DatabaseUtils.cursorIntToContentValues(cursor, "Error Field Name", contentValues, key); - assertNull(contentValues.getAsInteger(key)); - - DatabaseUtils.cursorIntToContentValues(cursor, "name", contentValues, key); - assertEquals(Integer.valueOf(0), contentValues.getAsInteger(key)); - - contentValues = new ContentValues(); - DatabaseUtils.cursorIntToContentValues(cursor, "age", contentValues); - assertEquals(Integer.valueOf(20), contentValues.getAsInteger("age")); - - DatabaseUtils.cursorIntToContentValues(cursor, "Error Field Name", contentValues); - assertNull(contentValues.getAsInteger("Error Field Name")); - - DatabaseUtils.cursorIntToContentValues(cursor, "name", contentValues); - assertEquals(Integer.valueOf(0), contentValues.getAsInteger("name")); - } - - public void testcursorLongToContentValues() { - mDatabase.execSQL("INSERT INTO " + TABLE_NAME + " (name, age, address)" + - " VALUES ('Mike', '20', 'LA');"); - Cursor cursor = mDatabase.query(TABLE_NAME, TEST_PROJECTION, null, null, null, null, null); - assertNotNull(cursor); - - ContentValues contentValues = new ContentValues(); - String key = "key"; - cursor.moveToNext(); - DatabaseUtils.cursorLongToContentValues(cursor, "age", contentValues, key); - assertEquals(Long.valueOf(20), contentValues.getAsLong(key)); - - DatabaseUtils.cursorLongToContentValues(cursor, "Error Field Name", contentValues, key); - assertNull(contentValues.getAsLong(key)); - - DatabaseUtils.cursorLongToContentValues(cursor, "name", contentValues, key); - assertEquals(Long.valueOf(0), contentValues.getAsLong(key)); - - contentValues = new ContentValues(); - DatabaseUtils.cursorLongToContentValues(cursor, "age", contentValues); - assertEquals(Long.valueOf(20), contentValues.getAsLong("age")); - - DatabaseUtils.cursorLongToContentValues(cursor, "Error Field Name", contentValues); - assertNull(contentValues.getAsLong("Error Field Name")); - - DatabaseUtils.cursorLongToContentValues(cursor, "name", contentValues); - assertEquals(Long.valueOf(0), contentValues.getAsLong("name")); - } - - public void testCursorRowToContentValues() { - mDatabase.execSQL("INSERT INTO " + TABLE_NAME + " (name, age, address)" + - " VALUES ('Mike', '20', 'LA');"); - Cursor cursor = mDatabase.query(TABLE_NAME, TEST_PROJECTION, - null, null, null, null, null); - assertNotNull(cursor); - - ContentValues contentValues = new ContentValues(); - cursor.moveToNext(); - DatabaseUtils.cursorRowToContentValues(cursor, contentValues); - assertEquals("Mike", (String) contentValues.get("name")); - assertEquals("20", (String) contentValues.get("age")); - assertEquals("LA", (String) contentValues.get("address")); - } - - public void testCursorStringToContentValues() { - mDatabase.execSQL("INSERT INTO " + TABLE_NAME + " (name, age, address)" + - " VALUES ('Mike', '20', 'LA');"); - Cursor cursor = mDatabase.query(TABLE_NAME, TEST_PROJECTION, - null, null, null, null, null); - assertNotNull(cursor); - - ContentValues contentValues = new ContentValues(); - String key = "key"; - cursor.moveToNext(); - DatabaseUtils.cursorStringToContentValues(cursor, "age", contentValues, key); - assertEquals("20", (String) contentValues.get(key)); - - try { - DatabaseUtils.cursorStringToContentValues(cursor, "Error Field Name", - contentValues, key); - fail("should throw IllegalArgumentException."); - } catch (IllegalArgumentException e) { - // expected - } - - DatabaseUtils.cursorStringToContentValues(cursor, "name", contentValues, key); - assertEquals("Mike", contentValues.get(key)); - - contentValues = new ContentValues(); - DatabaseUtils.cursorStringToContentValues(cursor, "age", contentValues); - assertEquals("20", contentValues.get("age")); - - try { - DatabaseUtils.cursorStringToContentValues(cursor, "Error Field Name", contentValues); - fail("should throw IllegalArgumentException."); - } catch (IllegalArgumentException e) { - // expected - } - - DatabaseUtils.cursorStringToContentValues(cursor, "name", contentValues); - assertEquals("Mike", contentValues.get("name")); - } - - public void testCursorStringToInsertHelper() { - // create a new table. - mDatabase.execSQL("CREATE TABLE test_copy (_id INTEGER PRIMARY KEY, " + - "name TEXT, age INTEGER, address TEXT);"); - - mDatabase.execSQL("INSERT INTO " + TABLE_NAME + " (name, age, address)" + - " VALUES ('Mike', '20', 'LA');"); - Cursor cursor = mDatabase.query("test_copy", TEST_PROJECTION, null, null, null, null, null); - assertEquals(0, cursor.getCount()); - - InsertHelper insertHelper = new InsertHelper(mDatabase, "test_copy"); - int indexName = insertHelper.getColumnIndex("name"); - int indexAge = insertHelper.getColumnIndex("age"); - int indexAddress = insertHelper.getColumnIndex("address"); - - cursor = mDatabase.query(TABLE_NAME, TEST_PROJECTION, null, null, null, null, null); - cursor.moveToNext(); - insertHelper.prepareForInsert(); - DatabaseUtils.cursorStringToInsertHelper(cursor, "name", insertHelper, indexName); - DatabaseUtils.cursorStringToInsertHelper(cursor, "age", insertHelper, indexAge); - DatabaseUtils.cursorStringToInsertHelper(cursor, "address", insertHelper, indexAddress); - insertHelper.execute(); - - cursor = mDatabase.query("test_copy", TEST_PROJECTION, null, null, null, null, null); - assertEquals(1, cursor.getCount()); - cursor.moveToNext(); - assertEquals("Mike", cursor.getString(1)); - assertEquals(20, cursor.getInt(2)); - assertEquals("LA", cursor.getString(3)); - } - - public void testDumpCurrentRow() { - mDatabase.execSQL("INSERT INTO " + TABLE_NAME + " (name, age, address)" + - " VALUES ('Mike', '20', 'LA');"); - Cursor cursor = mDatabase.query(TABLE_NAME, TEST_PROJECTION, - null, null, null, null, null); - assertNotNull(cursor); - cursor.moveToNext(); - String expected = "0 {\n _id=1\n name=Mike\n age=20\n address=LA\n}\n"; - - DatabaseUtils.dumpCurrentRow(cursor); - - ByteArrayOutputStream bos = new ByteArrayOutputStream(); - PrintStream os = new PrintStream(bos); - DatabaseUtils.dumpCurrentRow(cursor, os); - os.flush(); - os.close(); - assertEquals(expected, bos.toString()); - - StringBuilder sb = new StringBuilder(); - DatabaseUtils.dumpCurrentRow(cursor, sb); - assertEquals(expected, sb.toString()); - - assertEquals(expected, DatabaseUtils.dumpCurrentRowToString(cursor)); - } - - public void testDumpCursor() { - mDatabase.execSQL("INSERT INTO " + TABLE_NAME + " (name, age, address)" + - " VALUES ('Mike', '20', 'LA');"); - mDatabase.execSQL("INSERT INTO " + TABLE_NAME + " (name, age, address)" + - " VALUES ('Jack', '30', 'London');"); - Cursor cursor = mDatabase.query(TABLE_NAME, TEST_PROJECTION, - null, null, null, null, null); - assertNotNull(cursor); - int pos = cursor.getPosition(); - String expected = ">>>>> Dumping cursor " + cursor + "\n" + - "0 {\n" + - " _id=1\n" + - " name=Mike\n" + - " age=20\n" + - " address=LA\n" + - "}\n" + - "1 {\n" + - " _id=2\n" + - " name=Jack\n" + - " age=30\n" + - " address=London\n" + - "}\n" + - "<<<<<\n"; - - DatabaseUtils.dumpCursor(cursor); - - ByteArrayOutputStream bos = new ByteArrayOutputStream(); - PrintStream os = new PrintStream(bos); - DatabaseUtils.dumpCursor(cursor, os); - os.flush(); - os.close(); - assertEquals(pos, cursor.getPosition()); // dumpCursor should not change status of cursor - assertEquals(expected, bos.toString()); - - StringBuilder sb = new StringBuilder(); - DatabaseUtils.dumpCursor(cursor, sb); - assertEquals(pos, cursor.getPosition()); // dumpCursor should not change status of cursor - assertEquals(expected, sb.toString()); - - assertEquals(expected, DatabaseUtils.dumpCursorToString(cursor)); - assertEquals(pos, cursor.getPosition()); // dumpCursor should not change status of cursor - } - - public void testCollationKey() { - String key1 = DatabaseUtils.getCollationKey("abc"); - String key2 = DatabaseUtils.getCollationKey("ABC"); - String key3 = DatabaseUtils.getCollationKey("bcd"); - - assertTrue(key1.equals(key2)); - assertFalse(key1.equals(key3)); - - key1 = DatabaseUtils.getHexCollationKey("abc"); - key2 = DatabaseUtils.getHexCollationKey("ABC"); - key3 = DatabaseUtils.getHexCollationKey("bcd"); - - assertTrue(key1.equals(key2)); - assertFalse(key1.equals(key3)); - } - - public void testLongForQuery() { - mDatabase.execSQL("INSERT INTO " + TABLE_NAME + " (name, age, address)" + - " VALUES ('Mike', '20', 'LA');"); - - String query = "SELECT age FROM " + TABLE_NAME; - assertEquals(20, DatabaseUtils.longForQuery(mDatabase, query, null)); - - mDatabase.execSQL("INSERT INTO " + TABLE_NAME + " (name, age, address)" + - " VALUES ('Jack', '35', 'London');"); - query = "SELECT age FROM " + TABLE_NAME + " WHERE name = ?"; - String[] args = new String[] { "Jack" }; - assertEquals(35, DatabaseUtils.longForQuery(mDatabase, query, args)); - args = new String[] { "No such name" }; - try { - DatabaseUtils.longForQuery(mDatabase, query, args); - fail("should throw SQLiteDoneException"); - } catch (SQLiteDoneException e) { - // expected - } - - query = "SELECT count(*) FROM " + TABLE_NAME + ";"; - SQLiteStatement statement = mDatabase.compileStatement(query); - assertEquals(2, DatabaseUtils.longForQuery(statement, null)); - - query = "SELECT age FROM " + TABLE_NAME + " WHERE address = ?;"; - statement = mDatabase.compileStatement(query); - args = new String[] { "London" }; - assertEquals(35, DatabaseUtils.longForQuery(statement, args)); - - args = new String[] { "No such address" }; - try { - DatabaseUtils.longForQuery(statement, args); - fail("should throw SQLiteDoneException"); - } catch (SQLiteDoneException e) { - // expected - } - statement.close(); - } - - public void testQueryNumEntries() { - assertEquals(0, DatabaseUtils.queryNumEntries(mDatabase, TABLE_NAME)); - - mDatabase.execSQL( - "INSERT INTO " + TABLE_NAME + " (name, age, address)" + - " VALUES ('Mike', '20', 'LA');"); - assertEquals(1, DatabaseUtils.queryNumEntries(mDatabase, TABLE_NAME)); - - mDatabase.execSQL( - "INSERT INTO " + TABLE_NAME + " (name, age, address)" + - " VALUES ('Susan', '20', 'AR');"); - assertEquals(2, DatabaseUtils.queryNumEntries(mDatabase, TABLE_NAME)); - - mDatabase.execSQL( - "INSERT INTO " + TABLE_NAME + " (name, age, address)" + - " VALUES ('Christian', '25', 'AT');"); - assertEquals(3, DatabaseUtils.queryNumEntries(mDatabase, TABLE_NAME)); - - assertEquals(2, DatabaseUtils.queryNumEntries(mDatabase, TABLE_NAME, "AGE = 20")); - - assertEquals(1, DatabaseUtils.queryNumEntries(mDatabase, TABLE_NAME, "AGE = ?", - new String[] { "25" })); - - try { - DatabaseUtils.queryNumEntries(mDatabase, "NoSuchTable"); - fail("should throw SQLiteException."); - } catch (SQLiteException e) { - // expected - } - } - - public void testExceptionFromParcel() { - Parcel parcel = Parcel.obtain(); - DatabaseUtils.writeExceptionToParcel(parcel, new IllegalArgumentException()); - parcel.setDataPosition(0); - try { - DatabaseUtils.readExceptionFromParcel(parcel); - fail("should throw IllegalArgumentException."); - } catch (IllegalArgumentException e) { - // expected - } - - parcel = Parcel.obtain(); - DatabaseUtils.writeExceptionToParcel(parcel, new SQLiteAbortException()); - parcel.setDataPosition(0); - try { - DatabaseUtils.readExceptionFromParcel(parcel); - fail("should throw SQLiteAbortException."); - } catch (SQLiteAbortException e) { - // expected - } - - parcel = Parcel.obtain(); - DatabaseUtils.writeExceptionToParcel(parcel, new FileNotFoundException()); - parcel.setDataPosition(0); - try { - DatabaseUtils.readExceptionFromParcel(parcel); - fail("should throw RuntimeException."); - } catch (RuntimeException e) { - // expected - } - - parcel = Parcel.obtain(); - DatabaseUtils.writeExceptionToParcel(parcel, new FileNotFoundException()); - parcel.setDataPosition(0); - try { - DatabaseUtils.readExceptionWithFileNotFoundExceptionFromParcel(parcel); - fail("should throw FileNotFoundException."); - } catch (FileNotFoundException e) { - // expected - } - } - - public void testStringForQuery() { - mDatabase.execSQL("INSERT INTO " + TABLE_NAME + " (name, age, address)" + - " VALUES ('Mike', '20', 'LA');"); - - String query = "SELECT name FROM " + TABLE_NAME; - assertEquals("Mike", DatabaseUtils.stringForQuery(mDatabase, query, null)); - - mDatabase.execSQL("INSERT INTO " + TABLE_NAME + " (name, age, address)" + - " VALUES ('Jack', '35', 'London');"); - query = "SELECT name FROM " + TABLE_NAME + " WHERE address = ?"; - String[] args = new String[] { "London" }; - assertEquals("Jack", DatabaseUtils.stringForQuery(mDatabase, query, args)); - args = new String[] { "No such address" }; - try { - DatabaseUtils.stringForQuery(mDatabase, query, args); - fail("should throw SQLiteDoneException"); - } catch (SQLiteDoneException e) { - // expected - } - - query = "SELECT name FROM " + TABLE_NAME + " WHERE age = ?;"; - SQLiteStatement statement = mDatabase.compileStatement(query); - args = new String[] { "20" }; - assertEquals("Mike", DatabaseUtils.stringForQuery(statement, args)); - - args = new String[] { "1000" }; // NO people can be older than this. - try { - DatabaseUtils.blobFileDescriptorForQuery(statement, args); - fail("should throw SQLiteDoneException"); - } catch (SQLiteDoneException e) { - // expected - } - statement.close(); - } - - public void testBlobFileDescriptorForQuery() throws Exception { - String data1 = "5300FEFF"; - String data2 = "DECAFBAD"; - mDatabase.execSQL("INSERT INTO blob_test (name, data) VALUES ('Mike', X'" + data1 + "')"); - - String query = "SELECT data FROM blob_test"; - assertFileDescriptorContent(parseBlob(data1), - DatabaseUtils.blobFileDescriptorForQuery(mDatabase, query, null)); - - mDatabase.execSQL("INSERT INTO blob_test (name, data) VALUES ('Jack', X'" + data2 + "');"); - query = "SELECT data FROM blob_test WHERE name = ?"; - String[] args = new String[] { "Jack" }; - assertFileDescriptorContent(parseBlob(data2), - DatabaseUtils.blobFileDescriptorForQuery(mDatabase, query, args)); - - args = new String[] { "No such name" }; - try { - DatabaseUtils.stringForQuery(mDatabase, query, args); - fail("should throw SQLiteDoneException"); - } catch (SQLiteDoneException e) { - // expected - } - - query = "SELECT data FROM blob_test WHERE name = ?;"; - SQLiteStatement statement = mDatabase.compileStatement(query); - args = new String[] { "Mike" }; - assertFileDescriptorContent(parseBlob(data1), - DatabaseUtils.blobFileDescriptorForQuery(statement, args)); - - args = new String[] { "No such name" }; - try { - DatabaseUtils.blobFileDescriptorForQuery(statement, args); - fail("should throw SQLiteDoneException"); - } catch (SQLiteDoneException e) { - // expected - } - statement.close(); - } - - private static byte[] parseBlob(String src) { - int len = src.length(); - byte[] result = new byte[len / 2]; - - for (int i = 0; i < len / 2; i++) { - int val; - char c1 = src.charAt(i * 2); - char c2 = src.charAt(i * 2 + 1); - int val1 = Character.digit(c1, 16); - int val2 = Character.digit(c2, 16); - val = (val1 << 4) | val2; - result[i] = (byte) val; - } - return result; - } - - private static void assertFileDescriptorContent(byte[] expected, ParcelFileDescriptor fd) - throws IOException { - assertInputStreamContent(expected, new ParcelFileDescriptor.AutoCloseInputStream(fd)); - } - - private static void assertInputStreamContent(byte[] expected, InputStream is) - throws IOException { - try { - byte[] observed = new byte[expected.length]; - int count = is.read(observed); - assertEquals(expected.length, count); - assertEquals(-1, is.read()); - MoreAsserts.assertEquals(expected, observed); - } finally { - is.close(); - } - } - - public void testGetCollatorLocale() { - - //set Locale - String language = "en_"; - String country = "EN"; - Locale locale = new Locale(language, country); - DatabaseUtils.setCollatorLocale(locale); - - // get Locale - Locale tempLocale = DatabaseUtils.getCollatorLocale(); - - assertTrue(language.equals(tempLocale.getLanguage())); - assertTrue(country.equals(tempLocale.getCountry())); - - } - - public void testSetCollatorLocale() { - - //set Locale - String language = "zh_"; - String country = "ZH"; - Locale locale = new Locale(language, country); - DatabaseUtils.setCollatorLocale(locale); - - // get Locale - Locale tempLocale = DatabaseUtils.getCollatorLocale(); - - assertTrue(language.equals(tempLocale.getLanguage())); - assertTrue(country.equals(tempLocale.getCountry())); - } - -} diff --git a/proprietary/frameworks/base/tests/database/src/android/database/cts/DatabaseUtils_InsertHelperTest.java b/proprietary/frameworks/base/tests/database/src/android/database/cts/DatabaseUtils_InsertHelperTest.java deleted file mode 100755 index d72b78d1b97ee4cd8b9689554ec14192c162dd75..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/database/src/android/database/cts/DatabaseUtils_InsertHelperTest.java +++ /dev/null @@ -1,286 +0,0 @@ -/* - * Copyright (C) 2009 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.database.cts; - - -import android.content.ContentValues; -import android.content.Context; -import android.database.Cursor; -import android.database.DatabaseUtils.InsertHelper; -import android.database.sqlite.SQLiteDatabase; -import android.test.AndroidTestCase; -import android.test.MoreAsserts; - -public class DatabaseUtils_InsertHelperTest extends AndroidTestCase { - private static final String TEST_TABLE_NAME = "test"; - private static final String DATABASE_NAME = "database_test.db"; - - private SQLiteDatabase mDatabase; - private InsertHelper mInsertHelper; - - @Override - protected void setUp() throws Exception { - super.setUp(); - getContext().deleteDatabase(DATABASE_NAME); - mDatabase = getContext().openOrCreateDatabase(DATABASE_NAME, Context.MODE_PRIVATE, null); - assertNotNull(mDatabase); - mInsertHelper = new InsertHelper(mDatabase, TEST_TABLE_NAME); - } - - @Override - protected void tearDown() throws Exception { - mInsertHelper.close(); - mDatabase.close(); - getContext().deleteDatabase(DATABASE_NAME); - super.tearDown(); - } - - public void testConstructor() { - new InsertHelper(mDatabase, TEST_TABLE_NAME); - } - - public void testClose() { - mInsertHelper.close(); - } - - public void testGetColumnIndex() { - mDatabase.execSQL("CREATE TABLE " + TEST_TABLE_NAME + " (_id INTEGER PRIMARY KEY, " + - "name TEXT, age INTEGER, address TEXT);"); - assertEquals(1, mInsertHelper.getColumnIndex("_id")); - assertEquals(2, mInsertHelper.getColumnIndex("name")); - assertEquals(3, mInsertHelper.getColumnIndex("age")); - assertEquals(4, mInsertHelper.getColumnIndex("address")); - try { - mInsertHelper.getColumnIndex("missing_column"); - fail("Should throw exception (column does not exist)"); - } catch (IllegalArgumentException expected) { - // expected - } - } - - public void testInsert() { - mDatabase.execSQL("CREATE TABLE " + TEST_TABLE_NAME + "(_id INTEGER PRIMARY KEY," + - " boolean_value INTEGER, int_value INTEGER, long_value INTEGER," + - " double_value DOUBLE, float_value DOUBLE, string_value TEXT," + - " blob_value BLOB, null_value TEXT);"); - final int booleanValueIndex = 1; - final int intValueIndex = 2; - final int longValueIndex = 3; - final int doubleValueIndex = 4; - final int floatValueIndex = 5; - final int stringValueIndex = 6; - final int blobValueIndex = 7; - final int nullValueIndex = 8; - final String[] projection = new String[] { - "_id", // index 0 - "boolean_value", // index 1 - "int_value", // index 2 - "long_value", // index 3 - "double_value", // index 4 - "float_value", // index 5 - "string_value", // index 6 - "blob_value", // index 7 - "null_value" // index 8 - }; - - Cursor cursor = mDatabase.query(TEST_TABLE_NAME, projection, null, null, null, null, null); - assertNotNull(cursor); - assertEquals(0, cursor.getCount()); - cursor.close(); - - try { - mInsertHelper.execute(); - fail("Should throw exception (execute without prepare)"); - } catch (IllegalStateException expected) { - // expected - } - - mInsertHelper.prepareForInsert(); - mInsertHelper.bind(mInsertHelper.getColumnIndex("boolean_value"), true); - mInsertHelper.bind(mInsertHelper.getColumnIndex("int_value"), 10); - mInsertHelper.bind(mInsertHelper.getColumnIndex("long_value"), 1000L); - mInsertHelper.bind(mInsertHelper.getColumnIndex("double_value"), 123.456); - mInsertHelper.bind(mInsertHelper.getColumnIndex("float_value"), 1.0f); - mInsertHelper.bind(mInsertHelper.getColumnIndex("string_value"), "test insert"); - byte[] blob = new byte[] { '1', '2', '3' }; - mInsertHelper.bind(mInsertHelper.getColumnIndex("blob_value"), blob); - mInsertHelper.bindNull(mInsertHelper.getColumnIndex("null_value")); - long id = mInsertHelper.execute(); - assertEquals(1, id); - - cursor = mDatabase.query(TEST_TABLE_NAME, projection, null, null, null, null, null); - assertNotNull(cursor); - assertEquals(1, cursor.getCount()); - cursor.moveToFirst(); - assertEquals(1, cursor.getInt(booleanValueIndex)); - assertEquals(10, cursor.getInt(intValueIndex)); - assertEquals(1000L, cursor.getLong(longValueIndex)); - assertEquals(123.456, cursor.getDouble(doubleValueIndex)); - assertEquals(1.0f, cursor.getFloat(floatValueIndex)); - assertEquals("test insert", cursor.getString(stringValueIndex)); - byte[] value = cursor.getBlob(blobValueIndex); - MoreAsserts.assertEquals(blob, value); - assertNull(cursor.getString(nullValueIndex)); - cursor.close(); - - // try inserting a conflicting column -> should return -1 - mInsertHelper.prepareForInsert(); - mInsertHelper.bind(mInsertHelper.getColumnIndex("_id"), id); - assertEquals(-1, mInsertHelper.execute()); - - // subsequent insert() should ignore existing bindings - ContentValues values = new ContentValues(); - values.put("boolean_value", false); - values.put("int_value", 123); - values.put("long_value", 987654L); - values.put("double_value", 654.321); - values.put("float_value", 21.1f); - values.put("string_value", "insert another row"); - values.put("blob_value", blob); - values.putNull("null_value"); - id = mInsertHelper.insert(values); - assertEquals(2, id); - cursor = mDatabase.query(TEST_TABLE_NAME, projection, "_id = " + id, - null, null, null, null); - assertNotNull(cursor); - cursor.moveToFirst(); - assertEquals(0, cursor.getInt(booleanValueIndex)); - assertEquals(123, cursor.getInt(intValueIndex)); - assertEquals(987654L, cursor.getLong(longValueIndex)); - assertEquals(654.321, cursor.getDouble(doubleValueIndex)); - assertEquals(21.1f, cursor.getFloat(floatValueIndex)); - assertEquals("insert another row", cursor.getString(stringValueIndex)); - value = cursor.getBlob(blobValueIndex); - MoreAsserts.assertEquals(blob, value); - assertNull(cursor.getString(nullValueIndex)); - cursor.close(); - - // try inserting a conflicting column -> should return -1 - values.put("_id", id); - assertEquals(-1, mInsertHelper.insert(values)); - } - - public void testReplace() { - mDatabase.execSQL("CREATE TABLE " + TEST_TABLE_NAME + "(_id INTEGER PRIMARY KEY," + - " boolean_value INTEGER, int_value INTEGER, long_value INTEGER," + - " double_value DOUBLE, float_value DOUBLE, string_value TEXT," + - " blob_value BLOB, null_value TEXT);"); - final int booleanValueIndex = 1; - final int intValueIndex = 2; - final int longValueIndex = 3; - final int doubleValueIndex = 4; - final int floatValueIndex = 5; - final int stringValueIndex = 6; - final int blobValueIndex = 7; - final int nullValueIndex = 8; - final String[] projection = new String[] { - "_id", // index 0 - "boolean_value", // index 1 - "int_value", // index 2 - "long_value", // index 3 - "double_value", // index 4 - "float_value", // index 5 - "string_value", // index 6 - "blob_value", // index 7 - "null_value" // index 8 - }; - - Cursor cursor = mDatabase.query(TEST_TABLE_NAME, projection, null, null, null, null, null); - assertNotNull(cursor); - assertEquals(0, cursor.getCount()); - cursor.close(); - - // without specifying a key, this becomes an insert - mInsertHelper.prepareForReplace(); - mInsertHelper.bind(mInsertHelper.getColumnIndex("boolean_value"), true); - mInsertHelper.bind(mInsertHelper.getColumnIndex("int_value"), 10); - mInsertHelper.bind(mInsertHelper.getColumnIndex("long_value"), 1000L); - mInsertHelper.bind(mInsertHelper.getColumnIndex("double_value"), 123.456); - mInsertHelper.bind(mInsertHelper.getColumnIndex("float_value"), 1.0f); - mInsertHelper.bind(mInsertHelper.getColumnIndex("string_value"), "test insert"); - byte[] blob = new byte[] { '1', '2', '3' }; - mInsertHelper.bind(mInsertHelper.getColumnIndex("blob_value"), blob); - mInsertHelper.bindNull(mInsertHelper.getColumnIndex("null_value")); - long id = mInsertHelper.execute(); - assertEquals(1, id); - - cursor = mDatabase.query(TEST_TABLE_NAME, projection, null, null, null, null, null); - assertNotNull(cursor); - assertEquals(1, cursor.getCount()); - cursor.moveToFirst(); - assertEquals(1, cursor.getInt(booleanValueIndex)); - assertEquals(10, cursor.getInt(intValueIndex)); - assertEquals(1000L, cursor.getLong(longValueIndex)); - assertEquals(123.456, cursor.getDouble(doubleValueIndex)); - assertEquals(1.0f, cursor.getFloat(floatValueIndex)); - assertEquals("test insert", cursor.getString(stringValueIndex)); - byte[] value = cursor.getBlob(blobValueIndex); - MoreAsserts.assertEquals(blob, value); - assertNull(cursor.getString(nullValueIndex)); - cursor.close(); - - mInsertHelper.prepareForReplace(); - mInsertHelper.bind(mInsertHelper.getColumnIndex("_id"), id); - mInsertHelper.bind(mInsertHelper.getColumnIndex("int_value"), 42); - mInsertHelper.execute(); - cursor = mDatabase.query(TEST_TABLE_NAME, projection, null, null, null, null, null); - assertNotNull(cursor); - assertEquals(1, cursor.getCount()); - cursor.moveToFirst(); - assertEquals(42, cursor.getInt(intValueIndex)); - // previous bindings are forgotten - assertNull(cursor.getString(stringValueIndex)); - cursor.close(); - - // illegal primary key -> should return -1 - mInsertHelper.prepareForReplace(); - mInsertHelper.bind(mInsertHelper.getColumnIndex("_id"), "illegal_id"); - assertEquals(-1, mInsertHelper.execute()); - - ContentValues values = new ContentValues(); - // will replace row id - values.put("_id", id); - values.put("boolean_value", false); - values.put("int_value", 123); - values.put("long_value", 987654L); - values.put("double_value", 654.321); - values.put("float_value", 21.1f); - values.put("string_value", "replace the row"); - values.put("blob_value", blob); - values.putNull("null_value"); - id = mInsertHelper.replace(values); - assertEquals(1, id); - cursor = mDatabase.query(TEST_TABLE_NAME, projection, null, null, null, null, null); - assertEquals(1, cursor.getCount()); - assertNotNull(cursor); - cursor.moveToFirst(); - assertEquals(0, cursor.getInt(booleanValueIndex)); - assertEquals(123, cursor.getInt(intValueIndex)); - assertEquals(987654L, cursor.getLong(longValueIndex)); - assertEquals(654.321, cursor.getDouble(doubleValueIndex)); - assertEquals(21.1f, cursor.getFloat(floatValueIndex)); - assertEquals("replace the row", cursor.getString(stringValueIndex)); - value = cursor.getBlob(blobValueIndex); - MoreAsserts.assertEquals(blob, value); - assertNull(cursor.getString(nullValueIndex)); - cursor.close(); - - // illegal primary key -> should return -1 - values.put("_id", "illegal_id"); - assertEquals(-1, mInsertHelper.replace(values)); - } -} diff --git a/proprietary/frameworks/base/tests/database/src/android/database/cts/MatrixCursorTest.java b/proprietary/frameworks/base/tests/database/src/android/database/cts/MatrixCursorTest.java deleted file mode 100755 index 689c2a62264b0d2206eb80b5ee73b6bee3ef1cac..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/database/src/android/database/cts/MatrixCursorTest.java +++ /dev/null @@ -1,289 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.database.cts; - - -import android.database.CursorIndexOutOfBoundsException; -import android.database.MatrixCursor; -import android.database.MatrixCursor.RowBuilder; - -import java.util.ArrayList; - -import junit.framework.TestCase; - -public class MatrixCursorTest extends TestCase { - private static final String COLUMN0_NAME = "column0"; - - private static final String COLUMN1_NAME = "column1"; - - private static final String COLUMN2_NAME = "column2"; - - private static final int COLUMN0_INDEX = 0; - - private static final int COLUMN1_INDEX = 1; - - private static final int COLUMN2_INDEX = 2; - - private MatrixCursor mMatrixCursor; - - @Override - protected void setUp() throws Exception { - super.setUp(); - mMatrixCursor = new MatrixCursor(new String[] { COLUMN0_NAME, COLUMN1_NAME, COLUMN2_NAME }); - } - - public void testMatrixCursor() { - new MatrixCursor(new String[0]); - - new MatrixCursor(new String[] { COLUMN0_NAME }, 10); - } - - public void testNewRow() { - assertEquals(0, mMatrixCursor.getCount()); - RowBuilder builder = mMatrixCursor.newRow(); - assertNotNull(builder); - assertEquals(1, mMatrixCursor.getCount()); - mMatrixCursor.moveToFirst(); - assertTrue(mMatrixCursor.isNull(COLUMN0_INDEX)); - assertTrue(mMatrixCursor.isNull(COLUMN1_INDEX)); - assertTrue(mMatrixCursor.isNull(COLUMN2_INDEX)); - - builder.add(Integer.MIN_VALUE); - assertFalse(mMatrixCursor.isNull(COLUMN0_INDEX)); - assertEquals(Integer.MIN_VALUE, mMatrixCursor.getInt(COLUMN0_INDEX)); - assertTrue(mMatrixCursor.isNull(COLUMN1_INDEX)); - assertTrue(mMatrixCursor.isNull(COLUMN2_INDEX)); - - builder.add(0); - assertFalse(mMatrixCursor.isNull(COLUMN0_INDEX)); - assertEquals(Integer.MIN_VALUE, mMatrixCursor.getInt(COLUMN0_INDEX)); - assertFalse(mMatrixCursor.isNull(COLUMN1_INDEX)); - assertEquals(0, mMatrixCursor.getInt(COLUMN1_INDEX)); - assertTrue(mMatrixCursor.isNull(COLUMN2_INDEX)); - - builder.add(Integer.MAX_VALUE); - assertFalse(mMatrixCursor.isNull(COLUMN0_INDEX)); - assertEquals(Integer.MIN_VALUE, mMatrixCursor.getInt(COLUMN0_INDEX)); - assertFalse(mMatrixCursor.isNull(COLUMN1_INDEX)); - assertEquals(0, mMatrixCursor.getInt(COLUMN1_INDEX)); - assertFalse(mMatrixCursor.isNull(COLUMN2_INDEX)); - assertEquals(Integer.MAX_VALUE, mMatrixCursor.getInt(COLUMN2_INDEX)); - - try { - builder.add(1); - fail("Should throw CursorIndexOutOfBoundsException when adding too many values"); - } catch (CursorIndexOutOfBoundsException e) { - // expected - } - - assertNotNull(mMatrixCursor.newRow()); - assertEquals(2, mMatrixCursor.getCount()); - } - - public void testAddRow() { - assertEquals(0, mMatrixCursor.getCount()); - - mMatrixCursor.addRow(new Long[] { Long.MIN_VALUE, 0L, Long.MAX_VALUE }); - assertEquals(1, mMatrixCursor.getCount()); - mMatrixCursor.moveToLast(); - assertFalse(mMatrixCursor.isNull(COLUMN0_INDEX)); - assertEquals(Long.MIN_VALUE, mMatrixCursor.getLong(COLUMN0_INDEX)); - assertFalse(mMatrixCursor.isNull(COLUMN1_INDEX)); - assertEquals(0, mMatrixCursor.getLong(COLUMN1_INDEX)); - assertFalse(mMatrixCursor.isNull(COLUMN2_INDEX)); - assertEquals(Long.MAX_VALUE, mMatrixCursor.getLong(COLUMN2_INDEX)); - - try { - mMatrixCursor.addRow(new Long[2]); - fail("Should throw IllegalArgumentException if values does not have the same length " - + "as the columns"); - } catch (IllegalArgumentException e) { - // expected - } - - try { - mMatrixCursor.addRow(new Long[4]); - fail("Should throw IllegalArgumentException if values does not have the same length " - + "as the columns"); - } catch (IllegalArgumentException e) { - // expected - } - - ArrayList values = new ArrayList(); - values.add("value0"); - values.add("value1"); - try { - mMatrixCursor.addRow(values); - fail("Should throw IllegalArgumentException if values does not have the same length " - + "as the columns"); - } catch (IllegalArgumentException e) { - // expected - } - - values.add("value2"); - mMatrixCursor.addRow(values); - assertEquals(2, mMatrixCursor.getCount()); - mMatrixCursor.moveToLast(); - assertFalse(mMatrixCursor.isNull(COLUMN0_INDEX)); - assertEquals("value0", mMatrixCursor.getString(COLUMN0_INDEX)); - assertFalse(mMatrixCursor.isNull(COLUMN1_INDEX)); - assertEquals("value1", mMatrixCursor.getString(COLUMN1_INDEX)); - assertFalse(mMatrixCursor.isNull(COLUMN2_INDEX)); - assertEquals("value2", mMatrixCursor.getString(COLUMN2_INDEX)); - - values.add("value3"); - try { - mMatrixCursor.addRow(values); - fail("Should throw IllegalArgumentException if values does not have the same length " - + "as the columns"); - } catch (IllegalArgumentException e) { - // expected - } - } - - public void testGetColumnNames() { - String[] names = mMatrixCursor.getColumnNames(); - assertEquals(3, names.length); - assertEquals(COLUMN0_NAME, names[0]); - assertEquals(COLUMN1_NAME, names[1]); - assertEquals(COLUMN2_NAME, names[2]); - - // the following methods from super class will call {@link MatrixCursor#getColumnNames()} - assertEquals(COLUMN0_INDEX, mMatrixCursor.getColumnIndex(COLUMN0_NAME)); - assertEquals(COLUMN1_INDEX, mMatrixCursor.getColumnIndex(COLUMN1_NAME)); - assertEquals(COLUMN2_INDEX, mMatrixCursor.getColumnIndex(COLUMN2_NAME)); - } - - public void testGetters() { - mMatrixCursor.addRow(new Short[] { Short.MIN_VALUE, 0, Short.MAX_VALUE }); - mMatrixCursor.moveToLast(); - assertFalse(mMatrixCursor.isNull(COLUMN0_INDEX)); - assertFalse(mMatrixCursor.isNull(COLUMN1_INDEX)); - assertFalse(mMatrixCursor.isNull(COLUMN2_INDEX)); - - // numbers can be converted to each other and strings - assertEquals(Short.MIN_VALUE, mMatrixCursor.getShort(COLUMN0_INDEX)); - assertEquals(0, mMatrixCursor.getShort(COLUMN1_INDEX)); - assertEquals(Short.MAX_VALUE, mMatrixCursor.getShort(COLUMN2_INDEX)); - - assertEquals(Short.MIN_VALUE, mMatrixCursor.getInt(COLUMN0_INDEX)); - assertEquals(0, mMatrixCursor.getInt(COLUMN1_INDEX)); - assertEquals(Short.MAX_VALUE, mMatrixCursor.getInt(COLUMN2_INDEX)); - - assertEquals(Short.MIN_VALUE, mMatrixCursor.getLong(COLUMN0_INDEX)); - assertEquals(0, mMatrixCursor.getLong(COLUMN1_INDEX)); - assertEquals(Short.MAX_VALUE, mMatrixCursor.getLong(COLUMN2_INDEX)); - - assertEquals(-32768f, mMatrixCursor.getFloat(COLUMN0_INDEX), 0.0f); - assertEquals(0f, mMatrixCursor.getFloat(COLUMN1_INDEX), 0.0f); - assertEquals(32767f, mMatrixCursor.getFloat(COLUMN2_INDEX), 0.0f); - - assertEquals(-32768d, mMatrixCursor.getDouble(COLUMN0_INDEX), 0.0d); - assertEquals(0d, mMatrixCursor.getDouble(COLUMN1_INDEX), 0.0d); - assertEquals(32767d, mMatrixCursor.getDouble(COLUMN2_INDEX), 0.0d); - - assertEquals("-32768", mMatrixCursor.getString(COLUMN0_INDEX)); - assertEquals("0", mMatrixCursor.getString(COLUMN1_INDEX)); - assertEquals("32767", mMatrixCursor.getString(COLUMN2_INDEX)); - - mMatrixCursor.addRow(new Double[] { Double.MIN_VALUE, 0d, Double.MAX_VALUE }); - mMatrixCursor.moveToLast(); - assertFalse(mMatrixCursor.isNull(COLUMN0_INDEX)); - assertFalse(mMatrixCursor.isNull(COLUMN1_INDEX)); - assertFalse(mMatrixCursor.isNull(COLUMN2_INDEX)); - - // numbers can be converted to each other but loose accuracy - assertEquals(0, mMatrixCursor.getShort(COLUMN0_INDEX)); - assertEquals(0, mMatrixCursor.getShort(COLUMN1_INDEX)); - assertEquals(-1, mMatrixCursor.getShort(COLUMN2_INDEX)); - - assertEquals(0, mMatrixCursor.getInt(COLUMN0_INDEX)); - assertEquals(0, mMatrixCursor.getInt(COLUMN1_INDEX)); - assertEquals(Integer.MAX_VALUE, mMatrixCursor.getInt(COLUMN2_INDEX)); - - assertEquals(0, mMatrixCursor.getLong(COLUMN0_INDEX)); - assertEquals(0, mMatrixCursor.getLong(COLUMN1_INDEX)); - assertEquals(Long.MAX_VALUE, mMatrixCursor.getLong(COLUMN2_INDEX)); - - assertEquals(0.0f, mMatrixCursor.getFloat(COLUMN0_INDEX), 0.0f); - assertEquals(0f, mMatrixCursor.getFloat(COLUMN1_INDEX), 0.0f); - assertEquals(Float.POSITIVE_INFINITY, mMatrixCursor.getFloat(COLUMN2_INDEX), 0.0f); - - assertEquals(Double.MIN_VALUE, mMatrixCursor.getDouble(COLUMN0_INDEX), 0.0d); - assertEquals(0d, mMatrixCursor.getDouble(COLUMN1_INDEX), 0.0d); - assertEquals(Double.MAX_VALUE, mMatrixCursor.getDouble(COLUMN2_INDEX), 0.0d); - - assertEquals(Double.toString(Double.MIN_VALUE), mMatrixCursor.getString(COLUMN0_INDEX)); - assertEquals(Double.toString(0d), mMatrixCursor.getString(COLUMN1_INDEX)); - assertEquals(Double.toString(Double.MAX_VALUE), mMatrixCursor.getString(COLUMN2_INDEX)); - - mMatrixCursor.addRow(new String[] { "-1", "0", "1" }); - mMatrixCursor.moveToLast(); - assertFalse(mMatrixCursor.isNull(COLUMN0_INDEX)); - assertFalse(mMatrixCursor.isNull(COLUMN1_INDEX)); - assertFalse(mMatrixCursor.isNull(COLUMN2_INDEX)); - // strings can be converted to numbers - assertEquals(-1, mMatrixCursor.getShort(COLUMN0_INDEX)); - assertEquals(0, mMatrixCursor.getShort(COLUMN1_INDEX)); - assertEquals(1, mMatrixCursor.getShort(COLUMN2_INDEX)); - - assertEquals(-1, mMatrixCursor.getInt(COLUMN0_INDEX)); - assertEquals(0, mMatrixCursor.getInt(COLUMN1_INDEX)); - assertEquals(1, mMatrixCursor.getInt(COLUMN2_INDEX)); - - assertEquals(-1, mMatrixCursor.getLong(COLUMN0_INDEX)); - assertEquals(0, mMatrixCursor.getLong(COLUMN1_INDEX)); - assertEquals(1, mMatrixCursor.getLong(COLUMN2_INDEX)); - - assertEquals(-1f, mMatrixCursor.getFloat(COLUMN0_INDEX), 0.0f); - assertEquals(0f, mMatrixCursor.getFloat(COLUMN1_INDEX), 0.0f); - assertEquals(1f, mMatrixCursor.getFloat(COLUMN2_INDEX), 0.0f); - - assertEquals(-1d, mMatrixCursor.getDouble(COLUMN0_INDEX), 0.0d); - assertEquals(0f, mMatrixCursor.getDouble(COLUMN1_INDEX), 0.0d); - assertEquals(1d, mMatrixCursor.getDouble(COLUMN2_INDEX), 0.0d); - - assertEquals("-1", mMatrixCursor.getString(COLUMN0_INDEX)); - assertEquals("0", mMatrixCursor.getString(COLUMN1_INDEX)); - assertEquals("1", mMatrixCursor.getString(COLUMN2_INDEX)); - - mMatrixCursor.addRow(new String[] { "1.0E2", "0xff", "not number" }); - mMatrixCursor.moveToLast(); - assertFalse(mMatrixCursor.isNull(COLUMN0_INDEX)); - assertFalse(mMatrixCursor.isNull(COLUMN1_INDEX)); - assertFalse(mMatrixCursor.isNull(COLUMN2_INDEX)); - assertEquals("1.0E2", mMatrixCursor.getString(COLUMN0_INDEX)); - assertEquals("0xff", mMatrixCursor.getString(COLUMN1_INDEX)); - assertEquals("not number", mMatrixCursor.getString(COLUMN2_INDEX)); - - assertEquals(100f, mMatrixCursor.getFloat(COLUMN0_INDEX), 0.0f); - // strings can not be converted to numbers - try { - mMatrixCursor.getShort(COLUMN1_INDEX); - fail("Should throw NumberFormatException"); - } catch (NumberFormatException e) { - // expected - } - - try { - mMatrixCursor.getShort(COLUMN2_INDEX); - fail("Should throw NumberFormatException"); - } catch (NumberFormatException e) { - // expected - } - } -} diff --git a/proprietary/frameworks/base/tests/database/src/android/database/cts/MatrixCursor_RowBuilderTest.java b/proprietary/frameworks/base/tests/database/src/android/database/cts/MatrixCursor_RowBuilderTest.java deleted file mode 100755 index c5004d86753d817b7843c31a1db37d5e2975f0fb..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/database/src/android/database/cts/MatrixCursor_RowBuilderTest.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.database.cts; - - -import android.database.CursorIndexOutOfBoundsException; -import android.database.MatrixCursor; -import android.database.MatrixCursor.RowBuilder; - -import junit.framework.TestCase; - -public class MatrixCursor_RowBuilderTest extends TestCase { - private static final int COLUMN0_INDEX = 0; - - private static final int COLUMN1_INDEX = 1; - - private static final int COLUMN2_INDEX = 2; - - public void testAdd() { - MatrixCursor cursor = new MatrixCursor(new String[] { "column0", "column1", "column2" }); - assertEquals(0, cursor.getCount()); - RowBuilder builder = cursor.newRow(); - assertNotNull(builder); - assertEquals(1, cursor.getCount()); - cursor.moveToFirst(); - assertTrue(cursor.isNull(COLUMN0_INDEX)); - assertTrue(cursor.isNull(COLUMN1_INDEX)); - assertTrue(cursor.isNull(COLUMN2_INDEX)); - - builder.add(Integer.MIN_VALUE); - assertFalse(cursor.isNull(COLUMN0_INDEX)); - assertEquals(Integer.MIN_VALUE, cursor.getInt(COLUMN0_INDEX)); - assertTrue(cursor.isNull(COLUMN1_INDEX)); - assertTrue(cursor.isNull(COLUMN2_INDEX)); - - builder.add(0); - assertFalse(cursor.isNull(COLUMN0_INDEX)); - assertEquals(Integer.MIN_VALUE, cursor.getInt(COLUMN0_INDEX)); - assertFalse(cursor.isNull(COLUMN1_INDEX)); - assertEquals(0, cursor.getInt(COLUMN1_INDEX)); - assertTrue(cursor.isNull(COLUMN2_INDEX)); - - builder.add(Integer.MAX_VALUE); - assertFalse(cursor.isNull(COLUMN0_INDEX)); - assertEquals(Integer.MIN_VALUE, cursor.getInt(COLUMN0_INDEX)); - assertFalse(cursor.isNull(COLUMN1_INDEX)); - assertEquals(0, cursor.getInt(COLUMN1_INDEX)); - assertFalse(cursor.isNull(COLUMN2_INDEX)); - assertEquals(Integer.MAX_VALUE, cursor.getInt(COLUMN2_INDEX)); - - try { - builder.add(1); - fail("Should throw CursorIndexOutOfBoundsException when adding too many values"); - } catch (CursorIndexOutOfBoundsException e) { - // expected - } - - assertNotNull(cursor.newRow()); - assertEquals(2, cursor.getCount()); - } -} diff --git a/proprietary/frameworks/base/tests/database/src/android/database/cts/MergeCursorTest.java b/proprietary/frameworks/base/tests/database/src/android/database/cts/MergeCursorTest.java deleted file mode 100755 index 94a379f737ac85036352a66db3b17c7352872393..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/database/src/android/database/cts/MergeCursorTest.java +++ /dev/null @@ -1,391 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.database.cts; - - -import android.content.Context; -import android.database.ContentObserver; -import android.database.Cursor; -import android.database.DataSetObserver; -import android.database.MergeCursor; -import android.database.StaleDataException; -import android.database.sqlite.SQLiteDatabase; -import android.test.AndroidTestCase; - -import java.io.File; -import java.util.Arrays; - -public class MergeCursorTest extends AndroidTestCase { - private final int NUMBER_1_COLUMN_INDEX = 1; - private static final String TABLE1_NAME = "test1"; - private static final String TABLE2_NAME = "test2"; - private static final String TABLE3_NAME = "test3"; - private static final String TABLE4_NAME = "test4"; - private static final String TABLE5_NAME = "test5"; - private static final String COLUMN_FOR_NULL_TEST = "Null Field"; - - private SQLiteDatabase mDatabase; - private File mDatabaseFile; - - Cursor[] mCursors = null; - private static final String TABLE1_COLUMNS = " number_1 INTEGER"; - private static final String TABLE2_COLUMNS = " number_1 INTEGER, number_2 INTEGER"; - private static final String TABLE3_COLUMNS = " text_1 TEXT, number_3 INTEGER, number_4 REAL"; - private static final String TABLE2_COLUMN_NAMES = "_id,number_1,number_2"; - private static final String TABLE3_COLUMN_NAMES = "_id,text_1,number_3,number_4"; - private static final String TEXT_COLUMN_NAME = "text_1"; - private static final int TABLE2_COLUMN_COUNT = 3; - private static final int TABLE3_COLUMN_COUNT = 4; - private static final int DEFAULT_TABLE_VALUE_BEGINS = 1; - private static final int MAX_VALUE = 10; - private static final int HALF_VALUE = MAX_VALUE / 2; - - @Override - protected void setUp() throws Exception { - super.setUp(); - setupDatabase(); - mCursors = new Cursor[2]; - } - - @Override - protected void tearDown() throws Exception { - for (int i = 0; i < mCursors.length; i++) { - if (null != mCursors[i]) { - mCursors[i].close(); - } - } - mDatabase.close(); - mDatabaseFile.delete(); - super.tearDown(); - } - - public void testConstructor() { - // If each item of mCursors are null, count will be zero. - MergeCursor mergeCursor = new MergeCursor(mCursors); - assertEquals(0, mergeCursor.getCount()); - - createCursors(); - - // if the items are not null, getCount() will return the sum of all cursors' count. - mergeCursor = new MergeCursor(mCursors); - assertEquals(mCursors[0].getCount() + mCursors[1].getCount(), mergeCursor.getCount()); - } - - public void testOnMove() { - createCursors(); - MergeCursor mergeCursor = new MergeCursor(mCursors); - for (int i = 0; i < MAX_VALUE; i++) { - mergeCursor.moveToNext(); - //From 1~5, mCursor should be in mCursors[0], larger than 5, it should be in - //mCursors[1]. - assertEquals(i + 1, mergeCursor.getInt(NUMBER_1_COLUMN_INDEX)); - } - } - - public void testCursorSwiching() { - mDatabase.execSQL("CREATE TABLE " + TABLE5_NAME + " (_id INTEGER PRIMARY KEY," - + TABLE3_COLUMNS + ");"); - String sql = "INSERT INTO " + TABLE5_NAME + " (" + TEXT_COLUMN_NAME + ") VALUES ('TEXT')"; - mDatabase.execSQL(sql); - - Cursor[] cursors = new Cursor[2]; - cursors[0] = mDatabase.query(TABLE5_NAME, null, null, null, null, null, null); - assertEquals(1, cursors[0].getCount()); - createCursors(); - cursors[1] = mCursors[1]; - assertTrue(cursors[1].getCount() > 0); - MergeCursor mergeCursor = new MergeCursor(cursors); - // MergeCursor should points to cursors[0] after moveToFirst. - mergeCursor.moveToFirst(); - - String[] tableColumns = TABLE3_COLUMN_NAMES.split("[,]"); - assertEquals(TABLE3_COLUMN_COUNT, mergeCursor.getColumnCount()); - assertTrue(Arrays.equals(tableColumns, mergeCursor.getColumnNames())); - - // MergeCursor should points to cursors[1] moveToNext. - mergeCursor.moveToNext(); - tableColumns = TABLE2_COLUMN_NAMES.split("[,]"); - assertEquals(TABLE2_COLUMN_COUNT, mergeCursor.getColumnCount()); - assertTrue(Arrays.equals(tableColumns, mergeCursor.getColumnNames())); - } - - public void testGetValues() { - byte NUMBER_BLOB_UNIT = 99; - String[] TEST_STRING = new String[] {"Test String1", "Test String2"}; - String[] tableNames = new String[] {TABLE3_NAME, TABLE4_NAME}; - - final double NUMBER_DOUBLE = Double.MAX_VALUE; - final double NUMBER_FLOAT = (float) NUMBER_DOUBLE; - final long NUMBER_LONG_INTEGER = (long) 0xaabbccddffL; - final long NUMBER_INTEGER = (int) NUMBER_LONG_INTEGER; - final long NUMBER_SHORT = (short) NUMBER_INTEGER; - - // create tables - byte[][] originalBlobs = new byte[2][]; - for (int i = 0; i < 2; i++) { - // insert blob and other values - originalBlobs[i] = new byte[1000]; - Arrays.fill(originalBlobs[i], (byte) (NUMBER_BLOB_UNIT - i)); - buildDatabaseWithTestValues(TEST_STRING[i], NUMBER_DOUBLE - i, NUMBER_LONG_INTEGER - i, - originalBlobs[i], tableNames[i]); - // Get cursors. - mCursors[i] = mDatabase.query(tableNames[i], null, null, null, null, null, null); - } - - MergeCursor mergeCursor = new MergeCursor(mCursors); - assertEquals(4, mergeCursor.getCount()); - String[] testColumns = new String[] {"_id", "string_text", "double_number", "int_number", - "blob_data"}; - // Test getColumnNames(). - assertTrue(Arrays.equals(testColumns, mergeCursor.getColumnNames())); - - int columnBlob = mCursors[0].getColumnIndexOrThrow("blob_data"); - int columnString = mCursors[0].getColumnIndexOrThrow("string_text"); - int columnDouble = mCursors[0].getColumnIndexOrThrow("double_number"); - int columnInteger = mCursors[0].getColumnIndexOrThrow("int_number"); - - // Test values. - for (int i = 0; i < 2; i++) { - mergeCursor.moveToNext(); - assertEquals(5, mergeCursor.getColumnCount()); - - // Test getting value methods. - byte[] targetBlob = mergeCursor.getBlob(columnBlob); - assertTrue(Arrays.equals(originalBlobs[i], targetBlob)); - - assertEquals(TEST_STRING[i], mergeCursor.getString(columnString)); - assertEquals(NUMBER_DOUBLE - i, mergeCursor.getDouble(columnDouble), 0.000000000001); - assertEquals(NUMBER_FLOAT - i, mergeCursor.getFloat(columnDouble), 0.000000000001f); - assertEquals(NUMBER_LONG_INTEGER - i, mergeCursor.getLong(columnInteger)); - assertEquals(NUMBER_INTEGER - i, mergeCursor.getInt(columnInteger)); - assertEquals(NUMBER_SHORT - i, mergeCursor.getShort(columnInteger)); - - // Test isNull(int). - assertFalse(mergeCursor.isNull(columnBlob)); - mergeCursor.moveToNext(); - assertEquals(COLUMN_FOR_NULL_TEST, mergeCursor.getString(columnString)); - assertTrue(mergeCursor.isNull(columnBlob)); - } - } - - public void testContentObsererOperations() throws IllegalStateException { - createCursors(); - MergeCursor mergeCursor = new MergeCursor(mCursors); - ContentObserver observer = new ContentObserver(null) { }; - - // Can't unregister a Observer before it has been registered. - try { - mergeCursor.unregisterContentObserver(observer); - fail("testUnregisterContentObserver failed"); - } catch (IllegalStateException e) { - // expected - } - - mergeCursor.registerContentObserver(observer); - - // Can't register a same observer twice before unregister it. - try { - mergeCursor.registerContentObserver(observer); - fail("testRegisterContentObserver failed"); - } catch (IllegalStateException e) { - // expected - } - - mergeCursor.unregisterContentObserver(observer); - // one Observer can be registered again after it has been unregistered. - mergeCursor.registerContentObserver(observer); - - mergeCursor.unregisterContentObserver(observer); - - try { - mergeCursor.unregisterContentObserver(observer); - fail("testUnregisterContentObserver failed"); - } catch (IllegalStateException e) { - // expected - } - } - - public void testDeactivate() throws IllegalStateException { - createCursors(); - MergeCursor mergeCursor = new MergeCursor(mCursors); - MockObserver observer = new MockObserver(); - - // one DataSetObserver can't unregistered before it had been registered. - try { - mergeCursor.unregisterDataSetObserver(observer); - fail("testUnregisterDataSetObserver failed"); - } catch (IllegalStateException e) { - // expected - } - - // Before registering, observer can't be notified. - assertFalse(observer.hasInvalidated()); - mergeCursor.moveToLast(); - mergeCursor.deactivate(); - assertFalse(observer.hasInvalidated()); - - // Test with registering DataSetObserver - assertTrue(mergeCursor.requery()); - mergeCursor.registerDataSetObserver(observer); - assertFalse(observer.hasInvalidated()); - mergeCursor.moveToLast(); - assertEquals(MAX_VALUE, mergeCursor.getInt(NUMBER_1_COLUMN_INDEX)); - mergeCursor.deactivate(); - // deactivate method can invoke invalidate() method, can be observed by DataSetObserver. - assertTrue(observer.hasInvalidated()); - // After deactivating, the cursor can not provide values from database record. - try { - mergeCursor.getInt(NUMBER_1_COLUMN_INDEX); - fail("After deactivating, cursor cannot execute getting value operations."); - } catch (StaleDataException e) { - // expected - } - - // Can't register a same observer twice before unregister it. - try { - mergeCursor.registerDataSetObserver(observer); - fail("testRegisterDataSetObserver failed"); - } catch (IllegalStateException e) { - // expected - } - - // After runegistering, observer can't be notified. - mergeCursor.unregisterDataSetObserver(observer); - observer.resetStatus(); - assertFalse(observer.hasInvalidated()); - mergeCursor.moveToLast(); - mergeCursor.deactivate(); - assertFalse(observer.hasInvalidated()); - - // one DataSetObserver can't be unregistered twice continuously. - try { - mergeCursor.unregisterDataSetObserver(observer); - fail("testUnregisterDataSetObserver failed"); - } catch (IllegalStateException e) { - // expected - } - } - - public void testRequery() { - final String TEST_VALUE1 = Integer.toString(MAX_VALUE + 1); - final String TEST_VALUE2 = Integer.toString(MAX_VALUE + 2); - createCursors(); - MergeCursor mergeCursor = new MergeCursor(mCursors); - int cursor1Count = mCursors[0].getCount(); - int cursor2Count = mCursors[0].getCount(); - - mDatabase.execSQL("INSERT INTO " + TABLE1_NAME + " (number_1) VALUES ('" + TEST_VALUE1 - + "');"); - assertEquals(cursor1Count + cursor2Count, mergeCursor.getCount()); - assertTrue(mergeCursor.requery()); - cursor1Count += 1; - assertEquals(cursor1Count + cursor2Count, mergeCursor.getCount()); - mDatabase.execSQL("INSERT INTO " + TABLE2_NAME + " (number_1) VALUES ('" + TEST_VALUE2 - + "');"); - cursor2Count += 1; - assertTrue(mergeCursor.requery()); - assertEquals(cursor1Count + cursor2Count, mergeCursor.getCount()); - - mergeCursor.close(); - assertFalse(mergeCursor.requery()); - } - - private void buildDatabaseWithTestValues(String text, double doubleNumber, long intNumber, - byte[] blob, String tablename) { - Object[] args = new Object[4]; - args[0] = text; - args[1] = doubleNumber; - args[2] = intNumber; - args[3] = blob; - mDatabase.execSQL("CREATE TABLE " + tablename + " (_id INTEGER PRIMARY KEY," - + "string_text TEXT, double_number REAL, int_number INTEGER, blob_data BLOB);"); - - // Insert record in giving table. - String sql = "INSERT INTO " + tablename + " (string_text, double_number, int_number," - + " blob_data) VALUES (?,?,?,?)"; - mDatabase.execSQL(sql, args); - // insert null blob. - sql = "INSERT INTO " + tablename + " (string_text) VALUES ('" + COLUMN_FOR_NULL_TEST + "')"; - mDatabase.execSQL(sql); - } - - private void setupDatabase() { - File dbDir = getContext().getDir("tests", Context.MODE_PRIVATE); - mDatabaseFile = new File(dbDir, "database_test.db"); - if (mDatabaseFile.exists()) { - mDatabaseFile.delete(); - } - mDatabase = SQLiteDatabase.openOrCreateDatabase(mDatabaseFile.getPath(), null); - assertNotNull(mDatabaseFile); - createTable(TABLE1_NAME, TABLE1_COLUMNS); - createTable(TABLE2_NAME, TABLE2_COLUMNS); - addValuesIntoTable(TABLE1_NAME, DEFAULT_TABLE_VALUE_BEGINS, HALF_VALUE); - addValuesIntoTable(TABLE2_NAME, HALF_VALUE + 1, MAX_VALUE); - } - - private void createTable(String tableName, String columnNames) { - String sql = "Create TABLE " + tableName + " (_id INTEGER PRIMARY KEY, " + columnNames - + " );"; - mDatabase.execSQL(sql); - } - - private void addValuesIntoTable(String tableName, int start, int end) { - for (int i = start; i <= end; i++) { - mDatabase.execSQL("INSERT INTO " + tableName + "(number_1) VALUES ('" - + i + "');"); - } - } - - private Cursor getCursor(String tableName, String selection, String[] columnNames) { - return mDatabase.query(tableName, columnNames, selection, null, null, null, "number_1"); - } - - private void createCursors() { - mCursors[0] = getCursor(TABLE1_NAME, null, null); - mCursors[1] = getCursor(TABLE2_NAME, null, null); - } - - private class MockObserver extends DataSetObserver { - private boolean mHasChanged = false; - private boolean mHasInvalidated = false; - - @Override - public void onChanged() { - super.onChanged(); - mHasChanged = true; - } - - @Override - public void onInvalidated() { - super.onInvalidated(); - mHasInvalidated = true; - } - - public void resetStatus() { - mHasChanged = false; - mHasInvalidated = false; - } - - public boolean hasChanged() { - return mHasChanged; - } - - public boolean hasInvalidated() { - return mHasInvalidated; - } - } -} diff --git a/proprietary/frameworks/base/tests/database/src/android/database/cts/ObservableTest.java b/proprietary/frameworks/base/tests/database/src/android/database/cts/ObservableTest.java deleted file mode 100755 index 445f09f06abaaeb7ec300f3ad8eb209cb987ffd5..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/database/src/android/database/cts/ObservableTest.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.database.cts; - -import android.database.Observable; -import android.test.AndroidTestCase; - -public class ObservableTest extends AndroidTestCase { - public void testRegisterUnRegisterObserver() { - MockObservable observable = new MockObservable(); - - // Test register a null observer object - try { - observable.registerObserver((null)); - fail("registerObserver should throw a IllegalArgumentException here."); - } catch (IllegalArgumentException e) { - } - - Object observer = new Object(); - // In the beginning, Observable has no observer object, nothing to be unregistered. - try { - observable.unregisterObserver(observer); - fail("unregisterObserver should throw a IllegalStateException here."); - } catch (IllegalStateException e) { - } - - // Test unregister a null object, the Observable will unregister nothing. - try { - observable.unregisterObserver(null); - fail("unregisterObserver should throw a IllegalArgumentException here."); - } catch (IllegalArgumentException e) { - } - - // Test register a observer object - observable.registerObserver(observer); - // If previous registerObserver was executed successfully, the object can't be registered - // twice. - try { - observable.registerObserver(observer); - fail("registerObserver should throw a IllegalStateException here."); - } catch (IllegalStateException e) { - } - - // Test unregister a observer object - observable.unregisterObserver(observer); - // If unregister function was executed successfully, the input observer object will be - // removed, so it can not be unregistered anymore, and it can be registered again. - try { - observable.unregisterObserver(observer); - fail("unregisterObserver should throw a IllegalStateException here."); - } catch (IllegalStateException e) { - } - observable.registerObserver(observer); - } - - public void testUnregisterAll() { - MockObservable observable = new MockObservable(); - Object observer1 = new Object(); - Object observer2 = new Object(); - - observable.registerObserver(observer1); - observable.registerObserver(observer2); - - // If a observer was registered, it can't be registered again. - try { - observable.registerObserver(observer1); - fail("registerObserver should throw a IllegalStateException here."); - } catch (IllegalStateException e) { - } - try { - observable.registerObserver(observer2); - fail("registerObserver should throw a IllegalStateException here."); - } catch (IllegalStateException e) { - } - - // unregisterAll will unregister all the registered observers. - observable.unregisterAll(); - // The Observable will be empty after unregisterAll, so it can register observers again. - observable.registerObserver(observer1); - observable.registerObserver(observer2); - } - - private class MockObservable extends Observable { - } -} diff --git a/proprietary/frameworks/base/tests/database/src/android/database/cts/SQLExceptionTest.java b/proprietary/frameworks/base/tests/database/src/android/database/cts/SQLExceptionTest.java deleted file mode 100755 index c0265616ebe48f2c74bb75f2891b64d41997e7f6..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/database/src/android/database/cts/SQLExceptionTest.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.database.cts; - -import android.database.SQLException; -import android.test.AndroidTestCase; - -public class SQLExceptionTest extends AndroidTestCase { - - public void testConstructors() { - String expected1 = "Expected exception message"; - - // Test SQLException() - try { - throw new SQLException(); - } catch (SQLException e) { - assertNull(e.getMessage()); - } - - // Test SQLException(String) - try { - throw new SQLException(expected1); - } catch (SQLException e) { - assertEquals(expected1, e.getMessage()); - } - } -} diff --git a/proprietary/frameworks/base/tests/database/src/android/database/cts/StaleDataExceptionTest.java b/proprietary/frameworks/base/tests/database/src/android/database/cts/StaleDataExceptionTest.java deleted file mode 100755 index cffed5339ae0ed4da0fed1a27159b1babbe34278..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/database/src/android/database/cts/StaleDataExceptionTest.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.database.cts; - -import android.database.StaleDataException; -import android.test.AndroidTestCase; - -public class StaleDataExceptionTest extends AndroidTestCase { - public void testConstructors() { - String expected1 = "Expected exception message"; - - // Test StaleDataException() - try { - throw new StaleDataException(); - } catch (StaleDataException e) { - assertNull(e.getMessage()); - } - - // Test StaleDataException(String) - try { - throw new StaleDataException(expected1); - } catch (StaleDataException e) { - assertEquals(expected1, e.getMessage()); - } - } -} diff --git a/proprietary/frameworks/base/tests/database/src/android/database/sqlite/cts/DatabaseStatementTest.java b/proprietary/frameworks/base/tests/database/src/android/database/sqlite/cts/DatabaseStatementTest.java deleted file mode 100755 index 247039aea30d6027441c542b4f1004808083e6be..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/database/src/android/database/sqlite/cts/DatabaseStatementTest.java +++ /dev/null @@ -1,323 +0,0 @@ -/* - * Copyright (C) 2007 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.database.sqlite.cts; - -import android.content.Context; -import android.database.Cursor; -import android.database.sqlite.SQLiteConstraintException; -import android.database.sqlite.SQLiteDatabase; -import android.database.sqlite.SQLiteDoneException; -import android.database.sqlite.SQLiteStatement; -import android.test.AndroidTestCase; -import android.test.PerformanceTestCase; -import android.test.suitebuilder.annotation.MediumTest; - -/* - * These tests were taken from - * frameworks/base/tests/AndroidTests/src/com/android/unit_tests/DatabaseStatementTest.java - * Modifications: - * - use Context to create and delete the DB to avoid hard-coded paths - */ -public class DatabaseStatementTest extends AndroidTestCase implements PerformanceTestCase { - - private static final String sString1 = "this is a test"; - private static final String sString2 = "and yet another test"; - private static final String sString3 = "this string is a little longer, but still a test"; - - private static final String DATABASE_NAME = "database_test.db"; - - private static final int CURRENT_DATABASE_VERSION = 42; - private SQLiteDatabase mDatabase; - - @Override - protected void setUp() throws Exception { - super.setUp(); - - getContext().deleteDatabase(DATABASE_NAME); - mDatabase = getContext().openOrCreateDatabase(DATABASE_NAME, Context.MODE_PRIVATE, null); - assertNotNull(mDatabase); - mDatabase.setVersion(CURRENT_DATABASE_VERSION); - } - - @Override - protected void tearDown() throws Exception { - mDatabase.close(); - getContext().deleteDatabase(DATABASE_NAME); - super.tearDown(); - } - - public boolean isPerformanceOnly() { - return false; - } - - // These test can only be run once. - public int startPerformance(Intermediates intermediates) { - return 1; - } - - private void populateDefaultTable() { - mDatabase.execSQL("CREATE TABLE test (_id INTEGER PRIMARY KEY, data TEXT);"); - - mDatabase.execSQL("INSERT INTO test (data) VALUES ('" + sString1 + "');"); - mDatabase.execSQL("INSERT INTO test (data) VALUES ('" + sString2 + "');"); - mDatabase.execSQL("INSERT INTO test (data) VALUES ('" + sString3 + "');"); - } - - @MediumTest - public void testExecuteStatement() throws Exception { - populateDefaultTable(); - SQLiteStatement statement = mDatabase.compileStatement("DELETE FROM test"); - statement.execute(); - - Cursor c = mDatabase.query("test", null, null, null, null, null, null); - assertEquals(0, c.getCount()); - c.deactivate(); - statement.close(); - } - - @MediumTest - public void testSimpleQuery() throws Exception { - mDatabase.execSQL("CREATE TABLE test (num INTEGER NOT NULL, str TEXT NOT NULL);"); - mDatabase.execSQL("INSERT INTO test VALUES (1234, 'hello');"); - SQLiteStatement statement1 = - mDatabase.compileStatement("SELECT num FROM test WHERE str = ?"); - SQLiteStatement statement2 = - mDatabase.compileStatement("SELECT str FROM test WHERE num = ?"); - - try { - statement1.bindString(1, "hello"); - long value = statement1.simpleQueryForLong(); - assertEquals(1234, value); - - statement1.bindString(1, "world"); - statement1.simpleQueryForLong(); - fail("shouldn't get here"); - } catch (SQLiteDoneException e) { - // expected - } - - try { - statement2.bindLong(1, 1234); - String value = statement1.simpleQueryForString(); - assertEquals("hello", value); - - statement2.bindLong(1, 5678); - statement1.simpleQueryForString(); - fail("shouldn't get here"); - } catch (SQLiteDoneException e) { - // expected - } - - statement1.close(); - statement2.close(); - } - - @MediumTest - public void testStatementLongBinding() throws Exception { - mDatabase.execSQL("CREATE TABLE test (num INTEGER);"); - SQLiteStatement statement = mDatabase.compileStatement("INSERT INTO test (num) VALUES (?)"); - - for (int i = 0; i < 10; i++) { - statement.bindLong(1, i); - statement.execute(); - } - statement.close(); - - Cursor c = mDatabase.query("test", null, null, null, null, null, null); - int numCol = c.getColumnIndexOrThrow("num"); - c.moveToFirst(); - for (long i = 0; i < 10; i++) { - long num = c.getLong(numCol); - assertEquals(i, num); - c.moveToNext(); - } - c.close(); - } - - @MediumTest - public void testStatementStringBinding() throws Exception { - mDatabase.execSQL("CREATE TABLE test (num TEXT);"); - SQLiteStatement statement = mDatabase.compileStatement("INSERT INTO test (num) VALUES (?)"); - - for (long i = 0; i < 10; i++) { - statement.bindString(1, Long.toHexString(i)); - statement.execute(); - } - statement.close(); - - Cursor c = mDatabase.query("test", null, null, null, null, null, null); - int numCol = c.getColumnIndexOrThrow("num"); - c.moveToFirst(); - for (long i = 0; i < 10; i++) { - String num = c.getString(numCol); - assertEquals(Long.toHexString(i), num); - c.moveToNext(); - } - c.close(); - } - - @MediumTest - public void testStatementClearBindings() throws Exception { - mDatabase.execSQL("CREATE TABLE test (num INTEGER);"); - SQLiteStatement statement = mDatabase.compileStatement("INSERT INTO test (num) VALUES (?)"); - - for (long i = 0; i < 10; i++) { - statement.bindLong(1, i); - statement.clearBindings(); - statement.execute(); - } - statement.close(); - - Cursor c = mDatabase.query("test", null, null, null, null, null, "ROWID"); - int numCol = c.getColumnIndexOrThrow("num"); - assertTrue(c.moveToFirst()); - for (long i = 0; i < 10; i++) { - assertTrue(c.isNull(numCol)); - c.moveToNext(); - } - c.close(); - } - - @MediumTest - public void testSimpleStringBinding() throws Exception { - mDatabase.execSQL("CREATE TABLE test (num TEXT, value TEXT);"); - String statement = "INSERT INTO test (num, value) VALUES (?,?)"; - - String[] args = new String[2]; - for (int i = 0; i < 2; i++) { - args[i] = Integer.toHexString(i); - } - - mDatabase.execSQL(statement, args); - - Cursor c = mDatabase.query("test", null, null, null, null, null, null); - int numCol = c.getColumnIndexOrThrow("num"); - int valCol = c.getColumnIndexOrThrow("value"); - c.moveToFirst(); - String num = c.getString(numCol); - assertEquals(Integer.toHexString(0), num); - - String val = c.getString(valCol); - assertEquals(Integer.toHexString(1), val); - c.close(); - } - - @MediumTest - public void testStatementMultipleBindings() throws Exception { - mDatabase.execSQL("CREATE TABLE test (num INTEGER, str TEXT);"); - SQLiteStatement statement = - mDatabase.compileStatement("INSERT INTO test (num, str) VALUES (?, ?)"); - - for (long i = 0; i < 10; i++) { - statement.bindLong(1, i); - statement.bindString(2, Long.toHexString(i)); - statement.execute(); - } - statement.close(); - - Cursor c = mDatabase.query("test", null, null, null, null, null, "ROWID"); - int numCol = c.getColumnIndexOrThrow("num"); - int strCol = c.getColumnIndexOrThrow("str"); - assertTrue(c.moveToFirst()); - for (long i = 0; i < 10; i++) { - long num = c.getLong(numCol); - String str = c.getString(strCol); - assertEquals(i, num); - assertEquals(Long.toHexString(i), str); - c.moveToNext(); - } - c.close(); - } - - private static class StatementTestThread extends Thread { - private SQLiteDatabase mDatabase; - private SQLiteStatement mStatement; - - public StatementTestThread(SQLiteDatabase db, SQLiteStatement statement) { - super(); - mDatabase = db; - mStatement = statement; - } - - @Override - public void run() { - mDatabase.beginTransaction(); - for (long i = 0; i < 10; i++) { - mStatement.bindLong(1, i); - mStatement.bindString(2, Long.toHexString(i)); - mStatement.execute(); - } - mDatabase.setTransactionSuccessful(); - mDatabase.endTransaction(); - - Cursor c = mDatabase.query("test", null, null, null, null, null, "ROWID"); - int numCol = c.getColumnIndexOrThrow("num"); - int strCol = c.getColumnIndexOrThrow("str"); - assertTrue(c.moveToFirst()); - for (long i = 0; i < 10; i++) { - long num = c.getLong(numCol); - String str = c.getString(strCol); - assertEquals(i, num); - assertEquals(Long.toHexString(i), str); - c.moveToNext(); - } - c.close(); - } - } - - @MediumTest - public void testStatementMultiThreaded() throws Exception { - mDatabase.execSQL("CREATE TABLE test (num INTEGER, str TEXT);"); - SQLiteStatement statement = - mDatabase.compileStatement("INSERT INTO test (num, str) VALUES (?, ?)"); - - StatementTestThread thread = new StatementTestThread(mDatabase, statement); - thread.start(); - try { - thread.join(); - } finally { - statement.close(); - } - } - - @MediumTest - public void testStatementConstraint() throws Exception { - mDatabase.execSQL("CREATE TABLE test (num INTEGER NOT NULL);"); - SQLiteStatement statement = mDatabase.compileStatement("INSERT INTO test (num) VALUES (?)"); - - // Try to insert NULL, which violates the constraint - try { - statement.clearBindings(); - statement.execute(); - fail("expected exception not thrown"); - } catch (SQLiteConstraintException e) { - // expected - } - - // Make sure the statement can still be used - statement.bindLong(1, 1); - statement.execute(); - statement.close(); - - Cursor c = mDatabase.query("test", null, null, null, null, null, null); - int numCol = c.getColumnIndexOrThrow("num"); - c.moveToFirst(); - long num = c.getLong(numCol); - assertEquals(1, num); - c.close(); - } -} diff --git a/proprietary/frameworks/base/tests/database/src/android/database/sqlite/cts/SQLiteAbortExceptionTest.java b/proprietary/frameworks/base/tests/database/src/android/database/sqlite/cts/SQLiteAbortExceptionTest.java deleted file mode 100755 index ccf344a4e1ba278956f322a6ca02dec9acbecaea..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/database/src/android/database/sqlite/cts/SQLiteAbortExceptionTest.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (C) 2009 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.database.sqlite.cts; - -import android.database.sqlite.SQLiteAbortException; -import android.test.AndroidTestCase; - -public class SQLiteAbortExceptionTest extends AndroidTestCase { - public void testConstructor() { - new SQLiteAbortException(); - - new SQLiteAbortException("error"); - } -} diff --git a/proprietary/frameworks/base/tests/database/src/android/database/sqlite/cts/SQLiteClosableTest.java b/proprietary/frameworks/base/tests/database/src/android/database/sqlite/cts/SQLiteClosableTest.java deleted file mode 100755 index 4f5c60a02b3c8b37a9b30a90aa630e614b460f6e..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/database/src/android/database/sqlite/cts/SQLiteClosableTest.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (C) 2009 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.database.sqlite.cts; - -import android.database.sqlite.SQLiteClosable; -import android.test.AndroidTestCase; - -public class SQLiteClosableTest extends AndroidTestCase { - private class MockSQLiteClosable extends SQLiteClosable { - private boolean mOnAllReferencesReleasedCalled = false; - private boolean mOnAllReferencesReleasedFromContainerCalled = false; - - @Override - protected void onAllReferencesReleased() { - mOnAllReferencesReleasedCalled = true; - } - - protected void onAllReferencesReleasedFromContainer() { - mOnAllReferencesReleasedFromContainerCalled = true; - } - - public boolean isOnAllReferencesReleasedCalled() { - return mOnAllReferencesReleasedCalled; - } - - public boolean isOnAllReferencesReleasedFromContainerCalled() { - return mOnAllReferencesReleasedFromContainerCalled; - } - } - - public void testAcquireReference() { - MockSQLiteClosable closable = new MockSQLiteClosable(); - - closable.acquireReference(); - closable.releaseReference(); - - assertFalse(closable.isOnAllReferencesReleasedCalled()); - closable.releaseReference(); - // the reference count is 0 now. - assertTrue(closable.isOnAllReferencesReleasedCalled()); - - try { - closable.acquireReference(); - fail("should throw IllegalStateException."); - } catch (IllegalStateException e) { - } - } - - public void testReleaseReferenceFromContainer() { - MockSQLiteClosable closable = new MockSQLiteClosable(); - - closable.acquireReference(); - closable.releaseReferenceFromContainer(); - - // the reference count is 1 now. - assertFalse(closable.isOnAllReferencesReleasedFromContainerCalled()); - closable.releaseReferenceFromContainer(); - // the reference count is 0 now. - assertTrue(closable.isOnAllReferencesReleasedFromContainerCalled()); - } -} diff --git a/proprietary/frameworks/base/tests/database/src/android/database/sqlite/cts/SQLiteConstraintExceptionTest.java b/proprietary/frameworks/base/tests/database/src/android/database/sqlite/cts/SQLiteConstraintExceptionTest.java deleted file mode 100755 index cce4d02cb922380f3dcbf105f9308c8fd47ee4c0..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/database/src/android/database/sqlite/cts/SQLiteConstraintExceptionTest.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (C) 2009 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.database.sqlite.cts; - -import android.database.sqlite.SQLiteConstraintException; -import android.test.AndroidTestCase; - -public class SQLiteConstraintExceptionTest extends AndroidTestCase { - public void testConstructor() { - new SQLiteConstraintException(); - - new SQLiteConstraintException("error"); - } -} diff --git a/proprietary/frameworks/base/tests/database/src/android/database/sqlite/cts/SQLiteCursorTest.java b/proprietary/frameworks/base/tests/database/src/android/database/sqlite/cts/SQLiteCursorTest.java deleted file mode 100755 index f81de90e8f631310085336432674e860059cdbf5..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/database/src/android/database/sqlite/cts/SQLiteCursorTest.java +++ /dev/null @@ -1,283 +0,0 @@ -/* - * Copyright (C) 2009 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.database.sqlite.cts; - - -import android.content.Context; -import android.database.Cursor; -import android.database.CursorWindow; -import android.database.DataSetObserver; -import android.database.StaleDataException; -import android.database.sqlite.SQLiteCursor; -import android.database.sqlite.SQLiteDatabase; -import android.database.sqlite.SQLiteDirectCursorDriver; -import android.test.AndroidTestCase; - -import java.util.Arrays; - -/** - * Test {@link AbstractCursor}. - */ -public class SQLiteCursorTest extends AndroidTestCase { - private SQLiteDatabase mDatabase; - private static final String[] COLUMNS = new String[] { "_id", "number_1", "number_2" }; - private static final String TABLE_NAME = "test"; - private static final String TABLE_COLUMNS = " number_1 INTEGER, number_2 INTEGER"; - private static final int DEFAULT_TABLE_VALUE_BEGINS = 1; - private static final int TEST_COUNT = 10; - private static final String TEST_SQL = "SELECT * FROM test ORDER BY number_1"; - private static final String DATABASE_FILE = "database_test.db"; - - @Override - protected void setUp() throws Exception { - super.setUp(); - getContext().deleteDatabase(DATABASE_FILE); - mDatabase = getContext().openOrCreateDatabase(DATABASE_FILE, Context.MODE_PRIVATE, null); - createTable(TABLE_NAME, TABLE_COLUMNS); - addValuesIntoTable(TABLE_NAME, DEFAULT_TABLE_VALUE_BEGINS, TEST_COUNT); - } - - @Override - protected void tearDown() throws Exception { - mDatabase.close(); - getContext().deleteDatabase(DATABASE_FILE); - super.tearDown(); - } - - public void testConstructor() { - SQLiteDirectCursorDriver cursorDriver = new SQLiteDirectCursorDriver(mDatabase, - TEST_SQL, TABLE_NAME, null); - try { - new SQLiteCursor(mDatabase, cursorDriver, TABLE_NAME, null); - fail("constructor didn't throw IllegalArgumentException when SQLiteQuery is null"); - } catch (IllegalArgumentException e) { - } - - // get SQLiteCursor by querying database - SQLiteCursor cursor = getCursor(); - assertNotNull(cursor); - } - - public void testClose() { - SQLiteCursor cursor = getCursor(); - assertTrue(cursor.moveToFirst()); - assertFalse(cursor.isClosed()); - assertTrue(cursor.requery()); - cursor.close(); - assertFalse(cursor.requery()); - try { - cursor.moveToFirst(); - fail("moveToFirst didn't throw IllegalStateException after closed."); - } catch (IllegalStateException e) { - } - assertTrue(cursor.isClosed()); - } - - public void testRegisterDataSetObserver() { - SQLiteCursor cursor = getCursor(); - MockCursorWindow cursorWindow = new MockCursorWindow(false); - - MockObserver observer = new MockObserver(); - - cursor.setWindow(cursorWindow); - // Before registering, observer can't be notified. - assertFalse(observer.hasInvalidated()); - cursor.moveToLast(); - assertFalse(cursorWindow.isClosed()); - cursor.deactivate(); - assertFalse(observer.hasInvalidated()); - // deactivate() will close the CursorWindow - assertTrue(cursorWindow.isClosed()); - - // test registering DataSetObserver - assertTrue(cursor.requery()); - cursor.registerDataSetObserver(observer); - assertFalse(observer.hasInvalidated()); - cursor.moveToLast(); - assertEquals(TEST_COUNT, cursor.getInt(1)); - cursor.deactivate(); - // deactivate method can invoke invalidate() method, can be observed by DataSetObserver. - assertTrue(observer.hasInvalidated()); - - try { - cursor.getInt(1); - fail("After deactivating, cursor cannot execute getting value operations."); - } catch (StaleDataException e) { - } - - assertTrue(cursor.requery()); - cursor.moveToLast(); - assertEquals(TEST_COUNT, cursor.getInt(1)); - - // can't register a same observer twice. - try { - cursor.registerDataSetObserver(observer); - fail("didn't throw IllegalStateException when register existed observer"); - } catch (IllegalStateException e) { - } - - // after unregistering, observer can't be notified. - cursor.unregisterDataSetObserver(observer); - observer.resetStatus(); - assertFalse(observer.hasInvalidated()); - cursor.deactivate(); - assertFalse(observer.hasInvalidated()); - } - - public void testRequery() { - final String DELETE = "DELETE FROM " + TABLE_NAME + " WHERE number_1 ="; - final String DELETE_1 = DELETE + "1;"; - final String DELETE_2 = DELETE + "2;"; - - mDatabase.execSQL(DELETE_1); - // when cursor is created, it refreshes CursorWindow and populates cursor count - SQLiteCursor cursor = getCursor(); - MockObserver observer = new MockObserver(); - cursor.registerDataSetObserver(observer); - assertEquals(TEST_COUNT - 1, cursor.getCount()); - assertFalse(observer.hasChanged()); - - mDatabase.execSQL(DELETE_2); - // when getCount() has invoked once, it can no longer refresh CursorWindow. - assertEquals(TEST_COUNT - 1, cursor.getCount()); - - assertTrue(cursor.requery()); - // only after requery, getCount can get most up-to-date counting info now. - assertEquals(TEST_COUNT - 2, cursor.getCount()); - assertTrue(observer.hasChanged()); - } - - public void testRequery2() { - mDatabase.disableWriteAheadLogging(); - mDatabase.execSQL("create table testRequery2 (i int);"); - mDatabase.execSQL("insert into testRequery2 values(1);"); - mDatabase.execSQL("insert into testRequery2 values(2);"); - Cursor c = mDatabase.rawQuery("select * from testRequery2 order by i", null); - assertEquals(2, c.getCount()); - assertTrue(c.moveToFirst()); - assertEquals(1, c.getInt(0)); - assertTrue(c.moveToNext()); - assertEquals(2, c.getInt(0)); - // add more data to the table and requery - mDatabase.execSQL("insert into testRequery2 values(3);"); - assertTrue(c.requery()); - assertEquals(3, c.getCount()); - assertTrue(c.moveToFirst()); - assertEquals(1, c.getInt(0)); - assertTrue(c.moveToNext()); - assertEquals(2, c.getInt(0)); - assertTrue(c.moveToNext()); - assertEquals(3, c.getInt(0)); - // close the database and see if requery throws an exception - mDatabase.close(); - assertFalse(c.requery()); - } - - public void testGetColumnIndex() { - SQLiteCursor cursor = getCursor(); - - for (int i = 0; i < COLUMNS.length; i++) { - assertEquals(i, cursor.getColumnIndex(COLUMNS[i])); - } - - assertTrue(Arrays.equals(COLUMNS, cursor.getColumnNames())); - } - - public void testSetSelectionArguments() { - final String SELECTION = "_id > ?"; - int TEST_ARG1 = 2; - int TEST_ARG2 = 5; - SQLiteCursor cursor = (SQLiteCursor) mDatabase.query(TABLE_NAME, null, SELECTION, - new String[] { Integer.toString(TEST_ARG1) }, null, null, null); - assertEquals(TEST_COUNT - TEST_ARG1, cursor.getCount()); - cursor.setSelectionArguments(new String[] { Integer.toString(TEST_ARG2) }); - cursor.requery(); - assertEquals(TEST_COUNT - TEST_ARG2, cursor.getCount()); - } - - public void testOnMove() { - // Do not test this API. It is callback which: - // 1. The callback mechanism has been tested in super class - // 2. The functionality is implementation details, no need to test - } - - private void createTable(String tableName, String columnNames) { - String sql = "Create TABLE " + tableName + " (_id INTEGER PRIMARY KEY, " - + columnNames + " );"; - mDatabase.execSQL(sql); - } - - private void addValuesIntoTable(String tableName, int start, int end) { - for (int i = start; i <= end; i++) { - mDatabase.execSQL("INSERT INTO " + tableName + "(number_1) VALUES ('" + i + "');"); - } - } - - private SQLiteCursor getCursor() { - SQLiteCursor cursor = (SQLiteCursor) mDatabase.query(TABLE_NAME, null, null, - null, null, null, null); - return cursor; - } - - private class MockObserver extends DataSetObserver { - private boolean mHasChanged = false; - private boolean mHasInvalidated = false; - - @Override - public void onChanged() { - super.onChanged(); - mHasChanged = true; - } - - @Override - public void onInvalidated() { - super.onInvalidated(); - mHasInvalidated = true; - } - - protected void resetStatus() { - mHasChanged = false; - mHasInvalidated = false; - } - - protected boolean hasChanged() { - return mHasChanged; - } - - protected boolean hasInvalidated() { - return mHasInvalidated; - } - } - - private class MockCursorWindow extends CursorWindow { - private boolean mIsClosed = false; - - public MockCursorWindow(boolean localWindow) { - super(localWindow); - } - - @Override - public void close() { - super.close(); - mIsClosed = true; - } - - public boolean isClosed() { - return mIsClosed; - } - } -} diff --git a/proprietary/frameworks/base/tests/database/src/android/database/sqlite/cts/SQLiteDatabaseCorruptExceptionTest.java b/proprietary/frameworks/base/tests/database/src/android/database/sqlite/cts/SQLiteDatabaseCorruptExceptionTest.java deleted file mode 100755 index 3d8f56aa7c8ec2fc9e3d6db14fa704b43a796dd8..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/database/src/android/database/sqlite/cts/SQLiteDatabaseCorruptExceptionTest.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (C) 2009 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.database.sqlite.cts; - -import android.database.sqlite.SQLiteDatabaseCorruptException; -import android.test.AndroidTestCase; - -public class SQLiteDatabaseCorruptExceptionTest extends AndroidTestCase { - public void testConstructor() { - new SQLiteDatabaseCorruptException(); - - new SQLiteDatabaseCorruptException("error"); - } -} diff --git a/proprietary/frameworks/base/tests/database/src/android/database/sqlite/cts/SQLiteDatabaseTest.java b/proprietary/frameworks/base/tests/database/src/android/database/sqlite/cts/SQLiteDatabaseTest.java deleted file mode 100755 index 29ed9868e946a4e2b44bee2c2fd48aaec674d6b9..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/database/src/android/database/sqlite/cts/SQLiteDatabaseTest.java +++ /dev/null @@ -1,1494 +0,0 @@ -/* - * Copyright (C) 2009 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.database.sqlite.cts; - -import java.io.File; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Locale; -import java.util.concurrent.Semaphore; - -import android.content.ContentValues; -import android.content.Context; -import android.database.Cursor; -import android.database.DatabaseUtils; -import android.database.SQLException; -import android.database.sqlite.SQLiteCursor; -import android.database.sqlite.SQLiteCursorDriver; -import android.database.sqlite.SQLiteDatabase; -import android.database.sqlite.SQLiteDatabase.CursorFactory; -import android.database.sqlite.SQLiteQuery; -import android.database.sqlite.SQLiteStatement; -import android.database.sqlite.SQLiteTransactionListener; -import android.test.AndroidTestCase; -import android.test.MoreAsserts; -import android.test.suitebuilder.annotation.LargeTest; - -public class SQLiteDatabaseTest extends AndroidTestCase { - private SQLiteDatabase mDatabase; - private File mDatabaseFile; - private String mDatabaseFilePath; - private String mDatabaseDir; - - private boolean mTransactionListenerOnBeginCalled; - private boolean mTransactionListenerOnCommitCalled; - private boolean mTransactionListenerOnRollbackCalled; - - private static final String DATABASE_FILE_NAME = "database_test.db"; - private static final String TABLE_NAME = "test"; - private static final int COLUMN_ID_INDEX = 0; - private static final int COLUMN_NAME_INDEX = 1; - private static final int COLUMN_AGE_INDEX = 2; - private static final int COLUMN_ADDR_INDEX = 3; - private static final String[] TEST_PROJECTION = new String[] { - "_id", // 0 - "name", // 1 - "age", // 2 - "address" // 3 - }; - - @Override - protected void setUp() throws Exception { - super.setUp(); - - getContext().deleteDatabase(DATABASE_FILE_NAME); - mDatabaseFilePath = getContext().getDatabasePath(DATABASE_FILE_NAME).getPath(); - mDatabaseFile = getContext().getDatabasePath(DATABASE_FILE_NAME); - mDatabaseDir = mDatabaseFile.getParent(); - mDatabaseFile.getParentFile().mkdirs(); // directory may not exist - mDatabase = SQLiteDatabase.openOrCreateDatabase(mDatabaseFile, null); - assertNotNull(mDatabase); - - mTransactionListenerOnBeginCalled = false; - mTransactionListenerOnCommitCalled = false; - mTransactionListenerOnRollbackCalled = false; - } - - @Override - protected void tearDown() throws Exception { - mDatabase.close(); - mDatabaseFile.delete(); - super.tearDown(); - } - - public void testOpenDatabase() { - CursorFactory factory = new CursorFactory() { - public Cursor newCursor(SQLiteDatabase db, SQLiteCursorDriver masterQuery, - String editTable, SQLiteQuery query) { - return new MockSQLiteCursor(db, masterQuery, editTable, query); - } - }; - - SQLiteDatabase db = SQLiteDatabase.openDatabase(mDatabaseFilePath, - factory, SQLiteDatabase.CREATE_IF_NECESSARY); - assertNotNull(db); - db.close(); - - File dbFile = new File(mDatabaseDir, "database_test12345678.db"); - dbFile.delete(); - assertFalse(dbFile.exists()); - db = SQLiteDatabase.openOrCreateDatabase(dbFile.getPath(), factory); - assertNotNull(db); - db.close(); - dbFile.delete(); - - dbFile = new File(mDatabaseDir, DATABASE_FILE_NAME); - db = SQLiteDatabase.openOrCreateDatabase(dbFile, factory); - assertNotNull(db); - db.close(); - dbFile.delete(); - - db = SQLiteDatabase.create(factory); - assertNotNull(db); - db.close(); - } - - public void testDeleteDatabase() throws IOException { - File dbFile = new File(mDatabaseDir, "database_test12345678.db"); - File journalFile = new File(dbFile.getPath() + "-journal"); - File shmFile = new File(dbFile.getPath() + "-shm"); - File walFile = new File(dbFile.getPath() + "-wal"); - File mjFile1 = new File(dbFile.getPath() + "-mj00000000"); - File mjFile2 = new File(dbFile.getPath() + "-mj00000001"); - File innocentFile = new File(dbFile.getPath() + "-innocent"); - - dbFile.createNewFile(); - journalFile.createNewFile(); - shmFile.createNewFile(); - walFile.createNewFile(); - mjFile1.createNewFile(); - mjFile2.createNewFile(); - innocentFile.createNewFile(); - - boolean deleted = SQLiteDatabase.deleteDatabase(dbFile); - assertTrue(deleted); - - assertFalse(dbFile.exists()); - assertFalse(journalFile.exists()); - assertFalse(shmFile.exists()); - assertFalse(walFile.exists()); - assertFalse(mjFile1.exists()); - assertFalse(mjFile2.exists()); - assertTrue(innocentFile.exists()); - - innocentFile.delete(); - - boolean deletedAgain = SQLiteDatabase.deleteDatabase(dbFile); - assertFalse(deletedAgain); - } - - private class MockSQLiteCursor extends SQLiteCursor { - public MockSQLiteCursor(SQLiteDatabase db, SQLiteCursorDriver driver, - String editTable, SQLiteQuery query) { - super(db, driver, editTable, query); - } - } - - public void testTransaction() { - mDatabase.execSQL("CREATE TABLE test (num INTEGER);"); - mDatabase.execSQL("INSERT INTO test (num) VALUES (0)"); - - // test execSQL without any explicit transactions. - setNum(1); - assertNum(1); - - // Test a single-level transaction. - setNum(0); - assertFalse(mDatabase.inTransaction()); - mDatabase.beginTransaction(); - assertTrue(mDatabase.inTransaction()); - setNum(1); - mDatabase.setTransactionSuccessful(); - mDatabase.endTransaction(); - assertFalse(mDatabase.inTransaction()); - assertNum(1); - assertFalse(mDatabase.isDbLockedByCurrentThread()); - assertFalse(mDatabase.isDbLockedByOtherThreads()); - - // Test a rolled-back transaction. - setNum(0); - assertFalse(mDatabase.inTransaction()); - mDatabase.beginTransaction(); - setNum(1); - assertTrue(mDatabase.inTransaction()); - mDatabase.endTransaction(); - assertFalse(mDatabase.inTransaction()); - assertNum(0); - assertFalse(mDatabase.isDbLockedByCurrentThread()); - assertFalse(mDatabase.isDbLockedByOtherThreads()); - - // it should throw IllegalStateException if we end a non-existent transaction. - assertThrowsIllegalState(new Runnable() { - public void run() { - mDatabase.endTransaction(); - } - }); - - // it should throw IllegalStateException if a set a non-existent transaction as clean. - assertThrowsIllegalState(new Runnable() { - public void run() { - mDatabase.setTransactionSuccessful(); - } - }); - - mDatabase.beginTransaction(); - mDatabase.setTransactionSuccessful(); - // it should throw IllegalStateException if we mark a transaction as clean twice. - assertThrowsIllegalState(new Runnable() { - public void run() { - mDatabase.setTransactionSuccessful(); - } - }); - // it should throw IllegalStateException if we begin a transaction after marking the - // parent as clean. - assertThrowsIllegalState(new Runnable() { - public void run() { - mDatabase.beginTransaction(); - } - }); - mDatabase.endTransaction(); - assertFalse(mDatabase.isDbLockedByCurrentThread()); - assertFalse(mDatabase.isDbLockedByOtherThreads()); - - assertFalse(mDatabase.inTransaction()); - // Test a two-level transaction. - setNum(0); - mDatabase.beginTransaction(); - assertTrue(mDatabase.inTransaction()); - mDatabase.beginTransaction(); - assertTrue(mDatabase.inTransaction()); - setNum(1); - mDatabase.setTransactionSuccessful(); - mDatabase.endTransaction(); - assertTrue(mDatabase.inTransaction()); - mDatabase.setTransactionSuccessful(); - mDatabase.endTransaction(); - assertFalse(mDatabase.inTransaction()); - assertNum(1); - assertFalse(mDatabase.isDbLockedByCurrentThread()); - assertFalse(mDatabase.isDbLockedByOtherThreads()); - - // Test rolling back an inner transaction. - setNum(0); - mDatabase.beginTransaction(); - mDatabase.beginTransaction(); - setNum(1); - mDatabase.endTransaction(); - mDatabase.setTransactionSuccessful(); - mDatabase.endTransaction(); - assertNum(0); - assertFalse(mDatabase.isDbLockedByCurrentThread()); - assertFalse(mDatabase.isDbLockedByOtherThreads()); - - // Test rolling back an outer transaction. - setNum(0); - mDatabase.beginTransaction(); - mDatabase.beginTransaction(); - setNum(1); - mDatabase.setTransactionSuccessful(); - mDatabase.endTransaction(); - mDatabase.endTransaction(); - assertNum(0); - assertFalse(mDatabase.isDbLockedByCurrentThread()); - assertFalse(mDatabase.isDbLockedByOtherThreads()); - } - - private void setNum(int num) { - mDatabase.execSQL("UPDATE test SET num = " + num); - } - - private void assertNum(int num) { - assertEquals(num, DatabaseUtils.longForQuery(mDatabase, - "SELECT num FROM test", null)); - } - - private void assertThrowsIllegalState(Runnable r) { - try { - r.run(); - fail("did not throw expected IllegalStateException"); - } catch (IllegalStateException e) { - } - } - - public void testAccessMaximumSize() { - long curMaximumSize = mDatabase.getMaximumSize(); - - // the new maximum size is less than the current size. - mDatabase.setMaximumSize(curMaximumSize - 1); - assertEquals(curMaximumSize, mDatabase.getMaximumSize()); - - // the new maximum size is more than the current size. - mDatabase.setMaximumSize(curMaximumSize + 1); - assertEquals(curMaximumSize + mDatabase.getPageSize(), mDatabase.getMaximumSize()); - assertTrue(mDatabase.getMaximumSize() > curMaximumSize); - } - - public void testAccessPageSize() { - File databaseFile = new File(mDatabaseDir, "database.db"); - if (databaseFile.exists()) { - databaseFile.delete(); - } - SQLiteDatabase database = null; - try { - database = SQLiteDatabase.openOrCreateDatabase(databaseFile.getPath(), null); - - long initialValue = database.getPageSize(); - // check that this does not throw an exception - // setting a different page size may not be supported after the DB has been created - database.setPageSize(initialValue); - assertEquals(initialValue, database.getPageSize()); - - } finally { - if (database != null) { - database.close(); - databaseFile.delete(); - } - } - } - - public void testCompileStatement() { - mDatabase.execSQL("CREATE TABLE test (_id INTEGER PRIMARY KEY, " - + "name TEXT, age INTEGER, address TEXT);"); - - String name = "Mike"; - int age = 21; - String address = "LA"; - - // at the beginning, there is no record in the database. - Cursor cursor = mDatabase.query("test", TEST_PROJECTION, null, null, null, null, null); - assertNotNull(cursor); - assertEquals(0, cursor.getCount()); - - String sql = "INSERT INTO test (name, age, address) VALUES (?, ?, ?);"; - SQLiteStatement insertStatement = mDatabase.compileStatement(sql); - DatabaseUtils.bindObjectToProgram(insertStatement, 1, name); - DatabaseUtils.bindObjectToProgram(insertStatement, 2, age); - DatabaseUtils.bindObjectToProgram(insertStatement, 3, address); - insertStatement.execute(); - insertStatement.close(); - cursor.close(); - - cursor = mDatabase.query("test", TEST_PROJECTION, null, null, null, null, null); - assertNotNull(cursor); - assertEquals(1, cursor.getCount()); - cursor.moveToNext(); - assertEquals(name, cursor.getString(COLUMN_NAME_INDEX)); - assertEquals(age, cursor.getInt(COLUMN_AGE_INDEX)); - assertEquals(address, cursor.getString(COLUMN_ADDR_INDEX)); - cursor.close(); - - SQLiteStatement deleteStatement = mDatabase.compileStatement("DELETE FROM test"); - deleteStatement.execute(); - - cursor = mDatabase.query("test", null, null, null, null, null, null); - assertEquals(0, cursor.getCount()); - cursor.deactivate(); - deleteStatement.close(); - cursor.close(); - } - - public void testDelete() { - mDatabase.execSQL("CREATE TABLE test (_id INTEGER PRIMARY KEY, " - + "name TEXT, age INTEGER, address TEXT);"); - mDatabase.execSQL("INSERT INTO test (name, age, address) VALUES ('Mike', 20, 'LA');"); - mDatabase.execSQL("INSERT INTO test (name, age, address) VALUES ('Jack', 30, 'London');"); - mDatabase.execSQL("INSERT INTO test (name, age, address) VALUES ('Jim', 35, 'Chicago');"); - - // delete one record. - int count = mDatabase.delete(TABLE_NAME, "name = 'Mike'", null); - assertEquals(1, count); - - Cursor cursor = mDatabase.query(TABLE_NAME, TEST_PROJECTION, null, - null, null, null, null); - assertNotNull(cursor); - // there are 2 records here. - assertEquals(2, cursor.getCount()); - cursor.moveToFirst(); - assertEquals("Jack", cursor.getString(COLUMN_NAME_INDEX)); - assertEquals(30, cursor.getInt(COLUMN_AGE_INDEX)); - assertEquals("London", cursor.getString(COLUMN_ADDR_INDEX)); - cursor.moveToNext(); - assertEquals("Jim", cursor.getString(COLUMN_NAME_INDEX)); - assertEquals(35, cursor.getInt(COLUMN_AGE_INDEX)); - assertEquals("Chicago", cursor.getString(COLUMN_ADDR_INDEX)); - cursor.close(); - - // delete another record. - count = mDatabase.delete(TABLE_NAME, "name = ?", new String[] { "Jack" }); - assertEquals(1, count); - - cursor = mDatabase.query(TABLE_NAME, TEST_PROJECTION, null, null, null, - null, null); - assertNotNull(cursor); - // there are 1 records here. - assertEquals(1, cursor.getCount()); - cursor.moveToFirst(); - assertEquals("Jim", cursor.getString(COLUMN_NAME_INDEX)); - assertEquals(35, cursor.getInt(COLUMN_AGE_INDEX)); - assertEquals("Chicago", cursor.getString(COLUMN_ADDR_INDEX)); - cursor.close(); - - mDatabase.execSQL("INSERT INTO test (name, age, address) VALUES ('Mike', 20, 'LA');"); - mDatabase.execSQL("INSERT INTO test (name, age, address) VALUES ('Jack', 30, 'London');"); - - // delete all records. - count = mDatabase.delete(TABLE_NAME, null, null); - assertEquals(3, count); - - cursor = mDatabase.query(TABLE_NAME, TEST_PROJECTION, null, null, null, null, null); - assertNotNull(cursor); - assertEquals(0, cursor.getCount()); - cursor.close(); - } - - public void testExecSQL() { - mDatabase.execSQL("CREATE TABLE test (_id INTEGER PRIMARY KEY, " - + "name TEXT, age INTEGER, address TEXT);"); - - // add a new record. - mDatabase.execSQL("INSERT INTO test (name, age, address) VALUES ('Mike', 20, 'LA');"); - - Cursor cursor = mDatabase.query(TABLE_NAME, TEST_PROJECTION, null, - null, null, null, null); - assertNotNull(cursor); - assertEquals(1, cursor.getCount()); - cursor.moveToFirst(); - assertEquals("Mike", cursor.getString(COLUMN_NAME_INDEX)); - assertEquals(20, cursor.getInt(COLUMN_AGE_INDEX)); - assertEquals("LA", cursor.getString(COLUMN_ADDR_INDEX)); - cursor.close(); - - // add other new record. - mDatabase.execSQL("INSERT INTO test (name, age, address) VALUES ('Jack', 30, 'London');"); - - cursor = mDatabase.query(TABLE_NAME, TEST_PROJECTION, null, null, null, null, null); - assertNotNull(cursor); - assertEquals(2, cursor.getCount()); - cursor.moveToFirst(); - assertEquals("Mike", cursor.getString(COLUMN_NAME_INDEX)); - assertEquals(20, cursor.getInt(COLUMN_AGE_INDEX)); - assertEquals("LA", cursor.getString(COLUMN_ADDR_INDEX)); - cursor.moveToNext(); - assertEquals("Jack", cursor.getString(COLUMN_NAME_INDEX)); - assertEquals(30, cursor.getInt(COLUMN_AGE_INDEX)); - assertEquals("London", cursor.getString(COLUMN_ADDR_INDEX)); - cursor.close(); - - // delete a record. - mDatabase.execSQL("DELETE FROM test WHERE name = ?;", new String[] { "Jack" }); - - cursor = mDatabase.query(TABLE_NAME, TEST_PROJECTION, null, null, null, null, null); - assertNotNull(cursor); - assertEquals(1, cursor.getCount()); - cursor.moveToFirst(); - assertEquals("Mike", cursor.getString(COLUMN_NAME_INDEX)); - assertEquals(20, cursor.getInt(COLUMN_AGE_INDEX)); - assertEquals("LA", cursor.getString(COLUMN_ADDR_INDEX)); - cursor.close(); - - // delete a non-exist record. - mDatabase.execSQL("DELETE FROM test WHERE name = ?;", new String[] { "Wrong Name" }); - - cursor = mDatabase.query(TABLE_NAME, TEST_PROJECTION, null, null, null, null, null); - assertNotNull(cursor); - assertEquals(1, cursor.getCount()); - cursor.moveToFirst(); - assertEquals("Mike", cursor.getString(COLUMN_NAME_INDEX)); - assertEquals(20, cursor.getInt(COLUMN_AGE_INDEX)); - assertEquals("LA", cursor.getString(COLUMN_ADDR_INDEX)); - cursor.close(); - - try { - // execSQL can not use for query. - mDatabase.execSQL("SELECT * FROM test;"); - fail("should throw SQLException."); - } catch (SQLException e) { - } - - // make sure execSQL can't be used to execute more than 1 sql statement at a time - mDatabase.execSQL("UPDATE test SET age = 40 WHERE name = 'Mike';" + - "UPDATE test SET age = 50 WHERE name = 'Mike';"); - // age should be updated to 40 not to 50 - cursor = mDatabase.query(TABLE_NAME, TEST_PROJECTION, null, null, null, null, null); - assertNotNull(cursor); - assertEquals(1, cursor.getCount()); - cursor.moveToFirst(); - assertEquals("Mike", cursor.getString(COLUMN_NAME_INDEX)); - assertEquals(40, cursor.getInt(COLUMN_AGE_INDEX)); - assertEquals("LA", cursor.getString(COLUMN_ADDR_INDEX)); - cursor.close(); - - // make sure sql injection is NOT allowed or has no effect when using query() - String harmfulQuery = "name = 'Mike';UPDATE test SET age = 50 WHERE name = 'Mike'"; - cursor = mDatabase.query(TABLE_NAME, TEST_PROJECTION, harmfulQuery, null, null, null, null); - assertNotNull(cursor); - assertEquals(1, cursor.getCount()); - cursor.moveToFirst(); - assertEquals("Mike", cursor.getString(COLUMN_NAME_INDEX)); - // row's age column SHOULD NOT be 50 - assertEquals(40, cursor.getInt(COLUMN_AGE_INDEX)); - assertEquals("LA", cursor.getString(COLUMN_ADDR_INDEX)); - cursor.close();; - } - - public void testFindEditTable() { - String tables = "table1 table2 table3"; - assertEquals("table1", SQLiteDatabase.findEditTable(tables)); - - tables = "table1,table2,table3"; - assertEquals("table1", SQLiteDatabase.findEditTable(tables)); - - tables = "table1"; - assertEquals("table1", SQLiteDatabase.findEditTable(tables)); - - try { - SQLiteDatabase.findEditTable(""); - fail("should throw IllegalStateException."); - } catch (IllegalStateException e) { - } - } - - public void testGetPath() { - assertEquals(mDatabaseFilePath, mDatabase.getPath()); - } - - public void testAccessVersion() { - mDatabase.setVersion(1); - assertEquals(1, mDatabase.getVersion()); - - mDatabase.setVersion(3); - assertEquals(3, mDatabase.getVersion()); - } - - public void testInsert() { - mDatabase.execSQL("CREATE TABLE test (_id INTEGER PRIMARY KEY, " - + "name TEXT, age INTEGER, address TEXT);"); - - ContentValues values = new ContentValues(); - values.put("name", "Jack"); - values.put("age", 20); - values.put("address", "LA"); - mDatabase.insert(TABLE_NAME, "name", values); - - Cursor cursor = mDatabase.query(TABLE_NAME, TEST_PROJECTION, null, - null, null, null, null); - assertNotNull(cursor); - assertEquals(1, cursor.getCount()); - cursor.moveToFirst(); - assertEquals("Jack", cursor.getString(COLUMN_NAME_INDEX)); - assertEquals(20, cursor.getInt(COLUMN_AGE_INDEX)); - assertEquals("LA", cursor.getString(COLUMN_ADDR_INDEX)); - cursor.close(); - - mDatabase.insert(TABLE_NAME, "name", null); - cursor = mDatabase.query(TABLE_NAME, TEST_PROJECTION, null, null, null, - null, null); - assertNotNull(cursor); - assertEquals(2, cursor.getCount()); - cursor.moveToFirst(); - assertEquals("Jack", cursor.getString(COLUMN_NAME_INDEX)); - assertEquals(20, cursor.getInt(COLUMN_AGE_INDEX)); - assertEquals("LA", cursor.getString(COLUMN_ADDR_INDEX)); - cursor.moveToNext(); - assertNull(cursor.getString(COLUMN_NAME_INDEX)); - cursor.close(); - - values = new ContentValues(); - values.put("Wrong Key", "Wrong value"); - mDatabase.insert(TABLE_NAME, "name", values); - // there are still 2 records. - cursor = mDatabase.query(TABLE_NAME, TEST_PROJECTION, null, null, null, - null, null); - assertNotNull(cursor); - assertEquals(2, cursor.getCount()); - cursor.close(); - - // delete all record. - mDatabase.execSQL("DELETE FROM test;"); - - values = new ContentValues(); - values.put("name", "Mike"); - values.put("age", 30); - values.put("address", "London"); - mDatabase.insertOrThrow(TABLE_NAME, "name", values); - - cursor = mDatabase.query(TABLE_NAME, TEST_PROJECTION, null, null, null, - null, null); - assertNotNull(cursor); - assertEquals(1, cursor.getCount()); - cursor.moveToFirst(); - assertEquals("Mike", cursor.getString(COLUMN_NAME_INDEX)); - assertEquals(30, cursor.getInt(COLUMN_AGE_INDEX)); - assertEquals("London", cursor.getString(COLUMN_ADDR_INDEX)); - cursor.close(); - - mDatabase.insertOrThrow(TABLE_NAME, "name", null); - cursor = mDatabase.query(TABLE_NAME, TEST_PROJECTION, null, null, null, - null, null); - assertNotNull(cursor); - assertEquals(2, cursor.getCount()); - cursor.moveToFirst(); - assertEquals("Mike", cursor.getString(COLUMN_NAME_INDEX)); - assertEquals(30, cursor.getInt(COLUMN_AGE_INDEX)); - assertEquals("London", cursor.getString(COLUMN_ADDR_INDEX)); - cursor.moveToNext(); - assertNull(cursor.getString(COLUMN_NAME_INDEX)); - cursor.close(); - - values = new ContentValues(); - values.put("Wrong Key", "Wrong value"); - try { - mDatabase.insertOrThrow(TABLE_NAME, "name", values); - fail("should throw SQLException."); - } catch (SQLException e) { - } - } - - public void testIsOpen() { - assertTrue(mDatabase.isOpen()); - - mDatabase.close(); - assertFalse(mDatabase.isOpen()); - } - - public void testIsReadOnly() { - assertFalse(mDatabase.isReadOnly()); - - SQLiteDatabase database = null; - try { - database = SQLiteDatabase.openDatabase(mDatabaseFilePath, null, - SQLiteDatabase.OPEN_READONLY); - assertTrue(database.isReadOnly()); - } finally { - if (database != null) { - database.close(); - } - } - } - - public void testReleaseMemory() { - SQLiteDatabase.releaseMemory(); - } - - public void testSetLockingEnabled() { - mDatabase.execSQL("CREATE TABLE test (num INTEGER);"); - mDatabase.execSQL("INSERT INTO test (num) VALUES (0)"); - - mDatabase.setLockingEnabled(false); - - mDatabase.beginTransaction(); - setNum(1); - assertNum(1); - mDatabase.setTransactionSuccessful(); - mDatabase.endTransaction(); - } - - @SuppressWarnings("deprecation") - public void testYieldIfContendedWhenNotContended() { - assertFalse(mDatabase.yieldIfContended()); - - mDatabase.execSQL("CREATE TABLE test (num INTEGER);"); - mDatabase.execSQL("INSERT INTO test (num) VALUES (0)"); - - // Make sure that things work outside an explicit transaction. - setNum(1); - assertNum(1); - - setNum(0); - assertFalse(mDatabase.inTransaction()); - mDatabase.beginTransaction(); - assertTrue(mDatabase.inTransaction()); - assertFalse(mDatabase.yieldIfContended()); - setNum(1); - mDatabase.setTransactionSuccessful(); - mDatabase.endTransaction(); - - mDatabase.beginTransaction(); - assertTrue(mDatabase.inTransaction()); - assertFalse(mDatabase.yieldIfContendedSafely()); - setNum(1); - mDatabase.setTransactionSuccessful(); - mDatabase.endTransaction(); - } - - @SuppressWarnings("deprecation") - public void testYieldIfContendedWhenContended() throws Exception { - mDatabase.execSQL("CREATE TABLE test (num INTEGER);"); - mDatabase.execSQL("INSERT INTO test (num) VALUES (0)"); - - // Begin a transaction and update a value. - mDatabase.beginTransaction(); - setNum(1); - assertNum(1); - - // On another thread, begin a transaction there. This causes contention - // for use of the database. When the main thread yields, the second thread - // begin its own transaction. It should perceive the new state that was - // committed by the main thread when it yielded. - final Semaphore s = new Semaphore(0); - Thread t = new Thread() { - @Override - public void run() { - s.release(); // let main thread continue - - mDatabase.beginTransaction(); - assertNum(1); - setNum(2); - assertNum(2); - mDatabase.setTransactionSuccessful(); - mDatabase.endTransaction(); - } - }; - t.start(); - - // Wait for thread to try to begin its transaction. - s.acquire(); - Thread.sleep(500); - - // Yield. There should be contention for the database now, so yield will - // return true. - assertTrue(mDatabase.yieldIfContendedSafely()); - - // Since we reacquired the transaction, the other thread must have finished - // its transaction. We should observe its changes and our own within this transaction. - assertNum(2); - setNum(3); - assertNum(3); - - // Go ahead and finish the transaction. - mDatabase.setTransactionSuccessful(); - mDatabase.endTransaction(); - assertNum(3); - - t.join(); - } - - public void testQuery() { - mDatabase.execSQL("CREATE TABLE employee (_id INTEGER PRIMARY KEY, " + - "name TEXT, month INTEGER, salary INTEGER);"); - mDatabase.execSQL("INSERT INTO employee (name, month, salary) " + - "VALUES ('Mike', '1', '1000');"); - mDatabase.execSQL("INSERT INTO employee (name, month, salary) " + - "VALUES ('Mike', '2', '3000');"); - mDatabase.execSQL("INSERT INTO employee (name, month, salary) " + - "VALUES ('jack', '1', '2000');"); - mDatabase.execSQL("INSERT INTO employee (name, month, salary) " + - "VALUES ('jack', '3', '1500');"); - mDatabase.execSQL("INSERT INTO employee (name, month, salary) " + - "VALUES ('Jim', '1', '1000');"); - mDatabase.execSQL("INSERT INTO employee (name, month, salary) " + - "VALUES ('Jim', '3', '3500');"); - - Cursor cursor = mDatabase.query(true, "employee", new String[] { "name", "sum(salary)" }, - null, null, "name", "sum(salary)>1000", "name", null); - assertNotNull(cursor); - assertEquals(3, cursor.getCount()); - - final int COLUMN_NAME_INDEX = 0; - final int COLUMN_SALARY_INDEX = 1; - cursor.moveToFirst(); - assertEquals("Jim", cursor.getString(COLUMN_NAME_INDEX)); - assertEquals(4500, cursor.getInt(COLUMN_SALARY_INDEX)); - cursor.moveToNext(); - assertEquals("Mike", cursor.getString(COLUMN_NAME_INDEX)); - assertEquals(4000, cursor.getInt(COLUMN_SALARY_INDEX)); - cursor.moveToNext(); - assertEquals("jack", cursor.getString(COLUMN_NAME_INDEX)); - assertEquals(3500, cursor.getInt(COLUMN_SALARY_INDEX)); - cursor.close(); - - CursorFactory factory = new CursorFactory() { - public Cursor newCursor(SQLiteDatabase db, SQLiteCursorDriver masterQuery, - String editTable, SQLiteQuery query) { - return new MockSQLiteCursor(db, masterQuery, editTable, query); - } - }; - cursor = mDatabase.queryWithFactory(factory, true, "employee", - new String[] { "name", "sum(salary)" }, - null, null, "name", "sum(salary) > 1000", "name", null); - assertNotNull(cursor); - assertTrue(cursor instanceof MockSQLiteCursor); - cursor.moveToFirst(); - assertEquals("Jim", cursor.getString(COLUMN_NAME_INDEX)); - assertEquals(4500, cursor.getInt(COLUMN_SALARY_INDEX)); - cursor.moveToNext(); - assertEquals("Mike", cursor.getString(COLUMN_NAME_INDEX)); - assertEquals(4000, cursor.getInt(COLUMN_SALARY_INDEX)); - cursor.moveToNext(); - assertEquals("jack", cursor.getString(COLUMN_NAME_INDEX)); - assertEquals(3500, cursor.getInt(COLUMN_SALARY_INDEX)); - cursor.close(); - - cursor = mDatabase.query("employee", new String[] { "name", "sum(salary)" }, - null, null, "name", "sum(salary) <= 4000", "name"); - assertNotNull(cursor); - assertEquals(2, cursor.getCount()); - - cursor.moveToFirst(); - assertEquals("Mike", cursor.getString(COLUMN_NAME_INDEX)); - assertEquals(4000, cursor.getInt(COLUMN_SALARY_INDEX)); - cursor.moveToNext(); - assertEquals("jack", cursor.getString(COLUMN_NAME_INDEX)); - assertEquals(3500, cursor.getInt(COLUMN_SALARY_INDEX)); - cursor.close(); - - cursor = mDatabase.query("employee", new String[] { "name", "sum(salary)" }, - null, null, "name", "sum(salary) > 1000", "name", "2"); - assertNotNull(cursor); - assertEquals(2, cursor.getCount()); - - cursor.moveToFirst(); - assertEquals("Jim", cursor.getString(COLUMN_NAME_INDEX)); - assertEquals(4500, cursor.getInt(COLUMN_SALARY_INDEX)); - cursor.moveToNext(); - assertEquals("Mike", cursor.getString(COLUMN_NAME_INDEX)); - assertEquals(4000, cursor.getInt(COLUMN_SALARY_INDEX)); - cursor.close(); - - String sql = "SELECT name, month FROM employee WHERE salary > ?;"; - cursor = mDatabase.rawQuery(sql, new String[] { "2000" }); - assertNotNull(cursor); - assertEquals(2, cursor.getCount()); - - final int COLUMN_MONTH_INDEX = 1; - cursor.moveToFirst(); - assertEquals("Mike", cursor.getString(COLUMN_NAME_INDEX)); - assertEquals(2, cursor.getInt(COLUMN_MONTH_INDEX)); - cursor.moveToNext(); - assertEquals("Jim", cursor.getString(COLUMN_NAME_INDEX)); - assertEquals(3, cursor.getInt(COLUMN_MONTH_INDEX)); - cursor.close(); - - cursor = mDatabase.rawQueryWithFactory(factory, sql, new String[] { "2000" }, null); - assertNotNull(cursor); - assertEquals(2, cursor.getCount()); - assertTrue(cursor instanceof MockSQLiteCursor); - cursor.moveToFirst(); - assertEquals("Mike", cursor.getString(COLUMN_NAME_INDEX)); - assertEquals(2, cursor.getInt(COLUMN_MONTH_INDEX)); - cursor.moveToNext(); - assertEquals("Jim", cursor.getString(COLUMN_NAME_INDEX)); - assertEquals(3, cursor.getInt(COLUMN_MONTH_INDEX)); - cursor.close(); - } - - public void testReplace() { - mDatabase.execSQL("CREATE TABLE test (_id INTEGER PRIMARY KEY, " - + "name TEXT, age INTEGER, address TEXT);"); - - ContentValues values = new ContentValues(); - values.put("name", "Jack"); - values.put("age", 20); - values.put("address", "LA"); - mDatabase.replace(TABLE_NAME, "name", values); - - Cursor cursor = mDatabase.query(TABLE_NAME, TEST_PROJECTION, - null, null, null, null, null); - assertNotNull(cursor); - assertEquals(1, cursor.getCount()); - cursor.moveToFirst(); - int id = cursor.getInt(COLUMN_ID_INDEX); - assertEquals("Jack", cursor.getString(COLUMN_NAME_INDEX)); - assertEquals(20, cursor.getInt(COLUMN_AGE_INDEX)); - assertEquals("LA", cursor.getString(COLUMN_ADDR_INDEX)); - cursor.close(); - - values = new ContentValues(); - values.put("_id", id); - values.put("name", "Mike"); - values.put("age", 40); - values.put("address", "London"); - mDatabase.replace(TABLE_NAME, "name", values); - - cursor = mDatabase.query(TABLE_NAME, TEST_PROJECTION, null, null, null, null, null); - assertNotNull(cursor); - assertEquals(1, cursor.getCount()); // there is still ONLY 1 record. - cursor.moveToFirst(); - assertEquals("Mike", cursor.getString(COLUMN_NAME_INDEX)); - assertEquals(40, cursor.getInt(COLUMN_AGE_INDEX)); - assertEquals("London", cursor.getString(COLUMN_ADDR_INDEX)); - cursor.close(); - - values = new ContentValues(); - values.put("name", "Jack"); - values.put("age", 20); - values.put("address", "LA"); - mDatabase.replaceOrThrow(TABLE_NAME, "name", values); - - cursor = mDatabase.query(TABLE_NAME, TEST_PROJECTION, null, null, null, null, null); - assertNotNull(cursor); - assertEquals(2, cursor.getCount()); - cursor.moveToFirst(); - assertEquals("Mike", cursor.getString(COLUMN_NAME_INDEX)); - assertEquals(40, cursor.getInt(COLUMN_AGE_INDEX)); - assertEquals("London", cursor.getString(COLUMN_ADDR_INDEX)); - cursor.moveToNext(); - assertEquals("Jack", cursor.getString(COLUMN_NAME_INDEX)); - assertEquals(20, cursor.getInt(COLUMN_AGE_INDEX)); - assertEquals("LA", cursor.getString(COLUMN_ADDR_INDEX)); - cursor.close(); - - values = new ContentValues(); - values.put("Wrong Key", "Wrong value"); - try { - mDatabase.replaceOrThrow(TABLE_NAME, "name", values); - fail("should throw SQLException."); - } catch (SQLException e) { - } - } - - public void testUpdate() { - mDatabase.execSQL("CREATE TABLE test (_id INTEGER PRIMARY KEY, data TEXT);"); - - mDatabase.execSQL("INSERT INTO test (data) VALUES ('string1');"); - mDatabase.execSQL("INSERT INTO test (data) VALUES ('string2');"); - mDatabase.execSQL("INSERT INTO test (data) VALUES ('string3');"); - - String updatedString = "this is an updated test"; - ContentValues values = new ContentValues(1); - values.put("data", updatedString); - assertEquals(1, mDatabase.update("test", values, "_id=1", null)); - Cursor cursor = mDatabase.query("test", null, "_id=1", null, null, null, null); - assertNotNull(cursor); - assertEquals(1, cursor.getCount()); - cursor.moveToFirst(); - String value = cursor.getString(cursor.getColumnIndexOrThrow("data")); - assertEquals(updatedString, value); - cursor.close(); - } - - public void testNeedUpgrade() { - mDatabase.setVersion(0); - assertTrue(mDatabase.needUpgrade(1)); - mDatabase.setVersion(1); - assertFalse(mDatabase.needUpgrade(1)); - } - - public void testSetLocale() { - final String[] STRINGS = { - "c\u00f4t\u00e9", - "cote", - "c\u00f4te", - "cot\u00e9", - "boy", - "dog", - "COTE", - }; - - mDatabase.execSQL("CREATE TABLE test (data TEXT COLLATE LOCALIZED);"); - for (String s : STRINGS) { - mDatabase.execSQL("INSERT INTO test VALUES('" + s + "');"); - } - - mDatabase.setLocale(new Locale("en", "US")); - - String sql = "SELECT data FROM test ORDER BY data COLLATE LOCALIZED ASC"; - Cursor cursor = mDatabase.rawQuery(sql, null); - assertNotNull(cursor); - ArrayList items = new ArrayList(); - while (cursor.moveToNext()) { - items.add(cursor.getString(0)); - } - String[] results = items.toArray(new String[items.size()]); - assertEquals(STRINGS.length, results.length); - cursor.close(); - - // The database code currently uses PRIMARY collation strength, - // meaning that all versions of a character compare equal (regardless - // of case or accents), leaving the "cote" flavors in database order. - MoreAsserts.assertEquals(results, new String[] { - STRINGS[4], // "boy" - STRINGS[0], // sundry forms of "cote" - STRINGS[1], - STRINGS[2], - STRINGS[3], - STRINGS[6], // "COTE" - STRINGS[5], // "dog" - }); - } - - public void testOnAllReferencesReleased() { - assertTrue(mDatabase.isOpen()); - mDatabase.releaseReference(); - assertFalse(mDatabase.isOpen()); - } - - public void testTransactionWithSQLiteTransactionListener() { - mDatabase.execSQL("CREATE TABLE test (num INTEGER);"); - mDatabase.execSQL("INSERT INTO test (num) VALUES (0)"); - - assertEquals(mTransactionListenerOnBeginCalled, false); - assertEquals(mTransactionListenerOnCommitCalled, false); - assertEquals(mTransactionListenerOnRollbackCalled, false); - mDatabase.beginTransactionWithListener(new TestSQLiteTransactionListener()); - - // Assert that the transcation has started - assertEquals(mTransactionListenerOnBeginCalled, true); - assertEquals(mTransactionListenerOnCommitCalled, false); - assertEquals(mTransactionListenerOnRollbackCalled, false); - - setNum(1); - - // State shouldn't have changed - assertEquals(mTransactionListenerOnBeginCalled, true); - assertEquals(mTransactionListenerOnCommitCalled, false); - assertEquals(mTransactionListenerOnRollbackCalled, false); - - // commit the transaction - mDatabase.setTransactionSuccessful(); - mDatabase.endTransaction(); - - // the listener should have been told that commit was called - assertEquals(mTransactionListenerOnBeginCalled, true); - assertEquals(mTransactionListenerOnCommitCalled, true); - assertEquals(mTransactionListenerOnRollbackCalled, false); - } - - public void testRollbackTransactionWithSQLiteTransactionListener() { - mDatabase.execSQL("CREATE TABLE test (num INTEGER);"); - mDatabase.execSQL("INSERT INTO test (num) VALUES (0)"); - - assertEquals(mTransactionListenerOnBeginCalled, false); - assertEquals(mTransactionListenerOnCommitCalled, false); - assertEquals(mTransactionListenerOnRollbackCalled, false); - mDatabase.beginTransactionWithListener(new TestSQLiteTransactionListener()); - - // Assert that the transcation has started - assertEquals(mTransactionListenerOnBeginCalled, true); - assertEquals(mTransactionListenerOnCommitCalled, false); - assertEquals(mTransactionListenerOnRollbackCalled, false); - - setNum(1); - - // State shouldn't have changed - assertEquals(mTransactionListenerOnBeginCalled, true); - assertEquals(mTransactionListenerOnCommitCalled, false); - assertEquals(mTransactionListenerOnRollbackCalled, false); - - // commit the transaction - mDatabase.endTransaction(); - - // the listener should have been told that commit was called - assertEquals(mTransactionListenerOnBeginCalled, true); - assertEquals(mTransactionListenerOnCommitCalled, false); - assertEquals(mTransactionListenerOnRollbackCalled, true); - } - - private class TestSQLiteTransactionListener implements SQLiteTransactionListener { - public void onBegin() { - mTransactionListenerOnBeginCalled = true; - } - - public void onCommit() { - mTransactionListenerOnCommitCalled = true; - } - - public void onRollback() { - mTransactionListenerOnRollbackCalled = true; - } - } - - public void testGroupConcat() { - mDatabase.execSQL("CREATE TABLE test (i INT, j TEXT);"); - - // insert 2 rows - String sql = "INSERT INTO test (i) VALUES (?);"; - SQLiteStatement insertStatement = mDatabase.compileStatement(sql); - DatabaseUtils.bindObjectToProgram(insertStatement, 1, 1); - insertStatement.execute(); - DatabaseUtils.bindObjectToProgram(insertStatement, 1, 2); - insertStatement.execute(); - insertStatement.close(); - - // make sure there are 2 rows in the table - Cursor cursor = mDatabase.rawQuery("SELECT count(*) FROM test", null); - assertNotNull(cursor); - assertEquals(1, cursor.getCount()); - cursor.moveToNext(); - assertEquals(2, cursor.getInt(0)); - cursor.close(); - - // concatenate column j from all the rows. should return NULL - cursor = mDatabase.rawQuery("SELECT group_concat(j, ' ') FROM test", null); - assertNotNull(cursor); - assertEquals(1, cursor.getCount()); - cursor.moveToNext(); - assertNull(cursor.getString(0)); - cursor.close(); - - // drop the table - mDatabase.execSQL("DROP TABLE test;"); - // should get no exceptions - } - - public void testSchemaChanges() { - mDatabase.execSQL("CREATE TABLE test (i INT, j INT);"); - - // at the beginning, there is no record in the database. - Cursor cursor = mDatabase.rawQuery("SELECT * FROM test", null); - assertNotNull(cursor); - assertEquals(0, cursor.getCount()); - cursor.close(); - - String sql = "INSERT INTO test VALUES (?, ?);"; - SQLiteStatement insertStatement = mDatabase.compileStatement(sql); - DatabaseUtils.bindObjectToProgram(insertStatement, 1, 1); - DatabaseUtils.bindObjectToProgram(insertStatement, 2, 2); - insertStatement.execute(); - insertStatement.close(); - - // read the data from the table and make sure it is correct - cursor = mDatabase.rawQuery("SELECT i,j FROM test", null); - assertNotNull(cursor); - assertEquals(1, cursor.getCount()); - cursor.moveToNext(); - assertEquals(1, cursor.getInt(0)); - assertEquals(2, cursor.getInt(1)); - cursor.close(); - - // alter the table and execute another statement - mDatabase.execSQL("ALTER TABLE test ADD COLUMN k int;"); - sql = "INSERT INTO test VALUES (?, ?, ?);"; - insertStatement = mDatabase.compileStatement(sql); - DatabaseUtils.bindObjectToProgram(insertStatement, 1, 3); - DatabaseUtils.bindObjectToProgram(insertStatement, 2, 4); - DatabaseUtils.bindObjectToProgram(insertStatement, 3, 5); - insertStatement.execute(); - insertStatement.close(); - - // read the data from the table and make sure it is correct - cursor = mDatabase.rawQuery("SELECT i,j,k FROM test", null); - assertNotNull(cursor); - assertEquals(2, cursor.getCount()); - cursor.moveToNext(); - assertEquals(1, cursor.getInt(0)); - assertEquals(2, cursor.getInt(1)); - assertNull(cursor.getString(2)); - cursor.moveToNext(); - assertEquals(3, cursor.getInt(0)); - assertEquals(4, cursor.getInt(1)); - assertEquals(5, cursor.getInt(2)); - cursor.close(); - - // make sure the old statement - which should *try to reuse* cached query plan - - // still works - cursor = mDatabase.rawQuery("SELECT i,j FROM test", null); - assertNotNull(cursor); - assertEquals(2, cursor.getCount()); - cursor.moveToNext(); - assertEquals(1, cursor.getInt(0)); - assertEquals(2, cursor.getInt(1)); - cursor.moveToNext(); - assertEquals(3, cursor.getInt(0)); - assertEquals(4, cursor.getInt(1)); - cursor.close(); - - SQLiteStatement deleteStatement = mDatabase.compileStatement("DELETE FROM test"); - deleteStatement.execute(); - deleteStatement.close(); - } - - public void testSchemaChangesNewTable() { - mDatabase.execSQL("CREATE TABLE test (i INT, j INT);"); - - // at the beginning, there is no record in the database. - Cursor cursor = mDatabase.rawQuery("SELECT * FROM test", null); - assertNotNull(cursor); - assertEquals(0, cursor.getCount()); - cursor.close(); - - String sql = "INSERT INTO test VALUES (?, ?);"; - SQLiteStatement insertStatement = mDatabase.compileStatement(sql); - DatabaseUtils.bindObjectToProgram(insertStatement, 1, 1); - DatabaseUtils.bindObjectToProgram(insertStatement, 2, 2); - insertStatement.execute(); - insertStatement.close(); - - // read the data from the table and make sure it is correct - cursor = mDatabase.rawQuery("SELECT i,j FROM test", null); - assertNotNull(cursor); - assertEquals(1, cursor.getCount()); - cursor.moveToNext(); - assertEquals(1, cursor.getInt(0)); - assertEquals(2, cursor.getInt(1)); - cursor.close(); - - // alter the table and execute another statement - mDatabase.execSQL("CREATE TABLE test_new (i INT, j INT, k INT);"); - sql = "INSERT INTO test_new VALUES (?, ?, ?);"; - insertStatement = mDatabase.compileStatement(sql); - DatabaseUtils.bindObjectToProgram(insertStatement, 1, 3); - DatabaseUtils.bindObjectToProgram(insertStatement, 2, 4); - DatabaseUtils.bindObjectToProgram(insertStatement, 3, 5); - insertStatement.execute(); - insertStatement.close(); - - // read the data from the table and make sure it is correct - cursor = mDatabase.rawQuery("SELECT i,j,k FROM test_new", null); - assertNotNull(cursor); - assertEquals(1, cursor.getCount()); - cursor.moveToNext(); - assertEquals(3, cursor.getInt(0)); - assertEquals(4, cursor.getInt(1)); - assertEquals(5, cursor.getInt(2)); - cursor.close(); - - // make sure the old statement - which should *try to reuse* cached query plan - - // still works - cursor = mDatabase.rawQuery("SELECT i,j FROM test", null); - assertNotNull(cursor); - assertEquals(1, cursor.getCount()); - cursor.moveToNext(); - assertEquals(1, cursor.getInt(0)); - assertEquals(2, cursor.getInt(1)); - cursor.close(); - - SQLiteStatement deleteStatement = mDatabase.compileStatement("DELETE FROM test"); - deleteStatement.execute(); - deleteStatement.close(); - - SQLiteStatement deleteStatement2 = mDatabase.compileStatement("DELETE FROM test_new"); - deleteStatement2.execute(); - deleteStatement2.close(); - } - - public void testSchemaChangesDropTable() { - mDatabase.execSQL("CREATE TABLE test (i INT, j INT);"); - - // at the beginning, there is no record in the database. - Cursor cursor = mDatabase.rawQuery("SELECT * FROM test", null); - assertNotNull(cursor); - assertEquals(0, cursor.getCount()); - cursor.close(); - - String sql = "INSERT INTO test VALUES (?, ?);"; - SQLiteStatement insertStatement = mDatabase.compileStatement(sql); - DatabaseUtils.bindObjectToProgram(insertStatement, 1, 1); - DatabaseUtils.bindObjectToProgram(insertStatement, 2, 2); - insertStatement.execute(); - insertStatement.close(); - - // read the data from the table and make sure it is correct - cursor = mDatabase.rawQuery("SELECT i,j FROM test", null); - assertNotNull(cursor); - assertEquals(1, cursor.getCount()); - cursor.moveToNext(); - assertEquals(1, cursor.getInt(0)); - assertEquals(2, cursor.getInt(1)); - } - - /** - * With sqlite's write-ahead-logging (WAL) enabled, readers get old version of data - * from the table that a writer is modifying at the same time. - *

- * This method does the following to test this sqlite3 feature - *

    - *
  1. creates a table in the database and populates it with 5 rows of data
  2. - *
  3. do "select count(*) from this_table" and expect to receive 5
  4. - *
  5. start a writer thread who BEGINs a transaction, INSERTs a single row - * into this_table
  6. - *
  7. writer stops the transaction at this point, kicks off a reader thread - which will - * do the above SELECT query: "select count(*) from this_table"
  8. - *
  9. this query should return value 5 - because writer is still in transaction and - * sqlite returns OLD version of the data
  10. - *
  11. writer ends the transaction, thus making the extra row now visible to everyone
  12. - *
  13. reader is kicked off again to do the same query. this time query should - * return value = 6 which includes the newly inserted row into this_table.
  14. - *

    - * @throws InterruptedException - */ - @LargeTest - public void testReaderGetsOldVersionOfDataWhenWriterIsInXact() throws InterruptedException { - // redo setup to create WAL enabled database - mDatabase.close(); - new File(mDatabase.getPath()).delete(); - mDatabase = SQLiteDatabase.openOrCreateDatabase(mDatabaseFile.getPath(), null, null); - boolean rslt = mDatabase.enableWriteAheadLogging(); - assertTrue(rslt); - assertNotNull(mDatabase); - - // create a new table and insert 5 records into it. - mDatabase.execSQL("CREATE TABLE t1 (i int, j int);"); - mDatabase.beginTransaction(); - for (int i = 0; i < 5; i++) { - mDatabase.execSQL("insert into t1 values(?,?);", new String[] {i + "", i + ""}); - } - mDatabase.setTransactionSuccessful(); - mDatabase.endTransaction(); - - // make sure a reader can read the above data - ReaderQueryingData r1 = new ReaderQueryingData(5); - r1.start(); - Thread.yield(); - try { r1.join(); } catch (Exception e) { } - - WriterDoingSingleTransaction w = new WriterDoingSingleTransaction(); - w.start(); - w.join(); - } - - private class WriterDoingSingleTransaction extends Thread { - @Override public void run() { - // start a transaction - mDatabase.beginTransactionNonExclusive(); - mDatabase.execSQL("insert into t1 values(?,?);", new String[] {"11", "11"}); - assertTrue(mDatabase.isOpen()); - - // while the writer is in a transaction, start a reader and make sure it can still - // read 5 rows of data (= old data prior to the current transaction) - ReaderQueryingData r1 = new ReaderQueryingData(5); - r1.start(); - try { r1.join(); } catch (Exception e) { } - - // now, have the writer do the select count(*) - // it should execute on the same connection as this transaction - // and count(*) should reflect the newly inserted row - Long l = DatabaseUtils.longForQuery(mDatabase, "select count(*) from t1", null); - assertEquals(6, l.intValue()); - - // end transaction - mDatabase.setTransactionSuccessful(); - mDatabase.endTransaction(); - - // reader should now be able to read 6 rows = new data AFTER this transaction - r1 = new ReaderQueryingData(6); - r1.start(); - try { r1.join(); } catch (Exception e) { } - } - } - - private class ReaderQueryingData extends Thread { - private int count; - /** - * constructor with a param to indicate the number of rows expected to be read - */ - public ReaderQueryingData(int count) { - this.count = count; - } - @Override public void run() { - Long l = DatabaseUtils.longForQuery(mDatabase, "select count(*) from t1", null); - assertEquals(count, l.intValue()); - } - } - - public void testExceptionsFromEnableWriteAheadLogging() { - // attach a database - // redo setup to create WAL enabled database - mDatabase.close(); - new File(mDatabase.getPath()).delete(); - mDatabase = SQLiteDatabase.openOrCreateDatabase(mDatabaseFile.getPath(), null, null); - - // attach a database and call enableWriteAheadLogging - should not be allowed - mDatabase.execSQL("attach database ':memory:' as memoryDb"); - assertFalse(mDatabase.isWriteAheadLoggingEnabled()); - assertFalse(mDatabase.enableWriteAheadLogging()); - assertFalse(mDatabase.isWriteAheadLoggingEnabled()); - - // enableWriteAheadLogging on memory database is not allowed - SQLiteDatabase db = SQLiteDatabase.create(null); - assertFalse(mDatabase.isWriteAheadLoggingEnabled()); - assertFalse(db.enableWriteAheadLogging()); - assertFalse(mDatabase.isWriteAheadLoggingEnabled()); - db.close(); - } - - public void testEnableThenDisableWriteAheadLogging() { - // Enable WAL. - assertFalse(mDatabase.isWriteAheadLoggingEnabled()); - assertTrue(mDatabase.enableWriteAheadLogging()); - assertTrue(mDatabase.isWriteAheadLoggingEnabled()); - assertTrue(DatabaseUtils.stringForQuery(mDatabase, "PRAGMA journal_mode", null) - .equalsIgnoreCase("WAL")); - - // Enabling when already enabled should have no observable effect. - assertTrue(mDatabase.enableWriteAheadLogging()); - assertTrue(mDatabase.isWriteAheadLoggingEnabled()); - assertTrue(DatabaseUtils.stringForQuery(mDatabase, "PRAGMA journal_mode", null) - .equalsIgnoreCase("WAL")); - - // Disabling when there are no connections should work. - mDatabase.disableWriteAheadLogging(); - assertFalse(mDatabase.isWriteAheadLoggingEnabled()); - } - - public void testEnableThenDisableWriteAheadLoggingUsingOpenFlag() { - new File(mDatabase.getPath()).delete(); - mDatabase = SQLiteDatabase.openDatabase(mDatabaseFile.getPath(), null, - SQLiteDatabase.CREATE_IF_NECESSARY | SQLiteDatabase.ENABLE_WRITE_AHEAD_LOGGING, - null); - assertTrue(mDatabase.isWriteAheadLoggingEnabled()); - assertTrue(DatabaseUtils.stringForQuery(mDatabase, "PRAGMA journal_mode", null) - .equalsIgnoreCase("WAL")); - - // Enabling when already enabled should have no observable effect. - assertTrue(mDatabase.enableWriteAheadLogging()); - assertTrue(mDatabase.isWriteAheadLoggingEnabled()); - assertTrue(DatabaseUtils.stringForQuery(mDatabase, "PRAGMA journal_mode", null) - .equalsIgnoreCase("WAL")); - - // Disabling when there are no connections should work. - mDatabase.disableWriteAheadLogging(); - assertFalse(mDatabase.isWriteAheadLoggingEnabled()); - } - - public void testEnableWriteAheadLoggingFromContextUsingModeFlag() { - // Without the MODE_ENABLE_WRITE_AHEAD_LOGGING flag, database opens without WAL. - getContext().deleteDatabase(DATABASE_FILE_NAME); - mDatabase = getContext().openOrCreateDatabase(DATABASE_FILE_NAME, - Context.MODE_PRIVATE, null); - assertFalse(mDatabase.isWriteAheadLoggingEnabled()); - mDatabase.close(); - - // With the MODE_ENABLE_WRITE_AHEAD_LOGGING flag, database opens with WAL. - getContext().deleteDatabase(DATABASE_FILE_NAME); - mDatabase = getContext().openOrCreateDatabase(DATABASE_FILE_NAME, - Context.MODE_PRIVATE | Context.MODE_ENABLE_WRITE_AHEAD_LOGGING, null); - assertTrue(mDatabase.isWriteAheadLoggingEnabled()); - mDatabase.close(); - } - - public void testEnableWriteAheadLoggingShouldThrowIfTransactionInProgress() { - assertFalse(mDatabase.isWriteAheadLoggingEnabled()); - String oldJournalMode = DatabaseUtils.stringForQuery( - mDatabase, "PRAGMA journal_mode", null); - - // Begin transaction. - mDatabase.beginTransaction(); - - try { - // Attempt to enable WAL should fail. - mDatabase.enableWriteAheadLogging(); - fail("Expected IllegalStateException"); - } catch (IllegalStateException ex) { - // expected - } - - assertFalse(mDatabase.isWriteAheadLoggingEnabled()); - assertTrue(DatabaseUtils.stringForQuery(mDatabase, "PRAGMA journal_mode", null) - .equalsIgnoreCase(oldJournalMode)); - } - - public void testDisableWriteAheadLoggingShouldThrowIfTransactionInProgress() { - // Enable WAL. - assertFalse(mDatabase.isWriteAheadLoggingEnabled()); - assertTrue(mDatabase.enableWriteAheadLogging()); - assertTrue(mDatabase.isWriteAheadLoggingEnabled()); - - // Begin transaction. - mDatabase.beginTransaction(); - - try { - // Attempt to disable WAL should fail. - mDatabase.disableWriteAheadLogging(); - fail("Expected IllegalStateException"); - } catch (IllegalStateException ex) { - // expected - } - - assertTrue(mDatabase.isWriteAheadLoggingEnabled()); - assertTrue(DatabaseUtils.stringForQuery(mDatabase, "PRAGMA journal_mode", null) - .equalsIgnoreCase("WAL")); - } - - public void testEnableAndDisableForeignKeys() { - // Initially off. - assertEquals(0, DatabaseUtils.longForQuery(mDatabase, "PRAGMA foreign_keys", null)); - - // Enable foreign keys. - mDatabase.setForeignKeyConstraintsEnabled(true); - assertEquals(1, DatabaseUtils.longForQuery(mDatabase, "PRAGMA foreign_keys", null)); - - // Disable foreign keys. - mDatabase.setForeignKeyConstraintsEnabled(false); - assertEquals(0, DatabaseUtils.longForQuery(mDatabase, "PRAGMA foreign_keys", null)); - - // Cannot configure foreign keys if there are transactions in progress. - mDatabase.beginTransaction(); - try { - mDatabase.setForeignKeyConstraintsEnabled(true); - fail("Expected IllegalStateException"); - } catch (IllegalStateException ex) { - // expected - } - assertEquals(0, DatabaseUtils.longForQuery(mDatabase, "PRAGMA foreign_keys", null)); - mDatabase.endTransaction(); - - // Enable foreign keys should work again after transaction complete. - mDatabase.setForeignKeyConstraintsEnabled(true); - assertEquals(1, DatabaseUtils.longForQuery(mDatabase, "PRAGMA foreign_keys", null)); - } -} diff --git a/proprietary/frameworks/base/tests/database/src/android/database/sqlite/cts/SQLiteDiskIOExceptionTest.java b/proprietary/frameworks/base/tests/database/src/android/database/sqlite/cts/SQLiteDiskIOExceptionTest.java deleted file mode 100755 index 503607fdb5aedbbcf3b5851842b104c3de57820a..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/database/src/android/database/sqlite/cts/SQLiteDiskIOExceptionTest.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (C) 2009 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.database.sqlite.cts; - -import android.database.sqlite.SQLiteDiskIOException; -import android.test.AndroidTestCase; - -public class SQLiteDiskIOExceptionTest extends AndroidTestCase { - public void testConstructor() { - new SQLiteDiskIOException(); - - new SQLiteDiskIOException("error"); - } -} diff --git a/proprietary/frameworks/base/tests/database/src/android/database/sqlite/cts/SQLiteDoneExceptionTest.java b/proprietary/frameworks/base/tests/database/src/android/database/sqlite/cts/SQLiteDoneExceptionTest.java deleted file mode 100755 index 881d1c812028a165b2544ae0916ad6da68a68737..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/database/src/android/database/sqlite/cts/SQLiteDoneExceptionTest.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (C) 2009 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.database.sqlite.cts; - -import android.database.sqlite.SQLiteDoneException; -import android.test.AndroidTestCase; - -public class SQLiteDoneExceptionTest extends AndroidTestCase { - public void testConstructor() { - new SQLiteDoneException(); - - new SQLiteDoneException("error"); - } -} diff --git a/proprietary/frameworks/base/tests/database/src/android/database/sqlite/cts/SQLiteExceptionTest.java b/proprietary/frameworks/base/tests/database/src/android/database/sqlite/cts/SQLiteExceptionTest.java deleted file mode 100755 index bac8e607f5923eb4315e9e64049b3b3ac4692aa1..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/database/src/android/database/sqlite/cts/SQLiteExceptionTest.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (C) 2009 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.database.sqlite.cts; - -import android.database.sqlite.SQLiteException; -import android.test.AndroidTestCase; - -public class SQLiteExceptionTest extends AndroidTestCase { - public void testConstructor() { - new SQLiteException(); - - new SQLiteException("error"); - } -} diff --git a/proprietary/frameworks/base/tests/database/src/android/database/sqlite/cts/SQLiteFtsTest.java b/proprietary/frameworks/base/tests/database/src/android/database/sqlite/cts/SQLiteFtsTest.java deleted file mode 100755 index d291dd70861f553d238980414b186ed557b28160..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/database/src/android/database/sqlite/cts/SQLiteFtsTest.java +++ /dev/null @@ -1,124 +0,0 @@ -/* - * Copyright (C) 2009 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.database.sqlite.cts; - -import android.content.ContentValues; -import android.content.Context; -import android.content.res.Resources; -import android.database.Cursor; -import android.database.sqlite.SQLiteDatabase; -import android.test.AndroidTestCase; - -import java.io.File; - -/** - * Tests to verify FTS3/4 SQLite support. - */ -public class SQLiteFtsTest extends AndroidTestCase { - - private static final String TEST_TABLE = "cts_fts"; - - private static final String[] TEST_CONTENT = { - "Any sufficiently advanced TECHnology is indistinguishable from magic.", - "Those who would give up Essential Liberty to purchase a little Temporary Safety, deserve neither Liberty nor Safety.", - "It is poor civic hygiene to install technologies that could someday facilitate a police state.", - }; - - private SQLiteDatabase mDatabase; - - @Override - public void setUp() throws Exception { - super.setUp(); - mDatabase = getContext().openOrCreateDatabase("CTS_FTS", Context.MODE_PRIVATE, null); - } - - @Override - public void tearDown() throws Exception { - try { - final String path = mDatabase.getPath(); - mDatabase.close(); - SQLiteDatabase.deleteDatabase(new File(path)); - } finally { - super.tearDown(); - } - } - - public void testFts3Porter() throws Exception { - prepareFtsTable(TEST_TABLE, "fts3", "tokenize=porter"); - - // Porter should include stemmed words - final Cursor cursor = queryFtsTable(TEST_TABLE, "technology"); - try { - assertEquals(2, cursor.getCount()); - cursor.moveToPosition(0); - assertTrue(cursor.getString(0).contains(">TECHnology<")); - cursor.moveToPosition(1); - assertTrue(cursor.getString(0).contains(">technologies<")); - } finally { - cursor.close(); - } - } - - public void testFts3Simple() throws Exception { - prepareFtsTable(TEST_TABLE, "fts3", "tokenize=simple"); - - // Simple shouldn't include stemmed words - final Cursor cursor = queryFtsTable(TEST_TABLE, "technology"); - try { - assertEquals(1, cursor.getCount()); - cursor.moveToPosition(0); - assertTrue(cursor.getString(0).contains(">TECHnology<")); - } finally { - cursor.close(); - } - } - - public void testFts4Simple() throws Exception { - prepareFtsTable(TEST_TABLE, "fts4", "tokenize=simple"); - - // Simple shouldn't include stemmed words - final Cursor cursor = queryFtsTable(TEST_TABLE, "technology"); - try { - assertEquals(1, cursor.getCount()); - cursor.moveToPosition(0); - assertTrue(cursor.getString(0).contains(">TECHnology<")); - } finally { - cursor.close(); - } - } - - private void prepareFtsTable(String table, String ftsType, String options) - throws Exception { - mDatabase.execSQL( - "CREATE VIRTUAL TABLE " + table + " USING " + ftsType - + "(content TEXT, " + options + ");"); - - final Resources res = getContext().getResources(); - final ContentValues values = new ContentValues(); - for (String content : TEST_CONTENT) { - values.clear(); - values.put("content", content); - mDatabase.insert(table, null, values); - } - } - - private Cursor queryFtsTable(String table, String match) { - return mDatabase.query(table, new String[] { "snippet(" + table + ")" }, - "content MATCH ?", new String[] { match }, - null, null, "rowid ASC"); - } -} diff --git a/proprietary/frameworks/base/tests/database/src/android/database/sqlite/cts/SQLiteFullExceptionTest.java b/proprietary/frameworks/base/tests/database/src/android/database/sqlite/cts/SQLiteFullExceptionTest.java deleted file mode 100755 index 5745c88b79fadde19f9c5954e6f1d1068da76624..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/database/src/android/database/sqlite/cts/SQLiteFullExceptionTest.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (C) 2009 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.database.sqlite.cts; - -import android.database.sqlite.SQLiteFullException; -import android.test.AndroidTestCase; - -public class SQLiteFullExceptionTest extends AndroidTestCase { - public void testConstructor() { - new SQLiteFullException(); - - new SQLiteFullException("error"); - } -} diff --git a/proprietary/frameworks/base/tests/database/src/android/database/sqlite/cts/SQLiteMisuseExceptionTest.java b/proprietary/frameworks/base/tests/database/src/android/database/sqlite/cts/SQLiteMisuseExceptionTest.java deleted file mode 100755 index a67018475ec4180c1316bafe86ed45dc51ddfa7b..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/database/src/android/database/sqlite/cts/SQLiteMisuseExceptionTest.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (C) 2009 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.database.sqlite.cts; - -import android.database.sqlite.SQLiteMisuseException; -import android.test.AndroidTestCase; - -public class SQLiteMisuseExceptionTest extends AndroidTestCase { - public void testConstructor() { - new SQLiteMisuseException(); - - new SQLiteMisuseException("error"); - } -} diff --git a/proprietary/frameworks/base/tests/database/src/android/database/sqlite/cts/SQLiteOpenHelperTest.java b/proprietary/frameworks/base/tests/database/src/android/database/sqlite/cts/SQLiteOpenHelperTest.java deleted file mode 100755 index 8a0ba217b5a963be5b4668581999a00f1dbfa4b9..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/database/src/android/database/sqlite/cts/SQLiteOpenHelperTest.java +++ /dev/null @@ -1,136 +0,0 @@ -/* - * Copyright (C) 2009 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.database.sqlite.cts; - -import android.content.Context; -import android.database.Cursor; -import android.database.sqlite.SQLiteCursor; -import android.database.sqlite.SQLiteCursorDriver; -import android.database.sqlite.SQLiteDatabase; -import android.database.sqlite.SQLiteOpenHelper; -import android.database.sqlite.SQLiteQuery; -import android.database.sqlite.SQLiteDatabase.CursorFactory; -import android.test.AndroidTestCase; - -/** - * Test {@link SQLiteOpenHelper}. - */ -public class SQLiteOpenHelperTest extends AndroidTestCase { - private static final String TEST_DATABASE_NAME = "database_test.db"; - private static final int TEST_VERSION = 1; - private static final int TEST_ILLEGAL_VERSION = 0; - private MockOpenHelper mOpenHelper; - private SQLiteDatabase.CursorFactory mFactory = new SQLiteDatabase.CursorFactory() { - public Cursor newCursor(SQLiteDatabase db, SQLiteCursorDriver masterQuery, - String editTable, SQLiteQuery query) { - return new MockCursor(db, masterQuery, editTable, query); - } - }; - - @Override - protected void setUp() throws Exception { - super.setUp(); - mOpenHelper = getOpenHelper(); - } - - public void testConstructor() { - new MockOpenHelper(mContext, TEST_DATABASE_NAME, mFactory, TEST_VERSION); - - // Test with illegal version number. - try { - new MockOpenHelper(mContext, TEST_DATABASE_NAME, mFactory, TEST_ILLEGAL_VERSION); - fail("Constructor of SQLiteOpenHelp should throws a IllegalArgumentException here."); - } catch (IllegalArgumentException e) { - } - - // Test with null factory - new MockOpenHelper(mContext, TEST_DATABASE_NAME, null, TEST_VERSION); - } - - public void testGetDatabase() { - SQLiteDatabase database = null; - assertFalse(mOpenHelper.hasCalledOnOpen()); - // Test getReadableDatabase. - database = mOpenHelper.getReadableDatabase(); - assertNotNull(database); - assertTrue(database.isOpen()); - assertTrue(mOpenHelper.hasCalledOnOpen()); - - // Database has been opened, so onOpen can not be invoked. - mOpenHelper.resetStatus(); - assertFalse(mOpenHelper.hasCalledOnOpen()); - // Test getWritableDatabase. - SQLiteDatabase database2 = mOpenHelper.getWritableDatabase(); - assertSame(database, database2); - assertTrue(database.isOpen()); - assertFalse(mOpenHelper.hasCalledOnOpen()); - - mOpenHelper.close(); - assertFalse(database.isOpen()); - - // After close(), onOpen() will be invoked by getWritableDatabase. - mOpenHelper.resetStatus(); - assertFalse(mOpenHelper.hasCalledOnOpen()); - SQLiteDatabase database3 = mOpenHelper.getWritableDatabase(); - assertNotNull(database); - assertNotSame(database, database3); - assertTrue(mOpenHelper.hasCalledOnOpen()); - assertTrue(database3.isOpen()); - mOpenHelper.close(); - assertFalse(database3.isOpen()); - } - - private MockOpenHelper getOpenHelper() { - return new MockOpenHelper(mContext, TEST_DATABASE_NAME, mFactory, TEST_VERSION); - } - - private class MockOpenHelper extends SQLiteOpenHelper { - private boolean mHasCalledOnOpen = false; - - public MockOpenHelper(Context context, String name, CursorFactory factory, int version) { - super(context, name, factory, version); - } - - @Override - public void onCreate(SQLiteDatabase db) { - } - - @Override - public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { - } - - @Override - public void onOpen(SQLiteDatabase db) { - mHasCalledOnOpen = true; - } - - public boolean hasCalledOnOpen() { - return mHasCalledOnOpen; - } - - public void resetStatus() { - mHasCalledOnOpen = false; - } - } - - private class MockCursor extends SQLiteCursor { - public MockCursor(SQLiteDatabase db, SQLiteCursorDriver driver, String editTable, - SQLiteQuery query) { - super(db, driver, editTable, query); - } - } -} diff --git a/proprietary/frameworks/base/tests/database/src/android/database/sqlite/cts/SQLiteProgramTest.java b/proprietary/frameworks/base/tests/database/src/android/database/sqlite/cts/SQLiteProgramTest.java deleted file mode 100755 index 9477aecd7e2b68d1a54e338bbff850dcc0333f57..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/database/src/android/database/sqlite/cts/SQLiteProgramTest.java +++ /dev/null @@ -1,182 +0,0 @@ -/* - * Copyright (C) 2009 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.database.sqlite.cts; - - -import android.content.Context; -import android.database.Cursor; -import android.database.sqlite.SQLiteDatabase; -import android.database.sqlite.SQLiteDoneException; -import android.database.sqlite.SQLiteException; -import android.database.sqlite.SQLiteStatement; -import android.test.AndroidTestCase; -import android.test.MoreAsserts; - -public class SQLiteProgramTest extends AndroidTestCase { - private static final String DATABASE_NAME = "database_test.db"; - - private SQLiteDatabase mDatabase; - - @Override - protected void setUp() throws Exception { - super.setUp(); - - getContext().deleteDatabase(DATABASE_NAME); - mDatabase = getContext().openOrCreateDatabase(DATABASE_NAME, Context.MODE_PRIVATE, null); - assertNotNull(mDatabase); - } - - @Override - protected void tearDown() throws Exception { - mDatabase.close(); - getContext().deleteDatabase(DATABASE_NAME); - - super.tearDown(); - } - - public void testBind() { - mDatabase.execSQL("CREATE TABLE test (_id INTEGER PRIMARY KEY, text1 TEXT, text2 TEXT, " + - "num1 INTEGER, num2 INTEGER, image BLOB);"); - mDatabase.execSQL("INSERT INTO test (text1, text2, num1, num2, image) " + - "VALUES ('Mike', 'Jack', 12, 30, 'abcdefg');"); - mDatabase.execSQL("INSERT INTO test (text1, text2, num1, num2, image) " + - "VALUES ('test1', 'test2', 213, 589, '123456789');"); - SQLiteStatement statement; - - statement = mDatabase.compileStatement("SELECT num1 FROM test WHERE num2 = ?;"); - statement.bindLong(1, 30); - assertEquals(12, statement.simpleQueryForLong()); - - // re-bind without clearing - statement.bindDouble(1, 589.0); - assertEquals(213, statement.simpleQueryForLong()); - statement.close(); - - statement = mDatabase.compileStatement("SELECT text1 FROM test WHERE text2 = ?;"); - - statement.bindDouble(1, 589.0); // Wrong binding - try { - statement.simpleQueryForString(); - fail("Should throw exception (no rows found)"); - } catch (SQLiteDoneException expected) { - // expected - } - statement.bindString(1, "test2"); - assertEquals("test1", statement.simpleQueryForString()); - statement.clearBindings(); - try { - statement.simpleQueryForString(); - fail("Should throw exception (unbound value)"); - } catch (SQLiteDoneException expected) { - // expected - } - statement.close(); - - Cursor cursor = null; - try { - cursor = mDatabase.query("test", new String[]{"text1"}, "where text1='a'", - new String[]{"foo"}, null, null, null); - fail("Should throw exception (no value to bind)"); - } catch (SQLiteException expected) { - // expected - } finally { - if (cursor != null) { - cursor.close(); - } - } - try { - cursor = mDatabase.query("test", new String[]{"text1"}, "where text1='a'", - new String[]{"foo", "bar"}, null, null, null); - fail("Should throw exception (index too large)"); - } catch (SQLiteException expected) { - // expected - } finally { - if (cursor != null) { - cursor.close(); - } - } - // test positive case - statement = mDatabase.compileStatement( - "SELECT text1 FROM test WHERE text2 = ? AND num2 = ?;"); - statement.bindString(1, "Jack"); - statement.bindLong(2, 30); - assertEquals("Mike", statement.simpleQueryForString()); - statement.close(); - } - - public void testBindNull() { - mDatabase.execSQL("CREATE TABLE test (_id INTEGER PRIMARY KEY, text1 TEXT, text2 TEXT, " + - "num1 INTEGER, num2 INTEGER, image BLOB);"); - - SQLiteStatement statement = mDatabase.compileStatement("INSERT INTO test " + - "(text1,text2,num1,image) VALUES (?,?,?,?)"); - statement.bindString(1, "string1"); - statement.bindString(2, "string2"); - statement.bindLong(3, 100); - statement.bindNull(4); - statement.execute(); - statement.close(); - - final int COLUMN_TEXT1_INDEX = 0; - final int COLUMN_TEXT2_INDEX = 1; - final int COLUMN_NUM1_INDEX = 2; - final int COLUMN_IMAGE_INDEX = 3; - - Cursor cursor = mDatabase.query("test", new String[] { "text1", "text2", "num1", "image" }, - null, null, null, null, null); - assertNotNull(cursor); - assertEquals(1, cursor.getCount()); - cursor.moveToFirst(); - assertEquals("string1", cursor.getString(COLUMN_TEXT1_INDEX)); - assertEquals("string2", cursor.getString(COLUMN_TEXT2_INDEX)); - assertEquals(100, cursor.getInt(COLUMN_NUM1_INDEX)); - assertNull(cursor.getString(COLUMN_IMAGE_INDEX)); - cursor.close(); - } - - public void testBindBlob() { - mDatabase.execSQL("CREATE TABLE test (_id INTEGER PRIMARY KEY, text1 TEXT, text2 TEXT, " + - "num1 INTEGER, num2 INTEGER, image BLOB);"); - - SQLiteStatement statement = mDatabase.compileStatement("INSERT INTO test " + - "(text1,text2,num1,image) VALUES (?,?,?,?)"); - statement.bindString(1, "string1"); - statement.bindString(2, "string2"); - statement.bindLong(3, 100); - byte[] blob = new byte[] { '1', '2', '3' }; - statement.bindBlob(4, blob); - statement.execute(); - statement.close(); - - final int COLUMN_TEXT1_INDEX = 0; - final int COLUMN_TEXT2_INDEX = 1; - final int COLUMN_NUM1_INDEX = 2; - final int COLUMN_IMAGE_INDEX = 3; - - Cursor cursor = mDatabase.query("test", new String[] { "text1", "text2", "num1", "image" }, - null, null, null, null, null); - assertNotNull(cursor); - assertEquals(1, cursor.getCount()); - cursor.moveToFirst(); - assertEquals("string1", cursor.getString(COLUMN_TEXT1_INDEX)); - assertEquals("string2", cursor.getString(COLUMN_TEXT2_INDEX)); - assertEquals(100, cursor.getInt(COLUMN_NUM1_INDEX)); - byte[] value = cursor.getBlob(COLUMN_IMAGE_INDEX); - MoreAsserts.assertEquals(blob, value); - cursor.close(); - } -} diff --git a/proprietary/frameworks/base/tests/database/src/android/database/sqlite/cts/SQLiteQueryBuilderTest.java b/proprietary/frameworks/base/tests/database/src/android/database/sqlite/cts/SQLiteQueryBuilderTest.java deleted file mode 100755 index cde0bb0a563d7365d5f54f302a8152d26f609b4a..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/database/src/android/database/sqlite/cts/SQLiteQueryBuilderTest.java +++ /dev/null @@ -1,499 +0,0 @@ -/* - * Copyright (C) 2009 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.database.sqlite.cts; - - -import android.content.Context; -import android.database.Cursor; -import android.database.sqlite.SQLiteCursor; -import android.database.sqlite.SQLiteCursorDriver; -import android.database.sqlite.SQLiteDatabase; -import android.database.sqlite.SQLiteQuery; -import android.database.sqlite.SQLiteQueryBuilder; -import android.os.CancellationSignal; -import android.os.OperationCanceledException; -import android.test.AndroidTestCase; - -import java.util.HashMap; -import java.util.Map; -import java.util.concurrent.Semaphore; - -public class SQLiteQueryBuilderTest extends AndroidTestCase { - private SQLiteDatabase mDatabase; - private final String TEST_TABLE_NAME = "test"; - private final String EMPLOYEE_TABLE_NAME = "employee"; - private static final String DATABASE_FILE = "database_test.db"; - - @Override - protected void setUp() throws Exception { - super.setUp(); - - getContext().deleteDatabase(DATABASE_FILE); - mDatabase = getContext().openOrCreateDatabase(DATABASE_FILE, Context.MODE_PRIVATE, null); - assertNotNull(mDatabase); - } - - @Override - protected void tearDown() throws Exception { - mDatabase.close(); - getContext().deleteDatabase(DATABASE_FILE); - super.tearDown(); - } - - public void testConstructor() { - new SQLiteQueryBuilder(); - } - - public void testSetDistinct() { - String expected; - SQLiteQueryBuilder sqliteQueryBuilder = new SQLiteQueryBuilder(); - sqliteQueryBuilder.setTables(TEST_TABLE_NAME); - sqliteQueryBuilder.setDistinct(false); - sqliteQueryBuilder.appendWhere("age=20"); - String sql = sqliteQueryBuilder.buildQuery(new String[] { "age", "address" }, - null, null, null, null, null, null); - assertEquals(TEST_TABLE_NAME, sqliteQueryBuilder.getTables()); - expected = "SELECT age, address FROM " + TEST_TABLE_NAME + " WHERE (age=20)"; - assertEquals(expected, sql); - - sqliteQueryBuilder = new SQLiteQueryBuilder(); - sqliteQueryBuilder.setTables(EMPLOYEE_TABLE_NAME); - sqliteQueryBuilder.setDistinct(true); - sqliteQueryBuilder.appendWhere("age>32"); - sql = sqliteQueryBuilder.buildQuery(new String[] { "age", "address" }, - null, null, null, null, null, null); - assertEquals(EMPLOYEE_TABLE_NAME, sqliteQueryBuilder.getTables()); - expected = "SELECT DISTINCT age, address FROM " + EMPLOYEE_TABLE_NAME + " WHERE (age>32)"; - assertEquals(expected, sql); - - sqliteQueryBuilder = new SQLiteQueryBuilder(); - sqliteQueryBuilder.setTables(EMPLOYEE_TABLE_NAME); - sqliteQueryBuilder.setDistinct(true); - sqliteQueryBuilder.appendWhereEscapeString("age>32"); - sql = sqliteQueryBuilder.buildQuery(new String[] { "age", "address" }, - null, null, null, null, null, null); - assertEquals(EMPLOYEE_TABLE_NAME, sqliteQueryBuilder.getTables()); - expected = "SELECT DISTINCT age, address FROM " + EMPLOYEE_TABLE_NAME - + " WHERE ('age>32')"; - assertEquals(expected, sql); - } - - public void testSetProjectionMap() { - String expected; - Map projectMap = new HashMap(); - projectMap.put("EmployeeName", "name"); - projectMap.put("EmployeeAge", "age"); - projectMap.put("EmployeeAddress", "address"); - SQLiteQueryBuilder sqliteQueryBuilder = new SQLiteQueryBuilder(); - sqliteQueryBuilder.setTables(TEST_TABLE_NAME); - sqliteQueryBuilder.setDistinct(false); - sqliteQueryBuilder.setProjectionMap(projectMap); - String sql = sqliteQueryBuilder.buildQuery(new String[] { "EmployeeName", "EmployeeAge" }, - null, null, null, null, null, null); - expected = "SELECT name, age FROM " + TEST_TABLE_NAME; - assertEquals(expected, sql); - - sql = sqliteQueryBuilder.buildQuery(null, // projectionIn is null - null, null, null, null, null, null); - // TODO: implement an order-independent way of doing the projection columns comparison - expected = "SELECT address, name, age FROM " + TEST_TABLE_NAME; - assertEquals(expected, sql); - - sqliteQueryBuilder.setProjectionMap(null); - sql = sqliteQueryBuilder.buildQuery(new String[] { "name", "address" }, - null, null, null, null, null, null); - expected = "SELECT name, address FROM " + TEST_TABLE_NAME; - assertEquals(expected, sql); - } - - public void testSetCursorFactory() { - mDatabase.execSQL("CREATE TABLE test (_id INTEGER PRIMARY KEY, " + - "name TEXT, age INTEGER, address TEXT);"); - mDatabase.execSQL("INSERT INTO test (name, age, address) VALUES ('Mike', '20', 'LA');"); - mDatabase.execSQL("INSERT INTO test (name, age, address) VALUES ('jack', '40', 'LA');"); - - SQLiteQueryBuilder sqliteQueryBuilder = new SQLiteQueryBuilder(); - sqliteQueryBuilder.setTables(TEST_TABLE_NAME); - Cursor cursor = sqliteQueryBuilder.query(mDatabase, new String[] { "name", "age" }, - null, null, null, null, null); - assertNotNull(cursor); - assertTrue(cursor instanceof SQLiteCursor); - cursor.close(); - - SQLiteDatabase.CursorFactory factory = new SQLiteDatabase.CursorFactory() { - public Cursor newCursor(SQLiteDatabase db, SQLiteCursorDriver masterQuery, - String editTable, SQLiteQuery query) { - return new MockCursor(db, masterQuery, editTable, query); - } - }; - - sqliteQueryBuilder.setCursorFactory(factory); - cursor = sqliteQueryBuilder.query(mDatabase, new String[] { "name", "age" }, - null, null, null, null, null); - assertNotNull(cursor); - assertTrue(cursor instanceof MockCursor); - cursor.close(); - } - - private static class MockCursor extends SQLiteCursor { - public MockCursor(SQLiteDatabase db, SQLiteCursorDriver driver, - String editTable, SQLiteQuery query) { - super(db, driver, editTable, query); - } - } - - public void testBuildQueryString() { - String expected; - final String[] DEFAULT_TEST_PROJECTION = new String [] { "name", "age", "sum(salary)" }; - final String DEFAULT_TEST_WHERE = "age > 25"; - final String DEFAULT_HAVING = "sum(salary) > 3000"; - - String sql = SQLiteQueryBuilder.buildQueryString(false, "Employee", - DEFAULT_TEST_PROJECTION, - DEFAULT_TEST_WHERE, "name", DEFAULT_HAVING, "name", "100"); - - expected = "SELECT name, age, sum(salary) FROM Employee WHERE " + DEFAULT_TEST_WHERE + - " GROUP BY name " + - "HAVING " + DEFAULT_HAVING + " " + - "ORDER BY name " + - "LIMIT 100"; - assertEquals(expected, sql); - } - - public void testBuildQuery() { - final String[] DEFAULT_TEST_PROJECTION = new String[] { "name", "sum(salary)" }; - final String DEFAULT_TEST_WHERE = "age > 25"; - final String DEFAULT_HAVING = "sum(salary) > 2000"; - - SQLiteQueryBuilder sqliteQueryBuilder = new SQLiteQueryBuilder(); - sqliteQueryBuilder.setTables(TEST_TABLE_NAME); - sqliteQueryBuilder.setDistinct(false); - String sql = sqliteQueryBuilder.buildQuery(DEFAULT_TEST_PROJECTION, - DEFAULT_TEST_WHERE, null, "name", DEFAULT_HAVING, "name", "2"); - String expected = "SELECT name, sum(salary) FROM " + TEST_TABLE_NAME - + " WHERE (" + DEFAULT_TEST_WHERE + ") " + - "GROUP BY name HAVING " + DEFAULT_HAVING + " ORDER BY name LIMIT 2"; - assertEquals(expected, sql); - } - - public void testAppendColumns() { - StringBuilder sb = new StringBuilder(); - String[] columns = new String[] { "name", "age" }; - - assertEquals("", sb.toString()); - SQLiteQueryBuilder.appendColumns(sb, columns); - assertEquals("name, age ", sb.toString()); - } - - public void testQuery() { - createEmployeeTable(); - - SQLiteQueryBuilder sqliteQueryBuilder = new SQLiteQueryBuilder(); - sqliteQueryBuilder.setTables("Employee"); - Cursor cursor = sqliteQueryBuilder.query(mDatabase, - new String[] { "name", "sum(salary)" }, null, null, - "name", "sum(salary)>1000", "name"); - assertNotNull(cursor); - assertEquals(3, cursor.getCount()); - - final int COLUMN_NAME_INDEX = 0; - final int COLUMN_SALARY_INDEX = 1; - cursor.moveToFirst(); - assertEquals("Jim", cursor.getString(COLUMN_NAME_INDEX)); - assertEquals(4500, cursor.getInt(COLUMN_SALARY_INDEX)); - cursor.moveToNext(); - assertEquals("Mike", cursor.getString(COLUMN_NAME_INDEX)); - assertEquals(4000, cursor.getInt(COLUMN_SALARY_INDEX)); - cursor.moveToNext(); - assertEquals("jack", cursor.getString(COLUMN_NAME_INDEX)); - assertEquals(3500, cursor.getInt(COLUMN_SALARY_INDEX)); - cursor.close(); - - sqliteQueryBuilder = new SQLiteQueryBuilder(); - sqliteQueryBuilder.setTables(EMPLOYEE_TABLE_NAME); - cursor = sqliteQueryBuilder.query(mDatabase, - new String[] { "name", "sum(salary)" }, null, null, - "name", "sum(salary)>1000", "name", "2" // limit is 2 - ); - assertNotNull(cursor); - assertEquals(2, cursor.getCount()); - cursor.moveToFirst(); - assertEquals("Jim", cursor.getString(COLUMN_NAME_INDEX)); - assertEquals(4500, cursor.getInt(COLUMN_SALARY_INDEX)); - cursor.moveToNext(); - assertEquals("Mike", cursor.getString(COLUMN_NAME_INDEX)); - assertEquals(4000, cursor.getInt(COLUMN_SALARY_INDEX)); - cursor.close(); - } - - public void testUnionQuery() { - String expected; - String[] innerProjection = new String[] {"name", "age", "location"}; - SQLiteQueryBuilder employeeQueryBuilder = new SQLiteQueryBuilder(); - SQLiteQueryBuilder peopleQueryBuilder = new SQLiteQueryBuilder(); - - employeeQueryBuilder.setTables("employee"); - peopleQueryBuilder.setTables("people"); - - String employeeSubQuery = employeeQueryBuilder.buildUnionSubQuery( - "_id", innerProjection, - null, 2, "employee", - "age=25", - null, null, null); - String peopleSubQuery = peopleQueryBuilder.buildUnionSubQuery( - "_id", innerProjection, - null, 2, "people", - "location=LA", - null, null, null); - expected = "SELECT name, age, location FROM employee WHERE (age=25)"; - assertEquals(expected, employeeSubQuery); - expected = "SELECT name, age, location FROM people WHERE (location=LA)"; - assertEquals(expected, peopleSubQuery); - - SQLiteQueryBuilder unionQueryBuilder = new SQLiteQueryBuilder(); - - unionQueryBuilder.setDistinct(true); - - String unionQuery = unionQueryBuilder.buildUnionQuery( - new String[] { employeeSubQuery, peopleSubQuery }, null, null); - expected = "SELECT name, age, location FROM employee WHERE (age=25) " + - "UNION SELECT name, age, location FROM people WHERE (location=LA)"; - assertEquals(expected, unionQuery); - } - - public void testCancelableQuery_WhenNotCanceled_ReturnsResultSet() { - createEmployeeTable(); - - CancellationSignal cancellationSignal = new CancellationSignal(); - SQLiteQueryBuilder sqliteQueryBuilder = new SQLiteQueryBuilder(); - sqliteQueryBuilder.setTables("Employee"); - Cursor cursor = sqliteQueryBuilder.query(mDatabase, - new String[] { "name", "sum(salary)" }, null, null, - "name", "sum(salary)>1000", "name", null, cancellationSignal); - - assertEquals(3, cursor.getCount()); - cursor.close(); - } - - public void testCancelableQuery_WhenCanceledBeforeQuery_ThrowsImmediately() { - createEmployeeTable(); - - CancellationSignal cancellationSignal = new CancellationSignal(); - SQLiteQueryBuilder sqliteQueryBuilder = new SQLiteQueryBuilder(); - sqliteQueryBuilder.setTables("Employee"); - - cancellationSignal.cancel(); - Cursor cursor = null; - try { - cursor = sqliteQueryBuilder.query(mDatabase, - new String[] { "name", "sum(salary)" }, null, null, - "name", "sum(salary)>1000", "name", null, cancellationSignal); - fail("Expected OperationCanceledException"); - } catch (OperationCanceledException ex) { - // expected - } finally { - if (cursor != null) { - cursor.close(); - } - } - } - - public void testCancelableQuery_WhenCanceledAfterQuery_ThrowsWhenExecuted() { - createEmployeeTable(); - - CancellationSignal cancellationSignal = new CancellationSignal(); - SQLiteQueryBuilder sqliteQueryBuilder = new SQLiteQueryBuilder(); - sqliteQueryBuilder.setTables("Employee"); - - Cursor cursor = sqliteQueryBuilder.query(mDatabase, - new String[] { "name", "sum(salary)" }, null, null, - "name", "sum(salary)>1000", "name", null, cancellationSignal); - - cancellationSignal.cancel(); - try { - cursor.getCount(); // force execution - fail("Expected OperationCanceledException"); - } catch (OperationCanceledException ex) { - // expected - } finally { - if (cursor != null) { - cursor.close(); - } - } - } - - public void testCancelableQuery_WhenCanceledDueToContention_StopsWaitingAndThrows() { - createEmployeeTable(); - - for (int i = 0; i < 5; i++) { - final CancellationSignal cancellationSignal = new CancellationSignal(); - final Semaphore barrier1 = new Semaphore(0); - final Semaphore barrier2 = new Semaphore(0); - Thread contentionThread = new Thread() { - @Override - public void run() { - mDatabase.beginTransaction(); // acquire the only available connection - barrier1.release(); // release query to start running - try { - barrier2.acquire(); // wait for test to end - } catch (InterruptedException e) { - } - mDatabase.endTransaction(); // release the connection - } - }; - Thread cancellationThread = new Thread() { - @Override - public void run() { - try { - Thread.sleep(300); - } catch (InterruptedException ex) { - } - cancellationSignal.cancel(); - } - }; - try { - SQLiteQueryBuilder sqliteQueryBuilder = new SQLiteQueryBuilder(); - sqliteQueryBuilder.setTables("Employee"); - - contentionThread.start(); - cancellationThread.start(); - - try { - barrier1.acquire(); // wait for contention thread to start transaction - } catch (InterruptedException e) { - } - - final long startTime = System.nanoTime(); - Cursor cursor = null; - try { - cursor = sqliteQueryBuilder.query(mDatabase, - new String[] { "name", "sum(salary)" }, null, null, - "name", "sum(salary)>1000", "name", null, cancellationSignal); - cursor.getCount(); // force execution - fail("Expected OperationCanceledException"); - } catch (OperationCanceledException ex) { - // expected - } finally { - if (cursor != null) { - cursor.close(); - } - } - - // We want to confirm that the query really was blocked trying to acquire a - // connection for a certain amount of time before it was freed by cancel. - final long waitTime = System.nanoTime() - startTime; - if (waitTime > 150 * 1000000L) { - return; // success! - } - } finally { - barrier1.release(); - barrier2.release(); - try { - contentionThread.join(); - cancellationThread.join(); - } catch (InterruptedException e) { - } - } - } - - // Occasionally we might miss the timing deadline due to factors in the - // environment, but if after several trials we still couldn't demonstrate - // that the query was blocked, then the test must be broken. - fail("Could not prove that the query actually blocked before cancel() was called."); - } - - public void testCancelableQuery_WhenCanceledDuringLongRunningQuery_CancelsQueryAndThrows() { - // Populate a table with a bunch of integers. - mDatabase.execSQL("CREATE TABLE x (v INTEGER);"); - for (int i = 0; i < 100; i++) { - mDatabase.execSQL("INSERT INTO x VALUES (?)", new Object[] { i }); - } - - for (int i = 0; i < 5; i++) { - final CancellationSignal cancellationSignal = new CancellationSignal(); - Thread cancellationThread = new Thread() { - @Override - public void run() { - try { - Thread.sleep(300); - } catch (InterruptedException ex) { - } - cancellationSignal.cancel(); - } - }; - try { - // Build an unsatisfiable 5-way cross-product query over 100 values but - // produces no output. This should force SQLite to loop for a long time - // as it tests 10^10 combinations. - SQLiteQueryBuilder sqliteQueryBuilder = new SQLiteQueryBuilder(); - sqliteQueryBuilder.setTables("x AS a, x AS b, x AS c, x AS d, x AS e"); - - cancellationThread.start(); - - final long startTime = System.nanoTime(); - Cursor cursor = null; - try { - cursor = sqliteQueryBuilder.query(mDatabase, null, - "a.v + b.v + c.v + d.v + e.v > 1000000", - null, null, null, null, null, cancellationSignal); - cursor.getCount(); // force execution - fail("Expected OperationCanceledException"); - } catch (OperationCanceledException ex) { - // expected - } finally { - if (cursor != null) { - cursor.close(); - } - } - - // We want to confirm that the query really was running and then got - // canceled midway. - final long waitTime = System.nanoTime() - startTime; - if (waitTime > 150 * 1000000L && waitTime < 600 * 1000000L) { - return; // success! - } - } finally { - try { - cancellationThread.join(); - } catch (InterruptedException e) { - } - } - } - - // Occasionally we might miss the timing deadline due to factors in the - // environment, but if after several trials we still couldn't demonstrate - // that the query was canceled, then the test must be broken. - fail("Could not prove that the query actually canceled midway during execution."); - } - - private void createEmployeeTable() { - mDatabase.execSQL("CREATE TABLE employee (_id INTEGER PRIMARY KEY, " + - "name TEXT, month INTEGER, salary INTEGER);"); - mDatabase.execSQL("INSERT INTO employee (name, month, salary) " + - "VALUES ('Mike', '1', '1000');"); - mDatabase.execSQL("INSERT INTO employee (name, month, salary) " + - "VALUES ('Mike', '2', '3000');"); - mDatabase.execSQL("INSERT INTO employee (name, month, salary) " + - "VALUES ('jack', '1', '2000');"); - mDatabase.execSQL("INSERT INTO employee (name, month, salary) " + - "VALUES ('jack', '3', '1500');"); - mDatabase.execSQL("INSERT INTO employee (name, month, salary) " + - "VALUES ('Jim', '1', '1000');"); - mDatabase.execSQL("INSERT INTO employee (name, month, salary) " + - "VALUES ('Jim', '3', '3500');"); - } -} diff --git a/proprietary/frameworks/base/tests/database/src/android/database/sqlite/cts/SQLiteQueryTest.java b/proprietary/frameworks/base/tests/database/src/android/database/sqlite/cts/SQLiteQueryTest.java deleted file mode 100755 index c0549fdb5ea03c868cc2352a1804bca27a6d1442..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/database/src/android/database/sqlite/cts/SQLiteQueryTest.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (C) 2009 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.database.sqlite.cts; - -import junit.framework.TestCase; - -public class SQLiteQueryTest extends TestCase { - public void testMethods() { - // cannot obtain an instance of SQLiteQuery - } -} diff --git a/proprietary/frameworks/base/tests/database/src/android/database/sqlite/cts/SQLiteStatementTest.java b/proprietary/frameworks/base/tests/database/src/android/database/sqlite/cts/SQLiteStatementTest.java deleted file mode 100755 index a2e924d08d2fed14e9b90d73516eb8ff3b47a113..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/database/src/android/database/sqlite/cts/SQLiteStatementTest.java +++ /dev/null @@ -1,341 +0,0 @@ -/* - * Copyright (C) 2009 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.database.sqlite.cts; - - -import android.content.ContentValues; -import android.content.Context; -import android.database.Cursor; -import android.database.DatabaseUtils; -import android.database.SQLException; -import android.database.sqlite.SQLiteDatabase; -import android.database.sqlite.SQLiteDoneException; -import android.database.sqlite.SQLiteStatement; -import android.os.ParcelFileDescriptor; -import android.test.AndroidTestCase; -import android.test.MoreAsserts; - -import java.io.IOException; -import java.io.InputStream; - -public class SQLiteStatementTest extends AndroidTestCase { - private static final String STRING1 = "this is a test"; - private static final String STRING2 = "another test"; - - private static final byte[][] BLOBS = new byte [][] { - parseBlob("86FADCF1A820666AEBD0789F47932151A2EF734269E8AC4E39630AB60519DFD8"), - new byte[1], - null, - parseBlob("00"), - parseBlob("FF"), - parseBlob("D7B500FECF25F7A4D83BF823D3858690790F2526013DE6CAE9A69170E2A1E47238"), - }; - - private static final String DATABASE_NAME = "database_test.db"; - - private static final int CURRENT_DATABASE_VERSION = 42; - private SQLiteDatabase mDatabase; - - @Override - protected void setUp() throws Exception { - super.setUp(); - - getContext().deleteDatabase(DATABASE_NAME); - mDatabase = getContext().openOrCreateDatabase(DATABASE_NAME, Context.MODE_PRIVATE, null); - assertNotNull(mDatabase); - mDatabase.setVersion(CURRENT_DATABASE_VERSION); - } - - @Override - protected void tearDown() throws Exception { - mDatabase.close(); - getContext().deleteDatabase(DATABASE_NAME); - super.tearDown(); - } - - private void populateDefaultTable() { - mDatabase.execSQL("CREATE TABLE test (_id INTEGER PRIMARY KEY, data TEXT);"); - } - - private void populateBlobTable() { - mDatabase.execSQL("CREATE TABLE blob_test (_id INTEGER PRIMARY KEY, data BLOB)"); - for (int i = 0; i < BLOBS.length; i++) { - ContentValues values = new ContentValues(); - values.put("_id", i); - values.put("data", BLOBS[i]); - mDatabase.insert("blob_test", null, values); - } - } - - public void testExecute() { - mDatabase.disableWriteAheadLogging(); - populateDefaultTable(); - - assertEquals(0, DatabaseUtils.longForQuery(mDatabase, "select count(*) from test", null)); - - // test update - // insert 2 rows and then update them. - SQLiteStatement statement1 = mDatabase.compileStatement( - "INSERT INTO test (data) VALUES ('" + STRING2 + "')"); - assertEquals(1, statement1.executeInsert()); - assertEquals(2, statement1.executeInsert()); - SQLiteStatement statement2 = - mDatabase.compileStatement("UPDATE test set data = 'a' WHERE _id > 0"); - assertEquals(2, statement2.executeUpdateDelete()); - statement2.close(); - // should still have 2 rows in the table - assertEquals(2, DatabaseUtils.longForQuery(mDatabase, "select count(*) from test", null)); - - // test delete - // insert 2 more rows and delete 3 of them - assertEquals(3, statement1.executeInsert()); - assertEquals(4, statement1.executeInsert()); - statement1.close(); - statement2 = mDatabase.compileStatement("DELETE from test WHERE _id < 4"); - assertEquals(3, statement2.executeUpdateDelete()); - statement2.close(); - // should still have 1 row1 in the table - assertEquals(1, DatabaseUtils.longForQuery(mDatabase, "select count(*) from test", null)); - - // if the SQL statement is something that causes rows of data to - // be returned, executeUpdateDelete() (and execute()) throw an exception. - statement2 = mDatabase.compileStatement("SELECT count(*) FROM test"); - try { - statement2.executeUpdateDelete(); - fail("exception expected"); - } catch (SQLException e) { - // expected - } finally { - statement2.close(); - } - } - - public void testExecuteInsert() { - populateDefaultTable(); - - Cursor c = mDatabase.query("test", null, null, null, null, null, null); - assertEquals(0, c.getCount()); - - // test insert - SQLiteStatement statement = mDatabase.compileStatement( - "INSERT INTO test (data) VALUES ('" + STRING2 + "')"); - assertEquals(1, statement.executeInsert()); - statement.close(); - - // try to insert another row with the same id. last inserted rowid should be -1 - statement = mDatabase.compileStatement("insert or ignore into test values(1, 1);"); - assertEquals(-1, statement.executeInsert()); - statement.close(); - - c = mDatabase.query("test", null, null, null, null, null, null); - assertEquals(1, c.getCount()); - - c.moveToFirst(); - assertEquals(STRING2, c.getString(c.getColumnIndex("data"))); - c.close(); - - // if the sql statement is something that causes rows of data to - // be returned, executeInsert() throws an exception - statement = mDatabase.compileStatement( - "SELECT * FROM test WHERE data=\"" + STRING2 + "\""); - try { - statement.executeInsert(); - fail("exception expected"); - } catch (SQLException e) { - // expected - } finally { - statement.close(); - - } - } - - public void testSimpleQueryForLong() { - mDatabase.execSQL("CREATE TABLE test (num INTEGER NOT NULL, str TEXT NOT NULL);"); - mDatabase.execSQL("INSERT INTO test VALUES (1234, 'hello');"); - SQLiteStatement statement = - mDatabase.compileStatement("SELECT num FROM test WHERE str = ?"); - - // test query long - statement.bindString(1, "hello"); - long value = statement.simpleQueryForLong(); - assertEquals(1234, value); - - // test query returns zero rows - statement.bindString(1, "world"); - - try { - statement.simpleQueryForLong(); - fail("There should be a SQLiteDoneException thrown out."); - } catch (SQLiteDoneException e) { - // expected. - } - - statement.close(); - } - - public void testSimpleQueryForString() { - mDatabase.execSQL("CREATE TABLE test (num INTEGER NOT NULL, str TEXT NOT NULL);"); - mDatabase.execSQL("INSERT INTO test VALUES (1234, 'hello');"); - SQLiteStatement statement = - mDatabase.compileStatement("SELECT str FROM test WHERE num = ?"); - - // test query String - statement.bindLong(1, 1234); - String value = statement.simpleQueryForString(); - assertEquals("hello", value); - - // test query returns zero rows - statement.bindLong(1, 5678); - - try { - statement.simpleQueryForString(); - fail("There should be a SQLiteDoneException thrown out."); - } catch (SQLiteDoneException e) { - // expected. - } - - statement.close(); - } - - public void testSimpleQueryForBlobFileDescriptorSuccessNormal() throws IOException { - doTestSimpleQueryForBlobFileDescriptorSuccess(0); - } - - public void testSimpleQueryForBlobFileDescriptorSuccessEmpty() throws IOException { - doTestSimpleQueryForBlobFileDescriptorSuccess(1); - } - - public void testSimpleQueryForBlobFileDescriptorSuccessNull() { - populateBlobTable(); - - String sql = "SELECT data FROM blob_test WHERE _id = " + 2; - SQLiteStatement stm = mDatabase.compileStatement(sql); - assertNull(stm.simpleQueryForBlobFileDescriptor()); - } - - public void testSimpleQueryForBlobFileDescriptorSuccess00() throws IOException { - doTestSimpleQueryForBlobFileDescriptorSuccess(3); - } - - public void testSimpleQueryForBlobFileDescriptorSuccessFF() throws IOException { - doTestSimpleQueryForBlobFileDescriptorSuccess(4); - } - - public void testSimpleQueryForBlobFileDescriptorSuccessEmbeddedNul() throws IOException { - doTestSimpleQueryForBlobFileDescriptorSuccess(5); - } - - private void doTestSimpleQueryForBlobFileDescriptorSuccess(int i) throws IOException { - populateBlobTable(); - - String sql = "SELECT data FROM blob_test WHERE _id = " + i; - SQLiteStatement stm = mDatabase.compileStatement(sql); - ParcelFileDescriptor fd = stm.simpleQueryForBlobFileDescriptor(); - assertFileDescriptorContent(BLOBS[i], fd); - } - - public void testSimpleQueryForBlobFileDescriptorSuccessParam() throws IOException { - populateBlobTable(); - - String sql = "SELECT data FROM blob_test WHERE _id = ?"; - SQLiteStatement stm = mDatabase.compileStatement(sql); - stm.bindLong(1, 0); - ParcelFileDescriptor fd = stm.simpleQueryForBlobFileDescriptor(); - assertFileDescriptorContent(BLOBS[0], fd); - } - - public void testGetBlobFailureNoParam() throws Exception { - populateBlobTable(); - - String sql = "SELECT data FROM blob_test WHERE _id = 100"; - SQLiteStatement stm = mDatabase.compileStatement(sql); - ParcelFileDescriptor fd = null; - SQLiteDoneException expectedException = null; - try { - fd = stm.simpleQueryForBlobFileDescriptor(); - } catch (SQLiteDoneException ex) { - expectedException = ex; - } finally { - if (fd != null) { - fd.close(); - fd = null; - } - } - assertNotNull("Should have thrown SQLiteDoneException", expectedException); - } - - public void testGetBlobFailureParam() throws Exception { - populateBlobTable(); - - String sql = "SELECT data FROM blob_test WHERE _id = ?"; - SQLiteStatement stm = mDatabase.compileStatement(sql); - stm.bindLong(1, 100); - ParcelFileDescriptor fd = null; - SQLiteDoneException expectedException = null; - try { - fd = stm.simpleQueryForBlobFileDescriptor(); - } catch (SQLiteDoneException ex) { - expectedException = ex; - } finally { - if (fd != null) { - fd.close(); - fd = null; - } - } - assertNotNull("Should have thrown SQLiteDoneException", expectedException); - } - - /* - * Convert string of hex digits to byte array. - * Results are undefined for poorly formed string. - * - * @param src hex string - */ - private static byte[] parseBlob(String src) { - int len = src.length(); - byte[] result = new byte[len / 2]; - - for (int i = 0; i < len / 2; i++) { - int val; - char c1 = src.charAt(i * 2); - char c2 = src.charAt(i * 2 + 1); - int val1 = Character.digit(c1, 16); - int val2 = Character.digit(c2, 16); - val = (val1 << 4) | val2; - result[i] = (byte) val; - } - return result; - } - - private static void assertFileDescriptorContent(byte[] expected, ParcelFileDescriptor fd) - throws IOException { - assertInputStreamContent(expected, new ParcelFileDescriptor.AutoCloseInputStream(fd)); - } - - private static void assertInputStreamContent(byte[] expected, InputStream is) - throws IOException { - try { - byte[] observed = new byte[expected.length]; - int count = is.read(observed); - assertEquals(expected.length, count); - assertEquals(-1, is.read()); - MoreAsserts.assertEquals(expected, observed); - } finally { - is.close(); - } - } -} diff --git a/proprietary/frameworks/base/tests/net/Android.mk b/proprietary/frameworks/base/tests/net/Android.mk deleted file mode 100755 index 745a661bc37b45e98b3324e74c7adaad80dc033c..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/net/Android.mk +++ /dev/null @@ -1,37 +0,0 @@ -# Copyright (C) 2008 The Android Open Source Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -LOCAL_PATH:= $(call my-dir) - -include $(CLEAR_VARS) - -# don't include this package in any target -LOCAL_MODULE_TAGS := tests -# and when built explicitly put it in the data partition -LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS) - -LOCAL_JAVA_LIBRARIES := android.test.runner voip-common - -# include CtsTestServer as a temporary hack to free net.cts from cts.stub. -LOCAL_SRC_FILES := $(call all-java-files-under, src) - -LOCAL_PACKAGE_NAME := MtkNetTestCases - - -# uncomment when dalvik.annotation.Test* are removed or part of SDK -#LOCAL_SDK_VERSION := current - -include $(BUILD_PACKAGE) - -include $(call all-makefiles-under,$(LOCAL_PATH)) diff --git a/proprietary/frameworks/base/tests/net/Android.mk_ b/proprietary/frameworks/base/tests/net/Android.mk_ deleted file mode 100755 index 745a661bc37b45e98b3324e74c7adaad80dc033c..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/net/Android.mk_ +++ /dev/null @@ -1,37 +0,0 @@ -# Copyright (C) 2008 The Android Open Source Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -LOCAL_PATH:= $(call my-dir) - -include $(CLEAR_VARS) - -# don't include this package in any target -LOCAL_MODULE_TAGS := tests -# and when built explicitly put it in the data partition -LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS) - -LOCAL_JAVA_LIBRARIES := android.test.runner voip-common - -# include CtsTestServer as a temporary hack to free net.cts from cts.stub. -LOCAL_SRC_FILES := $(call all-java-files-under, src) - -LOCAL_PACKAGE_NAME := MtkNetTestCases - - -# uncomment when dalvik.annotation.Test* are removed or part of SDK -#LOCAL_SDK_VERSION := current - -include $(BUILD_PACKAGE) - -include $(call all-makefiles-under,$(LOCAL_PATH)) diff --git a/proprietary/frameworks/base/tests/net/AndroidManifest.xml b/proprietary/frameworks/base/tests/net/AndroidManifest.xml deleted file mode 100755 index 86add6daf01079f51aa243a2899d52f0e1ddd1e7..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/net/AndroidManifest.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/proprietary/frameworks/base/tests/net/NOTICE b/proprietary/frameworks/base/tests/net/NOTICE deleted file mode 100755 index 4d375606fc8d522e186504980e060442aa604b68..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/net/NOTICE +++ /dev/null @@ -1,34 +0,0 @@ -* Copyright (C) 2012 The Android Open Source Project: - - - -* Copyright (C) 2008 The Android Open Source Project: - - - -* Copyright (C) 2013 The Android Open Source Project: - - - -* Copyright (C) 2009 The Android Open Source Project: - - - -/* -* Copyright (C) 2011-2014 MediaTek Inc. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -: - \ No newline at end of file diff --git a/proprietary/frameworks/base/tests/net/README b/proprietary/frameworks/base/tests/net/README deleted file mode 100755 index f57215d2dd3c516799908e8a98c7a7641b718a7a..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/net/README +++ /dev/null @@ -1,15 +0,0 @@ -WHAT IT DOES? -============= -This is a CTS test APK for net related testing. -The moudle tag is tests. - -HOW IT WAS BUILT? -================== -[Build Method] -make MtkNetTestCases -or -mmm vendor/mediatek/proprietary/frameworks/base/tests/net - -HOW TO USE IT? -============== -adb shell am instrument -w com.mediatek.cts.net/android.test.InstrumentationTestRunner diff --git a/proprietary/frameworks/base/tests/net/src/android/net/cts/ConnectivityManagerTest.java b/proprietary/frameworks/base/tests/net/src/android/net/cts/ConnectivityManagerTest.java deleted file mode 100755 index 08ffdbdc790f0ba26836484701bc61b0b908727c..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/net/src/android/net/cts/ConnectivityManagerTest.java +++ /dev/null @@ -1,176 +0,0 @@ -/* - * Copyright (C) 2009 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.net.cts; - - -import android.content.BroadcastReceiver; -import android.content.Context; -import android.content.Intent; -import android.content.pm.PackageManager; -import android.net.ConnectivityManager; -import android.net.NetworkConfig; -import android.net.NetworkInfo; -import android.net.NetworkInfo.DetailedState; -import android.net.NetworkInfo.State; -import android.net.wifi.WifiManager; -import android.test.AndroidTestCase; -import android.util.Log; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.concurrent.CountDownLatch; -import java.util.concurrent.TimeUnit; - -public class ConnectivityManagerTest extends AndroidTestCase { - - private static final String TAG = ConnectivityManagerTest.class.getSimpleName(); - - private static final String FEATURE_ENABLE_HIPRI = "enableHIPRI"; - - public static final int TYPE_MOBILE = ConnectivityManager.TYPE_MOBILE; - public static final int TYPE_WIFI = ConnectivityManager.TYPE_WIFI; - private static final int HOST_ADDRESS = 0x7f000001; // represent ip 127.0.0.1 - - // device could have only one interface: data, wifi. - private static final int MIN_NUM_NETWORK_TYPES = 1; - - private ConnectivityManager mCm; - private WifiManager mWifiManager; - private PackageManager mPackageManager; - private final HashMap mNetworks = - new HashMap(); - private final ListmProtectedNetworks = new ArrayList(); - - @Override - protected void setUp() throws Exception { - super.setUp(); - mCm = (ConnectivityManager) getContext().getSystemService(Context.CONNECTIVITY_SERVICE); - mWifiManager = (WifiManager) getContext().getSystemService(Context.WIFI_SERVICE); - mPackageManager = getContext().getPackageManager(); - - // Get com.android.internal.R.array.networkAttributes - int resId = getContext().getResources().getIdentifier("networkAttributes", "array", "android"); - String[] naStrings = getContext().getResources().getStringArray(resId); - - for (String naString : naStrings) { - try { - NetworkConfig n = new NetworkConfig(naString); - mNetworks.put(n.type, n); - } catch (Exception e) { } - } - - // Get com.android.internal.R.array.config_protectedNetworks - resId = getContext().getResources().getIdentifier("config_protectedNetworks", "array", "android"); - int[] protectedNetworks = getContext().getResources().getIntArray(resId); - for (int p : protectedNetworks) { - mProtectedNetworks.add(p); - } - } - - - - public void testGetNetworkInfo() { - for (int type = -1; type <= ConnectivityManager.MAX_NETWORK_TYPE + 1; type++) { - if (isSupported(type)) { - NetworkInfo ni = mCm.getNetworkInfo(type); - assertTrue("Info shouldn't be null for " + type, ni != null); - State state = ni.getState(); - assertTrue("Bad state for " + type, State.UNKNOWN.ordinal() >= state.ordinal() - && state.ordinal() >= State.CONNECTING.ordinal()); - DetailedState ds = ni.getDetailedState(); - assertTrue("Bad detailed state for " + type, - DetailedState.FAILED.ordinal() >= ds.ordinal() - && ds.ordinal() >= DetailedState.IDLE.ordinal()); - } else { - assertNull("Info should be null for " + type, mCm.getNetworkInfo(type)); - } - } - } - - public void testGetAllNetworkInfo() { - NetworkInfo[] ni = mCm.getAllNetworkInfo(); - assertTrue(ni.length >= MIN_NUM_NETWORK_TYPES); - for (int type = 0; type <= ConnectivityManager.MAX_NETWORK_TYPE; type++) { - int desiredFoundCount = (isSupported(type) ? 1 : 0); - int foundCount = 0; - for (NetworkInfo i : ni) { - if (i.getType() == type) foundCount++; - } - if (foundCount != desiredFoundCount) { - Log.e(TAG, "failure in testGetAllNetworkInfo. Dump of returned NetworkInfos:"); - for (NetworkInfo networkInfo : ni) Log.e(TAG, " " + networkInfo); - } - assertTrue("Unexpected foundCount of " + foundCount + " for type " + type, - foundCount == desiredFoundCount); - } - } - - - private boolean isSupported(int networkType) { - // Change-Id I02eb5f22737720095f646f8db5c87fd66da129d6 added VPN support - // to all devices directly in software, independent of any external - // configuration. - return mNetworks.containsKey(networkType) || - (networkType == ConnectivityManager.TYPE_VPN); - } - - // true if only the system can turn it on - private boolean isNetworkProtected(int networkType) { - return mProtectedNetworks.contains(networkType); - } - - public void testIsNetworkSupported() { - for (int type = -1; type <= ConnectivityManager.MAX_NETWORK_TYPE; type++) { - boolean supported = mCm.isNetworkSupported(type); - if (isSupported(type)) { - assertTrue(supported); - } else { - assertFalse(supported); - } - } - } - - - - /** Receiver that captures the last connectivity change's network type and state. */ - private class ConnectivityActionReceiver extends BroadcastReceiver { - - private final CountDownLatch mReceiveLatch = new CountDownLatch(1); - - private final int mNetworkType; - - ConnectivityActionReceiver(int networkType) { - mNetworkType = networkType; - } - - public void onReceive(Context context, Intent intent) { - NetworkInfo networkInfo = intent.getExtras() - .getParcelable(ConnectivityManager.EXTRA_NETWORK_INFO); - int networkType = networkInfo.getType(); - State networkState = networkInfo.getState(); - Log.i(TAG, "Network type: " + networkType + " state: " + networkState); - if (networkType == mNetworkType && networkInfo.getState() == State.CONNECTED) { - mReceiveLatch.countDown(); - } - } - - public boolean waitForConnection() throws InterruptedException { - return mReceiveLatch.await(30, TimeUnit.SECONDS); - } - } -} diff --git a/proprietary/frameworks/base/tests/net/src/android/net/cts/CredentialsTest.java b/proprietary/frameworks/base/tests/net/src/android/net/cts/CredentialsTest.java deleted file mode 100755 index 91c3621eab8c583e69a0933556ba88c2c5412c81..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/net/src/android/net/cts/CredentialsTest.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.net.cts; - -import android.net.Credentials; -import android.test.AndroidTestCase; - -public class CredentialsTest extends AndroidTestCase { - - public void testCredentials() { - // new the Credentials instance - // Test with zero inputs - Credentials cred = new Credentials(0, 0, 0); - assertEquals(0, cred.getGid()); - assertEquals(0, cred.getPid()); - assertEquals(0, cred.getUid()); - - // Test with big integer - cred = new Credentials(Integer.MAX_VALUE, Integer.MAX_VALUE, Integer.MAX_VALUE); - assertEquals(Integer.MAX_VALUE, cred.getGid()); - assertEquals(Integer.MAX_VALUE, cred.getPid()); - assertEquals(Integer.MAX_VALUE, cred.getUid()); - - // Test with big negative integer - cred = new Credentials(Integer.MIN_VALUE, Integer.MIN_VALUE, Integer.MIN_VALUE); - assertEquals(Integer.MIN_VALUE, cred.getGid()); - assertEquals(Integer.MIN_VALUE, cred.getPid()); - assertEquals(Integer.MIN_VALUE, cred.getUid()); - } -} diff --git a/proprietary/frameworks/base/tests/net/src/android/net/cts/DhcpInfoTest.java b/proprietary/frameworks/base/tests/net/src/android/net/cts/DhcpInfoTest.java deleted file mode 100755 index 085fdd9132321d6385192e7319a13a554c5f7efd..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/net/src/android/net/cts/DhcpInfoTest.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (C) 2009 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.net.cts; - -import android.net.DhcpInfo; -import android.test.AndroidTestCase; - -public class DhcpInfoTest extends AndroidTestCase { - - public void testConstructor() { - new DhcpInfo(); - } - - public void testToString() { - String expectedDefault = "ipaddr 0.0.0.0 gateway 0.0.0.0 netmask 0.0.0.0 dns1 0.0.0.0 " - + "dns2 0.0.0.0 DHCP server 0.0.0.0 lease 0 seconds"; - String STR_ADDR1 = "255.255.255.255"; - String STR_ADDR2 = "127.0.0.1"; - String STR_ADDR3 = "192.168.1.1"; - String STR_ADDR4 = "192.168.1.0"; - int leaseTime = 9999; - String expected = "ipaddr " + STR_ADDR1 + " gateway " + STR_ADDR2 + " netmask " - + STR_ADDR3 + " dns1 " + STR_ADDR4 + " dns2 " + STR_ADDR4 + " DHCP server " - + STR_ADDR2 + " lease " + leaseTime + " seconds"; - - DhcpInfo dhcpInfo = new DhcpInfo(); - - // Test default string. - assertEquals(expectedDefault, dhcpInfo.toString()); - - dhcpInfo.ipAddress = ipToInteger(STR_ADDR1); - dhcpInfo.gateway = ipToInteger(STR_ADDR2); - dhcpInfo.netmask = ipToInteger(STR_ADDR3); - dhcpInfo.dns1 = ipToInteger(STR_ADDR4); - dhcpInfo.dns2 = ipToInteger(STR_ADDR4); - dhcpInfo.serverAddress = ipToInteger(STR_ADDR2); - dhcpInfo.leaseDuration = leaseTime; - - // Test with new values - assertEquals(expected, dhcpInfo.toString()); - } - - private int ipToInteger(String ipString) { - String ipSegs[] = ipString.split("[.]"); - int tmp = Integer.parseInt(ipSegs[3]) << 24 | Integer.parseInt(ipSegs[2]) << 16 | - Integer.parseInt(ipSegs[1]) << 8 | Integer.parseInt(ipSegs[0]); - return tmp; - } -} diff --git a/proprietary/frameworks/base/tests/net/src/android/net/cts/LocalServerSocketTest.java b/proprietary/frameworks/base/tests/net/src/android/net/cts/LocalServerSocketTest.java deleted file mode 100755 index dc7be1ff4ecaedc7083e5dca40376a6f896f3f9a..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/net/src/android/net/cts/LocalServerSocketTest.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (C) 2009 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package android.net.cts; - -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import android.net.LocalServerSocket; -import android.net.LocalSocket; -import android.net.LocalSocketAddress; -import android.test.AndroidTestCase; - -public class LocalServerSocketTest extends AndroidTestCase { - - public void testLocalServerSocket() throws IOException { - LocalServerSocket localServerSocket = new LocalServerSocket(LocalSocketTest.mSockAddr); - assertNotNull(localServerSocket.getLocalSocketAddress()); - commonFunctions(localServerSocket); - } - - public void commonFunctions(LocalServerSocket localServerSocket) throws IOException { - // create client socket - LocalSocket clientSocket = new LocalSocket(); - - // establish connection between client and server - clientSocket.connect(new LocalSocketAddress(LocalSocketTest.mSockAddr)); - LocalSocket serverSocket = localServerSocket.accept(); - - // send data from client to server - OutputStream clientOutStream = clientSocket.getOutputStream(); - clientOutStream.write(12); - InputStream serverInStream = serverSocket.getInputStream(); - assertEquals(12, serverInStream.read()); - - // send data from server to client - OutputStream serverOutStream = serverSocket.getOutputStream(); - serverOutStream.write(3); - InputStream clientInStream = clientSocket.getInputStream(); - assertEquals(3, clientInStream.read()); - - // close server socket - assertNotNull(localServerSocket.getFileDescriptor()); - localServerSocket.close(); - assertNull(localServerSocket.getFileDescriptor()); - } -} diff --git a/proprietary/frameworks/base/tests/net/src/android/net/cts/LocalSocketAddressTest.java b/proprietary/frameworks/base/tests/net/src/android/net/cts/LocalSocketAddressTest.java deleted file mode 100755 index 6ef003b26f3f5c8c0563f7983b599aafc5227b61..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/net/src/android/net/cts/LocalSocketAddressTest.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.net.cts; - -import android.net.LocalSocketAddress; -import android.net.LocalSocketAddress.Namespace; -import android.test.AndroidTestCase; - -public class LocalSocketAddressTest extends AndroidTestCase { - - public void testNewLocalSocketAddressWithDefaultNamespace() { - // default namespace - LocalSocketAddress localSocketAddress = new LocalSocketAddress("name"); - assertEquals("name", localSocketAddress.getName()); - assertEquals(Namespace.ABSTRACT, localSocketAddress.getNamespace()); - - // specify the namespace - LocalSocketAddress localSocketAddress2 = - new LocalSocketAddress("name2", Namespace.ABSTRACT); - assertEquals("name2", localSocketAddress2.getName()); - assertEquals(Namespace.ABSTRACT, localSocketAddress2.getNamespace()); - - LocalSocketAddress localSocketAddress3 = - new LocalSocketAddress("name3", Namespace.FILESYSTEM); - assertEquals("name3", localSocketAddress3.getName()); - assertEquals(Namespace.FILESYSTEM, localSocketAddress3.getNamespace()); - - LocalSocketAddress localSocketAddress4 = - new LocalSocketAddress("name4", Namespace.RESERVED); - assertEquals("name4", localSocketAddress4.getName()); - assertEquals(Namespace.RESERVED, localSocketAddress4.getNamespace()); - } -} diff --git a/proprietary/frameworks/base/tests/net/src/android/net/cts/LocalSocketAddress_NamespaceTest.java b/proprietary/frameworks/base/tests/net/src/android/net/cts/LocalSocketAddress_NamespaceTest.java deleted file mode 100755 index 97dfa435fa1b5890f1281bc679dab8470ac6a549..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/net/src/android/net/cts/LocalSocketAddress_NamespaceTest.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (C) 2009 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.net.cts; - -import android.net.LocalSocketAddress.Namespace; -import android.test.AndroidTestCase; - -public class LocalSocketAddress_NamespaceTest extends AndroidTestCase { - - public void testValueOf() { - assertEquals(Namespace.ABSTRACT, Namespace.valueOf("ABSTRACT")); - assertEquals(Namespace.RESERVED, Namespace.valueOf("RESERVED")); - assertEquals(Namespace.FILESYSTEM, Namespace.valueOf("FILESYSTEM")); - } - - public void testValues() { - Namespace[] expected = Namespace.values(); - assertEquals(Namespace.ABSTRACT, expected[0]); - assertEquals(Namespace.RESERVED, expected[1]); - assertEquals(Namespace.FILESYSTEM, expected[2]); - } -} diff --git a/proprietary/frameworks/base/tests/net/src/android/net/cts/LocalSocketTest.java b/proprietary/frameworks/base/tests/net/src/android/net/cts/LocalSocketTest.java deleted file mode 100755 index 946811c3fdca9c6d6bb82154bf467a479d431ef4..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/net/src/android/net/cts/LocalSocketTest.java +++ /dev/null @@ -1,171 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.net.cts; - -import java.io.FileDescriptor; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import android.net.Credentials; -import android.net.LocalServerSocket; -import android.net.LocalSocket; -import android.net.LocalSocketAddress; -import android.test.AndroidTestCase; - -public class LocalSocketTest extends AndroidTestCase { - public final static String mSockAddr = "com.android.net.LocalSocketTest"; - - public void testLocalConnections() throws IOException { - // create client and server socket - LocalServerSocket localServerSocket = new LocalServerSocket(mSockAddr); - LocalSocket clientSocket = new LocalSocket(); - - // establish connection between client and server - LocalSocketAddress locSockAddr = new LocalSocketAddress(mSockAddr); - assertFalse(clientSocket.isConnected()); - clientSocket.connect(locSockAddr); - assertTrue(clientSocket.isConnected()); - LocalSocket serverSocket = localServerSocket.accept(); - - Credentials credent = clientSocket.getPeerCredentials(); - assertTrue(0 != credent.getPid()); - - // send data from client to server - OutputStream clientOutStream = clientSocket.getOutputStream(); - clientOutStream.write(12); - InputStream serverInStream = serverSocket.getInputStream(); - assertEquals(12, serverInStream.read()); - - //send data from server to client - OutputStream serverOutStream = serverSocket.getOutputStream(); - serverOutStream.write(3); - InputStream clientInStream = clientSocket.getInputStream(); - assertEquals(3, clientInStream.read()); - - // Test sending and receiving file descriptors - clientSocket.setFileDescriptorsForSend(new FileDescriptor[]{FileDescriptor.in}); - clientOutStream.write(32); - assertEquals(32, serverInStream.read()); - - FileDescriptor[] out = serverSocket.getAncillaryFileDescriptors(); - assertEquals(1, out.length); - FileDescriptor fd = clientSocket.getFileDescriptor(); - assertTrue(fd.valid()); - - //shutdown input stream of client - clientSocket.shutdownInput(); - assertEquals(-1, clientInStream.read()); - - //shutdown output stream of client - clientSocket.shutdownOutput(); - try { - clientOutStream.write(10); - fail("testLocalSocket shouldn't come to here"); - } catch (IOException e) { - // expected - } - - //shutdown input stream of server - serverSocket.shutdownInput(); - assertEquals(-1, serverInStream.read()); - - //shutdown output stream of server - serverSocket.shutdownOutput(); - try { - serverOutStream.write(10); - fail("testLocalSocket shouldn't come to here"); - } catch (IOException e) { - // expected - } - - //close client socket - clientSocket.close(); - try { - clientInStream.read(); - fail("testLocalSocket shouldn't come to here"); - } catch (IOException e) { - // expected - } - - //close server socket - serverSocket.close(); - try { - serverInStream.read(); - fail("testLocalSocket shouldn't come to here"); - } catch (IOException e) { - // expected - } - } - - public void testAccessors() throws IOException { - LocalSocket socket = new LocalSocket(); - LocalSocketAddress addr = new LocalSocketAddress("secondary"); - - assertFalse(socket.isBound()); - socket.bind(addr); - assertTrue(socket.isBound()); - assertEquals(addr, socket.getLocalSocketAddress()); - - String str = socket.toString(); - assertTrue(str.contains("impl:android.net.LocalSocketImpl")); - - socket.setReceiveBufferSize(1999); - assertEquals(1999 << 1, socket.getReceiveBufferSize()); - - socket.setSendBufferSize(1998); - assertEquals(1998 << 1, socket.getSendBufferSize()); - - // Timeout is not support at present, so set is ignored - socket.setSoTimeout(1996); - assertEquals(0, socket.getSoTimeout()); - - try { - socket.getRemoteSocketAddress(); - fail("testLocalSocketSecondary shouldn't come to here"); - } catch (UnsupportedOperationException e) { - // expected - } - - try { - socket.isClosed(); - fail("testLocalSocketSecondary shouldn't come to here"); - } catch (UnsupportedOperationException e) { - // expected - } - - try { - socket.isInputShutdown(); - fail("testLocalSocketSecondary shouldn't come to here"); - } catch (UnsupportedOperationException e) { - // expected - } - - try { - socket.isOutputShutdown(); - fail("testLocalSocketSecondary shouldn't come to here"); - } catch (UnsupportedOperationException e) { - // expected - } - - try { - socket.connect(addr, 2005); - fail("testLocalSocketSecondary shouldn't come to here"); - } catch (UnsupportedOperationException e) { - // expected - } - } -} diff --git a/proprietary/frameworks/base/tests/net/src/android/net/cts/MailToTest.java b/proprietary/frameworks/base/tests/net/src/android/net/cts/MailToTest.java deleted file mode 100755 index e454d20628c3537f6ed96f3785526fabcda85178..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/net/src/android/net/cts/MailToTest.java +++ /dev/null @@ -1,125 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.net.cts; - -import android.net.MailTo; -import android.test.AndroidTestCase; -import android.util.Log; - -public class MailToTest extends AndroidTestCase { - private static final String MAILTOURI_1 = "mailto:chris@example.com"; - private static final String MAILTOURI_2 = "mailto:infobot@example.com?subject=current-issue"; - private static final String MAILTOURI_3 = - "mailto:infobot@example.com?body=send%20current-issue"; - private static final String MAILTOURI_4 = "mailto:infobot@example.com?body=send%20current-" + - "issue%0D%0Asend%20index"; - private static final String MAILTOURI_5 = "mailto:joe@example.com?" + - "cc=bob@example.com&body=hello"; - private static final String MAILTOURI_6 = "mailto:?to=joe@example.com&" + - "cc=bob@example.com&body=hello"; - - @Override - protected void setUp() throws Exception { - super.setUp(); - } - - public void testParseMailToURI() { - assertFalse(MailTo.isMailTo(null)); - assertFalse(MailTo.isMailTo("")); - assertFalse(MailTo.isMailTo("http://www.google.com")); - - assertTrue(MailTo.isMailTo(MAILTOURI_1)); - MailTo mailTo_1 = MailTo.parse(MAILTOURI_1); - Log.d("Trace", mailTo_1.toString()); - assertEquals("chris@example.com", mailTo_1.getTo()); - assertEquals(1, mailTo_1.getHeaders().size()); - assertNull(mailTo_1.getBody()); - assertNull(mailTo_1.getCc()); - assertNull(mailTo_1.getSubject()); - assertEquals("mailto:?to=chris%40example.com&", mailTo_1.toString()); - - assertTrue(MailTo.isMailTo(MAILTOURI_2)); - MailTo mailTo_2 = MailTo.parse(MAILTOURI_2); - Log.d("Trace", mailTo_2.toString()); - assertEquals(2, mailTo_2.getHeaders().size()); - assertEquals("infobot@example.com", mailTo_2.getTo()); - assertEquals("current-issue", mailTo_2.getSubject()); - assertNull(mailTo_2.getBody()); - assertNull(mailTo_2.getCc()); - String stringUrl = mailTo_2.toString(); - assertTrue(stringUrl.startsWith("mailto:?")); - assertTrue(stringUrl.contains("to=infobot%40example.com&")); - assertTrue(stringUrl.contains("subject=current-issue&")); - - assertTrue(MailTo.isMailTo(MAILTOURI_3)); - MailTo mailTo_3 = MailTo.parse(MAILTOURI_3); - Log.d("Trace", mailTo_3.toString()); - assertEquals(2, mailTo_3.getHeaders().size()); - assertEquals("infobot@example.com", mailTo_3.getTo()); - assertEquals("send current-issue", mailTo_3.getBody()); - assertNull(mailTo_3.getCc()); - assertNull(mailTo_3.getSubject()); - stringUrl = mailTo_3.toString(); - assertTrue(stringUrl.startsWith("mailto:?")); - assertTrue(stringUrl.contains("to=infobot%40example.com&")); - assertTrue(stringUrl.contains("body=send%20current-issue&")); - - assertTrue(MailTo.isMailTo(MAILTOURI_4)); - MailTo mailTo_4 = MailTo.parse(MAILTOURI_4); - Log.d("Trace", mailTo_4.toString() + " " + mailTo_4.getBody()); - assertEquals(2, mailTo_4.getHeaders().size()); - assertEquals("infobot@example.com", mailTo_4.getTo()); - assertEquals("send current-issue\r\nsend index", mailTo_4.getBody()); - assertNull(mailTo_4.getCc()); - assertNull(mailTo_4.getSubject()); - stringUrl = mailTo_4.toString(); - assertTrue(stringUrl.startsWith("mailto:?")); - assertTrue(stringUrl.contains("to=infobot%40example.com&")); - assertTrue(stringUrl.contains("body=send%20current-issue%0D%0Asend%20index&")); - - - assertTrue(MailTo.isMailTo(MAILTOURI_5)); - MailTo mailTo_5 = MailTo.parse(MAILTOURI_5); - Log.d("Trace", mailTo_5.toString() + mailTo_5.getHeaders().toString() - + mailTo_5.getHeaders().size()); - assertEquals(3, mailTo_5.getHeaders().size()); - assertEquals("joe@example.com", mailTo_5.getTo()); - assertEquals("bob@example.com", mailTo_5.getCc()); - assertEquals("hello", mailTo_5.getBody()); - assertNull(mailTo_5.getSubject()); - stringUrl = mailTo_5.toString(); - assertTrue(stringUrl.startsWith("mailto:?")); - assertTrue(stringUrl.contains("cc=bob%40example.com&")); - assertTrue(stringUrl.contains("body=hello&")); - assertTrue(stringUrl.contains("to=joe%40example.com&")); - - assertTrue(MailTo.isMailTo(MAILTOURI_6)); - MailTo mailTo_6 = MailTo.parse(MAILTOURI_6); - Log.d("Trace", mailTo_6.toString() + mailTo_6.getHeaders().toString() - + mailTo_6.getHeaders().size()); - assertEquals(3, mailTo_6.getHeaders().size()); - assertEquals(", joe@example.com", mailTo_6.getTo()); - assertEquals("bob@example.com", mailTo_6.getCc()); - assertEquals("hello", mailTo_6.getBody()); - assertNull(mailTo_6.getSubject()); - stringUrl = mailTo_6.toString(); - assertTrue(stringUrl.startsWith("mailto:?")); - assertTrue(stringUrl.contains("cc=bob%40example.com&")); - assertTrue(stringUrl.contains("body=hello&")); - assertTrue(stringUrl.contains("to=%2C%20joe%40example.com&")); - } -} diff --git a/proprietary/frameworks/base/tests/net/src/android/net/cts/NetworkInfoTest.java b/proprietary/frameworks/base/tests/net/src/android/net/cts/NetworkInfoTest.java deleted file mode 100755 index 7cb45ede681e05e979f1896b6d4504cec1ab38a9..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/net/src/android/net/cts/NetworkInfoTest.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (C) 2009 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.net.cts; - - -import android.content.Context; -import android.net.ConnectivityManager; -import android.net.NetworkInfo; -import android.net.NetworkInfo.DetailedState; -import android.net.NetworkInfo.State; -import android.test.AndroidTestCase; - -public class NetworkInfoTest extends AndroidTestCase { - - public static final int TYPE_MOBILE = ConnectivityManager.TYPE_MOBILE; - public static final int TYPE_WIFI = ConnectivityManager.TYPE_WIFI; - public static final String MOBILE_TYPE_NAME = "mobile"; - public static final String WIFI_TYPE_NAME = "WIFI"; - - public void testAccessNetworkInfoProperties() { - ConnectivityManager cm = (ConnectivityManager) getContext().getSystemService( - Context.CONNECTIVITY_SERVICE); - NetworkInfo[] ni = cm.getAllNetworkInfo(); - assertTrue(ni.length >= 1); - - for (NetworkInfo netInfo: ni) { - switch (netInfo.getType()) { - case TYPE_MOBILE: - assertNetworkInfo(netInfo, MOBILE_TYPE_NAME); - break; - case TYPE_WIFI: - assertNetworkInfo(netInfo, WIFI_TYPE_NAME); - break; - // TODO: Add BLUETOOTH_TETHER testing - default: - break; - } - } - } - - private void assertNetworkInfo(NetworkInfo netInfo, String expectedTypeName) { - assertEquals(expectedTypeName.compareToIgnoreCase(netInfo.getTypeName()), 0); - if (netInfo.isConnectedOrConnecting()) { - assertTrue(netInfo.isAvailable()); - if (State.CONNECTED == netInfo.getState()) { - assertTrue(netInfo.isConnected()); - } - assertTrue(State.CONNECTING == netInfo.getState() - || State.CONNECTED == netInfo.getState()); - assertTrue(DetailedState.SCANNING == netInfo.getDetailedState() - || DetailedState.CONNECTING == netInfo.getDetailedState() - || DetailedState.AUTHENTICATING == netInfo.getDetailedState() - || DetailedState.CONNECTED == netInfo.getDetailedState()); - } - assertNotNull(netInfo.toString()); - } -} diff --git a/proprietary/frameworks/base/tests/net/src/android/net/cts/NetworkInfo_DetailedStateTest.java b/proprietary/frameworks/base/tests/net/src/android/net/cts/NetworkInfo_DetailedStateTest.java deleted file mode 100755 index 590ce8957938c0e5055ae15d62074236cd522aa1..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/net/src/android/net/cts/NetworkInfo_DetailedStateTest.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (C) 2009 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.net.cts; - - -import android.net.NetworkInfo.DetailedState; -import android.test.AndroidTestCase; - -public class NetworkInfo_DetailedStateTest extends AndroidTestCase { - - public void testValueOf() { - assertEquals(DetailedState.AUTHENTICATING, DetailedState.valueOf("AUTHENTICATING")); - assertEquals(DetailedState.CONNECTED, DetailedState.valueOf("CONNECTED")); - assertEquals(DetailedState.CONNECTING, DetailedState.valueOf("CONNECTING")); - assertEquals(DetailedState.DISCONNECTED, DetailedState.valueOf("DISCONNECTED")); - assertEquals(DetailedState.DISCONNECTING, DetailedState.valueOf("DISCONNECTING")); - assertEquals(DetailedState.FAILED, DetailedState.valueOf("FAILED")); - assertEquals(DetailedState.IDLE, DetailedState.valueOf("IDLE")); - assertEquals(DetailedState.OBTAINING_IPADDR, DetailedState.valueOf("OBTAINING_IPADDR")); - assertEquals(DetailedState.SCANNING, DetailedState.valueOf("SCANNING")); - assertEquals(DetailedState.SUSPENDED, DetailedState.valueOf("SUSPENDED")); - } - - public void testValues() { - DetailedState[] expected = DetailedState.values(); - assertEquals(13, expected.length); - assertEquals(DetailedState.IDLE, expected[0]); - assertEquals(DetailedState.SCANNING, expected[1]); - assertEquals(DetailedState.CONNECTING, expected[2]); - assertEquals(DetailedState.AUTHENTICATING, expected[3]); - assertEquals(DetailedState.OBTAINING_IPADDR, expected[4]); - assertEquals(DetailedState.CONNECTED, expected[5]); - assertEquals(DetailedState.SUSPENDED, expected[6]); - assertEquals(DetailedState.DISCONNECTING, expected[7]); - assertEquals(DetailedState.DISCONNECTED, expected[8]); - assertEquals(DetailedState.FAILED, expected[9]); - assertEquals(DetailedState.BLOCKED, expected[10]); - assertEquals(DetailedState.VERIFYING_POOR_LINK, expected[11]); - assertEquals(DetailedState.CAPTIVE_PORTAL_CHECK, expected[12]); - } - -} diff --git a/proprietary/frameworks/base/tests/net/src/android/net/cts/NetworkInfo_StateTest.java b/proprietary/frameworks/base/tests/net/src/android/net/cts/NetworkInfo_StateTest.java deleted file mode 100755 index 5303ef1281524dbaead9dedd7c12f5c6336da36e..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/net/src/android/net/cts/NetworkInfo_StateTest.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (C) 2009 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.net.cts; - -import android.net.NetworkInfo.State; -import android.test.AndroidTestCase; - -public class NetworkInfo_StateTest extends AndroidTestCase { - - public void testValueOf() { - assertEquals(State.CONNECTED, State.valueOf("CONNECTED")); - assertEquals(State.CONNECTING, State.valueOf("CONNECTING")); - assertEquals(State.DISCONNECTED, State.valueOf("DISCONNECTED")); - assertEquals(State.DISCONNECTING, State.valueOf("DISCONNECTING")); - assertEquals(State.SUSPENDED, State.valueOf("SUSPENDED")); - assertEquals(State.UNKNOWN, State.valueOf("UNKNOWN")); - } - - public void testValues() { - State[] expected = State.values(); - assertEquals(6, expected.length); - assertEquals(State.CONNECTING, expected[0]); - assertEquals(State.CONNECTED, expected[1]); - assertEquals(State.SUSPENDED, expected[2]); - assertEquals(State.DISCONNECTING, expected[3]); - assertEquals(State.DISCONNECTED, expected[4]); - assertEquals(State.UNKNOWN, expected[5]); - } -} diff --git a/proprietary/frameworks/base/tests/net/src/android/net/cts/ProxyTest.java b/proprietary/frameworks/base/tests/net/src/android/net/cts/ProxyTest.java deleted file mode 100755 index 86c418660a8deeac4007de304cd9ebb6fb9d8bf0..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/net/src/android/net/cts/ProxyTest.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (C) 2009 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.net.cts; - - -import android.net.Proxy; -import android.test.AndroidTestCase; - -public class ProxyTest extends AndroidTestCase { - - public void testConstructor() { - new Proxy(); - } - - public void testAccessProperties() { - final int minValidPort = 0; - final int maxValidPort = 65535; - int defaultPort = Proxy.getDefaultPort(); - if (null == Proxy.getDefaultHost()) { - assertEquals(-1, defaultPort); - } else { - assertTrue(defaultPort >= minValidPort && defaultPort <= maxValidPort); - } - } -} diff --git a/proprietary/frameworks/base/tests/net/src/android/net/cts/TrafficStatsTest.java b/proprietary/frameworks/base/tests/net/src/android/net/cts/TrafficStatsTest.java deleted file mode 100755 index cc56866c9a2ef74c4752c109bd0e292cd597357b..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/net/src/android/net/cts/TrafficStatsTest.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright (C) 2010 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.net.cts; - -import android.net.TrafficStats; -import android.test.AndroidTestCase; -import android.util.Log; - -import java.io.BufferedReader; -import java.io.FileNotFoundException; -import java.io.FileReader; -import java.io.IOException; -import java.util.concurrent.CountDownLatch; -import java.util.concurrent.TimeUnit; - -public class TrafficStatsTest extends AndroidTestCase { - private static final String LOG_TAG = "TrafficStatsTest"; - - public void testValidMobileStats() { - // We can't assume a mobile network is even present in this test, so - // we simply assert that a valid value is returned. - - assertTrue(TrafficStats.getMobileTxPackets() >= 0); - assertTrue(TrafficStats.getMobileRxPackets() >= 0); - assertTrue(TrafficStats.getMobileTxBytes() >= 0); - assertTrue(TrafficStats.getMobileRxBytes() >= 0); - } - - public void testValidTotalStats() { - assertTrue(TrafficStats.getTotalTxPackets() >= 0); - assertTrue(TrafficStats.getTotalRxPackets() >= 0); - assertTrue(TrafficStats.getTotalTxBytes() >= 0); - assertTrue(TrafficStats.getTotalRxBytes() >= 0); - } - - public void testThreadStatsTag() throws Exception { - TrafficStats.setThreadStatsTag(0xf00d); - assertTrue("Tag didn't stick", TrafficStats.getThreadStatsTag() == 0xf00d); - - final CountDownLatch latch = new CountDownLatch(1); - - new Thread("TrafficStatsTest.testThreadStatsTag") { - @Override - public void run() { - assertTrue("Tag leaked", TrafficStats.getThreadStatsTag() != 0xf00d); - TrafficStats.setThreadStatsTag(0xcafe); - assertTrue("Tag didn't stick", TrafficStats.getThreadStatsTag() == 0xcafe); - latch.countDown(); - } - } .start(); - - latch.await(5, TimeUnit.SECONDS); - assertTrue("Tag lost", TrafficStats.getThreadStatsTag() == 0xf00d); - - TrafficStats.clearThreadStatsTag(); - assertTrue("Tag not cleared", TrafficStats.getThreadStatsTag() != 0xf00d); - } - - long tcpPacketToIpBytes(long packetCount, long bytes) { - // ip header + tcp header + data. - // Tcp header is mostly 32. Syn has different tcp options -> 40. Don't care. - return packetCount * (20 + 32 + bytes); - } - - private void accessOwnTrafficStats() throws IOException { - final int ownAppUid = getContext().getApplicationInfo().uid; - Log.d(LOG_TAG, "accesOwnTrafficStatsWithTags(): about to read qtaguid stats for own uid " + ownAppUid); - - boolean foundOwnDetailedStats = false; - try { - BufferedReader qtaguidReader = new BufferedReader(new FileReader("/proc/net/xt_qtaguid/stats")); - String line; - while ((line = qtaguidReader.readLine()) != null) { - String tokens[] = line.split(" "); - if (tokens.length > 3 && tokens[3].equals(String.valueOf(ownAppUid))) { - Log.d(LOG_TAG, "accessOwnTrafficStatsWithTags(): got own stats: " + line); - } - } - qtaguidReader.close(); - } catch (FileNotFoundException e) { - fail("Was not able to access qtaguid/stats: " + e); - } - } -} diff --git a/proprietary/frameworks/base/tests/net/src/android/net/cts/UriTest.java b/proprietary/frameworks/base/tests/net/src/android/net/cts/UriTest.java deleted file mode 100755 index 4ff43c6049967426ec52d57ab73c9aa20a88be25..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/net/src/android/net/cts/UriTest.java +++ /dev/null @@ -1,417 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.net.cts; - -import android.content.ContentUris; -import android.net.Uri; -import android.os.Parcel; -import android.test.AndroidTestCase; -import java.io.File; -import java.util.Arrays; - -public class UriTest extends AndroidTestCase { - public void testParcelling() { - parcelAndUnparcel(Uri.parse("foo:bob%20lee")); - parcelAndUnparcel(Uri.fromParts("foo", "bob lee", "fragment")); - parcelAndUnparcel(new Uri.Builder() - .scheme("http") - .authority("crazybob.org") - .path("/rss/") - .encodedQuery("a=b") - .fragment("foo") - .build()); - } - - private void parcelAndUnparcel(Uri u) { - Parcel p = Parcel.obtain(); - Uri.writeToParcel(p, u); - p.setDataPosition(0); - assertEquals(u, Uri.CREATOR.createFromParcel(p)); - - p.setDataPosition(0); - u = u.buildUpon().build(); - Uri.writeToParcel(p, u); - p.setDataPosition(0); - assertEquals(u, Uri.CREATOR.createFromParcel(p)); - } - - public void testBuildUpon() { - Uri u = Uri.parse("bob:lee").buildUpon().scheme("robert").build(); - assertEquals("robert", u.getScheme()); - assertEquals("lee", u.getEncodedSchemeSpecificPart()); - assertEquals("lee", u.getSchemeSpecificPart()); - assertNull(u.getQuery()); - assertNull(u.getPath()); - assertNull(u.getAuthority()); - assertNull(u.getHost()); - - Uri a = Uri.fromParts("foo", "bar", "tee"); - Uri b = a.buildUpon().fragment("new").build(); - assertEquals("new", b.getFragment()); - assertEquals("bar", b.getSchemeSpecificPart()); - assertEquals("foo", b.getScheme()); - a = new Uri.Builder() - .scheme("foo") - .encodedOpaquePart("bar") - .fragment("tee") - .build(); - b = a.buildUpon().fragment("new").build(); - assertEquals("new", b.getFragment()); - assertEquals("bar", b.getSchemeSpecificPart()); - assertEquals("foo", b.getScheme()); - } - - public void testStringUri() { - assertEquals("bob lee", - Uri.parse("foo:bob%20lee").getSchemeSpecificPart()); - assertEquals("bob%20lee", - Uri.parse("foo:bob%20lee").getEncodedSchemeSpecificPart()); - - assertEquals("/bob%20lee", - Uri.parse("foo:/bob%20lee").getEncodedPath()); - assertNull(Uri.parse("foo:bob%20lee").getPath()); - - assertEquals("bob%20lee", - Uri.parse("foo:?bob%20lee").getEncodedQuery()); - assertNull(Uri.parse("foo:bob%20lee").getEncodedQuery()); - assertNull(Uri.parse("foo:bar#?bob%20lee").getQuery()); - - assertEquals("bob%20lee", - Uri.parse("foo:#bob%20lee").getEncodedFragment()); - - Uri uri = Uri.parse("http://localhost:42"); - assertEquals("localhost", uri.getHost()); - assertEquals(42, uri.getPort()); - - uri = Uri.parse("http://bob@localhost:42"); - assertEquals("bob", uri.getUserInfo()); - assertEquals("localhost", uri.getHost()); - assertEquals(42, uri.getPort()); - - uri = Uri.parse("http://bob%20lee@localhost:42"); - assertEquals("bob lee", uri.getUserInfo()); - assertEquals("bob%20lee", uri.getEncodedUserInfo()); - - uri = Uri.parse("http://localhost"); - assertEquals("localhost", uri.getHost()); - assertEquals(-1, uri.getPort()); - } - - public void testCompareTo() { - Uri a = Uri.parse("foo:a"); - Uri b = Uri.parse("foo:b"); - Uri b2 = Uri.parse("foo:b"); - - assertTrue(a.compareTo(b) < 0); - assertTrue(b.compareTo(a) > 0); - assertEquals(0, b.compareTo(b2)); - } - - public void testEqualsAndHashCode() { - Uri a = Uri.parse("http://crazybob.org/test/?foo=bar#tee"); - - Uri b = new Uri.Builder() - .scheme("http") - .authority("crazybob.org") - .path("/test/") - .encodedQuery("foo=bar") - .fragment("tee") - .build(); - - // Try alternate builder methods. - Uri c = new Uri.Builder() - .scheme("http") - .encodedAuthority("crazybob.org") - .encodedPath("/test/") - .encodedQuery("foo=bar") - .encodedFragment("tee") - .build(); - - assertFalse(Uri.EMPTY.equals(null)); - assertEquals(a, b); - assertEquals(b, c); - assertEquals(c, a); - assertEquals(a.hashCode(), b.hashCode()); - assertEquals(b.hashCode(), c.hashCode()); - } - - public void testEncodeAndDecode() { - String encoded = Uri.encode("Bob:/", "/"); - assertEquals(-1, encoded.indexOf(':')); - assertTrue(encoded.indexOf('/') > -1); - assertDecode(null); - assertDecode(""); - assertDecode("Bob"); - assertDecode(":Bob"); - assertDecode("::Bob"); - assertDecode("Bob::Lee"); - assertDecode("Bob:Lee"); - assertDecode("Bob::"); - assertDecode("Bob:"); - assertDecode("::Bob::"); - } - - private void assertDecode(String s) { - assertEquals(s, Uri.decode(Uri.encode(s, null))); - } - - public void testFromFile() { - File f = new File("/tmp/bob"); - Uri uri = Uri.fromFile(f); - assertEquals("file:///tmp/bob", uri.toString()); - try { - Uri.fromFile(null); - fail("testFile fail"); - } catch (NullPointerException e) { } - } - - public void testQueryParameters() { - Uri uri = Uri.parse("content://user"); - assertEquals(null, uri.getQueryParameter("a")); - - uri = uri.buildUpon().appendQueryParameter("a", "b").build(); - assertEquals("b", uri.getQueryParameter("a")); - - uri = uri.buildUpon().appendQueryParameter("a", "b2").build(); - assertEquals(Arrays.asList("b", "b2"), uri.getQueryParameters("a")); - - uri = uri.buildUpon().appendQueryParameter("c", "d").build(); - assertEquals(Arrays.asList("b", "b2"), uri.getQueryParameters("a")); - assertEquals("d", uri.getQueryParameter("c")); - } - - public void testPathOperations() { - Uri uri = Uri.parse("content://user/a/b"); - - assertEquals(2, uri.getPathSegments().size()); - assertEquals("a", uri.getPathSegments().get(0)); - assertEquals("b", uri.getPathSegments().get(1)); - assertEquals("b", uri.getLastPathSegment()); - - Uri first = uri; - uri = uri.buildUpon().appendPath("c").build(); - assertEquals(3, uri.getPathSegments().size()); - assertEquals("c", uri.getPathSegments().get(2)); - assertEquals("c", uri.getLastPathSegment()); - assertEquals("content://user/a/b/c", uri.toString()); - - uri = ContentUris.withAppendedId(uri, 100); - assertEquals(4, uri.getPathSegments().size()); - assertEquals("100", uri.getPathSegments().get(3)); - assertEquals("100", uri.getLastPathSegment()); - assertEquals(100, ContentUris.parseId(uri)); - assertEquals("content://user/a/b/c/100", uri.toString()); - - // Make sure the original URI is still intact. - assertEquals(2, first.getPathSegments().size()); - assertEquals("b", first.getLastPathSegment()); - - try { - first.getPathSegments().get(2); - fail("test path operations"); - } catch (IndexOutOfBoundsException e) { } - - assertEquals(null, Uri.EMPTY.getLastPathSegment()); - - Uri withC = Uri.parse("foo:/a/b/").buildUpon().appendPath("c").build(); - assertEquals("/a/b/c", withC.getPath()); - } - - public void testOpaqueUri() { - Uri uri = Uri.parse("mailto:nobody"); - testOpaqueUri(uri); - - uri = uri.buildUpon().build(); - testOpaqueUri(uri); - - uri = Uri.fromParts("mailto", "nobody", null); - testOpaqueUri(uri); - - uri = uri.buildUpon().build(); - testOpaqueUri(uri); - - uri = new Uri.Builder() - .scheme("mailto") - .opaquePart("nobody") - .build(); - testOpaqueUri(uri); - - uri = uri.buildUpon().build(); - testOpaqueUri(uri); - } - - private void testOpaqueUri(Uri uri) { - assertEquals("mailto", uri.getScheme()); - assertEquals("nobody", uri.getSchemeSpecificPart()); - assertEquals("nobody", uri.getEncodedSchemeSpecificPart()); - - assertNull(uri.getFragment()); - assertTrue(uri.isAbsolute()); - assertTrue(uri.isOpaque()); - assertFalse(uri.isRelative()); - assertFalse(uri.isHierarchical()); - - assertNull(uri.getAuthority()); - assertNull(uri.getEncodedAuthority()); - assertNull(uri.getPath()); - assertNull(uri.getEncodedPath()); - assertNull(uri.getUserInfo()); - assertNull(uri.getEncodedUserInfo()); - assertNull(uri.getQuery()); - assertNull(uri.getEncodedQuery()); - assertNull(uri.getHost()); - assertEquals(-1, uri.getPort()); - - assertTrue(uri.getPathSegments().isEmpty()); - assertNull(uri.getLastPathSegment()); - - assertEquals("mailto:nobody", uri.toString()); - - Uri withFragment = uri.buildUpon().fragment("top").build(); - assertEquals("mailto:nobody#top", withFragment.toString()); - } - - public void testHierarchicalUris() { - testHierarchical("http", "google.com", "/p1/p2", "query", "fragment"); - testHierarchical("file", null, "/p1/p2", null, null); - testHierarchical("content", "contact", "/p1/p2", null, null); - testHierarchical("http", "google.com", "/p1/p2", null, "fragment"); - testHierarchical("http", "google.com", "", null, "fragment"); - testHierarchical("http", "google.com", "", "query", "fragment"); - testHierarchical("http", "google.com", "", "query", null); - testHierarchical("http", null, "/", "query", null); - } - - private static void testHierarchical(String scheme, String authority, - String path, String query, String fragment) { - StringBuilder sb = new StringBuilder(); - - if (authority != null) { - sb.append("//").append(authority); - } - if (path != null) { - sb.append(path); - } - if (query != null) { - sb.append('?').append(query); - } - - String ssp = sb.toString(); - - if (scheme != null) { - sb.insert(0, scheme + ":"); - } - if (fragment != null) { - sb.append('#').append(fragment); - } - - String uriString = sb.toString(); - - Uri uri = Uri.parse(uriString); - - // Run these twice to test caching. - compareHierarchical( - uriString, ssp, uri, scheme, authority, path, query, fragment); - compareHierarchical( - uriString, ssp, uri, scheme, authority, path, query, fragment); - - // Test rebuilt version. - uri = uri.buildUpon().build(); - - // Run these twice to test caching. - compareHierarchical( - uriString, ssp, uri, scheme, authority, path, query, fragment); - compareHierarchical( - uriString, ssp, uri, scheme, authority, path, query, fragment); - - // The decoded and encoded versions of the inputs are all the same. - // We'll test the actual encoding decoding separately. - - // Test building with encoded versions. - Uri built = new Uri.Builder() - .scheme(scheme) - .encodedAuthority(authority) - .encodedPath(path) - .encodedQuery(query) - .encodedFragment(fragment) - .build(); - - compareHierarchical( - uriString, ssp, built, scheme, authority, path, query, fragment); - compareHierarchical( - uriString, ssp, built, scheme, authority, path, query, fragment); - - // Test building with decoded versions. - built = new Uri.Builder() - .scheme(scheme) - .authority(authority) - .path(path) - .query(query) - .fragment(fragment) - .build(); - - compareHierarchical( - uriString, ssp, built, scheme, authority, path, query, fragment); - compareHierarchical( - uriString, ssp, built, scheme, authority, path, query, fragment); - - // Rebuild. - built = built.buildUpon().build(); - - compareHierarchical( - uriString, ssp, built, scheme, authority, path, query, fragment); - compareHierarchical( - uriString, ssp, built, scheme, authority, path, query, fragment); - } - - private static void compareHierarchical(String uriString, String ssp, - Uri uri, - String scheme, String authority, String path, String query, - String fragment) { - assertEquals(scheme, uri.getScheme()); - assertEquals(authority, uri.getAuthority()); - assertEquals(authority, uri.getEncodedAuthority()); - assertEquals(path, uri.getPath()); - assertEquals(path, uri.getEncodedPath()); - assertEquals(query, uri.getQuery()); - assertEquals(query, uri.getEncodedQuery()); - assertEquals(fragment, uri.getFragment()); - assertEquals(fragment, uri.getEncodedFragment()); - assertEquals(ssp, uri.getSchemeSpecificPart()); - - if (scheme != null) { - assertTrue(uri.isAbsolute()); - assertFalse(uri.isRelative()); - } else { - assertFalse(uri.isAbsolute()); - assertTrue(uri.isRelative()); - } - - assertFalse(uri.isOpaque()); - assertTrue(uri.isHierarchical()); - assertEquals(uriString, uri.toString()); - } - - public void testNormalizeScheme() { - assertEquals(Uri.parse(""), Uri.parse("").normalizeScheme()); - assertEquals(Uri.parse("http://www.android.com"), - Uri.parse("http://www.android.com").normalizeScheme()); - assertEquals(Uri.parse("http://USER@WWW.ANDROID.COM:100/ABOUT?foo=blah@bar=bleh#c"), - Uri.parse("HTTP://USER@WWW.ANDROID.COM:100/ABOUT?foo=blah@bar=bleh#c") - .normalizeScheme()); - } -} diff --git a/proprietary/frameworks/base/tests/net/src/android/net/cts/Uri_BuilderTest.java b/proprietary/frameworks/base/tests/net/src/android/net/cts/Uri_BuilderTest.java deleted file mode 100755 index 4088d822cfcca4dc6e7783cc16f72a3db59ea69d..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/net/src/android/net/cts/Uri_BuilderTest.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.net.cts; - -import junit.framework.TestCase; -import android.net.Uri.Builder; -import android.net.Uri; - -public class Uri_BuilderTest extends TestCase { - public void testBuilderOperations() { - Uri uri = Uri.parse("http://google.com/p1?query#fragment"); - Builder builder = uri.buildUpon(); - uri = builder.appendPath("p2").build(); - assertEquals("http", uri.getScheme()); - assertEquals("google.com", uri.getAuthority()); - assertEquals("/p1/p2", uri.getPath()); - assertEquals("query", uri.getQuery()); - assertEquals("fragment", uri.getFragment()); - assertEquals(uri.toString(), builder.toString()); - - uri = Uri.parse("mailto:nobody"); - builder = uri.buildUpon(); - uri = builder.build(); - assertEquals("mailto", uri.getScheme()); - assertEquals("nobody", uri.getSchemeSpecificPart()); - assertEquals(uri.toString(), builder.toString()); - - uri = new Uri.Builder() - .scheme("http") - .encodedAuthority("google.com") - .encodedPath("/p1") - .appendEncodedPath("p2") - .encodedQuery("query") - .appendQueryParameter("query2", null) - .encodedFragment("fragment") - .build(); - assertEquals("http", uri.getScheme()); - assertEquals("google.com", uri.getEncodedAuthority()); - assertEquals("/p1/p2", uri.getEncodedPath()); - assertEquals("query&query2=null", uri.getEncodedQuery()); - assertEquals("fragment", uri.getEncodedFragment()); - - uri = new Uri.Builder() - .scheme("mailto") - .encodedOpaquePart("nobody") - .build(); - assertEquals("mailto", uri.getScheme()); - assertEquals("nobody", uri.getEncodedSchemeSpecificPart()); - } -} diff --git a/proprietary/frameworks/base/tests/net/src/android/net/cts/UrlQuerySanitizerTest.java b/proprietary/frameworks/base/tests/net/src/android/net/cts/UrlQuerySanitizerTest.java deleted file mode 100755 index 7f8130fc834dc2010662f488ce886ec4fd99cb50..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/net/src/android/net/cts/UrlQuerySanitizerTest.java +++ /dev/null @@ -1,247 +0,0 @@ -/* - * Copyright (C) 2009 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.net.cts; - -import java.util.List; -import java.util.Set; -import android.net.UrlQuerySanitizer; -import android.net.UrlQuerySanitizer.IllegalCharacterValueSanitizer; -import android.net.UrlQuerySanitizer.ParameterValuePair; -import android.net.UrlQuerySanitizer.ValueSanitizer; -import android.test.AndroidTestCase; - -public class UrlQuerySanitizerTest extends AndroidTestCase { - private static final int ALL_OK = IllegalCharacterValueSanitizer.ALL_OK; - - // URL for test. - private static final String TEST_URL = "http://example.com/?name=Joe+User&age=20&height=175"; - - // Default sanitizer's change when "+". - private static final String EXPECTED_UNDERLINE_NAME = "Joe_User"; - - // IllegalCharacterValueSanitizer sanitizer's change when "+". - private static final String EXPECTED_SPACE_NAME = "Joe User"; - private static final String EXPECTED_AGE = "20"; - private static final String EXPECTED_HEIGHT = "175"; - private static final String NAME = "name"; - private static final String AGE = "age"; - private static final String HEIGHT = "height"; - - public void testUrlQuerySanitizer() { - MockUrlQuerySanitizer uqs = new MockUrlQuerySanitizer(); - assertFalse(uqs.getAllowUnregisteredParamaters()); - - final String query = "book=thinking in java&price=108"; - final String book = "book"; - final String bookName = "thinking in java"; - final String price = "price"; - final String bookPrice = "108"; - final String notExistPar = "notExistParameter"; - uqs.registerParameters(new String[]{book, price}, UrlQuerySanitizer.getSpaceLegal()); - uqs.parseQuery(query); - assertTrue(uqs.hasParameter(book)); - assertTrue(uqs.hasParameter(price)); - assertFalse(uqs.hasParameter(notExistPar)); - assertEquals(bookName, uqs.getValue(book)); - assertEquals(bookPrice, uqs.getValue(price)); - assertNull(uqs.getValue(notExistPar)); - uqs.clear(); - assertFalse(uqs.hasParameter(book)); - assertFalse(uqs.hasParameter(price)); - - uqs.parseEntry(book, bookName); - assertTrue(uqs.hasParameter(book)); - assertEquals(bookName, uqs.getValue(book)); - uqs.parseEntry(price, bookPrice); - assertTrue(uqs.hasParameter(price)); - assertEquals(bookPrice, uqs.getValue(price)); - assertFalse(uqs.hasParameter(notExistPar)); - assertNull(uqs.getValue(notExistPar)); - - uqs = new MockUrlQuerySanitizer(TEST_URL); - assertTrue(uqs.getAllowUnregisteredParamaters()); - - assertTrue(uqs.hasParameter(NAME)); - assertTrue(uqs.hasParameter(AGE)); - assertTrue(uqs.hasParameter(HEIGHT)); - assertFalse(uqs.hasParameter(notExistPar)); - - assertEquals(EXPECTED_UNDERLINE_NAME, uqs.getValue(NAME)); - assertEquals(EXPECTED_AGE, uqs.getValue(AGE)); - assertEquals(EXPECTED_HEIGHT, uqs.getValue(HEIGHT)); - assertNull(uqs.getValue(notExistPar)); - - final int ContainerLen = 3; - Set urlSet = uqs.getParameterSet(); - assertEquals(ContainerLen, urlSet.size()); - assertTrue(urlSet.contains(NAME)); - assertTrue(urlSet.contains(AGE)); - assertTrue(urlSet.contains(HEIGHT)); - assertFalse(urlSet.contains(notExistPar)); - - List urlList = uqs.getParameterList(); - assertEquals(ContainerLen, urlList.size()); - ParameterValuePair pvp = urlList.get(0); - assertEquals(NAME, pvp.mParameter); - assertEquals(EXPECTED_UNDERLINE_NAME, pvp.mValue); - pvp = urlList.get(1); - assertEquals(AGE, pvp.mParameter); - assertEquals(EXPECTED_AGE, pvp.mValue); - pvp = urlList.get(2); - assertEquals(HEIGHT, pvp.mParameter); - assertEquals(EXPECTED_HEIGHT, pvp.mValue); - - assertFalse(uqs.getPreferFirstRepeatedParameter()); - uqs.addSanitizedEntry(HEIGHT, EXPECTED_HEIGHT + 1); - assertEquals(ContainerLen, urlSet.size()); - assertEquals(ContainerLen + 1, urlList.size()); - assertEquals(EXPECTED_HEIGHT + 1, uqs.getValue(HEIGHT)); - - uqs.setPreferFirstRepeatedParameter(true); - assertTrue(uqs.getPreferFirstRepeatedParameter()); - uqs.addSanitizedEntry(HEIGHT, EXPECTED_HEIGHT); - assertEquals(ContainerLen, urlSet.size()); - assertEquals(ContainerLen + 2, urlList.size()); - assertEquals(EXPECTED_HEIGHT + 1, uqs.getValue(HEIGHT)); - - uqs.registerParameter(NAME, null); - assertNull(uqs.getValueSanitizer(NAME)); - assertNotNull(uqs.getEffectiveValueSanitizer(NAME)); - - uqs.setAllowUnregisteredParamaters(false); - assertFalse(uqs.getAllowUnregisteredParamaters()); - uqs.registerParameter(NAME, null); - assertNull(uqs.getEffectiveValueSanitizer(NAME)); - - ValueSanitizer vs = new IllegalCharacterValueSanitizer(ALL_OK); - uqs.registerParameter(NAME, vs); - uqs.parseUrl(TEST_URL); - assertEquals(EXPECTED_SPACE_NAME, uqs.getValue(NAME)); - assertNotSame(EXPECTED_AGE, uqs.getValue(AGE)); - - String[] register = {NAME, AGE}; - uqs.registerParameters(register, vs); - uqs.parseUrl(TEST_URL); - assertEquals(EXPECTED_SPACE_NAME, uqs.getValue(NAME)); - assertEquals(EXPECTED_AGE, uqs.getValue(AGE)); - assertNotSame(EXPECTED_HEIGHT, uqs.getValue(HEIGHT)); - - uqs.setUnregisteredParameterValueSanitizer(vs); - assertEquals(vs, uqs.getUnregisteredParameterValueSanitizer()); - - vs = UrlQuerySanitizer.getAllIllegal(); - assertEquals("Joe_User", vs.sanitize("Joe\0User")); - vs = UrlQuerySanitizer.getAllButNulLegal(); - assertEquals("Joe User", vs.sanitize("Joe\0User")); - vs = UrlQuerySanitizer.getAllButWhitespaceLegal(); - assertEquals("Joe_User", vs.sanitize("Joe User")); - vs = UrlQuerySanitizer.getAmpAndSpaceLegal(); - assertEquals("Joe User&", vs.sanitize("Joe User&")); - vs = UrlQuerySanitizer.getAmpLegal(); - assertEquals("Joe_User&", vs.sanitize("Joe User&")); - vs = UrlQuerySanitizer.getSpaceLegal(); - assertEquals("Joe User ", vs.sanitize("Joe User&")); - vs = UrlQuerySanitizer.getUrlAndSpaceLegal(); - assertEquals("Joe User&Smith%B5'\'", vs.sanitize("Joe User&Smith%B5'\'")); - vs = UrlQuerySanitizer.getUrlLegal(); - assertEquals("Joe_User&Smith%B5'\'", vs.sanitize("Joe User&Smith%B5'\'")); - - String escape = "Joe"; - assertEquals(escape, uqs.unescape(escape)); - String expectedPlus = "Joe User"; - String expectedPercentSignHex = "title=" + Character.toString((char) 181); - String initialPlus = "Joe+User"; - String initialPercentSign = "title=%B5"; - assertEquals(expectedPlus, uqs.unescape(initialPlus)); - assertEquals(expectedPercentSignHex, uqs.unescape(initialPercentSign)); - - assertTrue(uqs.decodeHexDigit('0') >= 0); - assertTrue(uqs.decodeHexDigit('b') >= 0); - assertTrue(uqs.decodeHexDigit('F') >= 0); - assertTrue(uqs.decodeHexDigit('$') < 0); - - assertTrue(uqs.isHexDigit('0')); - assertTrue(uqs.isHexDigit('b')); - assertTrue(uqs.isHexDigit('F')); - assertFalse(uqs.isHexDigit('$')); - - uqs.clear(); - assertEquals(0, urlSet.size()); - assertEquals(0, urlList.size()); - - uqs.setPreferFirstRepeatedParameter(true); - assertTrue(uqs.getPreferFirstRepeatedParameter()); - uqs.setPreferFirstRepeatedParameter(false); - assertFalse(uqs.getPreferFirstRepeatedParameter()); - - UrlQuerySanitizer uq = new UrlQuerySanitizer(); - uq.setPreferFirstRepeatedParameter(true); - final String PARA_ANSWER = "answer"; - uq.registerParameter(PARA_ANSWER, new MockValueSanitizer()); - uq.parseUrl("http://www.google.com/question?answer=13&answer=42"); - assertEquals("13", uq.getValue(PARA_ANSWER)); - - uq.setPreferFirstRepeatedParameter(false); - uq.parseQuery("http://www.google.com/question?answer=13&answer=42"); - assertEquals("42", uq.getValue(PARA_ANSWER)); - - } - - private static class MockValueSanitizer implements ValueSanitizer { - - public String sanitize(String value) { - return value; - } - } - - class MockUrlQuerySanitizer extends UrlQuerySanitizer { - public MockUrlQuerySanitizer() { - super(); - } - - public MockUrlQuerySanitizer(String url) { - super(url); - } - - @Override - protected void addSanitizedEntry(String parameter, String value) { - super.addSanitizedEntry(parameter, value); - } - - @Override - protected void clear() { - super.clear(); - } - - @Override - protected int decodeHexDigit(char c) { - return super.decodeHexDigit(c); - } - - @Override - protected boolean isHexDigit(char c) { - return super.isHexDigit(c); - } - - @Override - protected void parseEntry(String parameter, String value) { - super.parseEntry(parameter, value); - } - } -} diff --git a/proprietary/frameworks/base/tests/net/src/android/net/cts/UrlQuerySanitizer_IllegalCharacterValueSanitizerTest.java b/proprietary/frameworks/base/tests/net/src/android/net/cts/UrlQuerySanitizer_IllegalCharacterValueSanitizerTest.java deleted file mode 100755 index ac84abb4c5cce0acc393339861dfd81c9f459ae1..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/net/src/android/net/cts/UrlQuerySanitizer_IllegalCharacterValueSanitizerTest.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (C) 2009 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.net.cts; - -import android.net.UrlQuerySanitizer.IllegalCharacterValueSanitizer; -import android.test.AndroidTestCase; - -public class UrlQuerySanitizer_IllegalCharacterValueSanitizerTest extends AndroidTestCase { - static final int SPACE_OK = IllegalCharacterValueSanitizer.SPACE_OK; - public void testSanitize() { - IllegalCharacterValueSanitizer sanitizer = new IllegalCharacterValueSanitizer(SPACE_OK); - assertEquals("Joe User", sanitizer.sanitize("Joe getCriticalExtensionOIDs() { - return null; - } - - public byte[] getExtensionValue(String oid) { - return null; - } - - public Set getNonCriticalExtensionOIDs() { - return null; - } - - public boolean hasUnsupportedCriticalExtension() { - return false; - } - } - - public void testState() { - // set the expected value - - Date date1 = new Date(System.currentTimeMillis() - 1000); - Date date2 = new Date(System.currentTimeMillis()); - SslCertificate ssl = new SslCertificate("c=129", "e=weji", date1, date2); - Bundle saved = SslCertificate.saveState(ssl); - assertTrue(saved.size() == 4); - - assertNotNull(saved.getString("issued-to")); - assertNotNull(saved.getString("issued-by")); - assertNotNull(saved.getString("valid-not-before")); - assertNotNull(saved.getString("valid-not-after")); - assertNull(SslCertificate.saveState(null)); - - SslCertificate restored = SslCertificate.restoreState(saved); - assertEquals(ssl.getValidNotAfter(), restored.getValidNotAfter()); - assertEquals(ssl.getValidNotBefore(), restored.getValidNotBefore()); - } - - public void testSslCertificate() { - - final String TO = "c=ccc,o=testOName,ou=testUName,cn=testCName"; - final String BY = "e=aeei,c=adb,o=testOName,ou=testUName,cn=testCName"; - // new the SslCertificate instance - Date date1 = new Date(System.currentTimeMillis() - 1000); - Date date2 = new Date(System.currentTimeMillis()); - SslCertificate ssl = new SslCertificate(TO, BY, date1, date2); - DName issuedTo = ssl.getIssuedTo(); - DName issuedBy = ssl.getIssuedBy(); - - assertEquals("testCName", issuedTo.getCName()); - assertEquals(TO, issuedTo.getDName()); - assertEquals("testOName", issuedTo.getOName()); - assertEquals("testUName", issuedTo.getUName()); - - assertEquals("testCName", issuedBy.getCName()); - assertEquals(BY, issuedBy.getDName()); - assertEquals("testOName", issuedBy.getOName()); - assertEquals("testUName", issuedBy.getUName()); - - assertEquals(date1, ssl.getValidNotBeforeDate()); - assertEquals(date2, ssl.getValidNotAfterDate()); - final String EXPECTED = "Issued to: c=ccc,o=testOName,ou=testUName,cn=testCName;\n" - + "Issued by: e=aeei,c=adb,o=testOName,ou=testUName,cn=testCName;\n"; - assertEquals(EXPECTED, ssl.toString()); - } - -} diff --git a/proprietary/frameworks/base/tests/net/src/android/net/http/cts/SslCertificate_DNameTest.java b/proprietary/frameworks/base/tests/net/src/android/net/http/cts/SslCertificate_DNameTest.java deleted file mode 100755 index b0c71e8c10329fecc7e28bbeac60ad32732e48e5..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/net/src/android/net/http/cts/SslCertificate_DNameTest.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.net.http.cts; - -import java.text.DateFormat; -import java.util.Date; - -import junit.framework.TestCase; -import android.net.http.SslCertificate; -import android.net.http.SslCertificate.DName; - -public class SslCertificate_DNameTest extends TestCase { - - public void testDName() { - final String TO = "c=ccc,o=testOName,ou=testUName,cn=testCName"; - final String BY = "e=aeei,c=adb,o=testOName,ou=testUName,cn=testCName"; - // new the SslCertificate instance - Date date1 = new Date(System.currentTimeMillis() - 1000); - Date date2 = new Date(System.currentTimeMillis()); - SslCertificate ssl = new SslCertificate(TO, BY, DateFormat.getInstance().format( - date1), DateFormat.getInstance().format(date2)); - DName issuedTo = ssl.getIssuedTo(); - - assertNotNull(issuedTo); - - assertEquals("testCName", issuedTo.getCName()); - assertEquals(TO, issuedTo.getDName()); - assertEquals("testOName", issuedTo.getOName()); - assertEquals("testUName", issuedTo.getUName()); - } - -} diff --git a/proprietary/frameworks/base/tests/net/src/android/net/http/cts/SslErrorTest.java b/proprietary/frameworks/base/tests/net/src/android/net/http/cts/SslErrorTest.java deleted file mode 100755 index 850a8b61e6aed4d8456f1d2fc071419ed6c619c9..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/net/src/android/net/http/cts/SslErrorTest.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright (C) 2011 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.net.http.cts; - -import android.net.http.SslCertificate; -import android.net.http.SslError; - - -import java.util.Date; - -import junit.framework.TestCase; - -public class SslErrorTest extends TestCase { - private SslCertificate mCertificate; - - @Override - protected void setUp() throws Exception { - super.setUp(); - mCertificate = new SslCertificate("foo", "bar", new Date(42), new Date(43)); - } - - public void testHasError() { - SslError error = new SslError(SslError.SSL_EXPIRED, mCertificate); - assertTrue(error.hasError(SslError.SSL_EXPIRED)); - assertFalse(error.hasError(SslError.SSL_UNTRUSTED)); - } - - public void testAddError() { - SslError error = new SslError(SslError.SSL_EXPIRED, mCertificate); - assertFalse(error.hasError(SslError.SSL_UNTRUSTED)); - error.addError(SslError.SSL_UNTRUSTED); - assertTrue(error.hasError(SslError.SSL_UNTRUSTED)); - } - - public void testAddErrorIgnoresInvalidValues() { - SslError error = new SslError(SslError.SSL_EXPIRED, mCertificate); - error.addError(42); - assertFalse(error.hasError(42)); - } - - public void testConstructorIgnoresInvalidValues() { - SslError error = new SslError(42, mCertificate); - assertFalse(error.hasError(42)); - } - - public void testGetPrimaryError() { - SslError error = new SslError(SslError.SSL_EXPIRED, mCertificate); - error.addError(SslError.SSL_UNTRUSTED); - assertEquals(error.getPrimaryError(), SslError.SSL_UNTRUSTED); - } - - public void testGetPrimaryErrorWithEmptySet() { - SslError error = new SslError(42, mCertificate); - assertEquals(error.getPrimaryError(), -1); - } - - public void testGetUrl() { - SslError error = new SslError(SslError.SSL_EXPIRED, mCertificate, "foo"); - assertEquals(error.getUrl(), "foo"); - } - - public void testGetUrlWithDeprecatedConstructor() { - SslError error = new SslError(SslError.SSL_EXPIRED, mCertificate); - assertEquals(error.getUrl(), ""); - } -} diff --git a/proprietary/frameworks/base/tests/net/src/android/net/ipv6/cts/PingTest.java b/proprietary/frameworks/base/tests/net/src/android/net/ipv6/cts/PingTest.java deleted file mode 100755 index c23ad30f050109f0091f3d2d09c052c539f3926b..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/net/src/android/net/ipv6/cts/PingTest.java +++ /dev/null @@ -1,172 +0,0 @@ -/* - * Copyright (C) 2013 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.net.ipv6.cts; - -import android.test.AndroidTestCase; -import android.util.Log; - -import android.system.ErrnoException; -import android.system.Os; -import android.system.StructTimeval; -import static android.system.OsConstants.*; - -import java.io.FileDescriptor; -import java.io.IOException; -import java.net.InetAddress; -import java.net.Inet6Address; -import java.net.InetSocketAddress; -import java.net.UnknownHostException; -import java.nio.ByteBuffer; -import java.util.Arrays; -import java.util.Random; - -/** - * Checks that the device has kernel support for the IPv6 ping socket. This allows ping6 to work - * without root privileges. The necessary kernel code is in Linux 3.11 or above, or the - * common/android-3.x kernel trees. If you are not running one of these kernels, the - * functionality can be obtained by cherry-picking the following patches from David Miller's - * net-next tree: - *
      - *
    • 6d0bfe2 net: ipv6: Add IPv6 support to the ping socket. - *
    • c26d6b4 ping: always initialize ->sin6_scope_id and ->sin6_flowinfo - *
    • fbfe80c net: ipv6: fix wrong ping_v6_sendmsg return value - *
    • a1bdc45 net: ipv6: add missing lock in ping_v6_sendmsg - *
    • cf970c0 ping: prevent NULL pointer dereference on write to msg_name - *
    - * or the equivalent backports to the common/android-3.x trees. - */ -public class PingTest extends AndroidTestCase { - /** Maximum size of the packets we're using to test. */ - private static final int MAX_SIZE = 4096; - - /** Size of the ICMPv6 header. */ - private static final int ICMP_HEADER_SIZE = 8; - - /** Number of packets to test. */ - private static final int NUM_PACKETS = 10; - - /** The beginning of an ICMPv6 echo request: type, code, and uninitialized checksum. */ - private static final byte[] PING_HEADER = new byte[] { - (byte) 0x80, (byte) 0x00, (byte) 0x00, (byte) 0x00 - }; - - /** - * Returns a byte array containing an ICMPv6 echo request with the specified payload length. - */ - private byte[] pingPacket(int payloadLength) { - byte[] packet = new byte[payloadLength + ICMP_HEADER_SIZE]; - new Random().nextBytes(packet); - System.arraycopy(PING_HEADER, 0, packet, 0, PING_HEADER.length); - return packet; - } - - /** - * Checks that the first length bytes of two byte arrays are equal. - */ - private void assertArrayBytesEqual(byte[] expected, byte[] actual, int length) { - for (int i = 0; i < length; i++) { - assertEquals("Arrays differ at index " + i + ":", expected[i], actual[i]); - } - } - - /** - * Creates an IPv6 ping socket and sets a receive timeout of 100ms. - */ - private FileDescriptor createPingSocket() throws ErrnoException { - FileDescriptor s = Os.socket(AF_INET6, SOCK_DGRAM, IPPROTO_ICMPV6); - Os.setsockoptTimeval(s, SOL_SOCKET, SO_RCVTIMEO, StructTimeval.fromMillis(100)); - return s; - } - - /** - * Sends a ping packet to a random port on the specified address on the specified socket. - */ - private void sendPing(FileDescriptor s, - InetAddress address, byte[] packet) throws ErrnoException, IOException { - // Pick a random port. Choose a range that gives a reasonable chance of picking a low port. - int port = (int) (Math.random() * 2048); - - // Send the packet. - int ret = Os.sendto(s, ByteBuffer.wrap(packet), 0, address, port); - assertEquals(packet.length, ret); - } - - /** - * Checks that a socket has received a response appropriate to the specified packet. - */ - private void checkResponse(FileDescriptor s, InetAddress dest, - byte[] sent, boolean useRecvfrom) throws ErrnoException, IOException { - ByteBuffer responseBuffer = ByteBuffer.allocate(MAX_SIZE); - int bytesRead; - - // Receive the response. - if (useRecvfrom) { - InetSocketAddress from = new InetSocketAddress(); - bytesRead = Os.recvfrom(s, responseBuffer, 0, from); - - // Check the source address and scope ID. - assertTrue(from.getAddress() instanceof Inet6Address); - Inet6Address fromAddress = (Inet6Address) from.getAddress(); - assertEquals(0, fromAddress.getScopeId()); - assertNull(fromAddress.getScopedInterface()); - assertEquals(dest.getHostAddress(), fromAddress.getHostAddress()); - } else { - bytesRead = Os.read(s, responseBuffer); - } - - // Check the packet length. - assertEquals(sent.length, bytesRead); - - // Check the response is an echo reply. - byte[] response = new byte[bytesRead]; - responseBuffer.flip(); - responseBuffer.get(response, 0, bytesRead); - assertEquals((byte) 0x81, response[0]); - - // Find out what ICMP ID was used in the packet that was sent. - int id = ((InetSocketAddress) Os.getsockname(s)).getPort(); - sent[4] = (byte) (id / 256); - sent[5] = (byte) (id % 256); - - // Ensure the response is the same as the packet, except for the type (which is 0x81) - // and the ID and checksum, which are set by the kernel. - response[0] = (byte) 0x80; // Type. - response[2] = response[3] = (byte) 0x00; // Checksum. - assertArrayBytesEqual(response, sent, bytesRead); - } - - /** - * Sends NUM_PACKETS random ping packets to ::1 and checks the replies. - */ - public void testLoopbackPing() throws ErrnoException, IOException { - // Generate a random ping packet and send it to localhost. - InetAddress ipv6Loopback = InetAddress.getByName(null); - assertEquals("::1", ipv6Loopback.getHostAddress()); - - for (int i = 0; i < NUM_PACKETS; i++) { - byte[] packet = pingPacket((int) (Math.random() * (MAX_SIZE - ICMP_HEADER_SIZE))); - FileDescriptor s = createPingSocket(); - // Use both recvfrom and read(). - sendPing(s, ipv6Loopback, packet); - checkResponse(s, ipv6Loopback, packet, true); - sendPing(s, ipv6Loopback, packet); - checkResponse(s, ipv6Loopback, packet, false); - // Check closing the socket doesn't raise an exception. - Os.close(s); - } - } -} diff --git a/proprietary/frameworks/base/tests/nfc/Android.mk b/proprietary/frameworks/base/tests/nfc/Android.mk deleted file mode 100755 index 7f163908ca02dc2c11f2680c7643950d5d69b665..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/nfc/Android.mk +++ /dev/null @@ -1,17 +0,0 @@ -LOCAL_PATH:= $(call my-dir) -include $(CLEAR_VARS) - -# We only want this apk build for tests. -LOCAL_MODULE_TAGS := tests - -# Include all test java files. -LOCAL_SRC_FILES := \ - $(call all-java-files-under, src) - -LOCAL_JAVA_LIBRARIES := android.test.runner -LOCAL_PACKAGE_NAME := MediaTekNfcTestCases -LOCAL_CERTIFICATE := platform - -include $(BUILD_PACKAGE) - -include $(call all-makefiles-under,$(LOCAL_PATH)) diff --git a/proprietary/frameworks/base/tests/nfc/Android.mk_ b/proprietary/frameworks/base/tests/nfc/Android.mk_ deleted file mode 100755 index 7f163908ca02dc2c11f2680c7643950d5d69b665..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/nfc/Android.mk_ +++ /dev/null @@ -1,17 +0,0 @@ -LOCAL_PATH:= $(call my-dir) -include $(CLEAR_VARS) - -# We only want this apk build for tests. -LOCAL_MODULE_TAGS := tests - -# Include all test java files. -LOCAL_SRC_FILES := \ - $(call all-java-files-under, src) - -LOCAL_JAVA_LIBRARIES := android.test.runner -LOCAL_PACKAGE_NAME := MediaTekNfcTestCases -LOCAL_CERTIFICATE := platform - -include $(BUILD_PACKAGE) - -include $(call all-makefiles-under,$(LOCAL_PATH)) diff --git a/proprietary/frameworks/base/tests/nfc/AndroidManifest.xml b/proprietary/frameworks/base/tests/nfc/AndroidManifest.xml deleted file mode 100755 index 0fb1ae0d9c95ad94ab9d3a9231d87f0951074938..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/nfc/AndroidManifest.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/proprietary/frameworks/base/tests/nfc/NOTICE b/proprietary/frameworks/base/tests/nfc/NOTICE deleted file mode 100755 index 4637a4c4429745a16e84567299dc414019efdd4d..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/nfc/NOTICE +++ /dev/null @@ -1,34 +0,0 @@ -* Copyright (C) 2012 The Android Open Source Project: - - - -* Copyright (C) 2008 The Android Open Source Project: - - - -* Copyright (C) 2013 The Android Open Source Project: - - - -* Copyright (C) 2009 The Android Open Source Project: - - - -/* -* Copyright (C) 2011-2014 MediaTek Inc. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -: - \ No newline at end of file diff --git a/proprietary/frameworks/base/tests/nfc/README b/proprietary/frameworks/base/tests/nfc/README deleted file mode 100755 index d33c21fba709b23fb37dfb40150d209487451245..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/nfc/README +++ /dev/null @@ -1,20 +0,0 @@ -WHAT IT DOES? -============= -This is a nfc auto test APK -The purpose of this apk is to test nfc functionality -The RD should be able to verify nfc issues easily by using this program. - - -HOW IT WAS BUILT? -================== - - -[Build Method] - -mmm vendor/mediatek/proprietary/frameworks/base/tests/nfc - -HOW TO USE IT? -============== -install -r MediaTekNfcTestCases.apk -adb shell pm list instrumentation -adb shell am instrument -w com.mediatek.nfc.tests/com.mediatek.nfc.tests.NfcTestRunner \ No newline at end of file diff --git a/proprietary/frameworks/base/tests/nfc/src/com/mediatek/nfc/tests/NfcApiTest.java b/proprietary/frameworks/base/tests/nfc/src/com/mediatek/nfc/tests/NfcApiTest.java deleted file mode 100755 index a2707e18165098c6d7a952a7edb6434b4fe1b67e..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/nfc/src/com/mediatek/nfc/tests/NfcApiTest.java +++ /dev/null @@ -1,163 +0,0 @@ -/* Copyright Statement: - * - * This software/firmware and related documentation ("MediaTek Software") are - * protected under relevant copyright laws. The information contained herein is - * confidential and proprietary to MediaTek Inc. and/or its licensors. Without - * the prior written permission of MediaTek inc. and/or its licensors, any - * reproduction, modification, use or disclosure of MediaTek Software, and - * information contained herein, in whole or in part, shall be strictly - * prohibited. - * - * MediaTek Inc. (C) 2010. All rights reserved. - * - * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES - * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE") - * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER - * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL - * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED - * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR - * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH - * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, - * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES - * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. - * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO - * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK - * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE - * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR - * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S - * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE - * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE - * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE - * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. - * - * The following software/firmware and/or related documentation ("MediaTek - * Software") have been modified by MediaTek Inc. All revisions are subject to - * any receiver's applicable license agreements with MediaTek Inc. - */ - -/* - * Copyright (C) 2010 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.mediatek.nfc.tests; - -import android.nfc.NfcAdapter; -import android.content.Context; -import android.test.InstrumentationTestCase; -import android.content.Intent; -import java.util.concurrent.Semaphore; - -public class NfcApiTest extends InstrumentationTestCase { - private static final String TAG = "NfcApiTest"; - private boolean mHasNfcFeature = false; - - @Override - protected void setUp() throws Exception { - super.setUp(); - Context context = getInstrumentation().getContext(); - NfcAdapter adapter = NfcAdapter.getDefaultAdapter(context); - mHasNfcFeature = adapter != null ? true : false; - } - - @Override - protected void tearDown() throws Exception { - super.tearDown(); - } - - public void testEnable() { - if (!mHasNfcFeature) - return; - - Context context = getInstrumentation().getContext(); - NfcAdapter adapter = NfcAdapter.getDefaultAdapter(context); - assertNotNull(adapter); - adapter.isEnabled(); - } - - static final int setNdefPushMessage = 1; - static final int setNdefPushMessageCallback = 2; - static final int setOnNdefPushCompleteCallback = 3; - static final int enableForegroundDispatch = 4; - static final int disableForegroundDispatch = 5; - - static private Semaphore mSem = new Semaphore(0); - static private boolean mIsOk = false; - - static public boolean waitForResult() { - try { - mSem.acquire(); - } catch (InterruptedException e) { - return false; - } - return mIsOk; - } - - static public void onTestFinished(boolean isOk) { - mIsOk = isOk; - mSem.release(); - } - - private void launchTestCase(int id) { - if (!mHasNfcFeature) - return; - Context context = getInstrumentation().getContext(); - Intent i = new Intent(context, NfcTestActivity.class); - i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); - i.putExtra("NfcTestCase", id); - context.startActivity(i); - } - - public void testSetNdefPushMessage() { - if (!mHasNfcFeature) - return; - launchTestCase(NfcApiTest.setNdefPushMessage); - if (!waitForResult()) - assertNotNull(null); - } - - public void testSetNdefPushMessageCallback() { - if (!mHasNfcFeature) - return; - launchTestCase(NfcApiTest.setNdefPushMessageCallback); - if (!waitForResult()) - assertNotNull(null); - } - - public void testSetOnNdefPushCompleteCallback() { - if (!mHasNfcFeature) - return; - launchTestCase(NfcApiTest.setOnNdefPushCompleteCallback); - if (!waitForResult()) - assertNotNull(null); - } - - public void testEnableForegroundDispatch() { - if (!mHasNfcFeature) - return; - launchTestCase(NfcApiTest.enableForegroundDispatch); - if (!waitForResult()) - assertNotNull(null); - } - - public void testDisableForegroundDispatch() { - if (!mHasNfcFeature) - return; - launchTestCase(NfcApiTest.disableForegroundDispatch); - if (!waitForResult()) - assertNotNull(null); - } - -} - diff --git a/proprietary/frameworks/base/tests/nfc/src/com/mediatek/nfc/tests/NfcTestActivity.java b/proprietary/frameworks/base/tests/nfc/src/com/mediatek/nfc/tests/NfcTestActivity.java deleted file mode 100755 index 15cf8504110dcde18a73e7a2d2f2887a4da660e3..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/nfc/src/com/mediatek/nfc/tests/NfcTestActivity.java +++ /dev/null @@ -1,156 +0,0 @@ -/* Copyright Statement: - * - * This software/firmware and related documentation ("MediaTek Software") are - * protected under relevant copyright laws. The information contained herein is - * confidential and proprietary to MediaTek Inc. and/or its licensors. Without - * the prior written permission of MediaTek inc. and/or its licensors, any - * reproduction, modification, use or disclosure of MediaTek Software, and - * information contained herein, in whole or in part, shall be strictly - * prohibited. - * - * MediaTek Inc. (C) 2010. All rights reserved. - * - * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES - * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE") - * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER - * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL - * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED - * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR - * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH - * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, - * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES - * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. - * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO - * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK - * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE - * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR - * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S - * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE - * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE - * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE - * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. - * - * The following software/firmware and/or related documentation ("MediaTek - * Software") have been modified by MediaTek Inc. All revisions are subject to - * any receiver's applicable license agreements with MediaTek Inc. - */ - -/* - * Copyright (C) 2011 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.mediatek.nfc.tests; - -import android.app.Activity; -import android.content.Intent; -import android.os.Bundle; -import android.nfc.NfcAdapter; -import android.nfc.NfcEvent; -import android.nfc.NdefRecord; -import android.nfc.NdefMessage; -import java.nio.charset.Charset; -import android.nfc.tech.NfcF; -import android.app.PendingIntent; -import android.content.IntentFilter; -import android.content.IntentFilter.MalformedMimeTypeException; - -public class NfcTestActivity extends Activity - implements NfcAdapter.CreateNdefMessageCallback, NfcAdapter.OnNdefPushCompleteCallback { - - static final String EXTRA_LAUNCH_INTENT = "launchIntent"; - - private NdefRecord createMimeRecord(String mimeType, byte[] payload) { - byte[] mimeBytes = mimeType.getBytes(Charset.forName("US-ASCII")); - NdefRecord mimeRecord = new NdefRecord(NdefRecord.TNF_MIME_MEDIA, - mimeBytes, - new byte[0], - payload); - return mimeRecord; - } - - private NdefMessage createTestNdefMessage() { - String text = ("Beam me up, Android!\n\n" + "Beam Time: " + System.currentTimeMillis()); - NdefMessage msg = new NdefMessage(new NdefRecord[] - { createMimeRecord("application/com.example.android.beam", text.getBytes()) }); - return msg; - } - - @Override - public NdefMessage createNdefMessage(NfcEvent e) { - return createTestNdefMessage(); - } - - @Override - public void onNdefPushComplete(NfcEvent e) { - return; - } - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - int testCase = getIntent().getIntExtra("NfcTestCase", -1); - NfcAdapter adapter = NfcAdapter.getDefaultAdapter(this); - if (adapter == null) - testCase = -1; - - switch (testCase) { - case NfcApiTest.setNdefPushMessage: - NdefMessage msg = createTestNdefMessage(); - adapter.setNdefPushMessage(msg, this); - NfcApiTest.onTestFinished(true); - break; - case NfcApiTest.setNdefPushMessageCallback: - adapter.setNdefPushMessageCallback(this, this); - NfcApiTest.onTestFinished(true); - break; - case NfcApiTest.setOnNdefPushCompleteCallback: - adapter.setOnNdefPushCompleteCallback(this, this); - NfcApiTest.onTestFinished(true); - break; - case NfcApiTest.enableForegroundDispatch: - PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, - new Intent(this, getClass()).addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP), 0); - IntentFilter ndef = new IntentFilter(NfcAdapter.ACTION_NDEF_DISCOVERED); - try { - ndef.addDataType("*/*"); - } catch (MalformedMimeTypeException e) { - throw new RuntimeException("fail", e); - } - IntentFilter[] filters = new IntentFilter[] { ndef, }; - String[][] techLists = new String[][] { new String[] { NfcF.class.getName()}}; - try { - adapter.enableForegroundDispatch(this, pendingIntent, filters, techLists); - } catch (IllegalStateException e) { - // only allowed to be called when onResume state, - // currently bypass this exception - } - NfcApiTest.onTestFinished(true); - break; - case NfcApiTest.disableForegroundDispatch: - try { - adapter.disableForegroundDispatch(this); - } catch (IllegalStateException e) { - // only allowed to be called when onResume state, - // currently bypass this exception - } - NfcApiTest.onTestFinished(true); - break; - default: - break; - } - - finish(); - } -} diff --git a/proprietary/frameworks/base/tests/nfc/src/com/mediatek/nfc/tests/NfcTestRunner.java b/proprietary/frameworks/base/tests/nfc/src/com/mediatek/nfc/tests/NfcTestRunner.java deleted file mode 100755 index dd1891fdaf7a3c05669fea65e7637587a1d659d6..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/nfc/src/com/mediatek/nfc/tests/NfcTestRunner.java +++ /dev/null @@ -1,89 +0,0 @@ -/* Copyright Statement: - * - * This software/firmware and related documentation ("MediaTek Software") are - * protected under relevant copyright laws. The information contained herein is - * confidential and proprietary to MediaTek Inc. and/or its licensors. Without - * the prior written permission of MediaTek inc. and/or its licensors, any - * reproduction, modification, use or disclosure of MediaTek Software, and - * information contained herein, in whole or in part, shall be strictly - * prohibited. - * - * MediaTek Inc. (C) 2010. All rights reserved. - * - * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES - * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE") - * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER - * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL - * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED - * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR - * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH - * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, - * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES - * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. - * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO - * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK - * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE - * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR - * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S - * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE - * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE - * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE - * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. - * - * The following software/firmware and/or related documentation ("MediaTek - * Software") have been modified by MediaTek Inc. All revisions are subject to - * any receiver's applicable license agreements with MediaTek Inc. - */ - -/* - * Copyright (C) 2010 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.mediatek.nfc.tests; - -import junit.framework.TestSuite; - -import android.os.Bundle; -import android.test.InstrumentationTestRunner; -import android.test.InstrumentationTestSuite; -import android.util.Log; - - /** - adb shell am instrument \ - * [-e enable_iterations ] <-- example for input parameters - * -w com.mediatek.nfc.tests/.NfcTestRunner - * ^^^^^^ ^^^^^^^^^^^^^^^^^^^ <-- change to nfc related - */ - -public class NfcTestRunner extends InstrumentationTestRunner { - private static final String TAG = "NfcTestRunner"; - @Override - public TestSuite getAllTests() { - TestSuite suite = new InstrumentationTestSuite(this); - suite.addTestSuite(NfcApiTest.class); - return suite; - } - - @Override - public ClassLoader getLoader() { - return NfcTestRunner.class.getClassLoader(); - } - - @Override - public void onCreate(Bundle arguments) { - Log.d(TAG, String.format("NfcTestRunner onCreate() is called")); - super.onCreate(arguments); - } -} diff --git a/proprietary/frameworks/base/tests/resources/Android.mk b/proprietary/frameworks/base/tests/resources/Android.mk deleted file mode 100755 index 0548edc1c6ca4ac8c720083df12425bd85bc51e0..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/Android.mk +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright (C) 2008 The Android Open Source Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -LOCAL_PATH:= $(call my-dir) -include $(CLEAR_VARS) - -LOCAL_MODULE_TAGS := tests - -LOCAL_SRC_FILES := $(call all-java-files-under, src)\ - $(call all-java-files-under, core/runner/src) - -LOCAL_JAVA_LIBRARIES := android.test.runner - -#LOCAL_JNI_SHARED_LIBRARIES := libcts_jni - -# Resource unit tests use a private locale and some densities -LOCAL_AAPT_FLAGS = -c xx_YY -c cs -c small -c normal -c large -c xlarge \ - -c 320dpi -c 240dpi -c 160dpi -c 32dpi \ - -c mdpi -c hdpi -c xhdpi -c xxhdpi \ - -c kok,kok_IN,kok_419,kok_419_VARIANT,kok_Knda_419,kok_Knda_419_VARIANT,kok_VARIANT,kok_Knda,tgl,tgl_PH - -LOCAL_PACKAGE_NAME := MediaTekResourceTestStubs - -LOCAL_DEX_PREOPT := false - -include $(BUILD_PACKAGE) - -# Build the test APK using its own makefile, and any other CTS-related packages -include $(call all-makefiles-under,$(LOCAL_PATH)) diff --git a/proprietary/frameworks/base/tests/resources/Android.mk_ b/proprietary/frameworks/base/tests/resources/Android.mk_ deleted file mode 100755 index 0548edc1c6ca4ac8c720083df12425bd85bc51e0..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/Android.mk_ +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright (C) 2008 The Android Open Source Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -LOCAL_PATH:= $(call my-dir) -include $(CLEAR_VARS) - -LOCAL_MODULE_TAGS := tests - -LOCAL_SRC_FILES := $(call all-java-files-under, src)\ - $(call all-java-files-under, core/runner/src) - -LOCAL_JAVA_LIBRARIES := android.test.runner - -#LOCAL_JNI_SHARED_LIBRARIES := libcts_jni - -# Resource unit tests use a private locale and some densities -LOCAL_AAPT_FLAGS = -c xx_YY -c cs -c small -c normal -c large -c xlarge \ - -c 320dpi -c 240dpi -c 160dpi -c 32dpi \ - -c mdpi -c hdpi -c xhdpi -c xxhdpi \ - -c kok,kok_IN,kok_419,kok_419_VARIANT,kok_Knda_419,kok_Knda_419_VARIANT,kok_VARIANT,kok_Knda,tgl,tgl_PH - -LOCAL_PACKAGE_NAME := MediaTekResourceTestStubs - -LOCAL_DEX_PREOPT := false - -include $(BUILD_PACKAGE) - -# Build the test APK using its own makefile, and any other CTS-related packages -include $(call all-makefiles-under,$(LOCAL_PATH)) diff --git a/proprietary/frameworks/base/tests/resources/AndroidManifest.xml b/proprietary/frameworks/base/tests/resources/AndroidManifest.xml deleted file mode 100755 index 29e9b7d1750f7c8b51ad2e3984a6059b46f7b474..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/AndroidManifest.xml +++ /dev/null @@ -1,1055 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - android:label="VideoViewStubActivity"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/proprietary/frameworks/base/tests/resources/NOTICE b/proprietary/frameworks/base/tests/resources/NOTICE deleted file mode 100755 index a31a940b7fc5907dd049c0a66f52f1f55fa52dbc..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/NOTICE +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - diff --git a/proprietary/frameworks/base/tests/resources/assets/webkit/embedded_image.html b/proprietary/frameworks/base/tests/resources/assets/webkit/embedded_image.html deleted file mode 100755 index e41fa700bdaf26444214cfc1363c86f1c12f4f31..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/assets/webkit/embedded_image.html +++ /dev/null @@ -1,23 +0,0 @@ - - - - - test image - - - robot - - diff --git a/proprietary/frameworks/base/tests/resources/assets/webkit/favicon.png b/proprietary/frameworks/base/tests/resources/assets/webkit/favicon.png deleted file mode 100755 index fb795a0e7cf9779961419c5736644d3d02f9ff78..0000000000000000000000000000000000000000 Binary files a/proprietary/frameworks/base/tests/resources/assets/webkit/favicon.png and /dev/null differ diff --git a/proprietary/frameworks/base/tests/resources/assets/webkit/fonts.html b/proprietary/frameworks/base/tests/resources/assets/webkit/fonts.html deleted file mode 100755 index aefd0770876e64e6c466e259fb43a61b879a5e92..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/assets/webkit/fonts.html +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - Font test page - - - Standard ABCdef123
    - Fixed ABCdef123
    - Sans Serif ABCdef123
    - Serif ABCdef123
    - Cursive ABCdef123
    - Fantasy ABCdef123
    - - - diff --git a/proprietary/frameworks/base/tests/resources/assets/webkit/iframe_blank_tag.html b/proprietary/frameworks/base/tests/resources/assets/webkit/iframe_blank_tag.html deleted file mode 100755 index fbc6dc69422a3b553fb7ede4130ed9988e8dd9c7..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/assets/webkit/iframe_blank_tag.html +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - diff --git a/proprietary/frameworks/base/tests/resources/assets/webkit/javascript.html b/proprietary/frameworks/base/tests/resources/assets/webkit/javascript.html deleted file mode 100755 index 551931a619cd84b7c71568b30fac5bb112cc9fd5..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/assets/webkit/javascript.html +++ /dev/null @@ -1,29 +0,0 @@ - - - - - javascript off - - - - Javascript test - - - diff --git a/proprietary/frameworks/base/tests/resources/assets/webkit/jsalert.html b/proprietary/frameworks/base/tests/resources/assets/webkit/jsalert.html deleted file mode 100755 index c4b35fafbae73391e83a3059d3b27f8c137db283..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/assets/webkit/jsalert.html +++ /dev/null @@ -1,29 +0,0 @@ - - - - - javascript alert - - - - javascript alert test - - - diff --git a/proprietary/frameworks/base/tests/resources/assets/webkit/jsconfirm.html b/proprietary/frameworks/base/tests/resources/assets/webkit/jsconfirm.html deleted file mode 100755 index 720c5de1e13d3be5c759af42c4d1ff72d24967d6..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/assets/webkit/jsconfirm.html +++ /dev/null @@ -1,34 +0,0 @@ - - - - - javascript confirm - - - - javascript confirm test - - - diff --git a/proprietary/frameworks/base/tests/resources/assets/webkit/jsform.html b/proprietary/frameworks/base/tests/resources/assets/webkit/jsform.html deleted file mode 100755 index 4f04b29caaa923b4c267ec3953809dd8718e7dce..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/assets/webkit/jsform.html +++ /dev/null @@ -1,34 +0,0 @@ - - - - - javascript form - - - - javascript form test -
    - -
    - - - diff --git a/proprietary/frameworks/base/tests/resources/assets/webkit/jsprompt.html b/proprietary/frameworks/base/tests/resources/assets/webkit/jsprompt.html deleted file mode 100755 index a6b7d57e97d8bdeb0d97cb4769c4d942d5a5692f..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/assets/webkit/jsprompt.html +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - javascript prompt - - - - javascript prompt test - - - diff --git a/proprietary/frameworks/base/tests/resources/assets/webkit/jsunload.html b/proprietary/frameworks/base/tests/resources/assets/webkit/jsunload.html deleted file mode 100755 index fb0673e0acbc8c5dea47baf12019419d39b90c12..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/assets/webkit/jsunload.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - - javascript unload - - - - javascript unload test - - - diff --git a/proprietary/frameworks/base/tests/resources/assets/webkit/jswindow.html b/proprietary/frameworks/base/tests/resources/assets/webkit/jswindow.html deleted file mode 100755 index 7075d6ee0c38d1bc92ce25d2c52cf797ca252fd2..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/assets/webkit/jswindow.html +++ /dev/null @@ -1,33 +0,0 @@ - - - - - javascript window - - - - javascript window test - - - diff --git a/proprietary/frameworks/base/tests/resources/assets/webkit/network_state.html b/proprietary/frameworks/base/tests/resources/assets/webkit/network_state.html deleted file mode 100755 index 4712b83b85d15da4ea223db00a5a54deea722162..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/assets/webkit/network_state.html +++ /dev/null @@ -1,31 +0,0 @@ - - - - - uninitialized - - - - - diff --git a/proprietary/frameworks/base/tests/resources/assets/webkit/page_with_link.html b/proprietary/frameworks/base/tests/resources/assets/webkit/page_with_link.html deleted file mode 100755 index 50fb78a4c012cf8cbbf361c62e9aa39be6537305..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/assets/webkit/page_with_link.html +++ /dev/null @@ -1,20 +0,0 @@ - - - - - a link - - diff --git a/proprietary/frameworks/base/tests/resources/assets/webkit/popup.html b/proprietary/frameworks/base/tests/resources/assets/webkit/popup.html deleted file mode 100755 index b5ed6715fc6a40d87cad4f8ef9b34a3a43bf927b..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/assets/webkit/popup.html +++ /dev/null @@ -1,24 +0,0 @@ - - - - - Popup allowed - - - Popup allowed - - - diff --git a/proprietary/frameworks/base/tests/resources/assets/webkit/popup_base.html b/proprietary/frameworks/base/tests/resources/assets/webkit/popup_base.html deleted file mode 100755 index 6c6e7eb07f76590839dbf20120f3242a192f6660..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/assets/webkit/popup_base.html +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - Popup blocked - - - diff --git a/proprietary/frameworks/base/tests/resources/assets/webkit/test_anchor.html b/proprietary/frameworks/base/tests/resources/assets/webkit/test_anchor.html deleted file mode 100755 index fc5047d602dc830b5f103c95320702902ac43ace..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/assets/webkit/test_anchor.html +++ /dev/null @@ -1,10 +0,0 @@ - - - PASSING QUERY PARAM FAILED - - - - - diff --git a/proprietary/frameworks/base/tests/resources/assets/webkit/test_blankPage.html b/proprietary/frameworks/base/tests/resources/assets/webkit/test_blankPage.html deleted file mode 100755 index fbe282d225990126a5acc213b9b9a9885846cc33..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/assets/webkit/test_blankPage.html +++ /dev/null @@ -1,23 +0,0 @@ - - - - - Blank page - - -
     
    - - diff --git a/proprietary/frameworks/base/tests/resources/assets/webkit/test_br_tag.html b/proprietary/frameworks/base/tests/resources/assets/webkit/test_br_tag.html deleted file mode 100755 index 39eb2fa2530b1b223c2df905ee86e4c26760af0b..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/assets/webkit/test_br_tag.html +++ /dev/null @@ -1,29 +0,0 @@ - - - - - test br tag - - -

    testing br tag

    -

    - there is a br after line1
    line2 -

    -

    - there are two brs after line3

    line 4 -

    - - diff --git a/proprietary/frameworks/base/tests/resources/assets/webkit/test_databaseaccess.html b/proprietary/frameworks/base/tests/resources/assets/webkit/test_databaseaccess.html deleted file mode 100755 index dcf7b098f91db3c77fde4b59f1c52b4176f78436..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/assets/webkit/test_databaseaccess.html +++ /dev/null @@ -1,27 +0,0 @@ - - - - None - - - diff --git a/proprietary/frameworks/base/tests/resources/assets/webkit/test_favicon.html b/proprietary/frameworks/base/tests/resources/assets/webkit/test_favicon.html deleted file mode 100755 index 902a2771433bb12ac0aa574fb31316a07aac52a6..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/assets/webkit/test_favicon.html +++ /dev/null @@ -1,24 +0,0 @@ - - - - - test favicon - - - -

    hello favicon!


    - - diff --git a/proprietary/frameworks/base/tests/resources/assets/webkit/test_firstPage.html b/proprietary/frameworks/base/tests/resources/assets/webkit/test_firstPage.html deleted file mode 100755 index 18a55488b7e94477d0e9eb426dc20702511dca5b..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/assets/webkit/test_firstPage.html +++ /dev/null @@ -1,22 +0,0 @@ - - - - First page - -

    First page

    - Go to second page - - diff --git a/proprietary/frameworks/base/tests/resources/assets/webkit/test_hello_world.html b/proprietary/frameworks/base/tests/resources/assets/webkit/test_hello_world.html deleted file mode 100755 index 7750a0f28fe8c0c200a199dd8416971058e37cd1..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/assets/webkit/test_hello_world.html +++ /dev/null @@ -1,23 +0,0 @@ - - - - - test hello world - - -

    hello world!


    - - diff --git a/proprietary/frameworks/base/tests/resources/assets/webkit/test_iframeaccess.html b/proprietary/frameworks/base/tests/resources/assets/webkit/test_iframeaccess.html deleted file mode 100755 index 1b5fc5abd6ead43411ca26b9c00e4b40090e06e2..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/assets/webkit/test_iframeaccess.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - - DEFAULT TITLE - - - - - - diff --git a/proprietary/frameworks/base/tests/resources/assets/webkit/test_imageaccess.html b/proprietary/frameworks/base/tests/resources/assets/webkit/test_imageaccess.html deleted file mode 100755 index ce76c830eb55fbde08dd353a0c54f19ce1084109..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/assets/webkit/test_imageaccess.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - - TEST FAILED - - - - - - diff --git a/proprietary/frameworks/base/tests/resources/assets/webkit/test_jsInterface.html b/proprietary/frameworks/base/tests/resources/assets/webkit/test_jsInterface.html deleted file mode 100755 index 662dfe03590f5e5def6992f13fdb0abe8f54d6ea..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/assets/webkit/test_jsInterface.html +++ /dev/null @@ -1,21 +0,0 @@ - - - - Original title - - - - diff --git a/proprietary/frameworks/base/tests/resources/assets/webkit/test_queryparam.html b/proprietary/frameworks/base/tests/resources/assets/webkit/test_queryparam.html deleted file mode 100755 index 68b54e44e0ba8fd731cb7b4fd1588ca9a9221834..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/assets/webkit/test_queryparam.html +++ /dev/null @@ -1,32 +0,0 @@ - - - - - PASSING QUERY PARAM FAILED - - - - - diff --git a/proprietary/frameworks/base/tests/resources/assets/webkit/test_secondPage.html b/proprietary/frameworks/base/tests/resources/assets/webkit/test_secondPage.html deleted file mode 100755 index ea8e2a18111c4478af08682d316d413c3a6d9e2c..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/assets/webkit/test_secondPage.html +++ /dev/null @@ -1,22 +0,0 @@ - - - - Second page - -

    Second page

    - Go to third page - - diff --git a/proprietary/frameworks/base/tests/resources/assets/webkit/test_stop_loading.html b/proprietary/frameworks/base/tests/resources/assets/webkit/test_stop_loading.html deleted file mode 100755 index 1f0fc726661c23f6616eaa3295d1dcbbd7500af8..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/assets/webkit/test_stop_loading.html +++ /dev/null @@ -1,23 +0,0 @@ - - - - - Stop Loading test - - -

    hello world!


    - - diff --git a/proprietary/frameworks/base/tests/resources/assets/webkit/test_thirdPage.html b/proprietary/frameworks/base/tests/resources/assets/webkit/test_thirdPage.html deleted file mode 100755 index 1784c3203b824333f91a1e754fd1dc0a17d10de0..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/assets/webkit/test_thirdPage.html +++ /dev/null @@ -1,21 +0,0 @@ - - - - Third page - -

    Third page

    - - diff --git a/proprietary/frameworks/base/tests/resources/assets/webkit/test_timer.html b/proprietary/frameworks/base/tests/resources/assets/webkit/test_timer.html deleted file mode 100755 index 5e8496fd39b72f4a5435112d8fdebf1ccef66f41..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/assets/webkit/test_timer.html +++ /dev/null @@ -1,36 +0,0 @@ - - - - - 0 - - - - Timer test 0. - - diff --git a/proprietary/frameworks/base/tests/resources/res/anim/accelerate_alpha.xml b/proprietary/frameworks/base/tests/resources/res/anim/accelerate_alpha.xml deleted file mode 100755 index 594652b4bbf4f303885f11c4e122439b0dee0c27..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/anim/accelerate_alpha.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - diff --git a/proprietary/frameworks/base/tests/resources/res/anim/accelerate_decelerate_alpha.xml b/proprietary/frameworks/base/tests/resources/res/anim/accelerate_decelerate_alpha.xml deleted file mode 100755 index 7c892b2190eb48f36e5f413cfd4faf7331361603..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/anim/accelerate_decelerate_alpha.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - diff --git a/proprietary/frameworks/base/tests/resources/res/anim/alpha.xml b/proprietary/frameworks/base/tests/resources/res/anim/alpha.xml deleted file mode 100755 index 8893d6606829ed2fa737e86e23d8da45ce2f4b61..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/anim/alpha.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - diff --git a/proprietary/frameworks/base/tests/resources/res/anim/anim_alpha.xml b/proprietary/frameworks/base/tests/resources/res/anim/anim_alpha.xml deleted file mode 100755 index b5794c31c926511b935d2504975b5b09b83cc530..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/anim/anim_alpha.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - diff --git a/proprietary/frameworks/base/tests/resources/res/anim/anim_gridlayout.xml b/proprietary/frameworks/base/tests/resources/res/anim/anim_gridlayout.xml deleted file mode 100755 index be42d76e474331c70a489e8541a43bf209647cdd..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/anim/anim_gridlayout.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - diff --git a/proprietary/frameworks/base/tests/resources/res/anim/anim_rotate.xml b/proprietary/frameworks/base/tests/resources/res/anim/anim_rotate.xml deleted file mode 100755 index 4fbadcff6130d3254556b91f13ec5ecf15d0d4be..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/anim/anim_rotate.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - diff --git a/proprietary/frameworks/base/tests/resources/res/anim/anim_scale.xml b/proprietary/frameworks/base/tests/resources/res/anim/anim_scale.xml deleted file mode 100755 index 96a3e28e13317d980e7bac1769b858c259135ef8..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/anim/anim_scale.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - diff --git a/proprietary/frameworks/base/tests/resources/res/anim/anim_set.xml b/proprietary/frameworks/base/tests/resources/res/anim/anim_set.xml deleted file mode 100755 index 7d139a8947b0a5988732b8edb057326ce0799abe..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/anim/anim_set.xml +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/proprietary/frameworks/base/tests/resources/res/anim/anim_translate.xml b/proprietary/frameworks/base/tests/resources/res/anim/anim_translate.xml deleted file mode 100755 index 6659c2bafff5ccefd910edafa7df95dddcfb3ec3..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/anim/anim_translate.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - diff --git a/proprietary/frameworks/base/tests/resources/res/anim/cycle_alpha.xml b/proprietary/frameworks/base/tests/resources/res/anim/cycle_alpha.xml deleted file mode 100755 index 0a3b53c8d88d88d45f65f535e22910607e7a65c1..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/anim/cycle_alpha.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - diff --git a/proprietary/frameworks/base/tests/resources/res/anim/cycle_interpolator.xml b/proprietary/frameworks/base/tests/resources/res/anim/cycle_interpolator.xml deleted file mode 100755 index d1586e5301ad636f7660a4d34652d32a369b3a6e..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/anim/cycle_interpolator.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - diff --git a/proprietary/frameworks/base/tests/resources/res/anim/decelerate_alpha.xml b/proprietary/frameworks/base/tests/resources/res/anim/decelerate_alpha.xml deleted file mode 100755 index 793807ee9831a1f629451c51c57d1273cc59ee00..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/anim/decelerate_alpha.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - diff --git a/proprietary/frameworks/base/tests/resources/res/anim/layout_anim_controller_animation.xml b/proprietary/frameworks/base/tests/resources/res/anim/layout_anim_controller_animation.xml deleted file mode 100755 index 1e3608c6fb1dc042e7a15a6dd2080eb091f70149..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/anim/layout_anim_controller_animation.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - diff --git a/proprietary/frameworks/base/tests/resources/res/anim/lineartest.xml b/proprietary/frameworks/base/tests/resources/res/anim/lineartest.xml deleted file mode 100755 index 7a4162889ef54ce2c850e58227d3e055336d4fe9..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/anim/lineartest.xml +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/proprietary/frameworks/base/tests/resources/res/anim/move_ani.xml b/proprietary/frameworks/base/tests/resources/res/anim/move_ani.xml deleted file mode 100755 index b691c0d226c98ec149d80996d3119b7fb8130af8..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/anim/move_ani.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - diff --git a/proprietary/frameworks/base/tests/resources/res/anim/move_cycle.xml b/proprietary/frameworks/base/tests/resources/res/anim/move_cycle.xml deleted file mode 100755 index 2e2233a3a7c1bd77b59a90398e6defbd41d7f862..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/anim/move_cycle.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - diff --git a/proprietary/frameworks/base/tests/resources/res/anim/movie_test.xml b/proprietary/frameworks/base/tests/resources/res/anim/movie_test.xml deleted file mode 100755 index dcebd16c065ea547ad0f5a54f8cc7a8826bac527..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/anim/movie_test.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - diff --git a/proprietary/frameworks/base/tests/resources/res/color/color1.xml b/proprietary/frameworks/base/tests/resources/res/color/color1.xml deleted file mode 100755 index 87034fa2aeb0574083807f0c668fb7b20aecd698..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/color/color1.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - diff --git a/proprietary/frameworks/base/tests/resources/res/drawable-nodpi/vector_icon_clip_path_1_golden.png b/proprietary/frameworks/base/tests/resources/res/drawable-nodpi/vector_icon_clip_path_1_golden.png deleted file mode 100755 index be487d1118f6e41ec6ad898f35401514b34ad128..0000000000000000000000000000000000000000 Binary files a/proprietary/frameworks/base/tests/resources/res/drawable-nodpi/vector_icon_clip_path_1_golden.png and /dev/null differ diff --git a/proprietary/frameworks/base/tests/resources/res/drawable-nodpi/vector_icon_create_golden.png b/proprietary/frameworks/base/tests/resources/res/drawable-nodpi/vector_icon_create_golden.png deleted file mode 100755 index 943fce5392c1f032b0858ba8e50fdb3f8a690cba..0000000000000000000000000000000000000000 Binary files a/proprietary/frameworks/base/tests/resources/res/drawable-nodpi/vector_icon_create_golden.png and /dev/null differ diff --git a/proprietary/frameworks/base/tests/resources/res/drawable-nodpi/vector_icon_delete_golden.png b/proprietary/frameworks/base/tests/resources/res/drawable-nodpi/vector_icon_delete_golden.png deleted file mode 100755 index b46363e3b9c55c5bcca42d6126aa8836e053fb29..0000000000000000000000000000000000000000 Binary files a/proprietary/frameworks/base/tests/resources/res/drawable-nodpi/vector_icon_delete_golden.png and /dev/null differ diff --git a/proprietary/frameworks/base/tests/resources/res/drawable-nodpi/vector_icon_heart_golden.png b/proprietary/frameworks/base/tests/resources/res/drawable-nodpi/vector_icon_heart_golden.png deleted file mode 100755 index 745075164d0cd4032236c415e06844e6f2d86523..0000000000000000000000000000000000000000 Binary files a/proprietary/frameworks/base/tests/resources/res/drawable-nodpi/vector_icon_heart_golden.png and /dev/null differ diff --git a/proprietary/frameworks/base/tests/resources/res/drawable-nodpi/vector_icon_random_path_1_golden.png b/proprietary/frameworks/base/tests/resources/res/drawable-nodpi/vector_icon_random_path_1_golden.png deleted file mode 100755 index 91776a969325ad369e873959c18716e2df097ae1..0000000000000000000000000000000000000000 Binary files a/proprietary/frameworks/base/tests/resources/res/drawable-nodpi/vector_icon_random_path_1_golden.png and /dev/null differ diff --git a/proprietary/frameworks/base/tests/resources/res/drawable-nodpi/vector_icon_random_path_2_golden.png b/proprietary/frameworks/base/tests/resources/res/drawable-nodpi/vector_icon_random_path_2_golden.png deleted file mode 100755 index 9af40a34f83a331345d5669981ed3c3bbdd147b0..0000000000000000000000000000000000000000 Binary files a/proprietary/frameworks/base/tests/resources/res/drawable-nodpi/vector_icon_random_path_2_golden.png and /dev/null differ diff --git a/proprietary/frameworks/base/tests/resources/res/drawable-nodpi/vector_icon_render_order_1_golden.png b/proprietary/frameworks/base/tests/resources/res/drawable-nodpi/vector_icon_render_order_1_golden.png deleted file mode 100755 index ea3be9436f64e00cee595909c81815e8d683778e..0000000000000000000000000000000000000000 Binary files a/proprietary/frameworks/base/tests/resources/res/drawable-nodpi/vector_icon_render_order_1_golden.png and /dev/null differ diff --git a/proprietary/frameworks/base/tests/resources/res/drawable-nodpi/vector_icon_render_order_2_golden.png b/proprietary/frameworks/base/tests/resources/res/drawable-nodpi/vector_icon_render_order_2_golden.png deleted file mode 100755 index f317901554a195b9736dd7802f583740830ba543..0000000000000000000000000000000000000000 Binary files a/proprietary/frameworks/base/tests/resources/res/drawable-nodpi/vector_icon_render_order_2_golden.png and /dev/null differ diff --git a/proprietary/frameworks/base/tests/resources/res/drawable-nodpi/vector_icon_repeated_a_1_golden.png b/proprietary/frameworks/base/tests/resources/res/drawable-nodpi/vector_icon_repeated_a_1_golden.png deleted file mode 100755 index b3acfe780f4473eda8692d2b786ea69ea7a26f1d..0000000000000000000000000000000000000000 Binary files a/proprietary/frameworks/base/tests/resources/res/drawable-nodpi/vector_icon_repeated_a_1_golden.png and /dev/null differ diff --git a/proprietary/frameworks/base/tests/resources/res/drawable-nodpi/vector_icon_repeated_a_2_golden.png b/proprietary/frameworks/base/tests/resources/res/drawable-nodpi/vector_icon_repeated_a_2_golden.png deleted file mode 100755 index bbc84b97b5768fdf0865084ec9c89d02c0eb820c..0000000000000000000000000000000000000000 Binary files a/proprietary/frameworks/base/tests/resources/res/drawable-nodpi/vector_icon_repeated_a_2_golden.png and /dev/null differ diff --git a/proprietary/frameworks/base/tests/resources/res/drawable-nodpi/vector_icon_repeated_cq_golden.png b/proprietary/frameworks/base/tests/resources/res/drawable-nodpi/vector_icon_repeated_cq_golden.png deleted file mode 100755 index 8d73cfdffc8aab19c60183cd0e7f751e663b119b..0000000000000000000000000000000000000000 Binary files a/proprietary/frameworks/base/tests/resources/res/drawable-nodpi/vector_icon_repeated_cq_golden.png and /dev/null differ diff --git a/proprietary/frameworks/base/tests/resources/res/drawable-nodpi/vector_icon_repeated_st_golden.png b/proprietary/frameworks/base/tests/resources/res/drawable-nodpi/vector_icon_repeated_st_golden.png deleted file mode 100755 index 6094a9a91438a910d1e318f8286b419c508ff980..0000000000000000000000000000000000000000 Binary files a/proprietary/frameworks/base/tests/resources/res/drawable-nodpi/vector_icon_repeated_st_golden.png and /dev/null differ diff --git a/proprietary/frameworks/base/tests/resources/res/drawable-nodpi/vector_icon_schedule_golden.png b/proprietary/frameworks/base/tests/resources/res/drawable-nodpi/vector_icon_schedule_golden.png deleted file mode 100755 index 9822bc2ca602bd5a48fd69a1840ac66d87012844..0000000000000000000000000000000000000000 Binary files a/proprietary/frameworks/base/tests/resources/res/drawable-nodpi/vector_icon_schedule_golden.png and /dev/null differ diff --git a/proprietary/frameworks/base/tests/resources/res/drawable-nodpi/vector_icon_settings_golden.png b/proprietary/frameworks/base/tests/resources/res/drawable-nodpi/vector_icon_settings_golden.png deleted file mode 100755 index d12b142ed20eaa1483a370943dd008edc672456b..0000000000000000000000000000000000000000 Binary files a/proprietary/frameworks/base/tests/resources/res/drawable-nodpi/vector_icon_settings_golden.png and /dev/null differ diff --git a/proprietary/frameworks/base/tests/resources/res/drawable-nodpi/vector_icon_stroke_1_golden.png b/proprietary/frameworks/base/tests/resources/res/drawable-nodpi/vector_icon_stroke_1_golden.png deleted file mode 100755 index c57ad20e0dcd0de78118ce529252f407ef0fd6ad..0000000000000000000000000000000000000000 Binary files a/proprietary/frameworks/base/tests/resources/res/drawable-nodpi/vector_icon_stroke_1_golden.png and /dev/null differ diff --git a/proprietary/frameworks/base/tests/resources/res/drawable-nodpi/vector_icon_stroke_2_golden.png b/proprietary/frameworks/base/tests/resources/res/drawable-nodpi/vector_icon_stroke_2_golden.png deleted file mode 100755 index aee8ff5ac30046f9f778670da975047b2f1030c0..0000000000000000000000000000000000000000 Binary files a/proprietary/frameworks/base/tests/resources/res/drawable-nodpi/vector_icon_stroke_2_golden.png and /dev/null differ diff --git a/proprietary/frameworks/base/tests/resources/res/drawable-nodpi/vector_icon_stroke_3_golden.png b/proprietary/frameworks/base/tests/resources/res/drawable-nodpi/vector_icon_stroke_3_golden.png deleted file mode 100755 index 1212fb3573bd87f1463c8e8e500a6af179a9e889..0000000000000000000000000000000000000000 Binary files a/proprietary/frameworks/base/tests/resources/res/drawable-nodpi/vector_icon_stroke_3_golden.png and /dev/null differ diff --git a/proprietary/frameworks/base/tests/resources/res/drawable-nodpi/vector_icon_transformation_1_golden.png b/proprietary/frameworks/base/tests/resources/res/drawable-nodpi/vector_icon_transformation_1_golden.png deleted file mode 100755 index baf418dbe3022c2f16e14cc857bf508ae081e22f..0000000000000000000000000000000000000000 Binary files a/proprietary/frameworks/base/tests/resources/res/drawable-nodpi/vector_icon_transformation_1_golden.png and /dev/null differ diff --git a/proprietary/frameworks/base/tests/resources/res/drawable-nodpi/vector_icon_transformation_2_golden.png b/proprietary/frameworks/base/tests/resources/res/drawable-nodpi/vector_icon_transformation_2_golden.png deleted file mode 100755 index e0e14f3a44c8007c4a41da92fc92ee97ebb1ecea..0000000000000000000000000000000000000000 Binary files a/proprietary/frameworks/base/tests/resources/res/drawable-nodpi/vector_icon_transformation_2_golden.png and /dev/null differ diff --git a/proprietary/frameworks/base/tests/resources/res/drawable-nodpi/vector_icon_transformation_3_golden.png b/proprietary/frameworks/base/tests/resources/res/drawable-nodpi/vector_icon_transformation_3_golden.png deleted file mode 100755 index b6798c2159961cf9056d502e0e2646fbb08356a8..0000000000000000000000000000000000000000 Binary files a/proprietary/frameworks/base/tests/resources/res/drawable-nodpi/vector_icon_transformation_3_golden.png and /dev/null differ diff --git a/proprietary/frameworks/base/tests/resources/res/drawable-nodpi/vector_icon_transformation_4_golden.png b/proprietary/frameworks/base/tests/resources/res/drawable-nodpi/vector_icon_transformation_4_golden.png deleted file mode 100755 index a5d4d33596955252b1ae29e83facb130fe0bb445..0000000000000000000000000000000000000000 Binary files a/proprietary/frameworks/base/tests/resources/res/drawable-nodpi/vector_icon_transformation_4_golden.png and /dev/null differ diff --git a/proprietary/frameworks/base/tests/resources/res/drawable-nodpi/vector_icon_transformation_5_golden.png b/proprietary/frameworks/base/tests/resources/res/drawable-nodpi/vector_icon_transformation_5_golden.png deleted file mode 100755 index 0d8ded1da4595463dac1fd7437e3efe2e8e298ed..0000000000000000000000000000000000000000 Binary files a/proprietary/frameworks/base/tests/resources/res/drawable-nodpi/vector_icon_transformation_5_golden.png and /dev/null differ diff --git a/proprietary/frameworks/base/tests/resources/res/drawable-nodpi/vector_icon_transformation_6_golden.png b/proprietary/frameworks/base/tests/resources/res/drawable-nodpi/vector_icon_transformation_6_golden.png deleted file mode 100755 index 64d07fada5606546ea46d468a264c0f57e3635e7..0000000000000000000000000000000000000000 Binary files a/proprietary/frameworks/base/tests/resources/res/drawable-nodpi/vector_icon_transformation_6_golden.png and /dev/null differ diff --git a/proprietary/frameworks/base/tests/resources/res/drawable/alpha.png b/proprietary/frameworks/base/tests/resources/res/drawable/alpha.png deleted file mode 100755 index 8a88548739d1249f1fb960773da9ca414c495235..0000000000000000000000000000000000000000 Binary files a/proprietary/frameworks/base/tests/resources/res/drawable/alpha.png and /dev/null differ diff --git a/proprietary/frameworks/base/tests/resources/res/drawable/animated.gif b/proprietary/frameworks/base/tests/resources/res/drawable/animated.gif deleted file mode 100755 index 51baf1586394be7feae3bd475fb31e96f47c0f86..0000000000000000000000000000000000000000 Binary files a/proprietary/frameworks/base/tests/resources/res/drawable/animated.gif and /dev/null differ diff --git a/proprietary/frameworks/base/tests/resources/res/drawable/animationdrawable.xml b/proprietary/frameworks/base/tests/resources/res/drawable/animationdrawable.xml deleted file mode 100755 index 67569661b187f4b241ff459d97a5cbee00a9f9bb..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/drawable/animationdrawable.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - diff --git a/proprietary/frameworks/base/tests/resources/res/drawable/baseline_jpeg.jpg b/proprietary/frameworks/base/tests/resources/res/drawable/baseline_jpeg.jpg deleted file mode 100755 index ed5251c846b9832d4984aa575d9ee8369e6f6681..0000000000000000000000000000000000000000 Binary files a/proprietary/frameworks/base/tests/resources/res/drawable/baseline_jpeg.jpg and /dev/null differ diff --git a/proprietary/frameworks/base/tests/resources/res/drawable/baseline_restart_jpeg.jpg b/proprietary/frameworks/base/tests/resources/res/drawable/baseline_restart_jpeg.jpg deleted file mode 100755 index 00dcc5b2eae25bc6bc830a464c497dad296f9e78..0000000000000000000000000000000000000000 Binary files a/proprietary/frameworks/base/tests/resources/res/drawable/baseline_restart_jpeg.jpg and /dev/null differ diff --git a/proprietary/frameworks/base/tests/resources/res/drawable/bitmapdrawable_theme.xml b/proprietary/frameworks/base/tests/resources/res/drawable/bitmapdrawable_theme.xml deleted file mode 100755 index 6df36b36408e66dd82f3aa2305de51f8260a3fc5..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/drawable/bitmapdrawable_theme.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - diff --git a/proprietary/frameworks/base/tests/resources/res/drawable/bmp_test.bmp b/proprietary/frameworks/base/tests/resources/res/drawable/bmp_test.bmp deleted file mode 100755 index 5ec6dd4d93bc0dfda5810fdc9ed43fba2beb4559..0000000000000000000000000000000000000000 Binary files a/proprietary/frameworks/base/tests/resources/res/drawable/bmp_test.bmp and /dev/null differ diff --git a/proprietary/frameworks/base/tests/resources/res/drawable/colordrawable_test.xml b/proprietary/frameworks/base/tests/resources/res/drawable/colordrawable_test.xml deleted file mode 100755 index 9d2f390e6bf638744b2db72dca4e0d1aae791234..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/drawable/colordrawable_test.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - diff --git a/proprietary/frameworks/base/tests/resources/res/drawable/colordrawable_theme.xml b/proprietary/frameworks/base/tests/resources/res/drawable/colordrawable_theme.xml deleted file mode 100755 index 00c6fe712061d31e65a0663e1ea13b5b5728e1c1..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/drawable/colordrawable_theme.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - diff --git a/proprietary/frameworks/base/tests/resources/res/drawable/colorstatelist_test.xml b/proprietary/frameworks/base/tests/resources/res/drawable/colorstatelist_test.xml deleted file mode 100755 index c86a1a78df2b0876a9e2c26229370622fd3fe4c6..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/drawable/colorstatelist_test.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - diff --git a/proprietary/frameworks/base/tests/resources/res/drawable/faces.jpg b/proprietary/frameworks/base/tests/resources/res/drawable/faces.jpg deleted file mode 100755 index 0672022bc4afa6e44ff83169d7d61a4dc3c5b960..0000000000000000000000000000000000000000 Binary files a/proprietary/frameworks/base/tests/resources/res/drawable/faces.jpg and /dev/null differ diff --git a/proprietary/frameworks/base/tests/resources/res/drawable/failed.jpg b/proprietary/frameworks/base/tests/resources/res/drawable/failed.jpg deleted file mode 100755 index 1bb9b5280f87d7350d43a24d5b8d7d0b89a8c908..0000000000000000000000000000000000000000 Binary files a/proprietary/frameworks/base/tests/resources/res/drawable/failed.jpg and /dev/null differ diff --git a/proprietary/frameworks/base/tests/resources/res/drawable/gif_test.gif b/proprietary/frameworks/base/tests/resources/res/drawable/gif_test.gif deleted file mode 100755 index d1c2815db8cf0b985684fc72b2c292a52c0ebf68..0000000000000000000000000000000000000000 Binary files a/proprietary/frameworks/base/tests/resources/res/drawable/gif_test.gif and /dev/null differ diff --git a/proprietary/frameworks/base/tests/resources/res/drawable/google_logo_1.png b/proprietary/frameworks/base/tests/resources/res/drawable/google_logo_1.png deleted file mode 100755 index 6e038fc818c0d39a047e8cea2c043f5bb61dc5b3..0000000000000000000000000000000000000000 Binary files a/proprietary/frameworks/base/tests/resources/res/drawable/google_logo_1.png and /dev/null differ diff --git a/proprietary/frameworks/base/tests/resources/res/drawable/google_logo_2.webp b/proprietary/frameworks/base/tests/resources/res/drawable/google_logo_2.webp deleted file mode 100755 index f92c42bfbe2d291debead206675c1108bb0dac26..0000000000000000000000000000000000000000 Binary files a/proprietary/frameworks/base/tests/resources/res/drawable/google_logo_2.webp and /dev/null differ diff --git a/proprietary/frameworks/base/tests/resources/res/drawable/gradientdrawable.xml b/proprietary/frameworks/base/tests/resources/res/drawable/gradientdrawable.xml deleted file mode 100755 index ed8ff961a48b047bc68649963c5a9b602c46df15..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/drawable/gradientdrawable.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - diff --git a/proprietary/frameworks/base/tests/resources/res/drawable/gradientdrawable_radius_base.xml b/proprietary/frameworks/base/tests/resources/res/drawable/gradientdrawable_radius_base.xml deleted file mode 100755 index ecd50f8dae1930c866883a532956ec3eff7c44f2..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/drawable/gradientdrawable_radius_base.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/proprietary/frameworks/base/tests/resources/res/drawable/gradientdrawable_radius_parent.xml b/proprietary/frameworks/base/tests/resources/res/drawable/gradientdrawable_radius_parent.xml deleted file mode 100755 index 73d116a8cf8da88b52a966cc4a1dbfaa432a044b..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/drawable/gradientdrawable_radius_parent.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/proprietary/frameworks/base/tests/resources/res/drawable/gradientdrawable_theme.xml b/proprietary/frameworks/base/tests/resources/res/drawable/gradientdrawable_theme.xml deleted file mode 100755 index 68cec626a4f6829018267ba9aae1a54ca609d0c6..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/drawable/gradientdrawable_theme.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/proprietary/frameworks/base/tests/resources/res/drawable/ic_cts_minitab_selected.png b/proprietary/frameworks/base/tests/resources/res/drawable/ic_cts_minitab_selected.png deleted file mode 100755 index c730050f1dfe4fa2d28d3c73dc2e04955fcf9e96..0000000000000000000000000000000000000000 Binary files a/proprietary/frameworks/base/tests/resources/res/drawable/ic_cts_minitab_selected.png and /dev/null differ diff --git a/proprietary/frameworks/base/tests/resources/res/drawable/ic_cts_selected.png b/proprietary/frameworks/base/tests/resources/res/drawable/ic_cts_selected.png deleted file mode 100755 index 72a065cb85f1f927a9893e0b468e235245688f89..0000000000000000000000000000000000000000 Binary files a/proprietary/frameworks/base/tests/resources/res/drawable/ic_cts_selected.png and /dev/null differ diff --git a/proprietary/frameworks/base/tests/resources/res/drawable/icon_black.jpg b/proprietary/frameworks/base/tests/resources/res/drawable/icon_black.jpg deleted file mode 100755 index 4c9062a6da91a533488f894e04f20a2e99376152..0000000000000000000000000000000000000000 Binary files a/proprietary/frameworks/base/tests/resources/res/drawable/icon_black.jpg and /dev/null differ diff --git a/proprietary/frameworks/base/tests/resources/res/drawable/icon_blue.jpg b/proprietary/frameworks/base/tests/resources/res/drawable/icon_blue.jpg deleted file mode 100755 index 9e6c1c86b1f544da8568e2918b008f4dcc35ba73..0000000000000000000000000000000000000000 Binary files a/proprietary/frameworks/base/tests/resources/res/drawable/icon_blue.jpg and /dev/null differ diff --git a/proprietary/frameworks/base/tests/resources/res/drawable/icon_green.jpg b/proprietary/frameworks/base/tests/resources/res/drawable/icon_green.jpg deleted file mode 100755 index 55a78f208295c8636282f47ae7fd17fbe4ce7af4..0000000000000000000000000000000000000000 Binary files a/proprietary/frameworks/base/tests/resources/res/drawable/icon_green.jpg and /dev/null differ diff --git a/proprietary/frameworks/base/tests/resources/res/drawable/icon_red.jpg b/proprietary/frameworks/base/tests/resources/res/drawable/icon_red.jpg deleted file mode 100755 index 6bc9e1ff608ba23d17cdcad9f39576b408cf6dc6..0000000000000000000000000000000000000000 Binary files a/proprietary/frameworks/base/tests/resources/res/drawable/icon_red.jpg and /dev/null differ diff --git a/proprietary/frameworks/base/tests/resources/res/drawable/icon_yellow.jpg b/proprietary/frameworks/base/tests/resources/res/drawable/icon_yellow.jpg deleted file mode 100755 index e74805906008dae8048faa82b439578e57bd75d4..0000000000000000000000000000000000000000 Binary files a/proprietary/frameworks/base/tests/resources/res/drawable/icon_yellow.jpg and /dev/null differ diff --git a/proprietary/frameworks/base/tests/resources/res/drawable/insetdrawable.xml b/proprietary/frameworks/base/tests/resources/res/drawable/insetdrawable.xml deleted file mode 100755 index 8431c69a65a2e2a007f71933c4ab729d42dcf407..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/drawable/insetdrawable.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - diff --git a/proprietary/frameworks/base/tests/resources/res/drawable/layerdrawable.xml b/proprietary/frameworks/base/tests/resources/res/drawable/layerdrawable.xml deleted file mode 100755 index 521703b32caa2342b52a9d9240cbf3bb2f32a0ee..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/drawable/layerdrawable.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - diff --git a/proprietary/frameworks/base/tests/resources/res/drawable/layerdrawable_theme.xml b/proprietary/frameworks/base/tests/resources/res/drawable/layerdrawable_theme.xml deleted file mode 100755 index 2a678ff9105ce5d13ef7d21f5c3699f893db7e90..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/drawable/layerdrawable_theme.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/proprietary/frameworks/base/tests/resources/res/drawable/levellistdrawable.xml b/proprietary/frameworks/base/tests/resources/res/drawable/levellistdrawable.xml deleted file mode 100755 index 8fa93e89046dec16cd9b99909bbb4e37db3bda8e..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/drawable/levellistdrawable.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - diff --git a/proprietary/frameworks/base/tests/resources/res/drawable/ninepatch_0.9.png b/proprietary/frameworks/base/tests/resources/res/drawable/ninepatch_0.9.png deleted file mode 100755 index 24019d8fda78d106d1a1607d32a6a965adc1a792..0000000000000000000000000000000000000000 Binary files a/proprietary/frameworks/base/tests/resources/res/drawable/ninepatch_0.9.png and /dev/null differ diff --git a/proprietary/frameworks/base/tests/resources/res/drawable/ninepatch_1.9.png b/proprietary/frameworks/base/tests/resources/res/drawable/ninepatch_1.9.png deleted file mode 100755 index c56b1dbb14f2962d7c6257f1f5fb1efaa26bfd62..0000000000000000000000000000000000000000 Binary files a/proprietary/frameworks/base/tests/resources/res/drawable/ninepatch_1.9.png and /dev/null differ diff --git a/proprietary/frameworks/base/tests/resources/res/drawable/ninepatchdrawable.xml b/proprietary/frameworks/base/tests/resources/res/drawable/ninepatchdrawable.xml deleted file mode 100755 index 6e72457ade08ddac76abcfe24686f6e814e300d5..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/drawable/ninepatchdrawable.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - diff --git a/proprietary/frameworks/base/tests/resources/res/drawable/ninepatchdrawable_theme.xml b/proprietary/frameworks/base/tests/resources/res/drawable/ninepatchdrawable_theme.xml deleted file mode 100755 index bb031a52c373c4817f3ecce0d6e0f852c3e741d5..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/drawable/ninepatchdrawable_theme.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - diff --git a/proprietary/frameworks/base/tests/resources/res/drawable/no_padding.png b/proprietary/frameworks/base/tests/resources/res/drawable/no_padding.png deleted file mode 100755 index 7d4c27cb4d583c54c562cce4e978c067fe9d37f6..0000000000000000000000000000000000000000 Binary files a/proprietary/frameworks/base/tests/resources/res/drawable/no_padding.png and /dev/null differ diff --git a/proprietary/frameworks/base/tests/resources/res/drawable/opaque.9.png b/proprietary/frameworks/base/tests/resources/res/drawable/opaque.9.png deleted file mode 100755 index a60f6d84a475464cf9efd41a63188aa2294b9fd2..0000000000000000000000000000000000000000 Binary files a/proprietary/frameworks/base/tests/resources/res/drawable/opaque.9.png and /dev/null differ diff --git a/proprietary/frameworks/base/tests/resources/res/drawable/padding_0.9.png b/proprietary/frameworks/base/tests/resources/res/drawable/padding_0.9.png deleted file mode 100755 index 0127bf4d0ccb1a55a162170c8346892edff27cc2..0000000000000000000000000000000000000000 Binary files a/proprietary/frameworks/base/tests/resources/res/drawable/padding_0.9.png and /dev/null differ diff --git a/proprietary/frameworks/base/tests/resources/res/drawable/paintdrawable_attr.xml b/proprietary/frameworks/base/tests/resources/res/drawable/paintdrawable_attr.xml deleted file mode 100755 index 444e5e2f9c3190ee8819e0893e4b5d3ca8b0a294..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/drawable/paintdrawable_attr.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - diff --git a/proprietary/frameworks/base/tests/resources/res/drawable/pass.jpg b/proprietary/frameworks/base/tests/resources/res/drawable/pass.jpg deleted file mode 100755 index 2f4b083c1890957c3e36a17225201c43eada7e49..0000000000000000000000000000000000000000 Binary files a/proprietary/frameworks/base/tests/resources/res/drawable/pass.jpg and /dev/null differ diff --git a/proprietary/frameworks/base/tests/resources/res/drawable/png_test.png b/proprietary/frameworks/base/tests/resources/res/drawable/png_test.png deleted file mode 100755 index 523005168f726942e59f502a9d2d3c1da86c16a8..0000000000000000000000000000000000000000 Binary files a/proprietary/frameworks/base/tests/resources/res/drawable/png_test.png and /dev/null differ diff --git a/proprietary/frameworks/base/tests/resources/res/drawable/premul_data.png b/proprietary/frameworks/base/tests/resources/res/drawable/premul_data.png deleted file mode 100755 index 92d7e376db271ea79e2f562f9ff8b428ebdb741d..0000000000000000000000000000000000000000 Binary files a/proprietary/frameworks/base/tests/resources/res/drawable/premul_data.png and /dev/null differ diff --git a/proprietary/frameworks/base/tests/resources/res/drawable/progressive_jpeg.jpg b/proprietary/frameworks/base/tests/resources/res/drawable/progressive_jpeg.jpg deleted file mode 100755 index 6b58be435ae5a0cf2473e24c6d01aee7639497f2..0000000000000000000000000000000000000000 Binary files a/proprietary/frameworks/base/tests/resources/res/drawable/progressive_jpeg.jpg and /dev/null differ diff --git a/proprietary/frameworks/base/tests/resources/res/drawable/progressive_restart_jpeg.jpg b/proprietary/frameworks/base/tests/resources/res/drawable/progressive_restart_jpeg.jpg deleted file mode 100755 index 352c7a82cbbeb222722cb782ac6c6a62eb9a44f1..0000000000000000000000000000000000000000 Binary files a/proprietary/frameworks/base/tests/resources/res/drawable/progressive_restart_jpeg.jpg and /dev/null differ diff --git a/proprietary/frameworks/base/tests/resources/res/drawable/rippledrawable_theme.xml b/proprietary/frameworks/base/tests/resources/res/drawable/rippledrawable_theme.xml deleted file mode 100755 index a49b82029132304c09401e482f791351f474f520..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/drawable/rippledrawable_theme.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - diff --git a/proprietary/frameworks/base/tests/resources/res/drawable/robot.png b/proprietary/frameworks/base/tests/resources/res/drawable/robot.png deleted file mode 100755 index 8a9e6984be96ea93dcb63ae1973e530bdfb1eda0..0000000000000000000000000000000000000000 Binary files a/proprietary/frameworks/base/tests/resources/res/drawable/robot.png and /dev/null differ diff --git a/proprietary/frameworks/base/tests/resources/res/drawable/rotatedrawable.xml b/proprietary/frameworks/base/tests/resources/res/drawable/rotatedrawable.xml deleted file mode 100755 index b9b2cfe38c155d836d9aa3b06d14e4e8f97954d0..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/drawable/rotatedrawable.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - diff --git a/proprietary/frameworks/base/tests/resources/res/drawable/scaled1.png b/proprietary/frameworks/base/tests/resources/res/drawable/scaled1.png deleted file mode 100755 index 2dad42162456605cb23d57e868a8275bf564157a..0000000000000000000000000000000000000000 Binary files a/proprietary/frameworks/base/tests/resources/res/drawable/scaled1.png and /dev/null differ diff --git a/proprietary/frameworks/base/tests/resources/res/drawable/scaled2.png b/proprietary/frameworks/base/tests/resources/res/drawable/scaled2.png deleted file mode 100755 index 6d6a94f206c72ff97538c6c5a8255b208670f481..0000000000000000000000000000000000000000 Binary files a/proprietary/frameworks/base/tests/resources/res/drawable/scaled2.png and /dev/null differ diff --git a/proprietary/frameworks/base/tests/resources/res/drawable/scaledrawable.xml b/proprietary/frameworks/base/tests/resources/res/drawable/scaledrawable.xml deleted file mode 100755 index 7e65dce18ebbf1b13a38ae5a29eb57ebac55bca5..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/drawable/scaledrawable.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - diff --git a/proprietary/frameworks/base/tests/resources/res/drawable/scenery.jpg b/proprietary/frameworks/base/tests/resources/res/drawable/scenery.jpg deleted file mode 100755 index 7a6145b39348dcdf5481ee58d8640f450742a9c9..0000000000000000000000000000000000000000 Binary files a/proprietary/frameworks/base/tests/resources/res/drawable/scenery.jpg and /dev/null differ diff --git a/proprietary/frameworks/base/tests/resources/res/drawable/shapedrawable_test.xml b/proprietary/frameworks/base/tests/resources/res/drawable/shapedrawable_test.xml deleted file mode 100755 index 02da9f8428f59e2a185bca778b4f0b20d6b62cc3..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/drawable/shapedrawable_test.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - diff --git a/proprietary/frameworks/base/tests/resources/res/drawable/size_48x48.jpg b/proprietary/frameworks/base/tests/resources/res/drawable/size_48x48.jpg deleted file mode 100755 index 5c2291e3e580c9b6bfbafccd6f75ea472ecf6141..0000000000000000000000000000000000000000 Binary files a/proprietary/frameworks/base/tests/resources/res/drawable/size_48x48.jpg and /dev/null differ diff --git a/proprietary/frameworks/base/tests/resources/res/drawable/start.jpg b/proprietary/frameworks/base/tests/resources/res/drawable/start.jpg deleted file mode 100755 index 54e05e0d4b238bf9a5a1f4a54161b3331f8c0554..0000000000000000000000000000000000000000 Binary files a/proprietary/frameworks/base/tests/resources/res/drawable/start.jpg and /dev/null differ diff --git a/proprietary/frameworks/base/tests/resources/res/drawable/statelist_testimage.jpg b/proprietary/frameworks/base/tests/resources/res/drawable/statelist_testimage.jpg deleted file mode 100755 index 754df0ce5502e79ac8a7c114901b4dcfe7aa9104..0000000000000000000000000000000000000000 Binary files a/proprietary/frameworks/base/tests/resources/res/drawable/statelist_testimage.jpg and /dev/null differ diff --git a/proprietary/frameworks/base/tests/resources/res/drawable/statelistdrawable.xml b/proprietary/frameworks/base/tests/resources/res/drawable/statelistdrawable.xml deleted file mode 100755 index b867904590726e79230aa6e7a93265e83231626e..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/drawable/statelistdrawable.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - diff --git a/proprietary/frameworks/base/tests/resources/res/drawable/testcolor.xml b/proprietary/frameworks/base/tests/resources/res/drawable/testcolor.xml deleted file mode 100755 index d7b2718f6c9e931b9d8eb57f6591bca818a33225..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/drawable/testcolor.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - diff --git a/proprietary/frameworks/base/tests/resources/res/drawable/testimage.jpg b/proprietary/frameworks/base/tests/resources/res/drawable/testimage.jpg deleted file mode 100755 index 754df0ce5502e79ac8a7c114901b4dcfe7aa9104..0000000000000000000000000000000000000000 Binary files a/proprietary/frameworks/base/tests/resources/res/drawable/testimage.jpg and /dev/null differ diff --git a/proprietary/frameworks/base/tests/resources/res/drawable/transition_test.xml b/proprietary/frameworks/base/tests/resources/res/drawable/transition_test.xml deleted file mode 100755 index 3d62378f04b2ccbefbcd523c55aecd3d4f0772db..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/drawable/transition_test.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - diff --git a/proprietary/frameworks/base/tests/resources/res/drawable/transparent_border.9.png b/proprietary/frameworks/base/tests/resources/res/drawable/transparent_border.9.png deleted file mode 100755 index 2614c06be5aa71f2a1d14e5e7ecc92dd4b62f27d..0000000000000000000000000000000000000000 Binary files a/proprietary/frameworks/base/tests/resources/res/drawable/transparent_border.9.png and /dev/null differ diff --git a/proprietary/frameworks/base/tests/resources/res/drawable/transparent_right.9.png b/proprietary/frameworks/base/tests/resources/res/drawable/transparent_right.9.png deleted file mode 100755 index a438312a48f4c7eeaa5ec4635f53c1758907e614..0000000000000000000000000000000000000000 Binary files a/proprietary/frameworks/base/tests/resources/res/drawable/transparent_right.9.png and /dev/null differ diff --git a/proprietary/frameworks/base/tests/resources/res/drawable/typeface_test.png b/proprietary/frameworks/base/tests/resources/res/drawable/typeface_test.png deleted file mode 100755 index c337f5f6ac0d6d03f22ce4a68edda6a8039cf447..0000000000000000000000000000000000000000 Binary files a/proprietary/frameworks/base/tests/resources/res/drawable/typeface_test.png and /dev/null differ diff --git a/proprietary/frameworks/base/tests/resources/res/drawable/vector_icon_clip_path_1.xml b/proprietary/frameworks/base/tests/resources/res/drawable/vector_icon_clip_path_1.xml deleted file mode 100755 index c2ab429c57224ba7e4c9331e4d98b69535a95c1c..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/drawable/vector_icon_clip_path_1.xml +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/proprietary/frameworks/base/tests/resources/res/drawable/vector_icon_create.xml b/proprietary/frameworks/base/tests/resources/res/drawable/vector_icon_create.xml deleted file mode 100755 index 7db4ad5271742e77d126200b8275bb72a89bd20a..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/drawable/vector_icon_create.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/proprietary/frameworks/base/tests/resources/res/drawable/vector_icon_delete.xml b/proprietary/frameworks/base/tests/resources/res/drawable/vector_icon_delete.xml deleted file mode 100755 index 8d9c21cf074d530f8d8406e1af721071d407601d..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/drawable/vector_icon_delete.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/proprietary/frameworks/base/tests/resources/res/drawable/vector_icon_heart.xml b/proprietary/frameworks/base/tests/resources/res/drawable/vector_icon_heart.xml deleted file mode 100755 index ff55fe5f51c0e2e2fcf8ef3a3832be0b860ac77f..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/drawable/vector_icon_heart.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/proprietary/frameworks/base/tests/resources/res/drawable/vector_icon_random_path_1.xml b/proprietary/frameworks/base/tests/resources/res/drawable/vector_icon_random_path_1.xml deleted file mode 100755 index 5c55294a165c346314383a84d64c039f0b6a0d97..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/drawable/vector_icon_random_path_1.xml +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/proprietary/frameworks/base/tests/resources/res/drawable/vector_icon_random_path_2.xml b/proprietary/frameworks/base/tests/resources/res/drawable/vector_icon_random_path_2.xml deleted file mode 100755 index 95e0a546c3579e4cab12b6cf28003ca409802f31..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/drawable/vector_icon_random_path_2.xml +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/proprietary/frameworks/base/tests/resources/res/drawable/vector_icon_render_order_1.xml b/proprietary/frameworks/base/tests/resources/res/drawable/vector_icon_render_order_1.xml deleted file mode 100755 index 8639096dfa6ff34220c064bb744e44511d37d4ed..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/drawable/vector_icon_render_order_1.xml +++ /dev/null @@ -1,89 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/proprietary/frameworks/base/tests/resources/res/drawable/vector_icon_render_order_2.xml b/proprietary/frameworks/base/tests/resources/res/drawable/vector_icon_render_order_2.xml deleted file mode 100755 index 069a53154495bc5286fafb92bdcfc03b38fb6fe4..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/drawable/vector_icon_render_order_2.xml +++ /dev/null @@ -1,89 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/proprietary/frameworks/base/tests/resources/res/drawable/vector_icon_repeated_a_1.xml b/proprietary/frameworks/base/tests/resources/res/drawable/vector_icon_repeated_a_1.xml deleted file mode 100755 index e27464b7a572e03db7e64659bb00bf6923424f64..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/drawable/vector_icon_repeated_a_1.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/proprietary/frameworks/base/tests/resources/res/drawable/vector_icon_repeated_a_2.xml b/proprietary/frameworks/base/tests/resources/res/drawable/vector_icon_repeated_a_2.xml deleted file mode 100755 index 924ba1bf8bc2c07bd5aacdc10caeafedf4da270a..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/drawable/vector_icon_repeated_a_2.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/proprietary/frameworks/base/tests/resources/res/drawable/vector_icon_repeated_cq.xml b/proprietary/frameworks/base/tests/resources/res/drawable/vector_icon_repeated_cq.xml deleted file mode 100755 index e0848f0c1c229a12dae4064d1596e1430d3ed5fe..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/drawable/vector_icon_repeated_cq.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/proprietary/frameworks/base/tests/resources/res/drawable/vector_icon_repeated_st.xml b/proprietary/frameworks/base/tests/resources/res/drawable/vector_icon_repeated_st.xml deleted file mode 100755 index b104349a9beb24246a63e466e1795a2792723a2f..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/drawable/vector_icon_repeated_st.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/proprietary/frameworks/base/tests/resources/res/drawable/vector_icon_schedule.xml b/proprietary/frameworks/base/tests/resources/res/drawable/vector_icon_schedule.xml deleted file mode 100755 index 64d19e872634419948681c1d5d944ba53ec12fc1..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/drawable/vector_icon_schedule.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/proprietary/frameworks/base/tests/resources/res/drawable/vector_icon_settings.xml b/proprietary/frameworks/base/tests/resources/res/drawable/vector_icon_settings.xml deleted file mode 100755 index 13d7f055c55dcad7d5e5546580e16166ebe1021a..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/drawable/vector_icon_settings.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/proprietary/frameworks/base/tests/resources/res/drawable/vector_icon_stroke_1.xml b/proprietary/frameworks/base/tests/resources/res/drawable/vector_icon_stroke_1.xml deleted file mode 100755 index af351f1dd1730ff41247daafd2217978d74e11ca..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/drawable/vector_icon_stroke_1.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/proprietary/frameworks/base/tests/resources/res/drawable/vector_icon_stroke_2.xml b/proprietary/frameworks/base/tests/resources/res/drawable/vector_icon_stroke_2.xml deleted file mode 100755 index f85d5fc18fc4deedf50c96ae0118ae5571fb72dd..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/drawable/vector_icon_stroke_2.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/proprietary/frameworks/base/tests/resources/res/drawable/vector_icon_stroke_3.xml b/proprietary/frameworks/base/tests/resources/res/drawable/vector_icon_stroke_3.xml deleted file mode 100755 index 8f3d47ece13a67bd3c97be72474b31998648b975..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/drawable/vector_icon_stroke_3.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/proprietary/frameworks/base/tests/resources/res/drawable/vector_icon_transformation_1.xml b/proprietary/frameworks/base/tests/resources/res/drawable/vector_icon_transformation_1.xml deleted file mode 100755 index f6623d01df880ba34d412d8bbc7f709cd54e03ec..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/drawable/vector_icon_transformation_1.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - diff --git a/proprietary/frameworks/base/tests/resources/res/drawable/vector_icon_transformation_2.xml b/proprietary/frameworks/base/tests/resources/res/drawable/vector_icon_transformation_2.xml deleted file mode 100755 index 87da0bbee3b1cc2dad6f06d964294ce6f428e711..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/drawable/vector_icon_transformation_2.xml +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/proprietary/frameworks/base/tests/resources/res/drawable/vector_icon_transformation_3.xml b/proprietary/frameworks/base/tests/resources/res/drawable/vector_icon_transformation_3.xml deleted file mode 100755 index fc30af3e9910262eae8a70e8b2b8df3df4257203..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/drawable/vector_icon_transformation_3.xml +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/proprietary/frameworks/base/tests/resources/res/drawable/vector_icon_transformation_4.xml b/proprietary/frameworks/base/tests/resources/res/drawable/vector_icon_transformation_4.xml deleted file mode 100755 index 5b40d0d070133e2404bb0f7ed92a2512c021366e..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/drawable/vector_icon_transformation_4.xml +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/proprietary/frameworks/base/tests/resources/res/drawable/vector_icon_transformation_5.xml b/proprietary/frameworks/base/tests/resources/res/drawable/vector_icon_transformation_5.xml deleted file mode 100755 index 4a27754d18ee612fee154aaa58f1f91e025b0da7..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/drawable/vector_icon_transformation_5.xml +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/proprietary/frameworks/base/tests/resources/res/drawable/vector_icon_transformation_6.xml b/proprietary/frameworks/base/tests/resources/res/drawable/vector_icon_transformation_6.xml deleted file mode 100755 index 5e60c4aeec0e3045974adf374cfae1b0bb61165c..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/drawable/vector_icon_transformation_6.xml +++ /dev/null @@ -1,86 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/proprietary/frameworks/base/tests/resources/res/drawable/webp_test.webp b/proprietary/frameworks/base/tests/resources/res/drawable/webp_test.webp deleted file mode 100755 index 7b1009f0d90efb043899882011447c304332dc71..0000000000000000000000000000000000000000 Binary files a/proprietary/frameworks/base/tests/resources/res/drawable/webp_test.webp and /dev/null differ diff --git a/proprietary/frameworks/base/tests/resources/res/drawable/window_test_drawable.xml b/proprietary/frameworks/base/tests/resources/res/drawable/window_test_drawable.xml deleted file mode 100755 index 4281cd81fad3ac00114806d80573027c21efad3a..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/drawable/window_test_drawable.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - diff --git a/proprietary/frameworks/base/tests/resources/res/layout-land/mediaplayer.xml b/proprietary/frameworks/base/tests/resources/res/layout-land/mediaplayer.xml deleted file mode 100755 index 5dafdb9c9624403f416e5d5b79a48e71af639524..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/layout-land/mediaplayer.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - - - - - - diff --git a/proprietary/frameworks/base/tests/resources/res/layout/abslistview_layout.xml b/proprietary/frameworks/base/tests/resources/res/layout/abslistview_layout.xml deleted file mode 100755 index a090ce34c82768561fff64d8c5f8270e9ae0179e..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/layout/abslistview_layout.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - - - - - - diff --git a/proprietary/frameworks/base/tests/resources/res/layout/absolute_layout.xml b/proprietary/frameworks/base/tests/resources/res/layout/absolute_layout.xml deleted file mode 100755 index 6cec61bb270dd416a669b17981c5f55a7f70f440..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/layout/absolute_layout.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - - diff --git a/proprietary/frameworks/base/tests/resources/res/layout/adapterview_layout.xml b/proprietary/frameworks/base/tests/resources/res/layout/adapterview_layout.xml deleted file mode 100755 index e118500e4a111e38671041e8405bc2fb3db3ec3c..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/layout/adapterview_layout.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - diff --git a/proprietary/frameworks/base/tests/resources/res/layout/alert_dialog_text_entry.xml b/proprietary/frameworks/base/tests/resources/res/layout/alert_dialog_text_entry.xml deleted file mode 100755 index 8b87a5d5e5b9e067b6e31f77a271d508a1155f18..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/layout/alert_dialog_text_entry.xml +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - - - - - - - - - diff --git a/proprietary/frameworks/base/tests/resources/res/layout/alert_dialog_text_entry_2.xml b/proprietary/frameworks/base/tests/resources/res/layout/alert_dialog_text_entry_2.xml deleted file mode 100755 index 848b3424aae2337981668f26762efd11de982f95..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/layout/alert_dialog_text_entry_2.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - diff --git a/proprietary/frameworks/base/tests/resources/res/layout/alertdialog_custom_title.xml b/proprietary/frameworks/base/tests/resources/res/layout/alertdialog_custom_title.xml deleted file mode 100755 index ff36f2a91674101f72bdc2c20c7c8be11f75e026..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/layout/alertdialog_custom_title.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - diff --git a/proprietary/frameworks/base/tests/resources/res/layout/alertdialog_custom_title2.xml b/proprietary/frameworks/base/tests/resources/res/layout/alertdialog_custom_title2.xml deleted file mode 100755 index 51c154d60c509b5e70b6ff0e0b1ba3d9bdcd124c..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/layout/alertdialog_custom_title2.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - diff --git a/proprietary/frameworks/base/tests/resources/res/layout/analogclock.xml b/proprietary/frameworks/base/tests/resources/res/layout/analogclock.xml deleted file mode 100755 index 7d862c35611e9a68086cc41162ca563d0710e81a..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/layout/analogclock.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - diff --git a/proprietary/frameworks/base/tests/resources/res/layout/anim_layout.xml b/proprietary/frameworks/base/tests/resources/res/layout/anim_layout.xml deleted file mode 100755 index b6aa9066f1404628fe7005d40dbf5265cbe86fbb..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/layout/anim_layout.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - diff --git a/proprietary/frameworks/base/tests/resources/res/layout/animation_layout.xml b/proprietary/frameworks/base/tests/resources/res/layout/animation_layout.xml deleted file mode 100755 index 13228d1495382e24fba1437dad20008249bb3481..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/layout/animation_layout.xml +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - - - - - - - - - - - - - - - diff --git a/proprietary/frameworks/base/tests/resources/res/layout/app_activity.xml b/proprietary/frameworks/base/tests/resources/res/layout/app_activity.xml deleted file mode 100755 index 8b7206f658999ea15c32691974d8f49fa6fcca0a..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/layout/app_activity.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - - - - - diff --git a/proprietary/frameworks/base/tests/resources/res/layout/app_another.xml b/proprietary/frameworks/base/tests/resources/res/layout/app_another.xml deleted file mode 100755 index f4574a274b7588e7a66ab8ccdbc8818e0e7a6750..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/layout/app_another.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - - - - - diff --git a/proprietary/frameworks/base/tests/resources/res/layout/autocompletetextview_layout.xml b/proprietary/frameworks/base/tests/resources/res/layout/autocompletetextview_layout.xml deleted file mode 100755 index be1d2845a8fb447cae7d13ff293b6bc7306a6e0a..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/layout/autocompletetextview_layout.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - diff --git a/proprietary/frameworks/base/tests/resources/res/layout/available_intents_layout.xml b/proprietary/frameworks/base/tests/resources/res/layout/available_intents_layout.xml deleted file mode 100755 index 5415657e741783adceb8658f1b0427645cdc998b..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/layout/available_intents_layout.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - diff --git a/proprietary/frameworks/base/tests/resources/res/layout/checkbox_layout.xml b/proprietary/frameworks/base/tests/resources/res/layout/checkbox_layout.xml deleted file mode 100755 index a1f17184557b3aaf4301c8fe6783779c2c80b0ea..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/layout/checkbox_layout.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - diff --git a/proprietary/frameworks/base/tests/resources/res/layout/checkedtextview_layout.xml b/proprietary/frameworks/base/tests/resources/res/layout/checkedtextview_layout.xml deleted file mode 100755 index d5b9c1f9a3301cab8af17f278af95fdea2a61b00..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/layout/checkedtextview_layout.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - diff --git a/proprietary/frameworks/base/tests/resources/res/layout/chronometer_stub_layout.xml b/proprietary/frameworks/base/tests/resources/res/layout/chronometer_stub_layout.xml deleted file mode 100755 index 487f2f80abdfa87bd0325a19bf31ebf0858434ce..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/layout/chronometer_stub_layout.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - diff --git a/proprietary/frameworks/base/tests/resources/res/layout/context_layout.xml b/proprietary/frameworks/base/tests/resources/res/layout/context_layout.xml deleted file mode 100755 index 6ec6c76804cc71bc9ae850457eb80223cc04d661..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/layout/context_layout.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - diff --git a/proprietary/frameworks/base/tests/resources/res/layout/cursoradapter_group0.xml b/proprietary/frameworks/base/tests/resources/res/layout/cursoradapter_group0.xml deleted file mode 100755 index f6406868d39b723bb3f2e75477aea1099259ba87..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/layout/cursoradapter_group0.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - diff --git a/proprietary/frameworks/base/tests/resources/res/layout/cursoradapter_group1.xml b/proprietary/frameworks/base/tests/resources/res/layout/cursoradapter_group1.xml deleted file mode 100755 index d1dfa3cf0de23cd8fdd82477ad0b8113950e2671..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/layout/cursoradapter_group1.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - diff --git a/proprietary/frameworks/base/tests/resources/res/layout/cursoradapter_host.xml b/proprietary/frameworks/base/tests/resources/res/layout/cursoradapter_host.xml deleted file mode 100755 index 82ac72b21fac31a48b7dfd0676e67cbb37f7eec1..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/layout/cursoradapter_host.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - diff --git a/proprietary/frameworks/base/tests/resources/res/layout/cursoradapter_item0.xml b/proprietary/frameworks/base/tests/resources/res/layout/cursoradapter_item0.xml deleted file mode 100755 index 5ecd4968a909b3faa8e8fb3050a1d4fb2c319e29..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/layout/cursoradapter_item0.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - diff --git a/proprietary/frameworks/base/tests/resources/res/layout/cursoradapter_item1.xml b/proprietary/frameworks/base/tests/resources/res/layout/cursoradapter_item1.xml deleted file mode 100755 index 44037b0dae0738fcb05fa7831e8af1e87c4b5e5c..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/layout/cursoradapter_item1.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - diff --git a/proprietary/frameworks/base/tests/resources/res/layout/datepicker.xml b/proprietary/frameworks/base/tests/resources/res/layout/datepicker.xml deleted file mode 100755 index 6a7b51c80ab7d4b3d3c8d21b0f477650e6db45b9..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/layout/datepicker.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - diff --git a/proprietary/frameworks/base/tests/resources/res/layout/datepicker_layout.xml b/proprietary/frameworks/base/tests/resources/res/layout/datepicker_layout.xml deleted file mode 100755 index 925674c43ced26d26e30283a9158a73e92b258b4..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/layout/datepicker_layout.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - diff --git a/proprietary/frameworks/base/tests/resources/res/layout/dialerfilter_layout.xml b/proprietary/frameworks/base/tests/resources/res/layout/dialerfilter_layout.xml deleted file mode 100755 index 46edbd71ecfc3cf547f65862910a55109643b0ea..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/layout/dialerfilter_layout.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - diff --git a/proprietary/frameworks/base/tests/resources/res/layout/dialog_stub_layout.xml b/proprietary/frameworks/base/tests/resources/res/layout/dialog_stub_layout.xml deleted file mode 100755 index b0a88613aefdb7b558bb4ed97316ec75c2c91cc9..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/layout/dialog_stub_layout.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - diff --git a/proprietary/frameworks/base/tests/resources/res/layout/digitalclock_layout.xml b/proprietary/frameworks/base/tests/resources/res/layout/digitalclock_layout.xml deleted file mode 100755 index cbdb84dba4efb38fefec79f3809837e3e23aaabc..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/layout/digitalclock_layout.xml +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - - - - diff --git a/proprietary/frameworks/base/tests/resources/res/layout/digitalclock_simplelayout.xml b/proprietary/frameworks/base/tests/resources/res/layout/digitalclock_simplelayout.xml deleted file mode 100755 index 16f7b454ce452dc15708cbfa8d744c2986729c5f..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/layout/digitalclock_simplelayout.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - diff --git a/proprietary/frameworks/base/tests/resources/res/layout/edittext_layout.xml b/proprietary/frameworks/base/tests/resources/res/layout/edittext_layout.xml deleted file mode 100755 index 398d3be4c5b7f6be8b94800d5d66a0bfda9a6957..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/layout/edittext_layout.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - diff --git a/proprietary/frameworks/base/tests/resources/res/layout/expandablelistview_layout.xml b/proprietary/frameworks/base/tests/resources/res/layout/expandablelistview_layout.xml deleted file mode 100755 index 3a3ebb7779595e955f9ec9df626b56ebd2d65493..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/layout/expandablelistview_layout.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - diff --git a/proprietary/frameworks/base/tests/resources/res/layout/focus_finder_layout.xml b/proprietary/frameworks/base/tests/resources/res/layout/focus_finder_layout.xml deleted file mode 100755 index 0502fd812d331085771d95e83f43804d5ad75a9d..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/layout/focus_finder_layout.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/proprietary/frameworks/base/tests/resources/res/layout/focus_handling_layout.xml b/proprietary/frameworks/base/tests/resources/res/layout/focus_handling_layout.xml deleted file mode 100755 index 84c8e6a87914da35730ebf260891b357d40b5292..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/layout/focus_handling_layout.xml +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/proprietary/frameworks/base/tests/resources/res/layout/framelayout_layout.xml b/proprietary/frameworks/base/tests/resources/res/layout/framelayout_layout.xml deleted file mode 100755 index 78b7b470e0ad2c1f183a70d4a65c012a05fdea02..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/layout/framelayout_layout.xml +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/proprietary/frameworks/base/tests/resources/res/layout/horizontal_scrollview.xml b/proprietary/frameworks/base/tests/resources/res/layout/horizontal_scrollview.xml deleted file mode 100755 index 0f88ab3fc5d9100e344186168e72a59590565fc1..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/layout/horizontal_scrollview.xml +++ /dev/null @@ -1,105 +0,0 @@ - - - - - - - - - - - diff --git a/proprietary/frameworks/base/tests/resources/res/layout/mediacontroller_layout.xml b/proprietary/frameworks/base/tests/resources/res/layout/mediacontroller_layout.xml deleted file mode 100755 index 871adf46710162cef76033f94a88a8ef0b481561..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/layout/mediacontroller_layout.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - diff --git a/proprietary/frameworks/base/tests/resources/res/layout/multi_auto_complete_text_view_layout.xml b/proprietary/frameworks/base/tests/resources/res/layout/multi_auto_complete_text_view_layout.xml deleted file mode 100755 index 50109c838901180c9e2aa1cc50a238c375b6b127..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/layout/multi_auto_complete_text_view_layout.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/proprietary/frameworks/base/tests/resources/res/layout/multi_view.xml b/proprietary/frameworks/base/tests/resources/res/layout/multi_view.xml deleted file mode 100755 index 4f335d3be3ce6fb58e9b543f6b0a9373cd01f08d..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/layout/multi_view.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - diff --git a/proprietary/frameworks/base/tests/resources/res/layout/popupwindow.xml b/proprietary/frameworks/base/tests/resources/res/layout/popupwindow.xml deleted file mode 100755 index e6b0aedde5129a9f812cb2df54be2a15a8d56be8..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/layout/popupwindow.xml +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/proprietary/frameworks/base/tests/resources/res/layout/progressbar_layout.xml b/proprietary/frameworks/base/tests/resources/res/layout/progressbar_layout.xml deleted file mode 100755 index a1786b8d582e590dca829f1e0d69dff161c9802a..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/layout/progressbar_layout.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - diff --git a/proprietary/frameworks/base/tests/resources/res/layout/radiogroup_1.xml b/proprietary/frameworks/base/tests/resources/res/layout/radiogroup_1.xml deleted file mode 100755 index 1e9db839052145d86995943c908c5685b4a514bd..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/layout/radiogroup_1.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - diff --git a/proprietary/frameworks/base/tests/resources/res/layout/ratingbar_layout.xml b/proprietary/frameworks/base/tests/resources/res/layout/ratingbar_layout.xml deleted file mode 100755 index acc7fa8cea6b446a41247162a3c5736cfb24f6e6..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/layout/ratingbar_layout.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - diff --git a/proprietary/frameworks/base/tests/resources/res/layout/relative_layout.xml b/proprietary/frameworks/base/tests/resources/res/layout/relative_layout.xml deleted file mode 100755 index db4b2e8b28619ce49ff2840f82a9b3e651acec74..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/layout/relative_layout.xml +++ /dev/null @@ -1,258 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/proprietary/frameworks/base/tests/resources/res/layout/remote_view_test_bad_1.xml b/proprietary/frameworks/base/tests/resources/res/layout/remote_view_test_bad_1.xml deleted file mode 100755 index a65a5eca7c9e716c5ad3539894e2a5f84e705aae..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/layout/remote_view_test_bad_1.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - diff --git a/proprietary/frameworks/base/tests/resources/res/layout/remote_view_test_bad_2.xml b/proprietary/frameworks/base/tests/resources/res/layout/remote_view_test_bad_2.xml deleted file mode 100755 index 92623d810aa83d8f99ef3c9dca16a98c29d3c5fa..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/layout/remote_view_test_bad_2.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - diff --git a/proprietary/frameworks/base/tests/resources/res/layout/remote_view_test_good.xml b/proprietary/frameworks/base/tests/resources/res/layout/remote_view_test_good.xml deleted file mode 100755 index 3df9d6240018cba24b2915581780cfdecbf339be..0000000000000000000000000000000000000000 --- a/proprietary/frameworks/base/tests/resources/res/layout/remote_view_test_good.xml +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - - - - - - - - - - - - - -