A method and device for setting a country code based on an Android system

By dividing the country code into upper and lower halves and writing them into the init, frameworks, and launcher app parts of the Android system respectively, the problem of hardware configuration differences of Android system devices in different countries and regions is solved. This allows a single software version to adapt to the needs of multiple countries and regions, improving production efficiency and user experience.

CN116302182BActive Publication Date: 2026-02-10SHANGHAI LONGCHEER TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310201775.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-02
Publication Date
2026-02-10
Estimated Expiration
2043-03-02

AI Technical Summary

Technical Problem

The varying hardware configuration requirements of existing Android devices in different countries and regions necessitate multiple software versions, increasing costs, complicating user operations, and negatively impacting user experience.

Method used

The target country code is divided into an upper half and a lower half, which are written into the attribute service of the Android system init part respectively. The settings are completed by initializing the frameworks and launcher app parts of the Android system, so that a software version can adapt to the needs of multiple countries and regions.

Benefits of technology

It has improved production efficiency, simplified user operations, enhanced user experience, and met the diverse needs of multiple countries and regions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116302182B_ABST
    Figure CN116302182B_ABST
Patent Text Reader

Abstract

The application aims to provide a method and device for setting country code based on Android system. Specifically, the target country code is divided into upper and lower segments, the target country code is written into the attribute service of the init part of the Android system by the upper and lower segment writing mode, the Android system is initialized, the application classification of the frameworks part of the Android system is run, the desktop classification of the launcher app part of the Android system is run, and the setting of the target country code is completed. The application can meet the different needs of multiple countries and regions by only one software version, the operation of the page focuses on the process function, the function area is distinguished after the main clearing and the booting initialization, the production efficiency is improved, and the user experience is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of information technology, and in particular to a technology for setting a country code based on an Android system. BACKGROUND

[0002] Most of the mobile terminal devices on the market, such as smart phones and tablet computers, use the Android system. The hardware configuration requirements of Android devices are different for different countries and regions. For example, a machine shipped to the United Kingdom needs to be pre-installed with a certain APP required by the country, while a machine shipped to Japan may not need this APP; the WiFi frequency bands in the United Kingdom and Japan are different, which will also cause the machine manufactured for the needs of the United Kingdom to have poor signal when used in Japan; in addition, the RSA requirements of Google for different countries and regions are also different.

[0003] If dozens of versions of software are released for dozens of different countries, the cost is very high. In the prior art, some solutions set several country code options in the menu bar to allow users to set the country code, but the country code cannot be set at the factory end, which causes the user operation to be cumbersome and affects the user experience. SUMMARY

[0004] An object of the present application is to provide a method and device for setting a country code based on an Android system.

[0005] According to one aspect of the present application, a method for setting a country code based on an Android system is provided, wherein the method comprises:

[0006] dividing a target country code into an upper half and a lower half, and writing the target country code into a property service of an init part of the Android system by writing in the upper half and the lower half respectively;

[0007] initializing the Android system and running application classification of a frameworks part of the Android system;

[0008] running desktop classification of a launcher app part of the Android system to complete the setting of the target country code.

[0009] Further, the upper half of the target country code is applied to the after-sales end; wherein the writing process of the upper half of the target country code comprises: after a user inputs the corresponding secret code in the search bar of the setting page, the page is switched to the country code setting page of the factory application; the user selects the corresponding country code, the operator flag bit and the OEM customization bit to obtain the upper half of the target country code; and the upper half of the target country code is written into the corresponding position of the NV partition.

[0010] Further, the writing process of the lower half of the target country code comprises: receiving an instruction parameter about writing the lower half of the country code, and setting an executable program of the country code NV partition according to the instruction parameter, and writing the lower half of the target country code into the corresponding position of the NV partition.

[0011] Further, initializing the Android system, running the application classification of the Android system frameworks part, comprises:

[0012] Initializing the Android system, reading the parameter from the corresponding position of the NV partition, generating the parameter ro.boot.countrycode=GBXX by the bootloader part, and passing the ro.boot.countrycode=GBXX to the init properties service;

[0013] Setting zprojects, determining different compilation projects in the zprojects according to the hardware OD requirements, adding a macro variable to the mk file for each different compilation project, and passing the project_xx_xx in the mk file to the init properties service.

[0014] Further, the init properties service receives the ro.boot.countrycode=GBXX and the project_xx_xx, and reads the configuration file of the country code configuration list, determines the attribute information that needs to be modified by judging whether the country code contains the country of shipment through the query.

[0015] Further, running the application classification of the Android system frameworks part, comprises: determining whether the obtained country code needs to add or remove the corresponding feature according to the ro.boot.countrycode=GBXX; obtaining the corresponding app configuration list through the customized package manager service, and judging whether the app configuration list needs to be added or removed.

[0016] Further, running the desktop classification of the launcher app part of the Android system, comprises: obtaining the ro.boot.countrycode after the country code adaptation of the corresponding app configuration list, and determining the corresponding desktop configuration by using the desktop layout selector of the launcher app part.

[0017] According to another aspect of the present application, there is also provided a device for setting country code based on Android system, wherein the device comprises:

[0018] a first module for dividing a target country code into an upper half and a lower half, and writing the target country code into a property service of an init part of the Android system by means of separate writing of the upper and lower halves;

[0019] a second module for initializing the Android system and running application classification of a frameworks part of the Android system;

[0020] a third module for running desktop classification of a launcher app part of the Android system to complete setting of the target country code.

[0021] According to another aspect of the present application, there is also provided a computing device, wherein the device comprises a memory for storing computer program instructions and a processor for executing the computer program instructions, wherein when the computer program instructions are executed by the processor, the device is triggered to perform the method for setting country code based on Android system.

[0022] According to another aspect of the present application, there is also provided a computer readable medium having computer program instructions stored thereon, wherein the computer program instructions can be executed by a processor to implement the method for setting country code based on Android system.

[0023] In the scheme provided by the present application, the target country code is first divided into an upper half and a lower half, and the target country code is written into a property service of an init part of the Android system by means of separate writing of the upper and lower halves; then the Android system is initialized, and application classification of a frameworks part of the Android system is run; and desktop classification of a launcher app part of the Android system is run to complete setting of the target country code. The present application only needs one software version to be shipped to meet different needs of multiple countries and regions, and the operation on the page pays more attention to the function of process, and pays more attention to the function division of the main clearing after the boot initialization, thereby improving the production efficiency and enhancing the user experience. BRIEF DESCRIPTION OF DRAWINGS

[0024] Other features, objects and advantages of the present application will become more apparent from the following detailed description of non-limiting embodiments thereof, read in conjunction with the accompanying drawings:

[0025] Figure 1 is a flow chart of a method for setting country code based on Android system according to an embodiment of the present application;

[0026] Figure 2 This is a flowchart illustrating how to write the upper half of a country code according to an embodiment of this application;

[0027] Figure 3 This is a flowchart illustrating how to write the lower half of a country code according to an embodiment of this application;

[0028] Figure 4 This is a flowchart illustrating the initialization of an Android system after writing the country code, according to an embodiment of this application.

[0029] Figure 5 This is one of the embodiments according to this application. Figure 4 The schematic diagram of part D1 shown;

[0030] Figure 6 This is one of the embodiments according to this application. Figure 4 The schematic diagram of part D2 shown;

[0031] Figure 7 This is one of the embodiments according to this application. Figure 4 The schematic diagram of part D6 is shown below;

[0032] Figure 8 This is one of the embodiments according to this application. Figure 4 The schematic diagram of part D7 shown;

[0033] Figure 9 This is a flowchart illustrating the operation of a portion of the Android system frameworks according to an embodiment of this application;

[0034] Figure 10 This is a flowchart illustrating a portion of running an Android system launcher app according to an embodiment of this application;

[0035] Figure 11 This is a schematic diagram of a device for setting a country code based on an Android system, according to an embodiment of this application.

[0036] The same or similar reference numerals in the accompanying drawings represent the same or similar parts. Detailed Implementation

[0037] The present application will now be described in further detail with reference to the accompanying drawings.

[0038] In a typical configuration of this application, the terminal, the device of the service network, and the trusted party all include one or more processors (CPUs), input / output interfaces, network interfaces, and memory.

[0039] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0040] Computer-readable media include permanent and non-permanent, removable and non-removable media, which can store information by any method or technology. Information can be computer-readable instructions, data structures, devices of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, read-only optical disc (CD-ROM), digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transfer medium that can be used to store information accessible by a computing device.

[0041] This application provides a method for setting a country code based on the Android system, which can meet the different needs of multiple countries and regions with only one software version. This application focuses on the flow of functions in the page operation, emphasizing the distinction between the functions of master clearing and boot initialization; the country code writing stage is divided into an upper half and a lower half, with the upper half mainly addressing after-sales needs and the lower half mainly addressing mass production in the factory.

[0042] In practical scenarios, the device implementing this method can be a user device, a network device, or a device composed of user devices and network devices integrated through a network. The user device includes, but is not limited to, terminal devices such as smartphones, tablets, and personal computers. The network device includes, but is not limited to, network hosts, single network servers, multiple network server sets, or cloud computing-based computer sets. Here, the cloud consists of a large number of hosts or network servers based on cloud computing, where cloud computing is a type of distributed computing, consisting of a virtual computer composed of a group of loosely coupled computer sets.

[0043] Figure 1 This is a flowchart of a method for setting a country code based on an Android system according to an embodiment of this application. The method includes steps S101, S102 and S103.

[0044] For example, such as Figure 1As shown, the entire country code setting process is completed by writing to the property service in the init section, initializing the application category in frameworks, and the desktop category in the launcher app through the upper and lower half write methods. The distinction between the upper and lower half writes is for different purposes of flashing and booting. The upper half write is done through the UI interface to a specific location on the NV partition, a location that cannot be erased by a factory reset (master wipe), and initializes the country code after a factory reset. The lower half write completes the country code setting through a flashing software upgrade after the command is written.

[0045] Step S101: Divide the target country code into an upper half and a lower half, and write the target country code into the attribute service of the Android system init part by writing the upper and lower halves separately.

[0046] In some embodiments, the upper half of the target country code is applied to the after-sales service; wherein, the writing process of the upper half of the target country code includes: after the user enters the corresponding password in the search bar of the settings page, the page switches to the country code settings page of the industrial model application; the user selects the corresponding country code, operator flag bit and OEM customization bit, and combines them to obtain the upper half of the target country code; and the upper half of the target country code is written to the corresponding position of the NV partition.

[0047] For example, such as Figure 2 As shown, the upper half of the writing process is mainly performed in the application of the industrial mold. This part is primarily used in the after-sales service. The reason for this design is that the machine is not convenient for writing commands, and it is suitable for non-technical personnel to operate the country code switching function. The working process is as follows: in the search bar of the settings page (e.g., Figure 2 (As shown in B1) After entering the password ##XXX# (or a similar password), the page will switch to the country code switching page for the industrial mold application (e.g., ...). Figure 2 As shown in B2), on the country code settings page (e.g. Figure 2 To set the country code (as shown in B2), first select the country code of the shipment (e.g., the UK country code is GB), then select the carrier flag; if not selected, set it to X; select the OEM engraving flag; if not selected, set it to X; after selecting, click the OK button, and enter GBXX (e.g., ...). Figure 2 As shown in B3, the data is written to a specific segment of the NV partition (a location that cannot be cleared by the factory reset master wipe operation), such as... Figure 2 As shown in B4; after performing the above operations, perform the main cleanup and power-on actions, as follows. Figure 2 As shown in B5.

[0048] In some embodiments, the process of writing the lower half of the target country code includes: receiving instruction parameters for writing the lower half of the country code, setting an executable program for the country code NV partition according to the instruction parameters, and writing the lower half of the target country code to the corresponding position of the NV partition.

[0049] For example, such as Figure 3 As shown, the lower half of the write operation, which involves pages without any operations, is written in the factory version (the factory version has relatively high root privileges, which is a prerequisite for setting the country code executable program). The country code parameter is written to a specific segment of the NV partition all at once via instructions. Its working process is as follows: First, in... Figure 3 The factory version shown in C1 receives command parameters, such as `adb shell lc_nv_ram write 60 8GBXX`. This parameter means: run the program that sets the country code for the NV partition to `lc_nv_ram`, execute the `write` operation, and write the country code parameter `GBXX` 8 bits off from segment 60 in the NV partition to a specific segment or partition (e.g., ...). Figure 3 As shown in C3), the device to be flashed (e.g., ...). Figure 3 (As shown in C4) Flash the firmware to the user version and complete the writing of the country code.

[0050] Step S102: Initialize the Android system and run the application categories in the Android system frameworks.

[0051] In some embodiments, step S102 includes: initializing the Android system, reading parameters from the corresponding location of the NV partition, generating the parameter ro.boot.countrycode=GBXX using the bootloader part, and passing ro.boot.countrycode=GBXX to the init properties service; setting up zprojects, determining different compilation projects in the zprojects according to the hardware OD requirements, adding a macro variable to the mk file for each different compilation project, and passing the project_xx_xx in the mk file to the init properties service.

