CN115297204A - Ringtone setting method and terminal - Google Patents

Ringtone setting method and terminal Download PDF

Info

Publication number
CN115297204A
CN115297204A CN202210753706.XA CN202210753706A CN115297204A CN 115297204 A CN115297204 A CN 115297204A CN 202210753706 A CN202210753706 A CN 202210753706A CN 115297204 A CN115297204 A CN 115297204A
Authority
CN
China
Prior art keywords
audio
terminal
media library
information
path
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202210753706.XA
Other languages
Chinese (zh)
Other versions
CN115297204B (en
Inventor
刘松涛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Honor Device Co Ltd
Original Assignee
Honor Device Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Honor Device Co Ltd filed Critical Honor Device Co Ltd
Priority to CN202210753706.XA priority Critical patent/CN115297204B/en
Publication of CN115297204A publication Critical patent/CN115297204A/en
Application granted granted Critical
Publication of CN115297204B publication Critical patent/CN115297204B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/724User interfaces specially adapted for cordless or mobile telephones
    • H04M1/72403User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality
    • H04M1/72442User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality for playing music files
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/724User interfaces specially adapted for cordless or mobile telephones
    • H04M1/72448User interfaces specially adapted for cordless or mobile telephones with means for adapting the functionality of the device according to specific conditions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/724User interfaces specially adapted for cordless or mobile telephones
    • H04M1/72484User interfaces specially adapted for cordless or mobile telephones wherein functions are triggered by incoming communication events
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/725Cordless telephones

Abstract

The application provides a ringtone setting method and a terminal. In the method, the terminal sets a first ring tone as a first audio before upgrading, the terminal can determine whether the first audio is an internal audio after upgrading the system, and the terminal can set the ring tone information to be set based on a new media library added with information corresponding to the internal audio under the condition that the first audio is determined to be the internal audio. In a case where it is determined that the first audio is the external audio, the terminal may first use a default audio in which the path and the uri are determined as the first ring tone, and after it is determined that the external volume scanning is completed, the terminal may set the ring tone information to be set, so that the first ring tone is updated from the default audio to the first audio. In this way, the first ringtone can be made consistent before and after the system upgrade.

Description

Ringtone setting method and terminal
Technical Field
The present application relates to the field of terminals, and in particular, to a ring setting method and a terminal.
Background
After the terminal leaves a factory, a system of the terminal can be upgraded, so that functions of the terminal are more complete, and user experience is improved. During the course of a system upgrade, information that may be related to some resources changes. One common variation may be: the storage path of the audio changes, and the setting values corresponding to some setting items related to the audio also change correspondingly, and the change is caused because the terminal after the system upgrade cannot find the corresponding audio according to the storage path before the system upgrade. The setting item can be a setting item related to ring tone, such as incoming call ring tone, short message ring tone or notification ring tone. For example, the incoming call ring is taken as an example to explain here, the setting value corresponding to the incoming call ring setting item in the terminal before the system upgrade is audio A1 (that is, the terminal takes the playable audio A1 as the incoming call ring), where the setting value audio A1 is only the name corresponding to the audio A1 and is not the playable audio A1. After the system is upgraded, if the storage path corresponding to the audio A1 changes, the ring tone setting item cannot find the playable audio A1 through the audio A1. In such a case, after the system is upgraded, in order to prevent the playable audio A1 from being not found when there is an incoming call, the incoming call ringtone may be changed from the playable audio A1 to the default audio whose storage path is determined.
However, the terminal is mainly used for the user to communicate, the user can contact with other users through the terminal, and the contact manner includes telephone, short message and the like, so that the setting values corresponding to the setting items related to the ring tone, such as incoming call ring tone, short message ring tone and the like, may inherit the use habit of the user to the terminal to a great extent. The setting items related to the ring tone may affect the experience of the user when the terminal system changes before and after upgrading.
Therefore, how to ensure consistent ring before and after system upgrade is an urgent problem to be solved.
Disclosure of Invention
The application provides a ringtone setting method and a terminal, which can keep the consistency of a first ringtone before and after system upgrade.
In a first aspect, the present application provides a ringtone setting method, which is applied to a terminal, where the terminal stores multiple audios, and the method includes: before the system is upgraded, the terminal sets a first ring tone as a first audio frequency in the plurality of audio frequencies; after the system is upgraded, the terminal determines the upgrade type based on the paths corresponding to the multiple audios and the indication information of the media library; the media library is used for recording the corresponding relation between the audio path and the audio identifier, and comprises a first media library before system upgrade and a second media library after system upgrade; under the condition that the upgrading type is determined to be the first upgrading type, the terminal scans the plurality of audios and regenerates the media library to obtain a second media library; under the condition that the upgrading type is determined to be a second upgrading type, the terminal updates the corresponding relation of part or all of the audios in the first media library to generate a second media library; the terminal sets the ring information of the first ring based on the second media library to obtain the set ring information; the ringtone information of the first ringtone comprises a first identifier corresponding to the first audio in the first media library, and the first identifier is associated with a first path; the set ring tone information comprises a second identifier corresponding to the first audio in the second media library; the second identifier is associated with a second path, wherein the second path is a path corresponding to the first audio after the system upgrade; and under the condition that the upgrading type is determined to be a third upgrading type, the terminal sets the ring information of the first ring based on the first media library to obtain the set ring information.
In the above embodiment, before the terminal generates the new media library, the terminal may first determine the upgrade type. For different upgrading types, the terminal can determine a new media library based on different modes, and then, the ring information of the first ring is set to obtain the set ring information, so that the terminal can obtain the first audio through the set ring information. Thus, the first ring tone can be consistent before and after the system is upgraded and is the first audio.
In combination with the first aspect, the setting, by the terminal, of the ringtone information of the first ringtone based on the first media library to obtain the set ringtone information specifically includes: the terminal takes the first media library as the second media library; the terminal acquires a second identifier from the second media library, wherein a second path associated with the second identifier is the same as the first path; and the terminal replaces the first identifier in the first uri included in the ring information of the first ring tone with the second identifier to obtain the set ring tone information.
In the above embodiment, when the first ring tone is the first audio, the manner for the terminal to acquire the first ring tone to play the first ring tone is as follows: the uri (uri corresponding to the first audio) associated with the audio name is determined through the audio name corresponding to the first audio, the identifier corresponding to the audio is obtained through the uri, the path (namely, the storage path) corresponding to the identifier is obtained from the media library based on the identifier, and then the audio under the path is obtained from the memory and is played as the first ring. Setting the id in uri may enable the first ring tone to remain consistent.
With reference to the first aspect, the indication information of the media library includes a package name corresponding to the first media library and a package name corresponding to the second media library; the method for determining the upgrade type by the terminal based on the paths corresponding to the multiple audios and the indication information of the media library specifically comprises the following steps: under the condition that the package name corresponding to the first media library is determined to be different from the package name corresponding to the second media library, the terminal determines that the upgrading type is a first upgrading type; when determining that the package name corresponding to the first media is the same as the package name corresponding to the second media library but a path corresponding to the audio comprises a first preset field, the terminal determines that the upgrade type is a second upgrade type; and under the condition that the package name corresponding to the first media is the same as the package name corresponding to the second media library and the path corresponding to the audio does not comprise the first preset field, the terminal determines that the upgrading type is the third upgrading type.
In the above embodiment, the terminal may obtain the second media library, i.e., the new media library, in different manners according to different upgrade types, and then set the ring tone information of the first ring tone based on the new media library.
With reference to the first aspect, the terminal sets ring information of the first ring based on the second media library to obtain the set ring information, and specifically includes: the terminal determines whether the first audio is an internal audio; under the condition that the first audio is determined to be the internal audio, the terminal sets the ringtone information of the first ringtone based on a first database in the second media library to obtain the set ringtone information; the first database is used for recording information corresponding to the internal audio; under the condition that the first audio is determined to be external audio, the terminal sets the ring information of the first ring based on a second database in the second media library to obtain the set ring information; the second database is used for recording information corresponding to external audio.
In the above embodiments, the terminal may set the ring tone information of the first ring tone in different manners based on whether the first audio is internal audio.
With reference to the first aspect, before the terminal determines whether the first audio is an internal audio, the method further includes: and under the condition that the upgrade type is determined to be the first upgrade type, the terminal finishes scanning the internal volume and writes the information corresponding to the scanned internal audio into a first database in the second media library. Before the terminal sets the ring tone information of the first ring tone based on the second database in the second media library, the method further comprises: and under the condition that the upgrade type is determined to be the first upgrade type, the terminal finishes scanning the external volume and writes the information corresponding to the scanned external audio into a second database in the second media library.
In the above embodiment, the terminal may reconstruct the database when the upgrade type is the first upgrade type.
With reference to the first aspect, before the terminal determines whether the first audio is an internal audio, the method further includes: under the condition that the upgrading type is determined to be a second upgrading type, the terminal copies the content in the first media library to the second media library; the terminal finishes scanning the internal volume, deletes the original information corresponding to the scanned updatable internal audio from the second media library, and then writes the information corresponding to the updatable internal audio into a first database in the second media library; wherein the updatable internal audio is an internal audio comprising a second field in the corresponding new path; before the terminal sets the ring tone information of the first ring tone based on the second database in the second media library, the method further comprises: under the condition that the upgrade type is determined to be a second upgrade type, the terminal finishes scanning an external volume, deletes original information corresponding to the scanned updatable external audio from the second media library, and then writes the information corresponding to the updatable external audio into a second database in the second media library; and the updatable external audio is the external audio comprising a third field in the corresponding new path.
In the above embodiment, the terminal may not reconstruct the database when the upgrade type is the first upgrade type. And deleting the information corresponding to part of the audio and then rewriting the information.
With reference to the first aspect, the ring tone information of the first ring tone includes a first uniform resource identifier uri corresponding to a first audio; the first identifier is included in the first uri; the terminal sets the ring information of the first ring based on the first database in the second media library to obtain the set ring information, and the method specifically comprises the following steps: the terminal acquires a second identifier from the first database based on the first path; when the second identifier is obtained from the first database based on the first path, the second path associated with the second identifier is the same as the first path; the terminal replaces a first identifier in a first uri included in the ring information of the first ring with the second identifier to obtain the set ring information; in the case that the second identifier is not obtained from the first database based on the first path, the second path associated with the second identifier is different from the first path; the terminal determines the second path from the first database based on the file name included in the first path; acquiring an identifier associated with the second path as a second identifier; the terminal replaces a first identifier in a first uri included in the ring information of the first ring with the second identifier to obtain the set ring information; the file name included in the second path is the same as the file name included in the first path.
With reference to the first aspect, before the terminal completes scanning of the external volume, the method further includes: the terminal changes the first ringtone from a first audio to a default audio.
In the above embodiment, in order to prevent the problem that the first audio cannot be determined to be played and thus muted according to the to-be-set ring tone information when the first function is executed after the start-up is performed due to the fact that the external volume scanning time is too long under the condition that the first audio is determined to be the external audio, the terminal may first use the default audio in which the path and the uri are determined as the first ring tone, and after it is determined that the external volume scanning is completed, the terminal may set the to-be-set ring tone information so that the first ring tone is updated from the default audio to the first audio.
With reference to the first aspect, the ring tone information of the first ring tone includes a first uniform resource identifier uri corresponding to a first audio; the first identifier is included in the first uri; the terminal sets the ring information of the first ring based on a second database in the second media library to obtain the set ring information, and the method specifically comprises the following steps: in the case that the first ringtone is determined to be default audio, the terminal acquires a second identifier from the second database based on the first path; when the second identifier is obtained from the second database based on the first path, the second path associated with the second identifier is the same as the first path; the terminal replaces a first identifier in a first uri included in the ring information of the first ring with the second identifier to obtain the set ring information; in the case that the second identifier is not obtained from the second database based on the first path, the second path associated with the second identifier is different from the first path; the terminal determines the second path from the second database based on the file name included in the first path; acquiring an identifier associated with the second path as a second identifier; the terminal replaces a first identifier in a first uri included in the ring information of the first ring tone with the second identifier to obtain the set ring tone information; the file name included in the second path is the same as the file name included in the first path.
With reference to the first aspect, the determining, by the terminal, whether the first audio is an internal audio specifically includes: the terminal determines that the first audio is an internal audio if the terminal includes a first field in a first uri corresponding to the first audio in the ring information of the first ring; and the terminal determines that the first audio is the external audio based on that the first uri corresponding to the first audio in the ring tone information of the first ring tone comprises the second field.
With reference to the first aspect, the terminal includes an application setting application and an audio management module, and the method further includes: after the setting application receives the starting broadcast, registering and monitoring whether the second media library changes; and under the condition that the setting application determines that the second media library changes, the audio management module sets the ring information of the first ring based on the second media library to obtain the set ring information.
In the above embodiment, after the internal volume is scanned, the information corresponding to the internal audio may be written into the new media library, so that the new media library is changed. After the terminal determines that the new media library changes, the ring information to be set can be triggered to be set. Compared with the scheme, the time for the terminal to trigger the setting of the ringtone information to be set is about 20s faster. The failure to play the first audio while performing the first function does not occur within 20s after power-on.
In a second aspect, the present application provides an electronic device comprising: one or more processors and memory; the memory coupled with the one or more processors, the memory to store computer program code, the computer program code including computer instructions, the one or more processors to invoke the computer instructions to cause the electronic device to perform:
in the above embodiment, before the terminal generates the new media library, the terminal may first determine the upgrade type. For different upgrading types, the terminal can determine a new media library based on different modes, and then, the ring information of the first ring is set to obtain the set ring information, so that the terminal can obtain the first audio through the set ring information. Thus, the first ring tone can be consistent before and after the system is upgraded and is the first audio.
In a third aspect, the present application provides an electronic device, comprising: one or more processors and memory; the memory is coupled to the one or more processors, the memory for storing computer program code, the computer program code comprising computer instructions, which the one or more processors invoke to cause the electronic device to perform the method as described in the first aspect or any one of the embodiments of the first aspect.
In the above embodiment, before the terminal generates the new media library, the terminal may first determine the upgrade type. For different upgrading types, the terminal can determine a new media library based on different modes, and then, the ring information of the first ring is set to obtain the set ring information, so that the terminal can obtain the first audio through the set ring information. Thus, the first ring tone can be kept consistent before and after the system is upgraded and is the first audio.
In a fourth aspect, the present application provides a chip system applied to an electronic device, where the chip system includes one or more processors, and the processor is configured to invoke computer instructions to cause the electronic device to perform the method described in the first aspect or any one of the implementation manners of the first aspect.
In the above embodiment, before the terminal generates the new media library, the terminal may first determine the upgrade type. For different upgrading types, the terminal can determine a new media library based on different modes, and then, the ring information of the first ring is set to obtain the set ring information, so that the terminal can obtain the first audio through the set ring information. Thus, the first ring tone can be consistent before and after the system is upgraded and is the first audio.
In a fifth aspect, the present application provides a computer program product comprising instructions which, when run on an electronic device, cause the electronic device to perform the method as described in the first aspect or any one of the embodiments of the first aspect.
In the above embodiment, before the terminal generates the new media library, the terminal may first determine the upgrade type. For different upgrading types, the terminal can determine a new media library based on different modes, and then, the ring information of the first ring is set to obtain the set ring information, so that the terminal can obtain the first audio through the set ring information. Thus, the first ring tone can be kept consistent before and after the system is upgraded and is the first audio.
In a sixth aspect, the present application provides a computer-readable storage medium comprising instructions that, when executed on an electronic device, cause the electronic device to perform the method as described in the first aspect or any one of the implementation manners of the first aspect.
In the above embodiment, before the terminal generates the new media library, the terminal may first determine the upgrade type. For different upgrading types, the terminal can determine a new media library based on different modes, and then, the ring tone information of the first ring tone is set to obtain the ring tone information after setting, so that the terminal can obtain the first audio through the ring tone information after setting. Thus, the first ring tone can be consistent before and after the system is upgraded and is the first audio.
Drawings
FIG. 1 is a diagram illustrating a terminal keeping a consistent ring tone before and after a system upgrade;
fig. 2 shows a signaling interaction diagram for setting ring after upgrading the terminal system to keep consistency in one solution;
FIG. 3 illustrates the transmission and reception process of an internal volume scan completion broadcast;
fig. 4 shows another scenario in which a signaling interaction diagram is set for ring after the terminal system is upgraded to keep consistency;
FIG. 5 is a schematic diagram showing the completion of an internal volume scan until a change in a new media library is monitored;
fig. 6 shows a schematic flow chart involved when a terminal sets information to be set;
fig. 7 is a schematic flowchart of setting ring information to be set by a terminal in a first upgrade type;
fig. 8 is a schematic flowchart illustrating that the terminal sets the ring tone information to be set based on the new media library with the first change and the original path corresponding to the audio to obtain the set ring tone information;
fig. 9 illustrates a diagram in which a terminal changes a first bell to a default audio and then sets it as a first audio;
fig. 10 is a schematic flowchart of setting ring information to be set by a terminal in a second upgrade type;
fig. 11 is a schematic flowchart of setting ring information to be set by a terminal in a third upgrade type;
fig. 12 is a schematic structural diagram of a terminal according to an embodiment of the present application.
Detailed Description
The terminology used in the following examples of the present application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in the specification of this application and the appended claims, the singular forms "a", "an", "the" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the listed items.
In the following, the terms "first", "second" are used for descriptive purposes only and are not to be construed as implying or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature, and in the description of embodiments of the application, unless stated otherwise, "plurality" means two or more.
In this application, the embodiment of the present application is described by taking the first audio as the first ring tone before the system is upgraded.
The following describes terms related to embodiments of the present application.
(1) Media library
The media library may be used to record information corresponding to each audio in the terminal.
In some possible cases, the information corresponding to the audio in the media library may include at least a storage path (path) corresponding to the audio and an identification number (ID) corresponding to the audio. A path (storage path) corresponding to the audio may be used to indicate a location in the terminal where the audio is stored, and a file name corresponding to the audio may also be included in the path. The audio's corresponding identification number (ID) may be used to indicate the location of the audio in the media library.
In some possible cases, the file name corresponding to the audio may be the audio name corresponding to the audio and the adjacent level directory where the audio name is located. And the neighbor directory does not include a preset field (e.g., the first preset field referred to below). Generally, the neighbor level directory may include X audios, and the names of the audios corresponding to the X audios are different. For example, the audio corresponds to the paths: "/system/media/audio/XXX-1/A1.Ogg", the corresponding audio name is the last stage in the path, i.e., "A1.Ogg" field. Divided by the character "/", the contiguous level directory where the audio name is located is the "XXX-1" field, and the file name includes the "a1.Ogg" field and the "XXX-1" field.
In some possible cases, the file name corresponding to the audio may be the audio name corresponding to the audio and the top Y adjacent level directories where the audio name is located. And the N neighbor level directories do not include a preset field (e.g., the first preset field referred to below). Here, Y =2 is taken as an example, and for example, the path corresponding to the audio is: "/system/media/audio/XXX-1/A1.Ogg", the corresponding audio name is the last stage in the path, i.e., "A1.Ogg" field. Divided by the character "/", the top 2 adjacent level directories where the audio name is located are the "XXX-1" field and the "audio" field, and the file name includes the "a1.Ogg" field and the XXX-1 field as well as the "audio" field.
In other possible cases, the file name corresponding to the audio may be the audio name corresponding to the audio.
The identification number (id) corresponding to the audio is also recorded in a Uniform Resource Identifier (URI) corresponding to the audio. The uri corresponding to the audio may be used to identify the nature and information of the audio. For example, whether the audio is internal or external audio, and an identification number (ID) of the audio in the media library. The identification number of the audio in the media library that is included in the uri to which the audio corresponds may be referred to as the id in the uri to which the audio corresponds. For example, uri for audio A is: content:// media/internal/audio/media/8. The uri includes a plurality of fields, wherein the field "internal" indicates that the audio is internal audio. The field "8" is the id in the uri corresponding to the audio, which is the same as the identification number (id) of the audio in the media library.
In other possible cases, the information corresponding to the audio in the media library may include other information besides the path corresponding to the audio and the identifier corresponding to the audio, such as one or more of an audio name corresponding to the audio, a length corresponding to the audio, and the like. For example, the identifier corresponding to the audio a is associated with the path corresponding to the audio a, that is, the path of the audio a can be determined by the identifier corresponding to the audio a, and the identifier corresponding to the audio can also be determined by the path corresponding to the audio a.
The embodiment of the present application is described herein by taking the first audio as the first ring tone before the system upgrade.
In the embodiment of the present application, when the first audio is used as the first ring tone, the audio corresponding to the first ring tone may also be referred to as the first audio. If the first audio is used as the first ring tone before and after the system upgrade, the first ring tone can be said to be consistent before and after the system upgrade.
It should be understood that, in the case of using the first audio as the first ring tone, the audio name corresponding to the first audio is the setting value corresponding to the first ring tone setting item. The audio name corresponding to the first audio is associated with the uri corresponding to the first audio, and an identifier (id) in the uri is associated with the path corresponding to the first audio. The method for the terminal to acquire the first ring to play comprises the following steps: the uri (uri corresponding to the first audio) associated with the audio name is determined through the audio name corresponding to the first audio, the identifier corresponding to the audio is obtained through the uri, the path (namely, the storage path) corresponding to the identifier is obtained from the media library based on the identifier, and then the audio under the path is obtained from the memory and is played as the first ring. The path corresponding to the first audio is associated with the id in the uri corresponding to the first audio and is recorded in the media library together.
The media library may include an internal audio database and an external audio database.
Wherein the internal audio database may be used to store information corresponding to the internal audio. And information corresponding to the external audio database. The internal audio database and the external audio database may be stored in the same format or in different formats.
Table 1 shows one example of storing audio in a media library.
Identifier (id) Route corresponding to audio (path) Audio names
1 /system/media/audio/ringtone/XX1.ogg XX1.ogg
2 /system/media/audio/ringtone/XX2.ogg XX2.ogg
3 /system/media/audio/ringtone/XX3.ogg XX3.ogg
TABLE 1
Shown in table 1 is an example of an internal audio database, which includes information corresponding to internal audio. The information includes an identifier (id) corresponding to the internal audio, a path corresponding to the internal audio, and an audio name corresponding to the internal audio.
(2) First ring information
The terminal before the system upgrade includes first ring information corresponding to the first ring, and the first ring information may be used to determine a path corresponding to a first audio to obtain the first audio to play as the first ring. In some possible cases, the uri corresponding to the first audio is included in the first ringtone information. Before the system is upgraded, the uri corresponding to the first audio included in the first ringtone information may be referred to as an original uri corresponding to the first audio.
After the system is upgraded, the terminal may obtain the first ring tone information before the system is upgraded as the first ring tone information in the terminal after the system is upgraded, but the audio information stored in the media library after the system is upgraded may be changed, for example, the media library (new media library) in the terminal after the system is upgraded may be changed as follows compared with the media library (original media library) in the terminal before the system is upgraded: the uri corresponding to the first audio changes. Therefore, the corresponding path (new path) of the first audio after the upgrade cannot be acquired based on the original uri. At this time, after the upgrade, the original uri corresponding to the first audio included in the first ringtone information needs to be calibrated, and the original uri is set to be the uri (target uri) corresponding to the first audio after the upgrade. The description about the media library can refer to the related content in the aforementioned term (1), and is not repeated herein.
After the system is upgraded, the first ring tone information obtained by the terminal before the system is upgraded may be referred to as ring tone information to be set, where the ring tone information to be set includes the original uri corresponding to the first audio. Based on the foregoing description, after the system is upgraded, the original uri included in the to-be-set ring tone information may not be able to determine the new path corresponding to the first audio, so that the to-be-set ring tone information may be set, and an identifier in the original uri in the to-be-set ring tone information is updated to a target identifier (target id), so as to obtain the set ring tone information. The set ring tone information includes a target uri corresponding to the first audio, the target uri includes a target id, and the target id is associated with the new path in the new media library.
Situations that result in a change in the new media library after a system upgrade as compared to the original media library include, but are not limited to, the following:
case 1: after the system is upgraded, if the packet names of the new media library are different from those of the original media library, the audio (including the internal audio and the external audio) in the terminal needs to be scanned to obtain information corresponding to each audio, and the information is recorded in the new media library again. In the process of regenerating the new media library, the uri corresponding to each audio is randomly distributed, and the corresponding uri of the same audio before and after upgrading may change, which may cause the new media library to be different from the original media library. The description about this case 1 may refer to the following description of step S104, and will not be expanded here.
Case 2: after the system is upgraded, the package name of the new media library is the same as that of the original media library, and the situation of regenerating the media library in the case 1 is not involved. At this time, the terminal can copy the content in the original media library to the new media library as the content in the new media library, and then update the new media library to obtain the updated new media library as the new media library. The reason for the update here is that: before and after upgrading, the path corresponding to the same audio may change, and the change includes: the original path includes a first preset field, and the first preset field is changed into another preset field (for example, a second preset field or a third preset field referred to below) after the system is upgraded, so that the path is changed. For example, in the case of GTA rectification, an XX-product field may be included in the path of each audio in the terminal before the upgrade, where the XX-product field indicates a name of a folder, and after the upgrade, the name of the folder may be changed to another preset field (product-h), and at this time, the other preset field indicates the name of the folder, and then the path name corresponding to the audio stored in the folder is changed. For example, before the system upgrade, the path of audio a is: XX-product/region _ comm/china/media/audio/notifications/messages. Ogg, then after upgrade, the original path can be updated to a new path: product-h/region _ comm/china/media/audio/notifications/icons. After the path is changed, the terminal may delete the information corresponding to the audio a from the new media library, and then rewrite the information corresponding to the audio a, where the path corresponding to the audio a has already occurred and the path uri corresponding to the audio a may also be changed. The description about this case 2 may refer to the following description of step S105, and the description will not be expanded here.
(3) Internal volume scanning and external volume scanning
The internal volume scan refers to scanning internal audio, and the external volume scan refers to scanning external audio. The terminal can generate an internal volume database in the new media library through internal volume scanning, and generate an external volume database in the new media library through external volume scanning.
It should be understood that the audio in the terminal may include internal audio as well as external audio, wherein the internal audio may include audio set in the terminal before leaving a factory or system audio; the external audio is audio downloaded by a user in the using process after the terminal leaves a factory, for example, the audio is downloaded through third-party software. Generally, the number of internal audios is small, and the internal audios may be stored in the terminal after being compressed, the length of the internal audios is short. The amount of external audio is not controllable and is related to the amount of user downloads, but typically the external audio is longer in length compared to the internal audio, which may include the external audio being stored without compression.
In some possible cases, the terminal may then perform an internal volume scan as well as an external volume scan after the system if a change in the new media library is involved. Since the number of internal tones is small and short in length, the number of external tones is typically long in length and typically more numerous than the internal tones, and the terminal typically takes less time to complete the internal volume scan than the external volume scan.
In one arrangement, the terminal uses the first audio as a first ring tone prior to system upgrade. And the first ring tone information is recorded in the terminal. After the system is upgraded, the terminal may acquire the first ring information before the system is upgraded as ring information to be set. Then, the set ring tone information can be set to obtain the set ring tone information, so that the terminal can obtain the first audio through the set ring tone information. Thus, the first ring tone can be consistent before and after the system is upgraded and is the first audio. The first ring is an audio played when the first function is executed for the terminals before and after upgrading, for example, when the first ring is an incoming call ring, the first function may be a function of opening a call application to perform communication between the terminals.
Wherein, reference may be made to the foregoing description related to the term (2) for the first ring tone information and the content of the first audio determined by the first ring tone information, which is not described herein again.
Fig. 1 shows a schematic diagram of a terminal keeping a consistent ring tone before and after a system upgrade.
Fig. 2 shows a signaling interaction diagram in a scenario where a ring tone is set after the terminal system is upgraded to maintain consistency.
This scheme is described in detail below in conjunction with fig. 1 and 2.
As shown in fig. 1, the first ringtone setting item may be one of an incoming ringtone setting item, an informational ringtone setting item, and a notification ringtone setting item.
As shown in (1) in fig. 1, an interface is provided for "sound and vibration" that the terminal was involved in before the system upgrade. As shown in (2) in fig. 1, an interface is set for "sound and vibration" involved in the terminal after system upgrade. The setting values corresponding to the incoming call ringtone setting item, the information ringtone setting item and the notification ringtone setting item which are included in the sound and vibration setting interface before and after upgrading are not changed, which indicates that the audio corresponding to each ringtone can be consistent before and after upgrading.
The interaction between the modules in the scheme that the terminal makes the audio corresponding to the ring tone consistent can refer to the following description of step S11-step S15.
And S11, starting a system service module in the terminal after the system is determined to be upgraded.
After the system is upgraded, the terminal is usually rebooted, and after the terminal is booted, the terminal enters a new system.
And S12, the system service module sends starting broadcast to each module.
The system service module can send startup broadcast to each module after determining startup. Wherein, each module comprises an audio management module, a media library management module and the like.
The function of sending the startup broadcast is to inform each module terminal of being in a startup state and trigger each module to start the initialization of the relevant functions.
And S13, the media library management module performs internal volume scanning under the condition of determining that the new media library package name changes.
The media library module may trigger a detection of whether the new media library package name has changed after receiving the startup broadcast. Under the condition that the media library management module determines that the original media library package name is inconsistent with the new media library package name, the media library management module can determine that the package name of the new media library is changed after the system is upgraded.
And the media library management module scans the internal volume under the condition of determining that the new media library package name is changed. And generating a new media library based on the information corresponding to the scanned internal audio.
And S14, after the media library management module finishes internal volume scanning, sending internal volume scanning finish broadcast to each module at a time A.
The internal volume scan complete broadcast is used to inform the various modules that the internal volume scan has been completed.
It should be understood that step S13 and step S14 are performed based on the case where the internal volume scan is completed first, and in practical cases, there may be a case where the external volume scan is completed first, and the internal volume related description should be changed to the external volume related description here. After the external volume scan is completed, an external volume scan complete broadcast is sent to each module. The process may refer to the related description of scanning the inner volume, which is not described herein.
And S15, at the moment B, the audio management module receives the broadcast of the internal volume scanning completion and then triggers to set the ring tone information to be set.
The audio management module may determine that a new media library has been generated after receiving the internal volume scan complete broadcast. At this time, the information corresponding to the internal audio in the terminal is already stored in the new media library, and the ring information to be set can be set based on the new media library, so as to obtain the ring information after setting.
In some possible cases, the audio management module may include a HnRingtoneUriAutoCorretor class, which may be used to receive an internal volume scan completion broadcast sent by the media library management module. The audio management module may further include a uri pdateservice class, and the uri pdateservice class may be used to set ring information to be set.
However, there is a delay of about 20s between the completion of the broadcast by the media library management module from the internal volume scan to the receipt of the broadcast by each module. That is, the difference between the time B and the time a is about 20s, which may result in that the audio management module cannot set the ring tone information to be set quickly after the internal volume is scanned. Generally speaking, after the internal volume scanning is completed, the terminal may generate (including regenerating and updating) a new media library, but in the foregoing scheme, the audio management module may trigger the setting of the ring tone information to be set only about 20s after the new media library is generated, and in the time of about 20s, if the terminal needs to play the first ring tone after executing the first function, there may be a case that the first ring tone cannot be played. At this time, the terminal is not set based on the ring information with setting, but the ring information with setting includes the original uri corresponding to the first audio, and when the identifier of the first audio in the new media library changes, the new path corresponding to the first audio cannot be acquired through the ring information with setting. The terminal may fail to play the first audio while performing the first function within about 20s after the terminal is powered on after the upgrade.
Fig. 3 shows a process of transmitting and receiving an internal volume scan completion broadcast.
As shown in fig. 3, the media library management module generates an internal volume scan complete broadcast at 16 (time a) at 41, and the audio management module receives the internal volume scan complete broadcast at 16 (time B). I.e. the difference between time B and time a is about 20s.
In order to solve the aforementioned problem that the terminal may fail to play the first audio when the terminal executes the first function within about 20s after the terminal is powered on. The embodiment of the application provides another scheme, and the ring information set by the band can be set in advance.
In the scheme, the terminal can monitor whether the new media library changes or not, and can trigger the setting of the ring tone information to be set even if the broadcast of the internal volume scanning completion is not received under the condition that the media library changes.
Generally, after the internal volume scanning is completed, the writing of the information corresponding to the internal audio to the new media library may be completed, so that the new media library may be changed. After the terminal determines that the new media library changes, the ring information to be set can be triggered to be set. Compared with the scheme, the time for the terminal to trigger the setting of the ringtone information to be set is about 20s faster. The failure to play the first audio while performing the first function does not occur within 20s after power-on.
Fig. 4 shows another scheme of setting ring tone after upgrading the terminal system to maintain consistent signaling interaction diagram.
For the description of this scheme, reference may be made to the following description of steps S21 to S27.
And S21, starting a system service module in the terminal after the system is determined to be upgraded.
And S22, the system service module sends startup broadcast to each module.
For the description of step S21 and step S22, reference may be made to the description of step S11 and step S12, respectively, and the description is not repeated here.
And S23, after the setting application receives the startup broadcast, the setting application can register and monitor whether the new media library changes.
After registering and monitoring the change of the new media library, once the internal volume is scanned, the information corresponding to the internal audio is written into the new media library, and then the setting application can monitor the change of the new media library.
And S24, the media library management module starts internal volume scanning under the condition of determining that the new media library package name changes, and finishes internal volume scanning at the moment C.
The description of the media library module for internal volume scanning may refer to the description of step S14 previously described. At time C, the media library management module may complete the internal volume scan and write the information corresponding to the scanned internal audio into the media library.
And S25, at the moment D, setting the application to monitor that the new media library changes.
The difference between the time D and the time C is short (less than 1 s), that is, after the internal volume is scanned, the setup application can monitor that the new media library is changed.
Fig. 5 shows a schematic diagram of the internal volume scan being completed to listen for a change in the new media library.
As shown in fig. 5, the media library management module completes the internal volume scan at 16, 41, 40.644 (time C), and the setup application hears that the new media library has changed at 16, 42, 02.647 (time D). Time D differs from time C by about 3 ms.
S26, the setting application informs the audio management module to set the ring information to be set.
And S27, the audio management module starts to set the ring information to be set.
Compared with the previous solution, here in step S27, the time for the audio management module to start setting the ring tone information to be set is advanced by about 20S. After the computer is started, the setting of the ring tone information to be set can be completed in a short time, and the problem that the first audio cannot be played successfully when the first function is executed can be solved.
The terminal may trigger setting of the ring tone information to be set in the aforementioned step S14 and step S27. The following description may be referred to for a process of setting the ring information to be set by the terminal.
The terminal first determines whether the first audio is an internal audio, and in the case that the first audio is determined to be an internal audio, the terminal may set the ring tone information to be set based on the new media library to which the information corresponding to the internal audio is added. In order to prevent the problem that the first audio cannot be determined to be played and muted according to the to-be-set ring tone information when the first function is executed after the first audio is determined to be the external audio due to the fact that the external volume is scanned for too long time, the terminal may first use the default audio in which the path and the uri are determined as the first ring tone, and after the external volume is determined to be scanned, the terminal may set the to-be-set ring tone information so that the first ring tone is updated from the default audio to the first audio.
Therefore, under the condition that the first audio is the external audio, the problem that after the first ring tone is started up when the external volume scanning is not finished and the first function is executed, the first audio cannot be determined to be played according to the ring tone information to be set so as to be silent can be avoided under the condition that the first ring tone is consistent before and after the upgrading, and under the condition that the external volume scanning is not finished, the terminal can play the default audio when the first function is executed.
For the aforementioned references to generating a new media library, this may include regenerating and generating a new media library based on the original media library update. Before the terminal generates a new media library, the terminal may first determine the upgrade type. For different upgrading types, the terminal can determine a new media library based on different modes, and then set the ring information to be set based on the media library to obtain the updated ring information.
Fig. 6 shows a schematic flow chart involved when the terminal sets the information to be set.
The description of this process may refer to the following description of steps S101 to S105. The following describes the process in detail with the first audio as the first ring tone before the system upgrade.
S101, after the terminal finishes system upgrading, a new media library and information of the new media library are obtained, and at the moment, the new media library does not include information corresponding to the audio.
The audio includes internal audio as well as external audio. For the related description of the internal audio and the external audio, reference may be made to the foregoing description of term (3), which is not repeated herein.
And the new media library is used for recording the information corresponding to the audio in the terminal after the system is upgraded. The description of the media library may refer to the description of term (1) and will not be repeated here.
The new media library information of the new media library may include a package name corresponding to the new media library, i.e., a new media library package name.
It should be understood that, in the case of internal volume scanning and external scanning after the terminal is upgraded and then powered on, the new media library does not include information corresponding to the audio.
In some possible cases, the subsequent terminal may perform internal volume scanning to write information corresponding to the internal audio into the new media library, and perform external volume scanning to write information corresponding to the external audio into the new media library.
S102, the terminal obtains ring tone information to be set in the system before upgrading, an original path corresponding to the first audio, an original media library and original media library information, wherein the ring tone information to be set comprises an original uri corresponding to the first audio, the first ring tone is an audio played when the terminal executes a first function before upgrading, and the first ring tone is the first audio.
The original media library is a media library used for recording information corresponding to audio (internal audio and external audio) in the terminal before the system is upgraded. The description of the media library may refer to the description of term (1) and will not be repeated here.
The original media library information of the original media library may include a package name corresponding to the original media library, that is, an original media library package name.
The set ring tone information may include an original uri corresponding to a first audio, where the original uri corresponding to the first audio represents a uri corresponding to the first audio recorded in the terminal before the system is upgraded.
The original path corresponding to the first audio is the path corresponding to the first audio in the terminal before the system is upgraded. The first original path may be recorded in an original media library and corresponds to an identifier (id) in the original uri.
It should be understood that, before the system is upgraded, when the terminal executes the first function, the original path corresponding to the first audio may be determined from the original media library according to the original uri corresponding to the first audio. Thereby acquiring the audio (first audio) in the original path as the first ring tone for playing. The first ring tone may be default of the system, or may be set by the user through the terminal during the use of the terminal. After the system is upgraded, an identifier (id) corresponding to the first audio stored in the new media library may change, and then a path corresponding to the first audio cannot be determined after the system is upgraded based on the identifier in the original uri recorded in the to-be-set information, so that it is necessary to set the to-be-set ringtone information in the subsequent step, and update the identifier in the original uri included in the to-be-set ringtone information to the identifier corresponding to the first audio in the current new media library. For the description of the process, reference may be made to the following description of step S104, S105, or step S106, which is not repeated here.
Wherein, the process of determining the original path corresponding to the first audio from the original media library according to the original uri corresponding to the first audio comprises the following steps: determining an original uri (original uri corresponding to the first audio) associated with the audio name through the audio name corresponding to the first audio, acquiring an identifier corresponding to the first audio through the original uri, and acquiring a path (namely an original path) corresponding to the identifier from an original media library based on the identifier.
S103, the terminal determines an upgrading type based on original paths corresponding to the multiple audios and the media library information, wherein the upgrading type comprises one of a first upgrading type, a second upgrading type and a third upgrading type.
The plurality of audios are all internal audios and external audios in the terminal. The original paths corresponding to the multiple audios can be obtained from an original media library.
The media library information comprises new media library information and original media library information, wherein the new media library information comprises a new media library, and the original media library information comprises an original media library packet name.
The upgrade types include a first upgrade type, a second upgrade type, and a third upgrade type.
The first upgrading type is the upgrading type that the media library package name changes before and after the system is upgraded.
The second upgrading type is the upgrading type that the name of the media library package is not changed before and after the system is upgraded, but the original path corresponding to the audio comprises the first preset field.
The third upgrade type is an upgrade type in which the packet name of the media library is not changed before and after the system upgrade, and the original path corresponding to the audio does not include the first preset field, which means that the path of the same audio is not changed before and after the upgrade.
And (3) analyzing the process of determining the upgrade type by the terminal based on the description of the term (2).
And under the condition that the terminal determines that the new media library package name is different from the original media library package name, the terminal can determine that the upgrading type is the first upgrading type. For example, the original media library package name is: com. Xxxxx 1, package name of new media library: com. Xxxxx 2. The terminal may determine that the new media library package name is not the same as the original media library package name.
When the terminal determines that the new media library package name is the same as the original media library package name, but the original path corresponding to the audio includes the first preset field, the terminal may determine that the upgrade type is the second upgrade type. For example, the original media library package name is: com.xxxxx 1, package name for new media library: com.xxxx1. The terminal may determine that the new media library package name is the same as the original media library package name. For the related content in the original path including the first preset field, reference may be made to the foregoing description of the related content in term (2), which is not repeated herein. When the terminal determines that one original path corresponding to the S audios comprises the first preset field, the terminal can determine that the original path corresponding to the audio comprises the first preset field.
And under the condition that the terminal determines that the new media library package name is the same as the original media library package name and the original path corresponding to the audio does not comprise the first preset field, the terminal can determine that the upgrading type is the third upgrading type. When the terminal determines that one original path does not comprise the first preset field in the original paths corresponding to the S audios, the terminal can determine that the original path corresponding to the audios does not comprise the first preset field.
And S104, under the condition that the upgrading type is determined to be the first upgrading type, the terminal regenerates a new media library, and sets the to-be-ringing information based on the new media library to obtain the set ringing information.
The upgrade type is a first upgrade type, which indicates that the new media library is changed from the original media library package name, and in some possible cases, the upgrade type relates to the change of the media library structure, so that in this case, the terminal may perform internal volume scanning and external volume scanning to regenerate the media library to obtain the new media library, and set the to-be-ring information based on the new media library to obtain the set ring information.
The following description of steps S201 to S212 may be referred to for what this process involves, and will not be repeated here.
And S105, under the condition that the upgrading type is determined to be the second upgrading type, the terminal generates a new media library through updating based on the original media library, and sets the ring information to be set based on the new media library to obtain the set ring information.
And when the upgrade type is a second upgrade type, the new media library is compared with the original media library without change of the package name, but the original path corresponding to the audio comprises a first preset field. In some possible cases, no change in media library structure is indicated. The content in the original media library may be copied to the new media library or the original media library may be treated as the new media library. However, since the original path corresponding to the audio includes the first preset field, the path related to a part of the audio may change after the system is upgraded, and then the information corresponding to the part of the audio in the new media library may be deleted, and then the information corresponding to the part of the audio may be added, so that the new media library may be generated. Then, the terminal may set the ring information to be set based on the new media library to obtain the set ring information.
The content of the process can refer to the following description of steps S401 to S413, which is not repeated here.
And S106, under the condition that the upgrading type is determined to be the third upgrading type, the terminal takes the original media library as a new media library, and sets the ring information to be set based on the new media library to obtain the set ring information.
And when the upgrade type is the third upgrade type, the new media library is not changed from the original media library package name, and the original path corresponding to the audio comprises a first preset field. This means that the content in the new media library may be the same as the original media. At this time, the terminal may use the original media library as a new media library, and set the temporary information to be set based on the new media library to obtain the set ring information.
The content of the process may refer to the following description of step S501 to step S503, which is not repeated herein.
It should be understood that this step S106 is optional, and in some possible cases, the terminal may not execute step S106, and execute the following steps: and under the condition that the terminal determines that the upgrading type is the third upgrading type, setting the ring information to be set based on the original media library to obtain the set ring information. The process is similar to the following steps S502 and S503, and the description related to the new media library is replaced by the original media library, which is not described herein again.
Fig. 7 is a schematic flowchart of setting ring information to be set by a terminal in a first upgrade type.
Based on the foregoing step S104, in the case that the upgrade type is determined to be the first upgrade type, the terminal regenerates the new media library, and sets the to-be-ring information based on the new media library to obtain the set ring information. The description of the procedure may be referred to the following description of steps S201 to S212.
S201, the terminal scans the internal volume and writes the information corresponding to the scanned internal audio into a new media library.
And the terminal performs internal volume scanning, wherein the internal volume scanning refers to scanning internal audio. The terminal may generate an internal volume database in the new media library through internal volume scanning.
In some instances, the terminal may scan for an internal audio, i.e., write information corresponding to the internal audio to the new media library. For example, when the terminal scans the first audio, the information corresponding to the pair of audios may be written into a new media library, where the path corresponding to the first audio and the identifier (id) corresponding to the audio are included, where the identifier corresponding to the audio is associated with the path corresponding to the audio.
It should be understood that, in the new media library, the identifier corresponding to the first audio is system-assigned, and may be different from the identifier before upgrading, so that the identifier in the original uri in the ring tone information to be set needs to be reset subsequently. The identifier before upgrading corresponding to the first audio is the identifier in the original uri in the ring tone information to be set.
In other examples, the terminal may simultaneously write the scanned N internal audios into the new media library, where N is an integer greater than or equal to 2.
S202, after the scanning of the internal volume is completed, the terminal determines that the new media library is changed for the first time.
The new media library is changed into information corresponding to the internal audio and written into the new media library. In particular into the internal audio database of the new media library.
In some examples, the terminal may monitor whether the new media library changes through registration of the setup application, and after the information corresponding to the internal audio is written into the new media library, the setup application may determine that the new media library has changed first.
S203, the terminal determines whether the first audio is an internal audio or not based on the original uri corresponding to the first audio.
Based on the foregoing description, the original uri corresponding to the first audio may be used to represent the nature and information of the first audio.
In the case where the terminal determines that the first target field is included in the original uri, the terminal may determine that the first audio is an internal audio. Wherein the first target field (which may also be referred to as a first field) is a field that may be used to indicate that the first audio is internal audio, such as the aforementioned related "internal".
In the case where the terminal determines that the second target field is included in the original uri, the terminal may determine that the first audio is an external audio. Wherein the second target field may be used to indicate that the first audio is external audio, e.g., the second target field (which may also be referred to as a second field) may be the field "external". For example, the original uri of audio B is: content:// media/external/audio/media/8, then this audio B external audio is represented.
In the case where the terminal determines that the first audio is an internal audio, the following step S204 may be performed.
In the case where the terminal determines that the first audio is the external audio, the following steps S205 to S212 may be performed.
And S204, the terminal sets the ring information to be set based on the new media library with the first change and the original path corresponding to the audio to obtain the set ring information.
The first change occurs when information corresponding to the internal audio is written to the internal audio database of the new media library. The terminal sets the ring information to be set based on the new media library with the first change and the original path corresponding to the audio, and obtains the set ring information. Specifically, the terminal sets the ring tone information to be set based on an internal audio database in the new media library and an original path corresponding to the audio, and obtains the set ring tone information.
Since the terminal has a short time to complete the internal volume scan, the ring tone setting information may be set after the first audio is determined to be the internal audio, and the process may be completed within 1-2s after the terminal is turned on.
Fig. 8 shows a schematic flowchart of the terminal setting the ring tone information to be set based on the new media library with the first change and the original path corresponding to the audio to obtain the set ring tone information.
Here, the process may refer to the following description of step S301 to step S307.
S301, the terminal determines to finish obtaining the original path corresponding to the first audio.
And when the terminal determines that the original path corresponding to the acquired first audio is not empty, the terminal determines to finish acquiring the original path corresponding to the first audio.
When the terminal determines that the original path corresponding to the obtained first audio is empty, the terminal may obtain the original path corresponding to the first audio again, and continue to execute step S301 until the obtaining of the original path corresponding to the first audio is completed.
S302, the terminal determines whether a target id can be obtained based on the original path, wherein the target id is an id associated with the original path in the new media library.
The new media library involved in step S302 is the new media library in which the first change has occurred, and specifically relates to the internal audio database in the new media library.
This step S302 is described here by way of example with reference to table 1 as the internal audio database in the original media library, and table 2 as the internal audio database in the new media library or the internal audio database in the new media library of table 3.
With regard to table 1, reference may be made to the foregoing references related to table 1. Table 2 can be as follows.
Identifier (id) Path corresponding to audio (path) Audio names
4 /system/media/audio/ringtone/XX1.ogg XX1.ogg
5 /system/media/audio/ringtone/XX2.ogg XX2.ogg
6 /system/media/audio/ringtone/XX3.ogg XX3.ogg
TABLE 2
In the case that the terminal determines that the original path exists in the internal audio database of the new media library, the terminal may acquire an identifier associated with the original path as a target id, which indicates that the path corresponding to the first audio does not change before and after the system upgrade. For example, referring to table 1 and table 2 referred to above, assuming that xx1.Ogg is the first audio, referring to table 1, the original path corresponding to xx1.Ogg is/system/media/audio/ring/xx1. Ogg, referring to table 2, the terminal may determine that the original path is included in table 2, and then the original path has an associated identification number of 4 in table 2, that is, the target id is 4.
With regard to table 1, reference may be made to the foregoing in relation to table 1. Table 3 may be as follows.
Identifier (id) Route corresponding to audio (path) Audio names
4 /system/media/audio/tone/XX1.ogg XX1.ogg
5 /system/media/audio/tone/XX2.ogg XX2.ogg
6 /system/media/audio/tone/XX3.ogg XX3.ogg
TABLE 3
And under the condition that the terminal determines that the original path is not included in the internal audio database of the new media library, the terminal cannot acquire the target id. This indicates that the path corresponding to the first audio has not changed before and after the system upgrade. For example, referring to table 1 and table 3 referred to above, assuming that xx1.Ogg is the first audio, referring to table 1, original path corresponding to xx1.Ogg is/system/media/audio/ring/xx1. Ogg, referring to table 2, the terminal may determine that the original path is not included in table 2.
In the case where the terminal determines that the new media library exists in the original path, the terminal may acquire an identifier associated with the original path as a target id, and then the terminal may perform the following step S303.
And under the condition that the terminal determines that the new media library does not comprise the original path, the terminal cannot acquire the target id. The terminal may then perform steps S304-S307 described below.
And S303, the terminal replaces the id in the original uri corresponding to the first audio in the ring information to be set with the target id to obtain the set ring information.
And the terminal replaces the id in the original uri corresponding to the first audio in the first audio by the target id to obtain the target uri, so that the set ring information can be obtained. I.e. the target uri included in the set ring tone information. Since the target id is associated with the path corresponding to the first audio in the new media, the terminal may acquire the first audio based on the target uri to play as the first ring tone.
S304, the terminal obtains the file name corresponding to the first audio based on the original path corresponding to the first audio.
In some embodiments, the file name may be an audio name corresponding to the audio, and the audio name corresponding to the audio may be kept constant before and after the system upgrade. That is, the audio name may be included in the path corresponding to the first audio before and after the system upgrade. For example, referring to the foregoing tables 1 to 3, in the case that the first audio is xx1.Ogg, the terminal may determine that an audio name corresponding to xx1.Ogg may be included in a path corresponding to xx1.Ogg, and the field "xx1.Ogg" is included in the path regardless of whether the path is changed.
The terminal can obtain the file name corresponding to the first audio based on the field of the file name recorded in the original path corresponding to the first audio.
S305, the terminal acquires a target path from the new media database based on the file name, wherein the file name included in the target path is the same as the file name included in the original path.
In the case of the file name being the audio name, referring to the foregoing table 1 and table 3, when the first audio is xx1.Ogg, the path can be determined: "/system/media/audio/tone/XX1.Ogg" is the target path that includes the first audio. Although the target path is different from the original path, a file name (audio name) corresponding to the first audio is included in both the target path and the original path.
It should be understood that, in the case where the file name is an audio name, if two paths (path a and path B) of the same file name are included in the new corpus, a path with a high priority may be determined as the target path. Wherein, the high priority includes but is not limited to the following cases:
case 1: the smaller the identifier for the path a and the path B is, the higher the priority is.
Case 2: the path corresponding to the internal audio has a higher priority than the path corresponding to the external audio.
The priorities of the path a and the path B may also be determined according to other priority determination manners, and should not be limited in the embodiments of the present application.
It should be understood that, in this embodiment, the file name is taken as an example of an audio name, in practical cases, the file name may also be other contents, for example, the file name corresponding to the audio may be an audio name corresponding to the audio in the original path corresponding to the audio and an adjacent-level directory where the audio name is located, and the adjacent-level directory does not include a preset field (for example, the aforementioned first preset field). The file name corresponding to the audio can also be the audio name corresponding to the audio in the original path corresponding to the audio and the front Y adjacent level directories where the audio name is located. And the N neighbor level directories do not include a preset field (e.g., the first preset field mentioned above).
S306, the terminal determines the id corresponding to the target path as a target id.
And the terminal determines that the id corresponding to the target path is the target id, namely the terminal determines that the id associated with the target path is the target id. For example, as can be seen from tables 1 and 3, the terminal can determine the following target path: if id associated with "/system/media/audio/tone/xx1.Ogg" is 4, the terminal may determine that the target id is 4.
And S307, the terminal replaces the id in the original uri corresponding to the first ring in the ring information to be set with the target id to obtain the set ring information.
And the terminal replaces the id in the original uri corresponding to the first audio in the ring information to be set with the target id to obtain the target uri, so that the set ring information can be obtained. I.e. the target uri included in the set ring tone information. Since the target id is associated with the path corresponding to the first audio in the new media, the terminal may acquire the first audio based on the target uri to play as the first ring tone.
S205, the terminal establishes a temporary database to record an original path corresponding to the first audio.
In the case that the first audio is determined to be the external audio, the terminal may create a temporary database to record the original path corresponding to the first audio.
S206, the terminal changes the first ring tone from the first audio to a default audio.
Based on the foregoing, it can be seen that the time involved in the external volume scanning by the terminal is long, and in order to prevent the problem that the first audio cannot be determined to be played according to the to-be-set ring information so as to be muted when the first function is executed after the terminal is turned on due to the long external volume scanning time, the terminal may first use the default audio as the first ring.
In some examples, the terminal may replace the id in the original uri in the ring tone information to be set with the id corresponding to the default audio.
As shown in fig. 9, the terminal changes the first bell from the first audio to the default audio before the external volume scan is completed. For example, in the case that the first ring tone is the incoming ring tone of the card 1, the corresponding first audio is the ring tone A1, and the terminal may change it to the default ring tone 1.
And S207, the terminal scans the external volume and writes the information corresponding to the scanned external audio into a new media library.
And the terminal performs external volume scanning, wherein the external volume scanning refers to scanning external audio. The terminal may generate an external volume database in the new media library through external volume scanning.
In some instances, the terminal may scan for an external audio, i.e., write information corresponding to the external audio to the new media library. For example, when the terminal scans the first audio, the information corresponding to the pair of audios may be written into a new media library, where the path corresponding to the first audio and the identifier (id) corresponding to the audio are included, where the identifier corresponding to the audio is associated with the path corresponding to the audio.
It should be understood that, in the new media library, the identifier corresponding to the first audio is system-assigned, and may be different from the identifier before upgrading, so that the identifier in the original uri in the ring tone information to be set needs to be reset subsequently. The identifier before upgrading corresponding to the first audio is the identifier in the original uri in the ring tone information to be set.
In other examples, the terminal may simultaneously write the scanned N external audios into the new media library, where N is an integer greater than or equal to 2.
And S208, after the scanning of the external volume is completed, the terminal determines that the new media library has a second change.
And the new media library is changed for writing the information corresponding to the external audio into the new media library. In particular to an external audio database in the new media library.
In some examples, the terminal may monitor whether the new media library changes through registration of the setup application, and after information corresponding to the external audio is written into the new media library, the setup application may determine that the new media library has a second change.
S209, the terminal determines whether the first ring tone is the default audio.
In case that the terminal determines the first bell sound as the default audio, the terminal may perform the following step S212.
In the case that the terminal determines that the first ringtone is not the default audio, it means that after the system upgrade, the user sets the first ringtone through the terminal, and changes the first ringtone from the default audio to another audio.
S210, the terminal obtains an original path corresponding to the first audio from the temporary database.
And S211, the terminal sets the ring information to be set based on the new media library with the second change and the original path corresponding to the first audio to obtain the set ring information.
Specifically, the ring tone information to be set is set based on the external audio database in the new media library with the second change and the original path corresponding to the first audio, so as to obtain the set ring tone information.
For the description of the process, reference may be made to the foregoing description of step S301 to step S307, and the new media library in step S301 to step S307 may be changed into the new media library with the second change and the internal audio database may be replaced by the external audio database, which is not described herein again.
At this time, the terminal may change the first bell sound from the default audio to the first audio.
As shown in fig. 9, after the external volume scanning is completed, the terminal changes the first bell sound from the default audio to the first audio. For example, in the case that the first ring tone is the incoming ring tone of the card 1, the corresponding first audio is the default ring tone 1, and the terminal may change it to the ring tone A1.
S212, the terminal continues to use the current audio as the first ring tone.
The current ring tone is the first ring tone set by the user through the terminal after the system is upgraded.
In the case that the terminal determines that the first ring tone is not the default audio, it indicates that after the system upgrade, the user sets the first ring tone through the terminal, and changes the first ring tone from the default audio to other audio.
In some embodiments, in the foregoing steps S201 to S212, the execution sequence of step S201 and step S207 is not described in sequence.
It should be understood that the aforementioned steps S205 and S206 are optional, and in case that the first audio is determined to be the external audio, the terminal may not set the first ringtone from the first audio to the default audio. When step S205 and step S207 are not executed, the terminal does not execute step S209, step S210, and step S212.
Fig. 10 is a schematic flowchart of setting, by the terminal, ring tone information to be set in the second upgrade type.
Based on the foregoing step S105, in the case that the upgrade type is determined to be the second upgrade type, a new media library is generated by updating based on the original media library, and then the to-be-ring information is set based on the new media library, so as to obtain the set ring information. The description of the procedure may be referred to the following description of steps S401 to S413.
S401, the terminal copies the content in the original media library to a new media library.
This step S401 is optional.
In some embodiments, the terminal may treat the original media library as the new media library referred to in step S401.
S402, the terminal scans the internal volume, when the updatable internal audio is scanned, the terminal deletes the information corresponding to the updatable internal audio in the new media database and rewrites the information corresponding to the updatable internal audio, wherein the updatable internal audio is the audio with a path comprising a second preset field.
The internal audio can be updated to the corresponding internal audio in the new path including the second preset field. The updatable internal audio is the corresponding new path: after the system is upgraded, the terminal scans a path corresponding to the updatable internal audio.
In some embodiments, when the terminal scans an updatable internal audio, the original information corresponding to the updatable internal audio in the new media database can be deleted, and the information corresponding to the updatable internal audio can be rewritten.
In some possible cases, when the terminal detects the updatable internal audio, the internal audio with the same name as the audio is determined from the new media library based on the audio name corresponding to the updatable internal audio, then the information (i.e. the original information) corresponding to the internal audio with the same name as the audio is deleted, and then the information corresponding to the updatable internal audio (the information corresponding to the updatable internal audio after the system is upgraded) is written into the new media library, specifically into the internal audio database in the new media library, for example, after the information corresponding to the last audio in the internal audio database. The original information corresponding to the updatable internal audio is the information corresponding to the updatable internal audio before the system is upgraded.
In some possible cases, the identifier corresponding to the updateable internal audio may be different from the identifier corresponding to the internal audio to which the audio name is the same.
In other possible cases, the identifier corresponding to the updatable internal audio may be the same as the identifier corresponding to the internal audio with which the audio name is the same.
In some embodiments, the terminal may update the scanned N updatable internal audios into a new media library simultaneously, where N is an integer greater than or equal to 2. Updating some updatable internal audio frequency into the new media database, namely deleting the information corresponding to the updatable internal audio frequency in the new media database, and rewriting the information corresponding to the updatable internal audio frequency.
And S403, after the scanning of the internal volume is completed, the terminal determines that a third change occurs in the new media library.
The new media library is changed to have the information corresponding to the updatable internal audio written into the new media library. In particular into the internal audio database of the new media library.
In some examples, the terminal may monitor whether the new media library changes through registration of the setup application, and after the information corresponding to the internal audio is written into the new media library, the setup application may determine that the new media library has a third change.
S404, the terminal determines whether the first audio is an internal audio or not based on the original uri corresponding to the first audio.
The content related to step S404 is similar to that of step S203, and reference may be made to the foregoing description of step S203, which is not repeated herein.
In the case where the terminal determines that the first audio is an internal audio, the following step S405 may be performed.
In the case where the terminal determines that the first audio is the external audio, the following steps S406 to S413 may be performed.
S405, the terminal sets the ring information to be set based on the new media library with the third change and the original path corresponding to the first audio to obtain the set ring information.
Specifically, the ring information to be set is set based on the internal audio database of the new media library which is changed for the third time and the original path corresponding to the first audio, so as to obtain the ring information after setting.
For the process related to step S405, the aforementioned description of step S301 to step S307 may be referred to, and the new media library in step S301 to step S307 is changed into the new media library with the third change, which is not described herein again.
S406, the terminal creates a temporary database to record the original path corresponding to the first audio.
The content related to step S406 is similar to that of step S205, and reference may be made to the foregoing description of step S205, which is not repeated herein.
S407, the terminal changes the first ring tone from the first audio to a default audio.
The content of step S407 is similar to that of step S206, and reference may be made to the foregoing description of step S206, which is not repeated herein.
And S408, the terminal scans the external volume, deletes the information corresponding to the updatable external audio in the new media database when the updatable external audio is scanned, and rewrites the information corresponding to the updatable external audio, wherein the updatable external audio is the audio with a path comprising a third preset field.
The external audio can be updated to the external audio comprising the third preset field in the corresponding new path. The updatable external audio is the corresponding new path: and after the system is upgraded, the terminal scans a path corresponding to the updatable external audio.
In some embodiments, when the terminal scans an updatable external audio, the original information corresponding to the updatable external audio in the new media database may be deleted, and the information corresponding to the updatable external audio (after the system is upgraded, the information corresponding to the updatable external audio) may be rewritten. The original information corresponding to the updatable external audio is the information corresponding to the updatable external audio before the system is upgraded.
In some possible cases, when the terminal detects the updatable external audio, the external audio with the same name as the audio is determined from the new media library based on the audio name corresponding to the updatable external audio, then the information (i.e., the original information) corresponding to the external audio with the same name as the audio is deleted, and then the information corresponding to the updatable external audio is written into the new media library, specifically into the external audio database in the new media library, for example, after the information corresponding to the last audio in the external audio database.
In some possible cases, the identifier corresponding to the updatable external audio may be different from the identifier corresponding to the external audio for which the audio name is the same.
In other possible cases, the identifier corresponding to the updateable external audio may be the same as the identifier corresponding to the external audio for which the audio name is the same.
In some embodiments, the terminal may update the scanned N updatable external audios into a new media library at the same time, where N is an integer greater than or equal to 2. And updating a certain updatable external audio frequency into a new media database, namely deleting the information corresponding to the updatable external audio frequency in the new media database, and rewriting the information corresponding to the updatable external audio frequency.
For example, table 4 below is an exemplary new media library prior to performing an external volume scan.
Identifier (id) Route corresponding to audio (path) Audio names
7 /XX-product/…/media/…/XX11.ogg XX11.ogg
8 /…/media/audio/…/XX22.ogg XX22.ogg
9 /…/media/audio/…/XX33.ogg XX33.ogg
TABLE 4
Referring to table 4, taking the third preset field as "product-h" as an example for explanation, when the terminal detects the audio C, the path corresponding to the audio C is determined as follows: when the terminal is "/product-h/\ 8230;/media/\ 8230;/XX11. Ogg", the terminal determines that the corresponding path includes the "product-h" field, and acquires the audio name corresponding to the audio C included in the path: "XX11.Ogg". Then, the terminal determines the audio with the same audio name as the audio C, i.e., the audio corresponding to the identifier 7, in the new media library shown in table 4, and then the terminal may delete the audio corresponding to the identifier 7, resulting in table 5 shown below.
Identifier (id) Path corresponding to audio (path) Audio names
8 /…/media/audio/…/XX22.ogg XX22.ogg
9 /…/media/audio/…/XX33.ogg XX33.ogg
TABLE 5
Then, in some possible cases, the terminal may write the information corresponding to the updatable external audio, i.e., audio C, into the new media library shown in table 5, resulting in table 6 below.
Identifier (id) Route corresponding to audio (path) Audio names
8 /…/media/audio/…/XX22.ogg XX22.ogg
9 /…/media/audio/…/XX33.ogg XX33.ogg
10 /product-h/…/media/…/XX11.ogg XX11.ogg
TABLE 6
Based on table 6 and table 4 mentioned above, the field "XX-product" in the path corresponding to audio C becomes the field "product-h".
The foregoing is described by taking the audio C as an example, and the deletion and writing of other updatable external audio can refer to the related description, which is not described herein again.
And S409, after the scanning of the external volume is completed, the terminal determines that the new media library is changed in a fourth way.
The new media library is changed to have the information corresponding to the updatable internal audio written into the new media library. In particular to the internal audio database of the new media library.
In some examples, the terminal may monitor whether the new media library changes through registration of the setup application, and after the information corresponding to the internal audio is written into the new media library, the setup application may determine that the new media library has a fourth change.
S410, the terminal determines whether the first ring tone is the default audio.
The content of step S410 is similar to that of step S209, and reference may be made to the foregoing description of step S209, which is not repeated herein.
S411, the terminal obtains an original path corresponding to the first audio from the temporary database.
And S412, the terminal sets the ring tone information to be set based on the new media library with the fourth change and the original path corresponding to the first audio to obtain the set audio.
Specifically, the ring information to be set is set based on the external audio database in the new media library with the fourth change and the original path corresponding to the first audio, so as to obtain the ring information after setting.
For the description of the process, reference may be made to the foregoing description of step S301 to step S307, and the new media library in step S301 to step S307 may be changed into the new media library with the fourth change and the internal audio database may be replaced by the external audio database, which is not described herein again.
S413. The terminal continues to use the current audio as the first ring tone.
The content of step S413 is similar to that of step S212, and reference may be made to the description of step S212, which is not repeated herein.
In some embodiments, in the foregoing steps S401 to S413, the execution sequence of step S402 and step S408 is not described in sequence.
It should be understood that the aforementioned steps S406 and S407 are optional, and in case that the first audio is determined to be the external audio, the terminal may not set the first ringtone from the first audio to the default audio. When step S406 and step S407 are not executed, the terminal does not execute step S410, step S411, and step S413.
It should also be understood that, in some embodiments, in the case that the preset field is included in the path corresponding to the audio before and after the upgrade, the terminal may further determine whether the preset field is included in the path corresponding to the internal audio or the preset field is included in the path corresponding to the external audio. When the packet name is not changed and the original path corresponding to the internal audio does not include the preset field, the terminal may not scan the internal volume when the first audio is determined to be the internal audio. The terminal may set the ring tone information to be set based on the new media library in combination with the original path corresponding to the first audio, by using the internal audio database in the original media library as the internal audio database in the new media library. Under the condition that the packet name is not changed and the original path corresponding to the external audio does not include the preset field, when the first audio is determined to be the internal audio, the terminal does not scan the external volume or set the first ring tone as the default audio, the terminal can take the external audio database in the original media library as the external audio database in the new media library, and then the ring tone information to be set is set based on the new media library and the original path corresponding to the first audio.
Fig. 11 is a schematic flowchart of setting, by a terminal, ring tone information to be set in the third upgrade type.
Based on the foregoing step S106, in the case that the upgrade type is determined to be the second upgrade type, the terminal may use the original media library as a new media library, and then set the to-be-ring information based on the new media library to obtain the set ring information. The description of the procedure may be referred to the following description of steps S501 to S503.
And S501, the terminal takes the original media library as a new media library.
And when the upgrade type is the third upgrade type, the new media library is not changed from the original media library package name, and the original path corresponding to the audio does not include the first preset field. This means that the content in the new media library may be the same as the original media. At this time, the terminal may use the original media library as a new media library, and set temporary information to be set based on the new media library to obtain the set ring information.
S502, the terminal determines a target id from the new media library, and the path corresponding to the target id is the same as the original path corresponding to the first audio.
And the terminal determines the same path as the original path from the new media library based on the original path corresponding to the first audio. An identifier associated with the same path as the original path is obtained as a target id.
S503, the terminal replaces the id in the original uri corresponding to the first ring in the ring information to be set with the target id to obtain the set ring information.
And the terminal replaces the id in the original uri corresponding to the first audio in the ring tone information to be set with the target id to obtain the target uri, so that the set ring tone information can be obtained. I.e. the target uri included in the set ring tone information. Since the target id is associated with the path corresponding to the first audio in the new media, the terminal may acquire the first audio based on the target uri to play as the first ring tone.
It should be understood that the foregoing tables 1-6 are described by way of example, in which the information corresponding to the audio in the media library includes a path corresponding to the audio and an identifier corresponding to the audio and a name corresponding to the audio. More or less content may be included in practice, for example, when more content is included, the information corresponding to the audio in the media library may further include information such as the length corresponding to the audio. When less content is included, the information corresponding to the audio in the media library may not include a name corresponding to the audio, including a path corresponding to the audio and an identifier corresponding to the audio.
In some embodiments, when the information corresponding to the audio in the media library includes a path corresponding to the audio and an identifier corresponding to the audio and a name corresponding to the audio, the terminal may determine the target id directly from the new media library based on the name of the audio corresponding to the first audio without passing through the file name.
In the embodiment of the present application, the original paths corresponding to multiple audios may also be referred to as paths corresponding to multiple audios; the new media library information of the new media library and the original media library information of the original media library can be collectively referred to as the indication information of the media library; the original media library may also be referred to as a first media library; the new media library may be referred to as a second media library; the ring tone information to be set may be referred to as ring tone information of a first ring tone; the id in the original uri corresponding to the first audio may be referred to as a first identifier; the target id may be referred to as a second identifier; the original path corresponding to the first audio may be referred to as a first path; the new path corresponding to the first audio may be referred to as a second path; the original media library package name may also be referred to as a package name corresponding to the first media library; the new media library package name may also be referred to as a package name corresponding to the second media library; the internal audio database may also be referred to as the first audio database; the external audio database may also be referred to as a second audio database.
An exemplary terminal provided in the embodiments of the present application is first described below.
Fig. 12 is a schematic structural diagram of a terminal according to an embodiment of the present application.
The following describes embodiments in detail by taking a terminal as an example. It should be understood that a terminal may have more or fewer components than shown, may combine two or more components, or may have a different configuration of components. The various components shown in the figures may be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and/or application specific integrated circuits.
The terminal may include: the mobile terminal includes a processor 110, an external memory interface 120, an internal memory 121, a Universal Serial Bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, a Subscriber Identity Module (SIM) card interface 195, and the like. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, and the like.
It is to be understood that the illustrated structure of the embodiments of the present application does not constitute a specific limitation to the terminal. In other embodiments of the present application, the terminal may include more or fewer components than illustrated, or some components may be combined, some components may be split, or a different arrangement of components may be used. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
Processor 110 may include one or more processing units, such as: the processor 110 may include an Application Processor (AP), a modem processor, a Graphics Processor (GPU), an Image Signal Processor (ISP), a controller, a memory, a video codec, a Digital Signal Processor (DSP), a baseband processor, and/or a neural-Network Processing Unit (NPU), among others. Wherein, the different processing units may be independent devices or may be integrated in one or more processors.
Wherein, the controller can be the neural center and the command center of the terminal. The controller can generate an operation control signal according to the instruction operation code and the timing signal to complete the control of instruction fetching and instruction execution.
A memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may hold instructions or data that have just been used or recycled by the processor 110. If the processor 110 needs to use the instruction or data again, it can be called directly from the memory. Avoiding repeated accesses reduces the latency of the processor 110, thereby increasing the efficiency of the system.
In some embodiments, processor 110 may include one or more interfaces. The interface may include an integrated circuit (I2C) interface, an integrated circuit built-in audio (I2S) interface, a Pulse Code Modulation (PCM) interface, and the like.
It should be understood that the connection relationship between the modules illustrated in the embodiment of the present application is only an exemplary illustration, and does not form a limitation on the structure of the terminal. In other embodiments of the present application, the terminal may also adopt different interface connection manners or a combination of multiple interface connection manners in the foregoing embodiments.
The charging management module 140 is configured to receive a charging input from a charger.
The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110.
The wireless communication function of the terminal can be realized by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor, the baseband processor, and the like.
The antennas 1 and 2 are used for transmitting and receiving electromagnetic wave signals.
The mobile communication module 150 may provide a solution including 2G/3G/4G/5G wireless communication and the like applied on the terminal. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a Low Noise Amplifier (LNA), and the like.
The modem processor may include a modulator and a demodulator.
The wireless communication module 160 may provide solutions for wireless communication applied to a terminal, including Wireless Local Area Networks (WLANs) (e.g., wireless fidelity (Wi-Fi) networks), bluetooth (BT), global Navigation Satellite System (GNSS), frequency Modulation (FM), near Field Communication (NFC), infrared (IR), and the like. The wireless communication module 160 may be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, performs frequency modulation and filtering processing on electromagnetic wave signals, and transmits the processed signals to the processor 110. The wireless communication module 160 may also receive a signal to be transmitted from the processor 110, perform frequency modulation and amplification on the signal, and convert the signal into electromagnetic waves through the antenna 2 to radiate the electromagnetic waves.
In some embodiments, the antenna 1 of the terminal is coupled to the mobile communication module 150 and the antenna 2 is coupled to the wireless communication module 160 so that the terminal can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general Packet Radio Service (GPRS), code Division Multiple Access (CDMA), wideband Code Division Multiple Access (WCDMA), time division code division multiple access (TD-SCDMA), and the like.
The terminal implements the display function through the GPU, the display screen 194, and the application processor, etc.
The display screen 194 is used to display images, video, and the like. The display screen 194 includes a display panel.
The terminal can implement a shooting function through the ISP, the camera 193, the video codec, the GPU, the display screen 194, the application processor, and the like.
The ISP is used to process the data fed back by the camera 193.
The camera 193 is used to capture still images or video. The object generates an optical image through the lens and projects the optical image to the photosensitive element.
The digital signal processor is used for processing digital signals, and can process other digital signals besides digital image signals.
Video codecs are used to compress or decompress digital video.
The NPU is a neural-network (NN) computing processor that processes input information quickly by using a biological neural network structure, for example, by using a transfer mode between neurons of a human brain, and can also learn by itself continuously.
The internal memory 121 may include one or more Random Access Memories (RAMs) and one or more non-volatile memories (NVMs).
The random access memory may include static random-access memory (SRAM), dynamic random-access memory (DRAM), and the like.
The nonvolatile memory may include a magnetic disk storage device, a flash memory (flash memory).
The FLASH memory may include NOR FLASH, NAND FLASH, 3D NAND FLASH, and the like according to the operation principle, and may include single-level cells (SLC), multi-level cells (MLC), and the like according to the level order of the memory cell.
The terminal can implement an audio function through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the earphone interface 170D, and the application processor. Such as music playing, recording, etc.
The audio module 170 is used to convert digital audio information into an analog audio signal output and also to convert an analog audio input into a digital audio signal.
The speaker 170A, also called a "horn", is used to convert the audio electrical signal into an acoustic signal. The terminal can listen to music through the speaker 170A or listen to a hands-free call.
The receiver 170B, also called "earpiece", is used to convert the electrical audio signal into a sound signal. When the terminal receives a call or voice information, it can receive voice by placing the receiver 170B close to the ear.
The microphone 170C, also referred to as a "microphone," is used to convert sound signals into electrical signals.
The earphone interface 170D is used to connect a wired earphone. The headset interface 170D may be the USB interface 130, or may be a 3.5mm open mobile platform (OMTP) standard interface, a cellular telecommunications industry association (cellular telecommunications industry association of the USA, CTIA) standard interface.
The motor 191 may generate a vibration cue.
Indicator 192 may be an indicator light that may be used to indicate a state of charge, a change in charge, or a message, missed call, notification, etc.
The SIM card interface 195 is used to connect a SIM card.
In the embodiment of the present application, the processor 110 may call a computer instruction stored in the internal memory 121 to enable the terminal to execute the ringtone setting method in the embodiment of the present application.
The above embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present application.
As used in the above embodiments, the term "when 8230; may be interpreted to mean" if 8230, "or" after 8230; or "in response to a determination of 8230," or "in response to a detection of 8230," depending on the context. Similarly, the phrase "at the time of determination of \8230;" or "if (a stated condition or event) is detected" may be interpreted to mean "if it is determined 8230;" or "in response to the determination of 8230;" or "upon detection (a stated condition or event)" or "in response to the detection (a stated condition or event)" depending on the context.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the application to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire (e.g., coaxial cable, fiber optic, digital subscriber line) or wirelessly (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that includes one or more available media. The usable medium may be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid state disk), among others.
One of ordinary skill in the art will appreciate that all or part of the processes in the methods of the above embodiments may be implemented by hardware related to instructions of a computer program, which may be stored in a computer-readable storage medium, and when executed, may include the processes of the above method embodiments. And the aforementioned storage medium includes: various media capable of storing program codes, such as ROM or RAM, magnetic or optical disks, etc.

Claims (14)

1. A ringtone setting method applied to a terminal storing a plurality of audios, the method comprising:
before the system is upgraded, the terminal sets a first ring tone as a first audio frequency in the plurality of audio frequencies;
after the system is upgraded, the terminal determines the upgrade type based on the paths corresponding to the multiple audios and the indication information of the media library; the media library is used for recording the corresponding relation between the audio path and the audio identifier, and comprises a first media library before system upgrade and a second media library after system upgrade;
under the condition that the upgrading type is determined to be the first upgrading type, the terminal scans the plurality of audios and regenerates the media library to obtain a second media library; under the condition that the upgrading type is determined to be a second upgrading type, the terminal updates the corresponding relation of part or all of the audios in the first media library to generate a second media library; the terminal sets the ring information of the first ring based on the second media library to obtain the set ring information; the ringtone information of the first ringtone comprises a first identifier corresponding to the first audio in the first media library, and the first identifier is associated with a first path; the set ring tone information comprises a second identifier corresponding to the first audio in the second media library; the second identifier is associated with a second path, wherein the second path is a path corresponding to the first audio after the system upgrade;
and under the condition that the upgrading type is determined to be a third upgrading type, the terminal sets the ringtone information of the first ringtone based on the first media library to obtain the set ringtone information.
2. The method according to claim 1, wherein the terminal sets the ring tone information of the first ring tone based on the first media library to obtain the set ring tone information, specifically comprising:
the terminal takes the first media library as the second media library;
the terminal acquires a second identifier from the second media library, wherein a second path associated with the second identifier is the same as the first path;
and the terminal replaces the first identifier in the first uri included in the ring information of the first ring tone with the second identifier to obtain the set ring tone information.
3. The method according to claim 1, wherein the indication information of the media library comprises a package name corresponding to the first media library and a package name corresponding to the second media library; the method for determining the upgrade type by the terminal based on the paths corresponding to the multiple audios and the indication information of the media library specifically includes:
under the condition that the package name corresponding to the first media library is determined to be different from the package name corresponding to the second media library, the terminal determines that the upgrading type is a first upgrading type;
under the condition that the package name corresponding to the first media is the same as the package name corresponding to the second media library but a path corresponding to the audio comprises a first preset field, the terminal determines that the upgrading type is a second upgrading type;
and under the condition that the package name corresponding to the first media is the same as the package name corresponding to the second media library and the path corresponding to the audio does not comprise the first preset field, the terminal determines that the upgrading type is the third upgrading type.
4. The method according to any one of claims 1 to 3, wherein the terminal sets the ring tone information of the first ring tone based on the second media library, and obtains the set ring tone information, specifically comprising:
the terminal determines whether the first audio is an internal audio;
under the condition that the first audio is determined to be the internal audio, the terminal sets the ringtone information of the first ringtone based on a first database in the second media library to obtain the set ringtone information; the first database is used for recording information corresponding to the internal audio;
under the condition that the first audio is determined to be external audio, the terminal sets the ring information of the first ring based on a second database in the second media library to obtain the set ring information; the second database is used for recording information corresponding to external audio.
5. The method of claim 4, wherein before the terminal determines whether the first audio is an internal audio, the method further comprises:
under the condition that the upgrade type is determined to be the first upgrade type, the terminal finishes scanning the internal volume and writes the information corresponding to the scanned internal audio into a first database in the second media library;
before the terminal sets the ring tone information of the first ring tone based on the second database in the second media library, the method further comprises:
and under the condition that the upgrade type is determined to be the first upgrade type, the terminal finishes scanning the external volume and writes the information corresponding to the scanned external audio into a second database in the second media library.
6. The method of claim 4, wherein before the terminal determines whether the first audio is an internal audio, the method further comprises:
under the condition that the upgrading type is determined to be a second upgrading type, the terminal copies the content in the first media library to the second media library; the terminal finishes scanning the internal volume, deletes the original information corresponding to the scanned updatable internal audio from the second media library, and then writes the information corresponding to the updatable internal audio into a first database in the second media library; wherein the updatable internal audio is the internal audio of the corresponding new path including the second field;
before the terminal sets the ring tone information of the first ring tone based on the second database in the second media library, the method further comprises:
under the condition that the upgrade type is determined to be a second upgrade type, the terminal finishes scanning the external volume, deletes the original information corresponding to the scanned updatable external audio from the second media library, and then writes the information corresponding to the updatable external audio into a second database in the second media library; wherein the updatable external audio is the external audio in the corresponding new path including the third field.
7. The method of claim 4, wherein the ring information of the first ring tone includes a first uniform resource identifier uri corresponding to the first audio; the first identifier is included in the first uri; the terminal sets the ring information of the first ring based on the first database in the second media library to obtain the set ring information, and the method specifically comprises the following steps:
the terminal acquires a second identifier from the first database based on the first path;
when the second identifier is obtained from the first database based on the first path, the second path associated with the second identifier is the same as the first path; the terminal replaces a first identifier in a first uri included in the ring information of the first ring tone with the second identifier to obtain the set ring tone information;
under the condition that the second identifier is not obtained from the first database based on the first path, the second identifier is not obtained from the first database; the terminal determines the second path from the first database based on the file name included in the first path; acquiring an identifier associated with the second path as a second identifier; the terminal replaces a first identifier in a first uri included in the ring information of the first ring tone with the second identifier to obtain the set ring tone information; the file name included in the second path is the same as the file name included in the first path.
8. The method of claim 5 or 6, wherein before the terminal completes scanning the external volume, the method further comprises:
the terminal changes the first ring tone from a first audio to a default audio.
9. The method of claim 8, wherein the ring information of the first ring tone includes a first uniform resource identifier uri corresponding to the first audio; the first identifier is included in the first uri; the terminal sets the ring information of the first ring based on a second database in the second media library to obtain the set ring information, and the method specifically comprises the following steps:
in the case that the first ring tone is determined to be the default audio, the terminal acquires a second identifier from the second database based on the first path;
when the second identifier is obtained from the second database based on the first path, the second path associated with the second identifier is the same as the first path; the terminal replaces a first identifier in a first uri included in the ring information of the first ring tone with the second identifier to obtain the set ring tone information;
under the condition that the second identifier is not obtained from the second database based on the first path, the second path related to the second identifier is different from the first path; the terminal determines the second path from the second database based on the file name included in the first path; acquiring an identifier associated with the second path as a second identifier; the terminal replaces a first identifier in a first uri included in the ring information of the first ring with the second identifier to obtain the set ring information; the file name included in the second path is the same as the file name included in the first path.
10. The method according to any one of claims 7 to 9, wherein the terminal determines whether the first audio is an internal audio, specifically comprising:
the terminal determines that the first audio is an internal audio if the terminal includes a first field in a first uri corresponding to the first audio in the ring information of the first ring;
and the terminal determines that the first audio is the external audio based on that the first uri corresponding to the first audio in the ring tone information of the first ring tone comprises the second field.
11. The method according to any of claims 7-9, wherein the terminal comprises an application settings application and an audio management module, the method further comprising:
after the setting application receives the starting broadcast, registering and monitoring whether the second media library changes;
and under the condition that the setting application determines that the second media library changes, the audio management module sets the ring information of the first ring based on the second media library to obtain the set ring information.
12. An electronic device comprising one or more processors and one or more memories; wherein the one or more memories are coupled to the one or more processors for storing computer program code comprising computer instructions which, when executed by the one or more processors, cause performance of the method recited in any of claims 1-11.
13. A chip system for application to a terminal, the chip system comprising one or more processors for invoking computer instructions to cause the terminal to perform the method of any of claims 1-11.
14. A computer-readable storage medium comprising instructions that, when executed on an electronic device, cause performance of the method recited by any of claims 1-11.
CN202210753706.XA 2022-06-29 2022-06-29 Ring setting method and terminal Active CN115297204B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210753706.XA CN115297204B (en) 2022-06-29 2022-06-29 Ring setting method and terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210753706.XA CN115297204B (en) 2022-06-29 2022-06-29 Ring setting method and terminal

Publications (2)

Publication Number Publication Date
CN115297204A true CN115297204A (en) 2022-11-04
CN115297204B CN115297204B (en) 2023-06-16

Family

ID=83821237

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210753706.XA Active CN115297204B (en) 2022-06-29 2022-06-29 Ring setting method and terminal

Country Status (1)

Country Link
CN (1) CN115297204B (en)

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005157885A (en) * 2003-11-27 2005-06-16 Dowango:Kk Portable terminal, update system, update method and update program
WO2013163844A1 (en) * 2012-05-04 2013-11-07 中兴通讯股份有限公司 Message-strength-based ringing method, device and mobile terminal
CN103402024A (en) * 2013-08-09 2013-11-20 宇龙计算机通信科技(深圳)有限公司 Method and device for outputting ringtone
CN103412773A (en) * 2013-08-08 2013-11-27 华为终端有限公司 Method and device for obtaining files
WO2014161308A1 (en) * 2013-07-19 2014-10-09 中兴通讯股份有限公司 Ring tone setting method, device and terminal
CN105141781A (en) * 2015-09-23 2015-12-09 青岛海信移动通信技术股份有限公司 Ring playing method and device of terminal device
CN105721681A (en) * 2016-01-21 2016-06-29 青岛海信移动通信技术股份有限公司 Method and device of replacing ring tone of mobile device
CN108111699A (en) * 2013-08-26 2018-06-01 联想(北京)有限公司 A kind of information processing method and electronic equipment
CN110248028A (en) * 2019-07-30 2019-09-17 深圳市趣创科技有限公司 Based on audio guard method, device and the computer equipment for having been set to the tinkle of bells
CN114006973A (en) * 2020-07-28 2022-02-01 北京破壁者科技有限公司 Ringtone updating method, data updating method, ringtone publishing method, ringtone updating device, ringtone publishing device, electronic equipment and storage medium
CN114168237A (en) * 2020-09-10 2022-03-11 华为技术有限公司 Theme pack adaptation method and device

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005157885A (en) * 2003-11-27 2005-06-16 Dowango:Kk Portable terminal, update system, update method and update program
WO2013163844A1 (en) * 2012-05-04 2013-11-07 中兴通讯股份有限公司 Message-strength-based ringing method, device and mobile terminal
WO2014161308A1 (en) * 2013-07-19 2014-10-09 中兴通讯股份有限公司 Ring tone setting method, device and terminal
CN104301503A (en) * 2013-07-19 2015-01-21 中兴通讯股份有限公司 Ringtone setting method and device and terminal
CN103412773A (en) * 2013-08-08 2013-11-27 华为终端有限公司 Method and device for obtaining files
CN103402024A (en) * 2013-08-09 2013-11-20 宇龙计算机通信科技(深圳)有限公司 Method and device for outputting ringtone
CN108111699A (en) * 2013-08-26 2018-06-01 联想(北京)有限公司 A kind of information processing method and electronic equipment
CN105141781A (en) * 2015-09-23 2015-12-09 青岛海信移动通信技术股份有限公司 Ring playing method and device of terminal device
CN105721681A (en) * 2016-01-21 2016-06-29 青岛海信移动通信技术股份有限公司 Method and device of replacing ring tone of mobile device
CN110248028A (en) * 2019-07-30 2019-09-17 深圳市趣创科技有限公司 Based on audio guard method, device and the computer equipment for having been set to the tinkle of bells
CN114006973A (en) * 2020-07-28 2022-02-01 北京破壁者科技有限公司 Ringtone updating method, data updating method, ringtone publishing method, ringtone updating device, ringtone publishing device, electronic equipment and storage medium
CN114168237A (en) * 2020-09-10 2022-03-11 华为技术有限公司 Theme pack adaptation method and device

Also Published As

Publication number Publication date
CN115297204B (en) 2023-06-16

Similar Documents

Publication Publication Date Title
WO2020211712A1 (en) Patching method and related device, and system
KR20100081720A (en) Method and system for fota service
WO2009125396A2 (en) Updating firmware on mobile electronic devices
WO2019219059A1 (en) Method, apparatus and system for storing data, and method for reading data, apparatus, and system
CN106997302A (en) Firmware upgrade method, device and audio-frequence player device
WO2020037560A1 (en) Application installation method and terminal
CN111447323A (en) Application display continuing method and device
CN111078376A (en) Process management method and device
CN112306524A (en) System upgrading method, electronic device and computer storage medium
CN113608753A (en) Application uninstalling method, application recovery method, electronic device and storage medium
CN108475186B (en) Multimedia data playing method and terminal equipment
CN116382791B (en) Configuration file protection method and electronic equipment
CN115297204B (en) Ring setting method and terminal
CN111221544B (en) Management method and terminal for pre-installed application software
CN115309431A (en) Parameter updating method, readable medium and electronic equipment
CN113837338A (en) Detection method, terminal, user identification card, electronic equipment and storage medium
CN106997301B (en) Software upgrading method and device and electronic device
CN114116072A (en) Shared library multiplexing method and electronic equipment
CN114579181A (en) Patching method, related equipment and system
CN106708464B (en) Alarm clock ringtone playing method based on loudspeaker box and loudspeaker box
CN116841575B (en) Method and related device for generating image file
CN114240722A (en) Image simulation data generation method, electronic device and storage medium
CN117009023B (en) Method for displaying notification information and related device
CN116055632B (en) Incoming call processing method, electronic equipment and storage medium
CN114253872B (en) Electronic device, memory recovery method thereof and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant