Audio application starting method, electronic equipment and storage medium
Through the framework of the frame layer, the audio application was suspended and recovered when the vehicle power was changed, which solved the problem of users who needed to manually adjust the progress of the playback, realized the automatic thermal starting of audio applications, and enhanced the user experience.
Patent Information
- Application Number
- CN202411320375.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-20
- Publication Date
- 2025-01-28
AI Technical Summary
When the vehicle is powered off and powered on again, the user needs to manually adjust the playback progress of the audio application, which is cumbersome and prone to errors, affecting the user experience.
Send the audio focus of the frame layer to the application layer to lose and restore the message, realize the automatic suspension and recovery of audio applications, record and restore the playback progress, thereby automatically continues to play when the vehicle is called.
No need to manually adjust the playback progress, realize the automatic heat startup of audio applications, improve the user experience, and apply to any third -party audio application.
Smart Images

Figure CN119377005A_ABST
Abstract
Description
[Technical field]
[0001] Embodiments of the present application relate to the field of vehicle technology, and more particularly to a method for starting an audio application, an electronic device, and a storage medium. [Background technology]
[0002] Currently, users usually like to open audio applications to listen to audio content of interest while driving. Then, after the vehicle is powered off, the above audio applications will be closed. When the user powers on the vehicle again next time, if the user wants to continue listening to the historical audio in the audio application based on the historical playback progress, the user needs to manually adjust the playback progress of the historical audio to the historical playback progress.
[0003] There are two problems with the above method: first, the user may not be able to accurately remember the historical playback progress, so the user may be inaccurate when manually adjusting the playback progress; second, the user needs to manually start the audio application, manually select the historical audio in the music audio, and adjust the playback progress of the historical audio. The operation is relatively cumbersome, resulting in a poor user experience. [Summary of the invention]
[0004] The embodiments of the present application propose a method for starting an audio application, an electronic device, and a storage medium, which can automatically and accurately start from the historical playback progress and continue to play the audio content played historically when the vehicle is powered off and then powered on again, without the user having to manually adjust the playback progress, thereby improving the user experience.
[0005] In a first aspect, an embodiment of the present application provides a method for starting an audio application, which is applied to an electronic device, wherein the electronic device includes an application layer and a framework layer, and the method includes:
[0006] When the framework layer determines that the vehicle is powered off, the framework layer sends an audio focus loss message to the audio application in the application layer, where the audio focus loss message is used to indicate that the audio application temporarily loses the audio focus and needs to enter a paused playback state;
[0007] The audio application in the application layer pauses the target audio in a playing state in response to the audio focus loss message, and records the playing progress of the target audio;
[0008] When the framework layer determines that the vehicle is powered on, the framework layer sends an audio focus recovery message to the audio application in the application layer, wherein the audio focus recovery message is used to instruct the audio application to regain the audio focus;
[0009] The audio application in the application layer responds to the audio focus recovery message, takes the played progress as the starting progress, and continues to play the target audio.
[0010] In an embodiment of the present application, after the vehicle is powered off, the framework layer will notify the audio application in the application layer that it has temporarily lost the audio focus and needs to enter a paused playback state. Then, after receiving the above notification, the audio application in the application layer will pause the currently playing target audio and record the playback progress of the target audio. After the vehicle is powered on again, the framework layer will notify the audio application in the application layer to regain the audio focus. After receiving the above notification, the audio application in the application layer will continue to play the target audio in the audio application based on the historical playback progress. In other words, the method can automatically and accurately start from the historical playback progress when the vehicle is powered off and then powered on again, and continue to play the audio content that has been played in history, that is, to achieve a hot start of the audio application playback, without the user manually adjusting the playback progress, thereby improving the user experience. At the same time, the method utilizes the capabilities of the framework layer to achieve a hot start of the audio application playback, without the need for a third-party audio application to have a hot start capability, and can be applied to any third-party audio application.
[0011] Optionally, the framework layer sends an audio focus lost message to the audio application in the application layer, including:
[0012] The framework layer applies for a temporary audio focus, and the temporary audio focus is used to make the audio application lose focus temporarily, and the audio application needs to enter a paused playback state temporarily;
[0013] The framework layer sends the audio focus lost message to the audio application in the application layer.
[0014] In an embodiment of the present application, the framework layer can apply for a temporary audio focus, which can be considered to have two functions: first, it causes the audio application of the application layer to temporarily lose the audio focus; second, it causes the audio application of the application layer to be in a paused playback state, thereby triggering the framework layer to notify the application layer of what state the audio application of the application layer should be in, so as to prepare for the subsequent hot start.
[0015] Optionally, the framework layer sends an audio focus recovery message to the audio application in the application layer, including:
[0016] The framework layer abandons the temporary audio focus;
[0017] The framework layer sends the audio focus recovery message to the audio application in the application layer.
[0018] In the embodiment of the present application, the framework layer abandons the applied temporary audio focus, thereby triggering the framework layer to notify the audio application of the application layer to regain the audio focus in order to prepare for the subsequent hot start.
[0019] Optionally, the framework layer applies for a temporary audio focus, including:
[0020] The framework layer determines whether there is an audio application that has obtained the audio focus;
[0021] If so, the framework layer applies for the temporary audio focus.
[0022] In an embodiment of the present application, when the vehicle is powered off, the framework layer will first determine whether there is an audio application that obtains audio focus, that is, determine whether the user is using the audio application when the power is off. If the framework layer determines that there is an audio application that obtains audio focus when the vehicle is powered off, it indicates that the user is using the audio application when the vehicle is powered off. Only then will the framework layer apply for temporary audio focus so that the audio application can enter the corresponding pause state after the vehicle is powered off, thereby preparing for the hot start of the subsequent audio application.
[0023] Optionally, the audio application of the application layer records the playing progress of the target audio, including:
[0024] The audio application of the application layer outputs a prompt option, where the prompt option is used to prompt the user whether to save the playback progress of the target audio;
[0025] In response to the user confirming that the played progress needs to be saved, the audio application of the application layer records the played progress.
[0026] In an embodiment of the present application, the audio application of the application layer can output a prompt option to the user, which prompts the user whether it is necessary to save the playback progress of the target audio played when the vehicle is powered off. If the user determines that the playback progress needs to be saved, it indicates that the user wants to implement the hot start function of the subsequent audio application, and the audio application of the application layer will record the playback progress of the target audio; conversely, if the user determines that the playback progress does not need to be saved, it indicates that the user does not want to implement the hot start function of the subsequent audio application, and the audio application of the application layer will not record the playback progress of the target audio. In other words, this method can determine whether to record the playback record of the current target audio according to the needs of the user, and it can also be considered to determine whether to enable the hot start function of the audio application according to the needs of the user, thereby improving the user experience.
[0027] Optionally, the framework layer determines that the vehicle is powered off, including:
[0028] The framework layer obtains a power status value;
[0029] If it is determined that the power state value is a preset power-off state value, the framework layer determines that the vehicle is powered off.
[0030] In the embodiment of the present application, the framework layer can determine whether the vehicle is powered off by monitoring the power status value of the power management system, thereby accurately determining the timing of powering off the vehicle.
[0031] Optionally, the audio applications include music playing applications, audio book applications, and audio news applications.
[0032] In the embodiment of the present application, the capabilities of the framework layer can be utilized to achieve the continued playback of different types of audio content such as music, audio text, etc. that have been played historically based on the historical playback progress after the vehicle is powered off and then powered on again, thereby meeting the user's hot start requirements for different audio applications.
[0033] In a second aspect, an embodiment of the present application provides an electronic device, the electronic device comprising an application layer and a framework layer;
[0034] The framework layer is used to send an audio focus loss message to the audio application in the application layer when it is determined that the vehicle is powered off, wherein the audio focus loss message is used to indicate that the audio application temporarily loses the audio focus and needs to be in a paused playback state;
[0035] The audio application in the application layer is used to pause the target audio in a playing state in response to the audio focus loss message, and record the playing progress of the target audio;
[0036] The framework layer is further used to send an audio focus recovery message to the audio application in the application layer when it is determined that the vehicle is powered on, wherein the audio focus recovery message is used to instruct the audio application to regain the audio focus;
[0037] The audio application in the application layer is further used to respond to the audio focus recovery message, take the played progress as the starting progress, and continue to play the target audio.
[0038] Optionally, the framework layer is specifically used for:
[0039] Applying for a temporary audio focus, where the temporary audio focus is used to make the audio application temporarily lose the audio focus, and the audio application temporarily needs to enter a paused playback state;
[0040] The audio focus lost message is sent to an audio application in the application layer.
[0041] Optionally, the framework layer is specifically used for:
[0042] abandoning the temporary audio focus;
[0043] The audio focus recovery message is sent to an audio application in the application layer.
[0044] Optionally, the framework layer is specifically used for:
[0045] Determine whether there is an audio application that has obtained the audio focus;
[0046] If so, apply for the temporary audio focus.
[0047] Optionally, the application layer is specifically used for:
[0048] Outputting a prompt option through an audio application, wherein the prompt option is used to prompt the user whether to save the playback progress of the target audio;
[0049] In response to the user confirming that the played progress needs to be saved, the played progress is recorded through the audio application.
[0050] Optionally, the framework layer is specifically used for:
[0051] Get the power status value;
[0052] If it is determined that the power state value is a preset power-off state value, it is determined that the vehicle is powered off.
[0053] Optionally, the audio applications include music playing applications, audio book applications, and audio news applications.
[0054] In a third aspect, an embodiment of the present application provides an electronic device, comprising a memory for storing computer program instructions and a processor for executing the program instructions, wherein when the computer program instructions are executed by the processor, the electronic device is triggered to execute the steps of the method described in any embodiment of the first aspect.
[0055] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store computer instructions, and when the computer is running, the computer causes the computer to execute the steps of the method described in any embodiment of the first aspect.
[0056] It should be understood that the second to fourth aspects of the embodiments of the present application are consistent with the technical solutions of the first aspect of the embodiments of the present application, and the beneficial effects achieved by each aspect and the corresponding feasible implementation methods are similar and will not be repeated here.
Brief Description of the Drawings
[0057] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0058] Figure 1 A flowchart of a method for starting an audio application provided in an embodiment of the present application;
[0059] Figure 2 A flowchart of a method for sending an audio focus loss message to an application layer provided in an embodiment of the present application;
[0060] Figure 3 A flowchart of a method for applying for temporary audio focus provided in an embodiment of the present application;
[0061] Figure 4 A flowchart of a method for recording target audio playback progress provided in an embodiment of the present application;
[0062] Figure 5 A flowchart of a method for sending an audio focus recovery message to an application layer provided in an embodiment of the present application;
[0063] Figure 6 An overall flow chart of a method for starting an audio application provided in an embodiment of the present application;
[0064] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;
[0065] Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. [Specific implementation method]
[0066] In order to better understand the technical solution of this specification, the embodiments of the present application are described in detail below with reference to the accompanying drawings.
[0067] It should be clear that the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this specification.
[0068] The terms used in the embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to limit this specification. The singular forms of "a", "said" and "the" used in the embodiments of the present application and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings.
[0069] The professional terms involved in the embodiments of the present application are explained below.
[0070] Car Audio Service (CarAudio): CarAudio service is a system service in the Android system, which is used to manage functions related to in-car audio playback. This service is responsible for managing the audio input, output, volume control, sound effect processing and other functions of the in-car audio system, and provides audio playback support for the in-car entertainment system. At the same time, CarAudio service also manages audio focus to ensure that the priority and mutual exclusivity of audio playback in the vehicle environment are properly handled.
[0071] Audio Focus: It is an important function in the Android operating system, which is used to coordinate and manage the access and use of audio resources by applications. When an application obtains the audio focus, it means that it has the right to output sound in the system; other applications need to adjust the audio output behavior according to the state of the audio focus to avoid sound conflicts and provide a better user experience.
[0072] Currently, users usually like to open audio applications to listen to audio content of interest while driving. Then, after the vehicle is powered off, the above audio applications will be closed. When the user powers on the vehicle again next time, if the user wants to continue listening to the historical audio in the audio application based on the historical playback progress, the user needs to manually adjust the playback progress of the historical audio to the historical playback progress.
[0073] There are two problems with the above method: first, the user may not be able to accurately remember the historical playback progress, so the user may be inaccurate when manually adjusting the playback progress; second, the user needs to manually start the audio application, manually select the historical audio in the music audio, and adjust the playback progress of the historical audio. The operation is relatively cumbersome, resulting in a poor user experience.
[0074] In view of this, an embodiment of the present application provides a method for starting an audio application, in which, after the vehicle is powered off, the framework layer will notify the audio application in the application layer that it has temporarily lost the audio focus and needs to enter a paused playback state. Then, after receiving the above notification, the audio application in the application layer will pause the currently played target audio and record the playback progress of the target audio. After the vehicle is powered on again, the framework layer will notify the audio application in the application layer to regain the audio focus. After receiving the above notification, the audio application in the application layer will continue to play the target audio in the audio application based on the historical playback progress. In other words, the method can automatically and accurately start from the historical playback progress when the vehicle is powered off and powered on again, and continue to play the audio content that has been played in history, that is, to achieve a hot start of the audio application, without the user manually adjusting the playback progress, thereby improving the user experience. At the same time, the method utilizes the capabilities of the framework layer to achieve the startup of the audio application, without the need for a third-party audio application to have a hot start capability, and can be applied to any third-party audio application.
[0075] The technical solution provided by the embodiments of the present application is introduced below in conjunction with the accompanying drawings.
[0076] See also Figure 1 , is a flow chart of a method for starting an audio application provided in an embodiment of the present application. The method can be applied to an electronic device, for example, the electronic device can be a vehicle terminal, and the flow of the method is described as follows:
[0077] Step 101: The framework layer determines that the vehicle is powered off.
[0078] In an embodiment of the present application, the CarAudio service in the framework layer (Framework Layer) can register a monitoring power management service. The power status is then monitored through the monitoring power management service to obtain the corresponding power status value. When the power status value obtained by the monitoring power management service is "CarPowerManager.state_vendor_awake", the CarAudio service compares it with the preset power-off state value and the preset power-on state value respectively. If the current power status value "CarPowerManager.state_vendor_awake" is the same as the preset power-off state value, it can be determined that the vehicle is powered off, and then the CarAudio service can perform relevant operations for the audio application.
[0079] Step 102: The framework layer sends an audio focus lost message to the audio application in the application layer.
[0080] In an embodiment of the present application, after determining that the vehicle is powered off, the CarAudio service in the framework layer can send an audio focus loss message to the audio application in the application layer. It should be understood that the audio application here refers to the application that the user is using and occupies the audio focus before the vehicle is about to be powered off. Through the audio focus loss message, the CarAudio service in the framework layer can notify the audio application in the application layer that the audio focus is currently temporarily lost and needs to enter a paused playback state, so that the audio application in the application layer can enter a paused playback state and prepare for the hot start of the subsequent audio application.
[0081] In some embodiments, in order to send an audio focus loss message having the above-mentioned effect to the audio application at the application layer, the CarAudio service in the framework layer can apply for a specific audio focus by itself.
[0082] See also Figure 2 , is a flowchart of a method for sending an audio focus loss message to an application layer provided in an embodiment of the present application. Step 102 can be implemented by executing sub-steps 1021 and 1022:
[0083] Step 1021: The framework layer applies for temporary audio focus.
[0084] In an embodiment of the present application, the CarAudio service in the framework layer can apply for a temporary audio focus, which can be considered to seize the audio focus originally occupied by the audio application, and after seizing the audio focus of the audio application, the audio application needs to enter a paused playback state.
[0085] It is worth noting that, in the above process, even if the audio application loses the audio focus briefly, it is still in the audio focus stack.
[0086] In some embodiments, considering that the user may or may not be using an audio application when the vehicle is about to be powered off, in the embodiments of the present application, it is necessary to determine that the user is using an audio application when the vehicle is about to be powered off before preparations for hot starting the audio application are made.
[0087] See also Figure 3 , which is a flowchart of a method for applying for temporary audio focus provided in an embodiment of the present application. Step 1021 can be implemented by executing sub-steps 10211 and 10212:
[0088] Step 10211: The framework layer determines whether there is an audio application that has obtained the audio focus.
[0089] In an embodiment of the present application, the CarAudio service in the framework layer can query whether there is an audio application that has obtained audio focus in the current audio focus stack by interacting with the car audio focus (CarAudioFocus) service. For example, if there is only one package name (com.kuwomusic) in the current audio focus stack, then it can be considered that there is an audio application (Kugou Music) that has obtained audio focus.
[0090] Step 10212: If so, the framework layer applies for temporary audio focus.
[0091] In an embodiment of the present application, when the CarAudio service in the framework layer determines that an audio application has obtained the audio focus, it can be considered that the user is using the audio application that occupies the audio focus when the vehicle is about to be powered off. Then, after the vehicle is powered off, the CarAudio service in the framework layer can apply for temporary audio focus to cause the audio application that originally occupied the audio focus to temporarily lose focus and enter a paused playback state, thereby preparing for a subsequent hot start.
[0092] Step 1022: The framework layer sends an audio focus lost message to the audio application in the application layer.
[0093] In an embodiment of the present application, after applying for the above-mentioned type of temporary audio focus, the CarAudio service in the framework layer will send an audio focus loss message to the audio application in the application layer according to the functional characteristics of the temporary audio focus.
[0094] Step 103: The audio application in the application layer pauses the target audio in the playing state in response to the audio focus lost message.
[0095] In the embodiment of the present application, after receiving the audio focus lost message, the audio application of the application layer controls the target audio currently in the playing state to switch to the pause state.
[0096] Step 104: The audio application in the application layer records the playback progress of the target audio.
[0097] In the embodiment of the present application, the audio application of the application layer can also record the playback progress of the current target audio after switching the target audio in the playing state to the paused state. For example, the audio application of the application layer is Kuwo Music, the total duration of the song currently being played is 3 minutes, and it has been played for 1 minute and 30 seconds before the vehicle is about to be powered off, so it can be determined that the current playback progress is 50%.
[0098] In some embodiments, after the user subsequently powers on, the user may want to continue playing the target audio based on the historical playback progress, or may want to play the target audio from the beginning. Therefore, in an embodiment of the present application, when saving the playback progress, the user can be asked, and then it is determined whether the current playback progress of the target audio needs to be saved according to the user's actual needs, which is equivalent to determining whether the audio application needs to be hot-started later according to the user's actual needs.
[0099] See also Figure 4 , is a flowchart of a method for recording target audio playback progress provided by an embodiment of the present application. Step 104 can be implemented by executing sub-steps 1041 and 1042:
[0100] Step 1041: The audio application output prompt options of the application layer.
[0101] In an embodiment of the present application, the audio application of the application layer can output a prompt option, which may include a first sub-option and a second sub-option. The first sub-option is used to represent the playback progress of the target audio that needs to be saved, and the second sub-option is used to represent the playback progress of the target audio that does not need to be saved.
[0102] Step 1042: In response to the user confirming that the playback progress needs to be saved, the audio application at the application layer records the playback progress.
[0103] In the embodiment of the present application, if the audio application of the application layer detects that the user has selected the above-mentioned first sub-option, it indicates that the user confirms that the progress of the target audio has been played needs to be saved, and the audio application of the application layer will save the progress of the target audio when the target audio is in a paused state. Conversely, if the audio application of the application layer detects that the user has selected the above-mentioned second sub-option, it indicates that the user confirms that the progress of the target audio has not been saved, and the audio application of the application layer will not save the progress of the target audio when the target audio is in a paused state.
[0104] Step 105: The framework layer determines that the vehicle is powered on.
[0105] In the embodiment of the present application, when the power state value obtained by the monitoring power management service in the framework layer is "CarPowerManager.state_anim_stopped", the CarAudio service compares it with the preset power-off state value and the preset power-on state value. If the current power state value "CarPowerManager.state_anim_stopped" is the same as the preset power-on state value, it can be determined that the vehicle is powered on, and then the CarAudio service can perform a hot start operation for the audio application.
[0106] Step 106: The framework layer sends an audio focus recovery message to the audio application in the application layer.
[0107] In an embodiment of the present application, after determining that the vehicle is powered on, the CarAudio service in the framework layer can send an audio focus recovery message to the audio application in the application layer, and the audio focus recovery message is used to inform the audio application in the application layer to regain the audio focus.
[0108] In some embodiments, the CarAudio service in the framework layer may abandon the applied audio focus by itself in order to send an audio focus recovery message having the above-mentioned effect to the audio application in the application layer.
[0109] See also Figure 5 , which is a flowchart of a method for sending an audio focus recovery message to an application layer provided in an embodiment of the present application. Step 106 can be implemented by executing sub-steps 1061 and 1062:
[0110] Step 1061: The framework layer abandons the temporary audio focus.
[0111] In an embodiment of the present application, when the vehicle is about to be powered off, the CarAudio service in the framework layer seizes the audio focus occupied by the original audio application by applying for a temporary audio focus. Then, after the vehicle is powered on again, the CarAudio service in the framework layer can abandon the applied temporary audio focus so that the audio application can regain the audio focus.
[0112] Step 1062: The framework layer sends an audio focus recovery message to the audio application in the application layer.
[0113] In an embodiment of the present application, after the CarAudio service in the framework layer abandons the temporary audio focus it has applied for, the original audio application regains the audio focus. However, at this time, the audio application in the application layer is not aware that it has regained the audio focus. Therefore, the framework layer can send an audio focus recovery message to the audio application in the application layer to inform the audio application in the application layer that it has regained the audio focus.
[0114] Step 107: In response to the audio focus recovery message, the audio application in the application layer takes the played progress as the starting progress and continues to play the target audio.
[0115] In the embodiment of the present application, after the audio application at the application layer learns that it has regained the audio focus, it will control itself to switch from the pause state to the play state, and use the historical play progress as the starting progress to continue playing the target audio.
[0116] For example, the total duration of the target audio is 3 minutes. When the vehicle is about to be powered off, the target audio has been played for 50%, that is, it has been played for 1 minute and 30 seconds. Then, after the vehicle is powered on, it will start from 1 minute and 30 seconds of the target audio and continue to play the remaining audio content.
[0117] It should be understood that the above embodiment uses the capabilities of the CarAudio service in the framework layer to implement hot start of audio applications. It does not require third-party audio applications to have hot start capabilities, and can be applied to any third-party audio applications. For example, third-party audio applications may include but are not limited to: music playback applications (for example, Kuwo Music, QQ Music, NetEase Cloud Music, etc.), audio book applications (for example, Lazy Listening, Himalaya, etc.), and audio news applications (for example, Sina News, etc.).
[0118] See also Figure 6 , is an overall flow chart of a method for starting an audio application provided in an embodiment of the present application. The following is an overall description of the hot start process of the audio application.
[0119] Step 201: The framework layer obtains a power status value; if the power status value is determined to be a preset power-off status value, the framework layer determines that the vehicle is powered off.
[0120] Step 202: The CarAudio service in the framework layer determines whether there is an audio application that has obtained the audio focus. If so, jump to step 203; if not, end the current process.
[0121] Step 203: The CarAudio service in the framework layer applies for a temporary audio focus.
[0122] Step 204: The CarAudio service in the framework layer sends an audio focus lost message to the audio application in the application layer.
[0123] Step 205: The audio application in the application layer pauses the target audio in the playing state in response to the audio focus lost message.
[0124] Step 206: The audio application of the application layer outputs prompt options.
[0125] Step 207: In response to the user confirming that the playback progress needs to be saved, the audio application at the application layer records the playback progress.
[0126] Step 208: The framework layer obtains a power status value; if the power status value is determined to be a preset power-on status value, the framework layer determines that the vehicle is powered on.
[0127] Step 209: The CarAudio service in the framework layer abandons the temporary audio focus.
[0128] Step 210: The CarAudio service in the framework layer sends an audio focus recovery message to the audio application in the application layer.
[0129] Step 211: The audio application in the application layer responds to the audio focus recovery message, takes the played progress as the starting progress, and continues to play the target audio.
[0130] See also Figure 7 Based on the same inventive concept, the embodiment of the present application further provides an electronic device, which includes an application layer 301 and a framework layer 302;
[0131] The framework layer 302 is used to send an audio focus loss message to the audio application in the application layer 301 when it is determined that the vehicle is powered off. The audio focus loss message is used to indicate that the audio application temporarily loses the audio focus and needs to be in a paused playback state;
[0132] The audio application in the application layer 301 is used to pause the target audio in the playing state in response to the audio focus loss message, and record the playing progress of the target audio;
[0133] The framework layer 302 is further used to send an audio focus recovery message to the audio application in the application layer when it is determined that the vehicle is powered on, and the audio focus recovery message is used to instruct the audio application to regain the audio focus;
[0134] The audio application in the application layer 301 is further configured to respond to the audio focus recovery message, take the played progress as the starting progress, and continue to play the target audio.
[0135] Optionally, the framework layer 302 is specifically used for:
[0136] Apply for temporary audio focus. Temporary audio focus is used to make the audio application temporarily lose audio focus, and the audio application needs to enter the paused playback state for a short period of time.
[0137] An audio focus lost message is sent to the audio application in the application layer 301 .
[0138] Optionally, the framework layer 302 is specifically used for:
[0139] Abandon temporary audio focus;
[0140] An audio focus recovery message is sent to the audio application in the application layer 301 .
[0141] Optionally, the framework layer 302 is specifically used for:
[0142] Determine whether there is an audio application that has obtained the audio focus;
[0143] If so, apply for temporary audio focus.
[0144] Optionally, the application layer 301 is specifically used for:
[0145] Outputting a prompt option through the audio application, where the prompt option is used to prompt the user whether to save the playback progress of the target audio;
[0146] In response to the user confirming that the played progress needs to be saved, the played progress is recorded through the audio application.
[0147] Optionally, the framework layer 302 is specifically used for:
[0148] Get the power status value;
[0149] If it is determined that the power state value is the preset power-off state value, it is determined that the vehicle is powered off.
[0150] Optionally, the audio application includes a music player application, an audio book application, and an audio news application.
[0151] See also Figure 8 Based on the same inventive concept, an embodiment of the present application further provides an electronic device, the electronic device comprising at least one processor 401, the processor 401 is used to execute a computer program stored in a memory, and implement the embodiment of the present application as provided in Figure 1-6 Flow chart of steps of a method for starting an audio application shown.
[0152] Optionally, the processor 401 may specifically be a central processing unit, a specific ASIC, or one or more integrated circuits for controlling program execution.
[0153] Optionally, the electronic device may further include a memory 402 connected to the at least one processor 401, and the memory 402 may include a ROM, a RAM, and a disk memory. The memory 402 is used to store data required by the processor 401 when it is running, that is, it stores instructions that can be executed by the at least one processor 401. The at least one processor 401 executes the instructions stored in the memory 402 to execute the following steps: Figure 1-6 The method shown. Wherein, the number of memories 402 is one or more. Wherein, the number of memories 402 is one or more.
[0154] The present application also provides a computer storage medium, wherein the computer storage medium stores computer instructions, and when the computer instructions are executed on a computer, the computer executes Figure 1-6 method.
[0155] The above description is only a preferred embodiment of this specification and is not intended to limit this specification. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of this specification should be included in the scope of protection of this specification.
Claims
1. A method for starting an audio application, characterized in that: Applied to an electronic device, the electronic device includes an application layer and a framework layer, and the method includes: When the framework layer determines that the vehicle is powered off, an audio focus loss message is sent to the audio application in the application layer, where the audio focus loss message is used to indicate that the audio application temporarily loses audio focus and needs to enter a paused playback state; The audio application in the application layer pauses the target audio in a playing state in response to the audio focus loss message, and records the playing progress of the target audio; When the framework layer determines that the vehicle is powered on, the framework layer sends an audio focus recovery message to the audio application in the application layer, wherein the audio focus recovery message is used to instruct the audio application to regain the audio focus; The audio application in the application layer responds to the audio focus recovery message, takes the played progress as the starting progress, and continues to play the target audio.
2. The method according to claim 1, characterized in that The framework layer sends an audio focus loss message to the audio application in the application layer, including: The framework layer applies for a temporary audio focus, and the temporary audio focus is used to make the audio application temporarily lose the audio focus, and the audio application temporarily needs to enter a paused playback state; The framework layer sends the audio focus lost message to the audio application in the application layer.
3. The method according to claim 2, characterized in that The framework layer sends an audio focus recovery message to the audio application in the application layer, including: The framework layer abandons the temporary audio focus; The framework layer sends the audio focus recovery message to the audio application in the application layer.
4. The method according to claim 1, characterized in that The framework layer applies for temporary audio focus, including: The framework layer determines whether there is an audio application that has obtained the audio focus; If so, the framework layer applies for the temporary audio focus.
5. The method according to claim 1, characterized in that The audio application of the application layer records the playing progress of the target audio, including: The audio application of the application layer outputs a prompt option, where the prompt option is used to prompt the user whether to save the playback progress of the target audio; In response to the user confirming that the played progress needs to be saved, the audio application of the application layer records the played progress.
6. The method according to claim 1, characterized in that The framework layer determines that the vehicle is powered off, including: The framework layer obtains a power status value; If it is determined that the power state value is a preset power-off state value, the framework layer determines that the vehicle is powered off.
7. The method according to any one of claims 1 to 6, characterized in that: The audio applications include music playing applications, audio book applications, and audio news applications.
8. An electronic device, characterized in that: The electronic device comprises an application layer and a framework layer; The framework layer is used to send an audio focus loss message to the audio application in the application layer when it is determined that the vehicle is powered off, wherein the audio focus loss message is used to indicate that the audio application temporarily loses the audio focus and needs to be in a paused playback state; The audio application in the application layer is used to pause the target audio in a playing state in response to the audio focus loss message, and record the playing progress of the target audio; The framework layer is further used to send an audio focus recovery message to the audio application in the application layer when it is determined that the vehicle is powered on, wherein the audio focus recovery message is used to instruct the audio application to regain the audio focus; The audio application in the application layer is further used to respond to the audio focus recovery message, take the played progress as the starting progress, and continue to play the target audio.
9. An electronic device, characterized in that: The electronic device comprises a memory for storing computer program instructions and a processor for executing the program instructions, wherein when the computer program instructions are executed by the processor, the electronic device is triggered to execute the steps of the method as claimed in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store computer instructions, and when the computer instructions are executed in a computer, the computer is caused to execute the steps of the method according to any one of claims 1 to 7.
Citation Information
Cited By
Application recovery method and related apparatus
WO2026195019A1