[0052] For example, in such Figure 2 B4 and Figure 3 After the steps shown in C3, i.e. Figure 4 After the steps shown in D4, the initial boot read operation is complete. Next, as... Figure 4As shown, the workflow is as follows: D2 reads the parameters of the partition from D4, and then generates `Androidboot.countrycode=GBXX` in the bootloader. The purpose of this is to generate a parameter `Androidboot.countrycode=GBXX` for D6 to use. D6 reads two important parameters, one of which is the compiler macro generated by the `.mk` file. These macros control device configuration information, such as distinguishing between Wi-Fi and LTE versions of the device name; the `.mk` file (e.g., ...) Figure 4 As shown in D3, the data is obtained through D1; D1 is a zprojects set up to add compilation projects. zprojects contains different compilation projects, created according to hardware OD requirements. Each different project adds a macro variable to the mk file; D6 retrieves the macro variables from the mk file and differentiates them according to hardware OD requirements in the init program; D6 retrieves variables from two parts, one being the bootloader (e.g., ... Figure 4 The other is the ro.boot.countrycode generated by (as shown in D2), and the macro variable (such as project_wifi or project_lte version) in the mk file. Figure 4 (As shown in D3); D6 needs to add the default attributes of the variables passed from D2 and D3.

[0053] Figure 4 The principle of part D1 is as follows: Figure 5 As shown, its main function is to provide a project_xx_xx, which contains many compiled builds such as project_wifi, project_lte, project_wifi_audio, and project_lte_audio. During the compilation process, these builds form a corresponding compilation macro in the mk file of the init module, and finally provide a project_xx_xx.

[0054] Figure 4 The principle of part D2 is as follows Figure 6 As shown, the parameters to be written are first read from a certain segment or partition of the nv partition; after obtaining the parameters, the bootloader part will determine whether the parameters are empty; if they are empty, the part will give a default country code parameter USXX; if they are not empty, the value of cmdline is set according to the read parameters: android.countrycode = GBXX / USXX (default); the final result is ro.boot.countrycode = USXX.

[0055] In some embodiments, the init properties service receives ro.boot.countrycode=GBXX and project_xx_xx, as well as a configuration file that reads the country code configuration list, and determines whether the country of shipment is included by querying the country code, and determines the attribute information that needs to be modified.

[0056] For example, Figure 4 The principle of part D6 is as follows Figure 7 As shown, Figure 4 Part D1 (e.g.) Figure 5 (as shown) and part D2 (as shown) Figure 6 As shown, parameters for part D6 are generated respectively (e.g.) Figure 7 As shown in the diagram. Part D6 will receive two parameters generated by parts D1 and D2: ro.boot.countrycode=GBXX and project_xx_xx; Additionally, it will need to read... Figure 7 The configuration file showing the country code configuration list as shown in E7. Section D6 is used to obtain... Figure 7 After obtaining the parameters shown in E4, bit decomposition will be performed first to obtain the country name, ro.product.google.3bitX, as shown below. Figure 7 The two attributes, ro.odm.setf.4bitX, shown in E6 and E7, are used by the upper layer for differentiation. Figure 7 Read config_country_list.xml (e.g.) Figure 7 After E3 (as shown in E3), it checks whether the country code obtained from E4 contains the country of shipment, thus obtaining E8. This part mainly sets the language and other important system attributes, as well as E9. By obtaining the country code from E4, the compilation parameters from E2, and the country code from E11, it determines and modifies important authentication attributes (such as...). Figure 7 (As shown in E10).

[0057] Figure 4 The principle of part D7 is as follows: Figure 8 As shown, the purpose of adding this section is to resolve the authentication issues between VTS and GSI. The executable for this section must be placed in the vendor partition, not the system partition. Figure 8 The sum shown in F1 Figure 7 E12 shows the same method. Figure 8 The sum shown in F5 Figure 7 The parameter shown in E4 is the same. Figure 8 The country code detector shown in F4 obtains... Figure 5 The parameters shown are then called. Figure 8The country code required by Google, as shown in F1, is processed and then used to generate a triggerable attribute. Figure 8 The processing shown in F3 ultimately configures a suitable fingerprint, which is used for the test reports of VTS and GSI.

[0058] In some embodiments, step S102 includes: determining whether the obtained country code needs to be added or removed from the corresponding feature based on ro.boot.countrycode=GBXX; obtaining the corresponding app configuration list through a customized package manager service, and determining whether it is necessary to add or remove the app configuration list.

[0059] For example, such as Figure 9 As shown, the main function of the framework section is to classify APKs and modify their features. The main parameters obtained in this section are... Figure 7 In the ro.product.countrycode = GB (e.g. Figure 9 As shown in G6, this parameter is used for two paths. The first path is... Figure 9 The method shown in G5 and Figure 8 The consistent judgment shown in F1 determines whether to add or remove the corresponding feature for the acquired country, ultimately resulting in a feature suitable for the GB country code. The second path needs to go through... Figure 9 The customized PMS (Package Manager Service) shown in G2 requires G2 to obtain the app configuration list from G3 (this list details the apps that need to be supported and the apps that must be removed under a specific codebase). G2 then uses the app loading criteria to determine whether an app needs to be loaded or removed, ultimately resulting in a compatible app list suitable for the GB codebase (e.g., ...). Figure 9 (As shown in G1).

[0060] Step S103: Run the desktop category of the Android system launcher app to complete the setting of the target country code.

[0061] In some embodiments, step S103 includes: after adapting the country code to the corresponding app configuration list, obtaining the ro.boot.countrycode, and using the desktop layout selector of the launcher app section to determine the corresponding desktop configuration.

[0062] For example, the launcher app's processing is as follows: Figure 10As shown, this part of the development was primarily due to the different initial desktop layout requirements for each country. After obtaining the list of remaining apps after country code adaptation in the framework (such as...), Figure 10 (As shown in H1), then obtain as follows Figure 7 The ro.product.countrycode shown in E9 (e.g.) Figure 10 As shown in H5), through the desktop layout selector in the launcher app (such as... Figure 10 (As shown in H3) Load the desktop list database Launcherprovider from H2, and finally obtain a suitable desktop layout (such as...) Figure 10 (shown in H4).

[0063] Figure 11 This is a schematic diagram of a device for setting a country code based on an Android system according to an embodiment of this application. The device includes a first module 111, a second module 112, and a third module 113.

[0064] For example, by writing to the property services in the init section, initializing the application categories in frameworks, and the desktop categories in the launcher app using the upper and lower half write methods, the entire country code setting process can be completed. The distinction between the upper and lower half writes is for different purposes: flashing and booting. The upper half write is done through the UI interface to a specific location on the NV partition. This location cannot be erased by a factory reset (master wipe), and the country code is initialized after a factory reset. The lower half write completes the country code setting through a flashing software upgrade after the command is written.

[0065] The first module 111 divides the target country code into an upper half and a lower half, and writes the target country code into the attribute service of the Android system init part by writing the upper and lower halves separately.

[0066] In some embodiments, the upper half of the target country code is applied to the after-sales service; wherein, the writing process of the upper half of the target country code includes: after the user enters the corresponding password in the search bar of the settings page, the page switches to the country code settings page of the industrial model application; the user selects the corresponding country code, operator flag bit and OEM customization bit, and combines them to obtain the upper half of the target country code; and the upper half of the target country code is written to the corresponding position of the NV partition.

[0067] For example, such as Figure 2As shown, the upper half of the writing process is primarily executed in the application of the industrial mold. This part is mainly used in the after-sales service. The reason for this design is that the machine is not convenient for writing using commands, and it is suitable for non-technical personnel to operate the country code switching. The working process is to search in the search bar of the settings page (e.g., Figure 2 (As shown in B1) After entering the password ##XXX# (or a similar password), the page will switch to the country code switching page for the industrial mold application (e.g., ...). Figure 2 As shown in B2), on the country code settings page (e.g. Figure 2 To set the country code (as shown in B2), first select the country code of the shipment (e.g., the UK country code is GB), then select the carrier flag; if not selected, set it to X; select the OEM engraving flag; if not selected, set it to X; after selecting, click the OK button, and enter GBXX (e.g., ...). Figure 2 As shown in B3, the data is written to a specific segment of the NV partition (a location that cannot be cleared by the factory reset master wipe operation), such as... Figure 2 As shown in B4; after performing the above operations, perform the main cleanup and power-on actions, as follows. Figure 2 As shown in B5.

[0068] In some embodiments, the process of writing the lower half of the target country code includes: receiving instruction parameters for writing the lower half of the country code, setting an executable program for the country code NV partition according to the instruction parameters, and writing the lower half of the target country code to the corresponding position of the NV partition.

[0069] For example, such as Figure 3 As shown, the lower half of the write operation, which involves pages without any operations, is written in the factory version (the factory version has relatively high root privileges, which is a prerequisite for setting the country code executable program). The country code parameter is written to a specific segment of the NV partition in one go via instructions. Its working process is as follows: first, in... Figure 3 The factory version shown in C1 receives command parameters, such as `adb shell lc_nv_ram write 60 8GBXX`. This parameter means: run the program that sets the country code for the NV partition to `lc_nv_ram`, execute the `write` operation, and write the country code parameter `GBXX` 8 bits off from segment 60 in the NV partition to a specific segment or partition (e.g., ...). Figure 3 As shown in C3), the device to be flashed (e.g., ...). Figure 3 (As shown in C4) Flash the firmware to the user version and complete the writing of the country code.

[0070] The second module 112 initializes the Android system and runs the application categories in the Android system frameworks.

[0071] In some embodiments, the second module 112 is configured to: initialize the Android system, read parameters from the corresponding location of the NV partition, generate the parameter ro.boot.countrycode=GBXX using the bootloader part, and pass the ro.boot.countrycode=GBXX to the init properties service; establish zprojects, determine different compilation projects in the zprojects according to the hardware OD requirements, add a macro variable to the mk file for each different compilation project, and pass the project_xx_xx in the mk file to the init properties service.

[0072] For example, in such Figure 2 B4 and Figure 3 After the steps shown in C3, i.e. Figure 4 After the steps shown in D4, the initial boot read operation is complete. Next, as... Figure 4 As shown, the workflow is as follows: D2 reads the parameters of the partition from D4, and then generates `Androidboot.countrycode=GBXX` in the bootloader. The purpose of this is to generate a parameter `Androidboot.countrycode=GBXX` for D6 to use. D6 reads two important parameters, one of which is the compiler macro generated by the `.mk` file. These macros control device configuration information, such as distinguishing between Wi-Fi and LTE versions of the device name; the `.mk` file (e.g., ...) Figure 4 As shown in D3, the data is obtained through D1; D1 is a zprojects set up to add compilation projects. zprojects contains different compilation projects, created according to hardware OD requirements. Each different project adds a macro variable to the mk file; D6 retrieves the macro variables from the mk file and differentiates them according to hardware OD requirements in the init program; D6 retrieves variables from two parts, one being the bootloader (e.g., ... Figure 4 The other is the ro.boot.countrycode generated by (as shown in D2), and the macro variable (such as project_wifi or project_lte version) in the mk file. Figure 4 (As shown in D3); D6 needs to add the default attributes of the variables passed from D2 and D3.

[0073] Figure 4 The principle of part D1 is as follows: Figure 5As shown, its main function is to provide a project_xx_xx, which contains many compiled builds such as project_wifi, project_lte, project_wifi_audio, and project_lte_audio. During the compilation process, these builds form a corresponding compilation macro in the mk file of the init module, and finally provide a project_xx_xx.

[0074] Figure 4 The principle of part D2 is as follows Figure 6 As shown, the parameters to be written are first read from a certain segment or partition of the nv partition; after obtaining the parameters, the bootloader part will determine whether the parameters are empty; if they are empty, the part will give a default country code parameter USXX; if they are not empty, the value of cmdline is set according to the read parameters: android.countrycode = GBXX / USXX (default); the final result is ro.boot.countrycode = USXX.

[0075] In some embodiments, the init properties service receives ro.boot.countrycode=GBXX and project_xx_xx, as well as a configuration file that reads the country code configuration list, and determines whether the country of shipment is included by querying the country code, and determines the attribute information that needs to be modified.

[0076] For example, Figure 4 The principle of part D6 is as follows Figure 7 As shown, Figure 4 Part D1 (e.g.) Figure 5 (as shown) and part D2 (as shown) Figure 6 As shown, parameters for part D6 are generated respectively (e.g.) Figure 7 As shown in the diagram. Part D6 will receive two parameters generated by parts D1 and D2: ro.boot.countrycode=GBXX and project_xx_xx; Additionally, it will need to read... Figure 7 The configuration file showing the country code configuration list as shown in E7. Section D6 is used to obtain... Figure 7 After obtaining the parameters shown in E4, bit decomposition will be performed first to obtain the country name, ro.product.google.3bitX, as shown below. Figure 7 The two attributes, ro.odm.setf.4bitX, shown in E6 and E7, are used by the upper layer for differentiation. Figure 7 Read config_country_list.xml (e.g.) Figure 7After E3 (as shown in E3), it checks whether the country code obtained from E4 contains the country of shipment, thus obtaining E8. This part mainly sets the language and other important system attributes, as well as E9. By obtaining the country code from E4, the compilation parameters from E2, and the country code from E11, it determines and modifies important authentication attributes (such as...). Figure 7 (As shown in E10).

[0077] Figure 4 The principle of part D7 is as follows: Figure 8 As shown, the purpose of adding this section is to resolve the authentication issues between VTS and GSI. The executable for this section must be placed in the vendor partition, not the system partition. Figure 8 The sum shown in F1 Figure 7 E12 shows the same method. Figure 8 The sum shown in F5 Figure 7 The parameter shown in E4 is the same. Figure 8 The country code detector shown in F4 obtains... Figure 5 The parameters shown are then called. Figure 8 The country code required by Google, as shown in F1, is processed and then used to generate a triggerable attribute. Figure 8 The processing shown in F3 ultimately configures a suitable fingerprint, which is used for the test reports of VTS and GSI.

[0078] In some embodiments, the second module 112 is used to: determine whether the obtained country code needs to be added or removed from the corresponding feature based on ro.boot.countrycode=GBXX; obtain the corresponding app configuration list through a customized package manager service, and determine whether it is necessary to add or remove the app configuration list.

[0079] For example, such as Figure 9 As shown, the main function of the framework section is to classify APKs and modify their features. The main parameters obtained in this section are... Figure 7 In the ro.product.countrycode = GB (e.g. Figure 9 As shown in G6, this parameter is used for two paths. The first path is... Figure 9 The method shown in G5 and Figure 8 The consistent judgment shown in F1 determines whether to add or remove the corresponding feature for the acquired country, ultimately resulting in a feature suitable for the GB country code. The second path needs to go through... Figure 9The customized PMS (Package Manager Service) shown in G2 requires G2 to obtain the app configuration list from G3 (this list details the apps that need to be supported and the apps that must be removed under a specific codebase). G2 then uses the app loading criteria to determine whether an app needs to be loaded or removed, ultimately resulting in a compatible app list suitable for the GB codebase (e.g., ...). Figure 9 (As shown in G1).

[0080] The third module 113 runs the desktop category of the Android system launcher app and completes the setting of the target country code.

[0081] In some embodiments, the third module 113 is used to: after adapting the country code to the corresponding app configuration list, obtain the ro.boot.countrycode, and use the desktop layout selector of the launcher app section to determine the corresponding desktop configuration.

[0082] For example, the launcher app's processing is as follows: Figure 10 As shown, this part of the development was primarily due to the different initial desktop layout requirements for each country. After obtaining the list of remaining apps after country code adaptation in the framework (such as...), Figure 10 (As shown in H1), then obtain as follows Figure 7 The ro.product.countrycode shown in E9 (e.g.) Figure 10 As shown in H5), through the desktop layout selector in the launcher app (such as... Figure 10 (As shown in H3) Load the desktop list database Launcherprovider from H2, and finally obtain a suitable desktop layout (such as...) Figure 10 (shown in H4).

[0083] In summary, this application embodiment only requires one software version to meet the different needs of multiple countries and regions. The operation of the page focuses more on the process function and emphasizes the distinction between the function of initialization after main clearing, which improves production efficiency and enhances user experience.

[0084] Furthermore, a portion of this application can be applied as a computer program product, such as computer program instructions, which, when executed by a computer, can invoke or provide the methods and / or technical solutions according to this application through the operation of the computer. The program instructions invoking the methods of this application may be stored in a fixed or removable recording medium, and / or transmitted via data streams in broadcast or other signal carrying media, and / or stored in the working memory of a computer device operating according to the program instructions. Here, some embodiments of this application provide a computing device including a memory for storing computer program instructions and a processor for executing the computer program instructions, wherein, when the computer program instructions are executed by the processor, the device is triggered to execute the methods and / or technical solutions of the aforementioned embodiments of this application.

[0085] Furthermore, some embodiments of this application also provide a computer-readable medium having computer program instructions stored thereon, which can be executed by a processor to implement the methods and / or technical solutions of the aforementioned embodiments of this application.

[0086] It should be noted that this application can be implemented in software and / or a combination of software and hardware, for example, using an application-specific integrated circuit (ASIC), a general-purpose computer, or any other similar hardware device. In some embodiments, the software program of this application can be executed by a processor to implement the steps or functions described above. Similarly, the software program of this application (including related data structures) can be stored in a computer-readable recording medium, such as RAM memory, magnetic or optical drives, floppy disks, and similar devices. Furthermore, some steps or functions of this application can be implemented in hardware, for example, as circuitry that cooperates with a processor to perform the various steps or functions.

[0087] It will be apparent to those skilled in the art that this application is not limited to the details of the exemplary embodiments described above, and that this application can be implemented in other specific forms without departing from the spirit or essential characteristics of this application. Therefore, the embodiments should be considered exemplary and non-limiting in all respects, and the scope of this application is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of equivalents of the claims are intended to be embraced within this application. No reference numerals in the claims should be construed as limiting the scope of the claims. Furthermore, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices recited in the apparatus claims may also be implemented by a single unit or device in software or hardware. The terms "first," "second," etc., are used to indicate names and do not indicate any particular order.

Claims

1. A method for setting the country code based on the Android system, wherein, The method includes: The target country code is divided into an upper half and a lower half. The target country code is written to the attribute service of the Android system init part by writing the upper half separately. The upper half of the target country code is written in the application of the industrial model and is used for the back-end sales. The lower half of the target country code is written in the factory version and is used for mass production in the factory. Initialize the Android system and run the application categories in the Android system frameworks. Run the desktop category of the Android system launcher app to complete the setting of the target country code; The process of writing the upper half of the target country code includes: after the user enters the corresponding password in the search bar of the settings page, the page switches to the country code settings page of the industrial model application; the user selects the corresponding country code, operator flag bit and OEM customization bit, and combines them to obtain the upper half of the target country code; the upper half of the target country code is written to the corresponding position of the upper half of the NV partition. The process of writing the lower half of the target country code includes: receiving instruction parameters for writing the lower half of the country code, setting the executable program of the country code NV partition according to the instruction parameters, and writing the lower half of the target country code to the corresponding position of the lower half of the NV partition. The Android system is initialized, and application categories that run the Android system frameworks are included: The Android system is initialized by reading parameters from the corresponding location of the NV partition, generating the parameter ro.boot.countrycode=GBXX using the bootloader part, and passing ro.boot.countrycode=GBXX to initpropertiesservice; Set up zprojects, determine different compilation projects in zprojects according to hardware OD requirements, add a macro variable to the mk file for each different compilation project, and pass the project_xx_xx in the mk file to the initpropertiesservice; Based on ro.boot.countrycode=GBXX, determine whether the obtained country code needs to have its corresponding feature added or removed; After obtaining the corresponding app configuration list through the customized package manager service, it is determined whether it is necessary to add or remove the app configuration list. The desktop categories that run the Android system launcher app portion include: After matching the country code to the corresponding app configuration list, obtain the ro.boot.countrycode, and use the desktop layout selector in the launcher app section to determine the corresponding desktop configuration.

2. The method according to claim 1, wherein, The initpropertiesservice receives ro.boot.countrycode=GBXX and project_xx_xx, as well as a configuration file that reads the country code configuration list. It determines whether the country of shipment is included by querying the country code and determines the attribute information that needs to be modified.

3. A device for setting a country code based on the Android system, wherein, The device includes: The first module is used to divide the target country code into an upper half and a lower half, and write the target country code into the attribute service of the Android system init part by writing the upper half separately. The upper half of the target country code is written in the application of the industrial model and is used in the back-end sales, while the lower half of the target country code is written in the factory version and is used for mass production in the factory. The second module is used to initialize the Android system and run the application categories in the Android system frameworks. The third module is used to run the desktop category of the Android system launcher app and complete the setting of the target country code; The process of writing the upper half of the target country code includes: after the user enters the corresponding password in the search bar of the settings page, the page switches to the country code settings page of the industrial model application; the user selects the corresponding country code, operator flag bit and OEM customization bit, and combines them to obtain the upper half of the target country code; the upper half of the target country code is written to the corresponding position of the upper half of the NV partition. The process of writing the lower half of the target country code includes: receiving instruction parameters for writing the lower half of the country code, setting the executable program of the country code NV partition according to the instruction parameters, and writing the lower half of the target country code to the corresponding position of the lower half of the NV partition. The Android system is initialized, and application categories that run the Android system frameworks are included: The Android system is initialized by reading parameters from the corresponding location of the NV partition, generating the parameter ro.boot.countrycode=GBXX using the bootloader part, and passing ro.boot.countrycode=GBXX to initpropertiesservice; Set up zprojects, determine different compilation projects in zprojects according to hardware OD requirements, add a macro variable to the mk file for each different compilation project, and pass the project_xx_xx in the mk file to the initpropertiesservice; Based on ro.boot.countrycode=GBXX, determine whether the obtained country code needs to have its corresponding feature added or removed; After obtaining the corresponding app configuration list through the customized package manager service, it is determined whether it is necessary to add or remove the app configuration list. The desktop categories that run the Android system launcher app portion include: After matching the country code to the corresponding app configuration list, obtain the ro.boot.countrycode, and use the desktop layout selector in the launcher app section to determine the corresponding desktop configuration.

4. A computing device, wherein, The device includes a memory for storing computer program instructions and a processor for executing the computer program instructions, wherein when the computer program instructions are executed by the processor, the device is triggered to perform the method of any one of claims 1 or 2.

5. A computer-readable medium having stored thereon computer program instructions that can be executed by a processor to implement the method as described in any one of claims 1 or 2.

Citation Information

Patent Citations

  • Secure subscriber identity module service

    CN104023333A

  • National code menu based on Android device and use method thereof

    CN113329394A