CN108989576B - Variable value adjustment method and device, storage medium and mobile terminal - Google Patents

Variable value adjustment method and device, storage medium and mobile terminal Download PDF

Info

Publication number
CN108989576B
CN108989576B CN201811056687.5A CN201811056687A CN108989576B CN 108989576 B CN108989576 B CN 108989576B CN 201811056687 A CN201811056687 A CN 201811056687A CN 108989576 B CN108989576 B CN 108989576B
Authority
CN
China
Prior art keywords
value
state
variable
mobile terminal
activity
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.)
Active
Application number
CN201811056687.5A
Other languages
Chinese (zh)
Other versions
CN108989576A (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.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp 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 Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201811056687.5A priority Critical patent/CN108989576B/en
Publication of CN108989576A publication Critical patent/CN108989576A/en
Application granted granted Critical
Publication of CN108989576B publication Critical patent/CN108989576B/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
    • 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/72448User interfaces specially adapted for cordless or mobile telephones with means for adapting the functionality of the device according to specific conditions
    • H04M1/72454User interfaces specially adapted for cordless or mobile telephones with means for adapting the functionality of the device according to specific conditions according to context-related or environment-related 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Environmental & Geological Engineering (AREA)
  • Telephone Function (AREA)

Abstract

The embodiment of the application discloses a variable value adjusting method, a variable value adjusting device, a storage medium and a mobile terminal. The method comprises the following steps: detecting that the mobile terminal is in a black screen state in the communication process; monitoring whether the working state of the activity corresponding to the call interface enters a second state from a first state before the call is finished, and then restoring to the first state; and if so, adjusting the value of the first variable corresponding to the working state, wherein the value of the first variable and the value of the second variable corresponding to the activity jointly determine whether the mobile terminal is allowed to enter the bright screen state. By adopting the technical scheme, the method and the device for judging the bright screen state of the mobile terminal can improve the existing value adjustment strategy of the variable for judging whether the mobile terminal is allowed to enter the bright screen state, optimize the control flow of the bright screen of the screen, and avoid the situation that the screen is abnormally lightened when a user uses the call function of the mobile terminal.

Description

Variable value adjustment method and device, storage medium and mobile terminal
Technical Field
The embodiment of the application relates to the technical field of mobile terminals, in particular to a variable value adjusting method, a variable value adjusting device, a storage medium and a mobile terminal.
Background
At present, a display screen becomes a standard configuration of most mobile terminals, and a user can check rich display contents in the mobile terminal through the display screen and establish good man-machine interaction with the mobile terminal.
The mobile terminal generally needs a built-in power supply to supply power, so as to meet the portability of the mobile terminal, and the display of the display screen increases the power consumption of the mobile terminal. In order to reasonably control the power consumption of the mobile terminal and prolong the standby time, the screen on and off of the screen of the mobile terminal need to be reasonably controlled. However, the current bright screen control scheme of the mobile terminal is still not perfect and needs to be improved.
Disclosure of Invention
The embodiment of the application provides a variable value adjusting method and device, a storage medium and a mobile terminal, and a bright screen control scheme of the mobile terminal can be optimized by optimizing a variable value adjusting strategy.
In a first aspect, an embodiment of the present application provides a method for adjusting a value of a variable, including:
detecting that the mobile terminal is in a black screen state in the communication process;
monitoring whether the working state of the activity corresponding to the call interface enters a second state from a first state before the call is finished, and then recovering to the first state; wherein the activity enters a first state when the mobile terminal is in a proximate state relative to a user and the activity enters a second state when the mobile terminal is in a distant state relative to the user;
and if so, adjusting the value of a first variable corresponding to the working state, wherein the value of the first variable and the value of a second variable corresponding to the activity jointly determine whether the mobile terminal is allowed to enter a bright screen state.
In a second aspect, an embodiment of the present application provides a variable value adjusting device, including:
the system comprises a black screen state detection module, a voice recognition module and a voice recognition module, wherein the black screen state detection module is used for detecting whether the mobile terminal is in a black screen state in the conversation process;
the state judgment module is used for monitoring whether the working state of the activity corresponding to the call interface enters a second state from a first state before the call is finished when the mobile terminal is detected to be in a black screen state in the call process, and then the mobile terminal is recovered to the first state; wherein the activity enters a first state when the mobile terminal is in a proximate state relative to a user and the activity enters a second state when the mobile terminal is in a distant state relative to the user;
and the variable value adjusting module is used for adjusting the value of a first variable corresponding to the working state when the judgment result of the state judging module is yes, wherein the value of the first variable and the value of a second variable corresponding to the activity jointly determine whether the mobile terminal is allowed to enter a bright screen state.
In a third aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements a variable value adjustment method according to an embodiment of the present application.
In a fourth aspect, an embodiment of the present application provides a mobile terminal, which includes a memory, a processor, and a computer program that is stored in the memory and can be run on the processor, where the processor executes the computer program to implement the variable value adjustment method according to the embodiment of the present application.
According to the variable value adjusting scheme provided in the embodiment of the application, when the mobile terminal is detected to be in a black screen state in a call process, whether a working state of an activity corresponding to a call interface enters a second state from a first state before the call is finished is monitored, and then the working state is recovered to the first state, if so, the value of the first variable corresponding to the working state is adjusted, wherein the value of the first variable and the value of a second variable corresponding to the activity jointly determine whether the mobile terminal is allowed to enter a bright screen state. By adopting the technical scheme, the existing value adjustment strategy of the variable for judging whether the mobile terminal is allowed to enter the bright screen state can be improved, the control flow of the bright screen of the screen is optimized, and the situation that the screen is abnormally lightened when a user uses the call function of the mobile terminal is avoided.
Drawings
Fig. 1 is a schematic flow chart of a variable value adjustment method according to an embodiment of the present disclosure;
fig. 2 is a schematic flow chart of another variable value adjustment method according to an embodiment of the present disclosure;
fig. 3 is a block diagram of a structure of a variable value adjusting apparatus according to an embodiment of the present disclosure;
fig. 4 is a schematic structural diagram of a mobile terminal according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of another mobile terminal according to an embodiment of the present application.
Detailed Description
The technical scheme of the application is further explained by the specific implementation mode in combination with the attached drawings. It is to be understood that the specific embodiments described herein are merely illustrative of the application and are not limiting of the application. It should be further noted that, for the convenience of description, only some of the structures related to the present application are shown in the drawings, not all of the structures.
Before discussing exemplary embodiments in more detail, it should be noted that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although a flowchart may describe the steps as a sequential process, many of the steps can be performed in parallel, concurrently or simultaneously. In addition, the order of the steps may be rearranged. The process may be terminated when its operations are completed, but may have additional steps not included in the figure. The processes may correspond to methods, functions, procedures, subroutines, and the like.
Fig. 1 is a schematic flowchart of a variable value adjusting method according to an embodiment of the present disclosure, where the method may be executed by a variable value adjusting apparatus, where the apparatus may be implemented by software and/or hardware, and may generally be integrated in a mobile terminal. As shown in fig. 1, the method includes:
step 101, detecting that the mobile terminal is in a black screen state in a call process.
For example, the mobile terminal in the embodiment of the present application may include a mobile device with a call function, such as a mobile phone and a tablet computer. The call function in the embodiment of the present application may include a telephone function provided by a telephone application program in the mobile terminal system, and may be generally implemented based on a service provided by a mobile communication operator (such as china mobile or china unicom); the method can also comprise other third-party application programs in the mobile terminal, such as a call function provided by social application programs such as WeChat or QQ, and the like, and can be generally realized based on a wireless network.
Generally, a mobile device with a communication function is provided with a sound collection device such as a microphone and a sound playing device such as a receiver, so as to realize voice communication during the communication process. In order to fit the usage habits of users, a microphone is generally arranged at the bottom of the mobile terminal for collecting the voice of the mouth of the user, and an earphone is arranged at the top of the mobile terminal for sending the voice of the other party to the ear of the user. When a user answers a call, in order to ensure the call effect, the mobile terminal is generally placed on one side of the head, the display screen of the mobile terminal can be contacted with the face or ears of the user under most conditions, the user does not need to check the content of the display screen at the moment, in order to save power consumption, meanwhile, the mobile terminal can control the display screen to enter a black screen state or a screen off state in order to avoid mistaken touch caused by the contact of the face or ears of the user and the display screen, and the display screen is also turned off. The mobile terminal is generally provided with a distance sensor near the receiver for detecting the distance between the mobile terminal and the head of a user, when the distance is smaller than a first set value, the mobile terminal is considered to be in a close state relative to the user, the display screen is controlled to enter a black screen state, and when the distance is larger than a second preset value, the mobile terminal is considered to be in a far state relative to the user, and the display screen is controlled to enter a bright screen state. The distance sensor may be implemented by a proximity sensor (e.g., an infrared proximity sensor) or an ultrasonic sensor.
In this step, the black screen state during the call includes a black screen state that the mobile terminal is in the call state and enters when the mobile terminal is in the proximity state with respect to the user.
Step 102, monitoring whether the working state of the activity corresponding to the call interface enters a second state from a first state before the call is finished, and then restoring to the first state.
Wherein the activity enters a first state when the mobile terminal is in a proximate state relative to a user and the activity enters a second state when the mobile terminal is in a distant state relative to the user.
In the embodiment of the present application, an activity may be understood as a separate interface or page directly providing interaction and operation for a user, and different names may be used for naming the interface in different operating systems. For ease of understanding, the following description will be made taking an Android (Android) operating system as an example. In the Android system, an Activity is called Activity. Activity is a component responsible for interacting with a user that provides a screen (which may be understood as a screen interface, rather than a display screen of an entity) for the user to interact to accomplish a task. In an android application, an Activity is usually a separate screen on which controls can be displayed and events of the user can be monitored and processed. The Activity corresponding to the call interface can be understood as the Activity corresponding to the call interface in the application currently used for calling. Activities may generally have a variety of operational states such as run, pause, stop, close, and resume, among others. For Activity, running, pause, stopped, killed, resume, etc. may be included generally. In the embodiment of the present application, the first state may be pause (pause), and the second state may be resume (resume).
In this embodiment, the call interface may include a call interface in a phone application program in the mobile terminal system, may also include a call interface in a third-party social application program in the mobile terminal, and may also include both the above two call interfaces.
For example, during a call made by a user using a mobile terminal, the user may need to move the mobile terminal away from the ear for some reason and then continue listening to the call content close to the ear. For example, a user may need to view a phone number, a file, or web content, etc. in a mobile terminal; alternatively, the user may need to temporarily release the mobile terminal in his or her hands, release both hands to find something, and so on. Therefore, before the call is finished, the corresponding activity of the call interface goes through the process of entering the second state from the first state and then recovering to the first state.
In the related art, when the mobile terminal is in a black screen state during a call, there are many flows for triggering the display screen to light up. One of the processes for triggering the display screen to be lit involves two variables, when the values of the two variables both indicate that the display screen is allowed to enter a lit state, the display screen is lit, and then the values corresponding to the two variables are restored to a default value (if not allowed), where one of the two variables is a first variable mentioned next in the embodiment of the present application, and the other is referred to as a second variable in the embodiment of the present application. The first variable is a variable corresponding to an active working state corresponding to a call interface, and the variable is used for judging whether the mobile terminal is allowed to enter a bright screen state. In the related art, when the value of the first variable is set to indicate permission, if the second variable is not always set to be permitted, the value of the first variable cannot be restored to the default value, and even after the activity is restored from the second state to the first state, the value of the first variable is still permitted. When the activity is in the first state, it indicates that the mobile terminal is in an approaching state relative to the user, and after the second variable is set to allow, the screen is lighted up by mistake due to the fact that the values of the two variables both indicate allowance, so that the display screen of the mobile terminal enters a screen-up state when being close to the user, power consumption is wasted, mistaken touch is easy to occur, and inconvenience is brought to the user.
And 103, if so, adjusting the value of the first variable corresponding to the working state.
And the value of the first variable and the value of the second variable corresponding to the activity jointly determine whether the mobile terminal is allowed to enter a bright screen state.
In the embodiment of the application, in order to avoid the situation that the display screen is turned on by mistake, if the working state of the activity corresponding to the call interface is before the call is finished, the state is changed from the first state to the second state, and then the working state is restored to the first state, the value of the first variable is actively adjusted, and if the working state is restored to a default value or other values which do not indicate permission, the value of the first variable is set to a value which does not cause the display screen to be allowed to enter the screen-on state.
According to the variable value adjusting method provided in the embodiment of the application, when the mobile terminal is detected to be in a black screen state in a call process, whether a working state of an activity corresponding to a call interface enters a second state from a first state before the call is finished is monitored, and then the working state is restored to the first state, if yes, a value of a first variable corresponding to the working state is adjusted, wherein the value of the first variable and the value of a second variable corresponding to the activity jointly determine whether the mobile terminal is allowed to enter a bright screen state. By adopting the technical scheme, the existing value adjustment strategy of the variable for judging whether the mobile terminal is allowed to enter the bright screen state can be improved, the control flow of the bright screen of the screen is optimized, and the situation that the screen is abnormally lightened when a user uses the call function of the mobile terminal is avoided.
In some embodiments, the adjusting the value of the first variable corresponding to the working state includes: modifying the value of the first variable corresponding to the working state from a first preset value to a second preset value; when the activity enters a second state from a first state, setting the value of the first variable to be the first preset value; when the value of the first variable is the first preset value and the value of the second variable is a third preset value, the mobile terminal is allowed to enter a bright screen state, and the value of the first variable is set to be the second preset value; and the value of the second variable is set as the third preset value when the call of the other party is finished. The advantage that sets up like this lies in, sets up in advance the value of first variable under the different operating condition, when needs adjust, directly revises into the default, promotes stability. Illustratively, the first preset value is a value indicating an allowance, such as true (true) or 1; the second preset value is a value indicating not allowable, such as false (false) or 0; the third preset value is an allowable value, such as true (true) or 1, and the third preset value may be the same as or different from the first preset value, and the embodiment of the present application is not limited; the value of the second variable may also have a fourth preset value, indicating that it is not allowed, such as false (false) or 0. For example, when an activity enters the second state from the first state, the value of the first variable is true. The value of the second variable is set to true when the call partner ends the call. And when the value of the first variable is true and the value of the second variable is true, the mobile terminal is allowed to enter a bright screen state, and the value of the first variable and the value of the second variable are set to false. In the related art, the activity of the call interface enters the second state from the first state, if the value of the second variable is always false before the activity is restored to the first state, the value of the first variable is still true, and is not restored to false, and after that, if the value of the second variable is set to true because the call counterpart ends the call, the display screen is erroneously lit because the first variable and the second variable are both true. In the embodiment of the application, after the activity is recovered to the first state, the value of the first variable is set to false in time, so that the display screen can be effectively prevented from being lighted by mistake, namely, when the opposite party hangs up the call, the display screen cannot enter the screen-lighting state before the user removes the head of the mobile terminal, the power consumption is saved, and the mistaken touch is prevented.
In some embodiments, after modifying the value of the first variable corresponding to the working state from the first preset value to the second preset value, the method further includes: and when the value of the first variable is detected to be the second preset value and the value of the second variable is detected to be the third preset value, the mobile terminal is prevented from entering a bright screen state. The advantage of setting up like this is, further guarantee that the mobile terminal mistake gets into bright screen state under the condition that first variable and second variable do not allow the display screen to get into bright screen state simultaneously.
In some embodiments, further comprising: when the fact that the call of the other call party is finished is detected, a re-layout function is called through the activity, and the value of the second variable is set to be the third preset value; wherein the activity carries a lighted screen identification. The advantage of setting up like this lies in, rationally sets up the setting mode of second variable value. Generally, when a call home terminal wants to end a call, it usually needs to click an end button on the screen, and the display screen is already lighted. When the other party hangs up the call, the mobile terminal is still in a black screen state, and after the call is finished, the call interface needs to be changed, so that the call interface needs to be rearranged, and the screen identifier can be lightened for the activity setting of the call interface, so that when the function for rearranging is called actively, the call interface needs to be restored to display.
In some embodiments, the first variable comprises one variable of an application window extraction AppWindowToken object corresponding to the activity for determining whether to allow the mobile terminal to enter a bright screen state; the second variable includes another variable used for determining whether to allow the mobile terminal to enter a bright screen state in a window state WindowState corresponding to the activity. By taking the Android operating system as an example, the first variable and the second variable are further defined, and compatibility between the embodiment of the application and the Android operating system is ensured.
In some embodiments, the modifying the value of the first variable corresponding to the working state from the first preset value to the second preset value includes: and setting the value of the first variable corresponding to the working state as a second preset value by sequentially calling preset functions in an activity stack ActivityStack class, an application window container controller (AppWindowContainerController class and an AppWindowToken class. The preset function is a function newly added in the embodiment of the application for modifying the value of the first variable, and through the function calling process, the modification of the value of the first variable can be safely and accurately realized in an Android operating system, so that the stability of the system is ensured.
Fig. 2 is a schematic flowchart of another variable value adjustment method provided in an embodiment of the present application, where the method is described by taking an example in which an Android operating system is installed in a mobile terminal, and for convenience of understanding, the following related technologies are first described.
There are two services in the Android system, namely, an Activity Management Service (AMS), which is a service for managing all activities in the system, and a Window Management Service (WMS), which is a service for managing all windows in the system. Each Activity component is in the AMS and corresponds to an Activity record object, and the Activity record object is created in the process of starting the Activity component and is used for describing the running state of the Activity component. During the starting process of an Activity component, an associated ViewRootImpl object is created to cooperate with WMS service to manage the window state of the Activity component. The ViewRootImpl class has a static member variable, sipindowsmission, which points to a Session proxy object that implements the iwindowsmission interface. During the starting process of the Activity component, calling the member function add of the IWindowSession interface can transfer an associated W object to the WMS service, so that the WMS service can create a WindowState object for the Activity component. In the running process of the Activity component, calling a member function replay of the IWindowSession interface to request WMS service to lay out the UI of the Activity component, so that the UI of the Activity component can be correctly displayed on the screen, that is, when the window of the call interface in the embodiment of the present application is changed, requesting WMS again to update the window (which may generally include the size and position of the window) of the current call interface. In addition, during the starting process of the Activity component, a member function startActivityLocked of the ActivityStack class is called, and the function requests the WMS service to create an AppWindowToken object for the currently started Activity component. Each Activity component in an application process corresponds to an ActivityRecord object in the AMS. Each activiyrecord object in the AMS corresponds to an AppWindowToken object in the WMS. In WMS, the AppWindowToken object is used to describe a set of windows with identical tokens, each window being described by a WindowState object. Further, it should be noted that FLAG _ TURN _ SCREEN _ ON can light up the SCREEN when the Activity or window corresponding to the Application (APP) is activated when the Activity is activated.
In the Android system, there is a native flow of the APP lighting up the SCREEN with FLAG _ TURN _ SCREEN _ ON. When an activity with FLAG _ TURN _ SCREEN _ ON (e.g., the activity corresponding to the call interface in the embodiment of the present application) calls the relay function, mTurnOnScreen (corresponding to the second variable in the embodiment of the present application) of the corresponding WindowState is set to true. When the activity enters the resume state by calling onResume method, mcanturnscreen (equivalent to the first variable in the embodiment of the present application) of AppWindowToken is set to true. When mTurnOnScreen and mcanturnscreen are true at the same time, mTurnOnScreen and mcanturnscreen are set to false at the same time and the screen is lighted. The problem with this native flow is that once the variable mcanturnscreen on of AppWindowToken is set to true by resume (i.e., enter resume state due to Activity), the variable mcanturnscreen on cannot be set to false unless there is replay (i.e., Activity calls replay function) to set mtueonscreen of windows state to true, and after two conditions are met, the bright screen flow is entered and set to false. This results in the mcanturnscaneenon being true even if Activity is not in resume state (e.g., pause state), which results in an abnormal bright screen condition. The variable value adjusting scheme provided by the embodiment of the application can effectively solve the problem of abnormal screen lightening.
Specifically, the method comprises the following steps:
step 201, detecting that the mobile terminal is in a black screen state in a call process.
Step 202, detecting that the activity corresponding to the call interface enters a re-returning state from a suspended state, and setting a first variable in an application window extraction object corresponding to the working state of the activity as a first preset value.
For example, when it is detected that the mobile terminal is in a away state with respect to the user, the Activity corresponding to the call interface enters a resume state from an original pause state when the onResume method is called, and at this time, the mcanturnscreen on of the corresponding AppWindowToken is set to true (i.e., changed from false to true). During the conversation, the user may temporarily remove the mobile terminal from the head, such as viewing the content of the short message. It should be noted that, after the mobile terminal is removed, it is detected that the mobile terminal is in a far state relative to the user, and at this time, the mobile terminal may be controlled to enter a SCREEN-up state based ON another SCREEN-up flow, such as sending a SCREEN-up request, and the SCREEN-up flow is independent from a flow in which the APP in the embodiment of the present application lights up the SCREEN by using FLAG _ TURN _ SCREEN _ ON.
Step 203, detecting that the activity corresponding to the call interface enters a suspended state, and setting the first variable as a second preset value.
Illustratively, after the user finishes viewing the content of the short message, the mobile terminal is put back to the ear to continue the call, and then the mobile terminal returns to the black screen state. When the mobile terminal is detected to be in a close state relative to a user, the Activity corresponding to the call interface enters a pause state when the onPause method is called, but the value of the mcanturnscreen on is not changed in the native flow, namely, the value is still true, because the value of the mTurnOnScreen is not true at this time. That is, although the mobile terminal returns to the blank screen state, the value of mCanTurnScreenOn is still true. In the embodiment of the application, in order to avoid the occurrence of abnormal bright screen, the value of mcanturnscreen is actively set to false.
For example, the determination of Activity currently in the use state may be added to an Activity pause lock (Activity pause locked) function in an Activity stack class (Activity stack. java), and if the Activity is call-related Activity, an application pause notification (notifypappused) function is triggered, where the function is a newly added preset function in the embodiment of the present application. For example, a notifyApused function is newly added in ActiviyRecord. java, a notifyApused function is newly added in AppWindowContainerController. java, a notifyApused function is newly added in AppWindowToken. java, and a call relationship from top to bottom is adopted to finally set the mCanTurnScrenOn of AppWindowToken as false.
And 204, when the fact that the call of the opposite call party is finished is detected, calling a re-layout function through the activity to set the value of the second variable as the third preset value.
Illustratively, after the call of the call counterpart is finished, the call interface needs to be changed, so the Activity corresponding to the call interface calls the replay function, and the Activity corresponding to the call interface carries the FLAG _ TURN _ SCREEN _ ON FLAG, so the mTurnOnScreen of the corresponding WindowState is set to true. At this time, the value of mcanturnscreen is false, so the screen is not lighted.
Step 205, detecting that the activity corresponding to the call interface enters a re-returning state, and setting a first variable in the application window extraction object corresponding to the working state of the activity as a first preset value.
For example, when a call counterpart just ends a call, a user has not yet reached to remove the mobile terminal from the head, and after a while, after removing the head of the mobile terminal, the user may detect that the mobile terminal is in a away state relative to the user, at this time, Activity corresponding to the call interface calls an onResume method again to enter a resume state, and resets mcanturnscreen on of corresponding AppWindowToken to true.
And step 206, controlling the mobile terminal to enter a bright screen state, setting the value of the first variable as a second preset value, and setting the value of the second variable as a fourth preset value.
At this time, mTurnOnScreen and mcanturnscreen are true at the same time, the condition that the APP (i.e., the call application) lights the SCREEN by using FLAG _ TURN _ SCREEN _ ON is met, the display SCREEN of the mobile terminal is controlled to be lighted up, and mTurnOnScreen and mcanturnscreen are restored to false.
According to the variable value adjustment method provided by the embodiment of the application, the original flow that the conventional APP in the Android system lights up the SCREEN by using the FLAG _ TURN _ SCREEN _ ON is improved, the value adjustment strategy of one variable for judging whether the mobile terminal is allowed to enter the bright SCREEN state is changed, the bright SCREEN logic can be effectively improved, the adaptability of codes is enhanced, and the phenomenon of abnormal bright SCREEN is avoided.
Fig. 3 is a block diagram of a structure of a variable value adjusting device according to an embodiment of the present disclosure, where the device may be implemented by software and/or hardware, and is generally integrated in a mobile terminal, and may perform variable value adjustment by executing a variable value adjusting method. As shown in fig. 3, the apparatus includes:
a black screen state detection module 301, configured to detect whether the mobile terminal is in a black screen state in a call process;
the state judgment module 302 is configured to monitor whether a working state of an activity corresponding to a call interface enters a second state from a first state before a call is ended and then returns to the first state when the mobile terminal is detected to be in a black screen state in a call process; wherein the activity enters a first state when the mobile terminal is in a proximate state relative to a user and the activity enters a second state when the mobile terminal is in a distant state relative to the user;
a variable value adjusting module 303, configured to adjust a value of a first variable corresponding to the working state when a determination result of the state determining module is yes, where the value of the first variable and a value of a second variable corresponding to the activity jointly determine whether to allow the mobile terminal to enter a bright screen state.
The variable value adjusting device provided by the embodiment of the application detects that the mobile terminal is in a black screen state in a call process, monitors whether a working state of an activity corresponding to a call interface enters a second state from a first state before the call is finished, and then returns to the first state, and if so, adjusts a value of a first variable corresponding to the working state, wherein the value of the first variable and the value of a second variable corresponding to the activity jointly determine whether the mobile terminal is allowed to enter a bright screen state. By adopting the technical scheme, the existing value adjustment strategy of the variable for judging whether the mobile terminal is allowed to enter the bright screen state can be improved, the control flow of the bright screen of the screen is optimized, and the situation that the screen is abnormally lightened when a user uses the call function of the mobile terminal is avoided.
Optionally, the adjusting the value of the first variable corresponding to the working state includes:
modifying the value of the first variable corresponding to the working state from a first preset value to a second preset value; when the activity enters a second state from a first state, setting the value of the first variable to be the first preset value; when the value of the first variable is the first preset value and the value of the second variable is a third preset value, the mobile terminal is allowed to enter a bright screen state, and the value of the first variable is set to be the second preset value; and the value of the second variable is set as the third preset value when the call of the other party is finished.
Optionally, the apparatus further comprises:
and the bright screen prevention module is used for preventing the mobile terminal from entering a bright screen state when the value of the first variable corresponding to the working state is detected to be the second preset value and the value of the second variable is detected to be the third preset value after the value of the first variable is changed from the first preset value to the second preset value.
Optionally, the apparatus further comprises:
the layout function calling module is used for calling a re-layout function through the activity when the call of the other call party is detected to be ended so as to set the value of the second variable as the third preset value; wherein the activity carries a lighted screen identification.
Optionally, the first variable includes a variable that is extracted from an AppWindowToken object corresponding to the activity and used for determining whether to allow the mobile terminal to enter a bright screen state; the second variable includes another variable used for determining whether to allow the mobile terminal to enter a bright screen state in a window state WindowState corresponding to the activity.
Optionally, the modifying the value of the first variable corresponding to the working state from the first preset value to the second preset value includes:
and setting the value of the first variable corresponding to the working state as a second preset value by sequentially calling preset functions in an activity record ActiviyRecord class, an application Window Container controller (AppWindowContainerController class) and an AppWindowToken class.
Optionally, the call interface includes a call interface in a phone application program in the mobile terminal system, and/or a call interface in a third-party social application program in the mobile terminal.
Embodiments of the present application further provide a storage medium containing computer-executable instructions, which when executed by a computer processor, are configured to perform a method for adjusting a value of a variable, the method including:
detecting that the mobile terminal is in a black screen state in the communication process;
monitoring whether the working state of the activity corresponding to the call interface enters a second state from a first state before the call is finished, and then recovering to the first state; wherein the activity enters a first state when the mobile terminal is in a proximate state relative to a user and the activity enters a second state when the mobile terminal is in a distant state relative to the user;
and if so, adjusting the value of a first variable corresponding to the working state, wherein the value of the first variable and the value of a second variable corresponding to the activity jointly determine whether the mobile terminal is allowed to enter a bright screen state.
Storage medium-any of various types of memory devices or storage devices. The term "storage medium" is intended to include: mounting media such as CD-ROM, floppy disk, or tape devices; computer system memory or random access memory such as DRAM, DDRRAM, SRAM, EDORAM, Lanbas (Rambus) RAM, etc.; non-volatile memory such as flash memory, magnetic media (e.g., hard disk or optical storage); registers or other similar types of memory elements, etc. The storage medium may also include other types of memory or combinations thereof. In addition, the storage medium may be located in a first computer system in which the program is executed, or may be located in a different second computer system connected to the first computer system through a network (such as the internet). The second computer system may provide program instructions to the first computer for execution. The term "storage medium" may include two or more storage media that may reside in different locations, such as in different computer systems that are connected by a network. The storage medium may store program instructions (e.g., embodied as a computer program) that are executable by one or more processors.
Of course, the storage medium including the computer-executable instructions provided in the embodiments of the present application is not limited to the above-described variable value adjustment operation, and may also perform related operations in the variable value adjustment method provided in any embodiments of the present application.
The embodiment of the application provides a mobile terminal, and the variable value adjusting device provided by the embodiment of the application can be integrated in the mobile terminal. Fig. 4 is a schematic structural diagram of a mobile terminal according to an embodiment of the present application. The mobile terminal 400 may include: the variable value adjusting method includes a memory 401, a processor 402, and a computer program stored on the memory 401 and executable by the processor 402, where the processor 402 implements the variable value adjusting method according to an embodiment of the present application when executing the computer program.
The mobile terminal provided by the embodiment of the application can improve the existing value adjustment strategy of the variable for judging whether the mobile terminal is allowed to enter the bright screen state, optimize the control flow of the bright screen of the screen, and avoid the situation that the screen is abnormally lightened when a user uses the call function of the mobile terminal.
Fig. 5 is a schematic structural diagram of another mobile terminal provided in an embodiment of the present application, where the mobile terminal may include: a housing (not shown), a memory 501, a Central Processing Unit (CPU) 502 (also called processor, hereinafter referred to as CPU), a circuit board (not shown), and a power circuit (not shown). The circuit board is arranged in a space enclosed by the shell; the CPU502 and the memory 501 are provided on the circuit board; the power supply circuit is used for supplying power to each circuit or device of the mobile terminal; the memory 501 is used for storing executable program codes; the CPU502 executes a computer program corresponding to the executable program code by reading the executable program code stored in the memory 501 to implement the steps of:
detecting that the mobile terminal is in a black screen state in the communication process;
monitoring whether the working state of the activity corresponding to the call interface enters a second state from a first state before the call is finished, and then recovering to the first state; wherein the activity enters a first state when the mobile terminal is in a proximate state relative to a user and the activity enters a second state when the mobile terminal is in a distant state relative to the user;
and if so, adjusting the value of a first variable corresponding to the working state, wherein the value of the first variable and the value of a second variable corresponding to the activity jointly determine whether the mobile terminal is allowed to enter a bright screen state.
The mobile terminal further includes: peripheral interface 503, RF (Radio Frequency) circuitry 505, audio circuitry 506, speakers 511, power management chip 508, input/output (I/O) subsystem 509, other input/control devices 510, touch screen 512, other input/control devices 510, and external port 504, which communicate via one or more communication buses or signal lines 507.
It should be understood that the illustrated mobile terminal 500 is merely one example of a mobile terminal and that the mobile terminal 500 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 following describes in detail the mobile terminal for adjusting the value of the variable provided in this embodiment, where the mobile terminal is a mobile phone as an example.
A memory 501, the memory 501 being accessible by the CPU502, the peripheral interface 503, and the like, the memory 501 may include high speed random access memory, and may also include non-volatile memory, such as one or more magnetic disk storage devices, flash memory devices, or other volatile solid state storage devices.
A peripheral interface 503, the peripheral interface 503 may connect input and output peripherals of the device to the CPU502 and the memory 501.
An I/O subsystem 509, which I/O subsystem 509 may connect input and output peripherals on the device, such as a touch screen 512 and other input/control devices 510, to the peripheral interface 503. The I/O subsystem 509 may include a display controller 5091 and one or more input controllers 5092 for controlling other input/control devices 510. Where one or more input controllers 5092 receive electrical signals from or send electrical signals to other input/control devices 510, the other input/control devices 510 may include physical buttons (push buttons, rocker buttons, etc.), dials, slide switches, joysticks, click wheels. It is noted that the input controller 5092 may be connected to any one of: a keyboard, an infrared port, a USB interface, and a pointing device such as a mouse.
A touch screen 512, which is an input interface and an output interface between the user's mobile terminal and the user, displays visual output to the user, which may include graphics, text, icons, video, and the like.
The display controller 5091 in the I/O subsystem 509 receives electrical signals from the touch screen 512 or transmits electrical signals to the touch screen 512. The touch screen 512 detects a contact on the touch screen, and the display controller 5091 converts the detected contact into an interaction with a user interface object displayed on the touch screen 512, that is, implements a human-computer interaction, and the user interface object displayed on the touch screen 512 may be an icon for running a game, an icon networked to a corresponding network, or the like. It is worth mentioning that the device may also comprise a light mouse, which is a touch sensitive surface that does not show visual output, or an extension of the touch sensitive surface formed by the touch screen.
The RF circuit 505 is mainly used to establish communication between the mobile phone and the wireless network (i.e., network side), and implement data reception and transmission between the mobile phone and the wireless network. Such as sending and receiving short messages, e-mails, etc. In particular, the RF circuitry 505 receives and transmits RF signals, also referred to as electromagnetic signals, through which the RF circuitry 505 converts electrical signals to or from electromagnetic signals and communicates with communication networks and other devices. The RF circuitry 505 may include known circuitry for performing these functions including, but not limited to, an antenna system, an RF transceiver, one or more amplifiers, a tuner, one or more oscillators, a digital signal processor, a CODEC (CODEC) chipset, a Subscriber Identity Module (SIM), and so forth.
The audio circuit 506 is mainly used to receive audio data from the peripheral interface 503, convert the audio data into an electric signal, and transmit the electric signal to the speaker 511.
The speaker 511 is used for restoring the voice signal received by the handset from the wireless network through the RF circuit 505 to sound and playing the sound to the user.
And a power management chip 508 for supplying power and managing power to the hardware connected to the CPU502, the I/O subsystem, and the peripheral interfaces.
The variable value adjusting device, the storage medium and the mobile terminal provided in the above embodiments can execute the variable value adjusting method provided in any embodiment of the present application, and have corresponding functional modules and beneficial effects for executing the method. For technical details that are not described in detail in the above embodiments, reference may be made to a variable value adjustment method provided in any embodiment of the present application.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present application and the technical principles employed. It will be understood by those skilled in the art that the present application is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the application. Therefore, although the present application has been described in more detail with reference to the above embodiments, the present application is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present application, and the scope of the present application is determined by the scope of the appended claims.

Claims (9)

1. A variable value adjustment method is characterized by comprising the following steps:
detecting that the mobile terminal is in a black screen state in the communication process;
monitoring whether the working state of the activity corresponding to the call interface enters a second state from a first state before the call is finished, and then recovering to the first state; wherein the activity enters a first state when the mobile terminal is in a proximate state relative to a user and the activity enters a second state when the mobile terminal is in a distant state relative to the user;
if so, adjusting the value of a first variable corresponding to the working state, wherein the value of the first variable and the value of a second variable corresponding to the activity jointly determine whether the mobile terminal is allowed to enter a bright screen state; the first variable and the second variable are used for judging whether the mobile terminal is allowed to enter a bright screen state or not;
the adjusting the value of the first variable corresponding to the working state includes:
modifying the value of the first variable corresponding to the working state from a first preset value to a second preset value; when the activity enters a second state from a first state, setting the value of the first variable to be the first preset value; when the value of the first variable is the first preset value and the value of the second variable is a third preset value, the mobile terminal is allowed to enter a bright screen state, and the value of the first variable is set to be the second preset value; the value of the second variable is set to be the third preset value when the call of the other party is finished;
the first preset value is a value indicating that the mobile terminal is allowed to enter a bright screen state, the second preset value is a value indicating that the mobile terminal is not allowed to enter the bright screen state, and the third preset value is a value indicating that the mobile terminal is allowed to enter the bright screen state.
2. The method of claim 1, wherein after modifying the value of the first variable corresponding to the operating state from a first preset value to a second preset value, further comprising:
and when the value of the first variable is detected to be the second preset value and the value of the second variable is detected to be the third preset value, the mobile terminal is prevented from entering a bright screen state.
3. The method of claim 1, further comprising:
when the fact that the call of the other call party is finished is detected, a re-layout function is called through the activity, and the value of the second variable is set to be the third preset value; wherein the activity carries a lighted screen identification.
4. The method according to claim 1, wherein the first variable comprises a variable for extracting, from an app window extraction AppWindowToken object corresponding to the activity, whether to allow the mobile terminal to enter a bright screen state; the second variable includes another variable used for determining whether to allow the mobile terminal to enter a bright screen state in a window state WindowState corresponding to the activity.
5. The method of claim 4, wherein modifying the value of the first variable corresponding to the operating state from a first preset value to a second preset value comprises:
and setting the value of the first variable corresponding to the working state as a second preset value by sequentially calling preset functions in an activity record ActiviyRecord class, an application Window Container controller (AppWindowContainerController class) and an AppWindowToken class.
6. The method according to claim 1, wherein the call interface comprises a call interface in a phone application in the mobile terminal system and/or a call interface in a third party social application in the mobile terminal.
7. A variable value adjusting device is characterized by comprising:
the system comprises a black screen state detection module, a voice recognition module and a voice recognition module, wherein the black screen state detection module is used for detecting whether the mobile terminal is in a black screen state in the conversation process;
the state judgment module is used for monitoring whether the working state of the activity corresponding to the call interface enters a second state from a first state before the call is finished when the mobile terminal is detected to be in a black screen state in the call process, and then the mobile terminal is recovered to the first state; wherein the activity enters a first state when the mobile terminal is in a proximate state relative to a user and the activity enters a second state when the mobile terminal is in a distant state relative to the user;
a variable value adjusting module, configured to adjust a value of a first variable corresponding to the working state when a determination result of the state determining module is yes, where the value of the first variable and a value of a second variable corresponding to the activity jointly determine whether to allow the mobile terminal to enter a bright screen state; the first variable and the second variable are used for judging whether the mobile terminal is allowed to enter a bright screen state or not;
wherein adjusting the value of the first variable corresponding to the operating state comprises:
modifying the value of the first variable corresponding to the working state from a first preset value to a second preset value;
when the activity enters a second state from a first state, setting the value of the first variable to be the first preset value; when the value of the first variable is the first preset value and the value of the second variable is a third preset value, the mobile terminal is allowed to enter a bright screen state, and the value of the first variable is set to be the second preset value; the value of the second variable is set to be the third preset value when the call of the other party is finished;
the first preset value is a value indicating permission, the second preset value is a value indicating non-permission, and the third preset value is a value indicating permission.
8. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out a variable value adjustment method according to any one of claims 1 to 6.
9. A mobile terminal, comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the variable value adjustment method according to any one of claims 1 to 6 when executing the computer program.
CN201811056687.5A 2018-09-11 2018-09-11 Variable value adjustment method and device, storage medium and mobile terminal Active CN108989576B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811056687.5A CN108989576B (en) 2018-09-11 2018-09-11 Variable value adjustment method and device, storage medium and mobile terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811056687.5A CN108989576B (en) 2018-09-11 2018-09-11 Variable value adjustment method and device, storage medium and mobile terminal

Publications (2)

Publication Number Publication Date
CN108989576A CN108989576A (en) 2018-12-11
CN108989576B true CN108989576B (en) 2020-09-01

Family

ID=64545611

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811056687.5A Active CN108989576B (en) 2018-09-11 2018-09-11 Variable value adjustment method and device, storage medium and mobile terminal

Country Status (1)

Country Link
CN (1) CN108989576B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI699991B (en) * 2019-02-26 2020-07-21 華碩電腦股份有限公司 Electronic device and controlling method thereof

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7869204B2 (en) * 2008-09-15 2011-01-11 International Business Machines Corporation Compact size portable computer having a fully integrated virtual keyboard projector and a display projector
CN104572328A (en) * 2014-12-29 2015-04-29 广东欧珀移动通信有限公司 Control method and device
CN105245717A (en) * 2015-10-27 2016-01-13 努比亚技术有限公司 Mobile terminal palm rejection device and method
CN106412243B (en) * 2016-09-05 2019-08-30 努比亚技术有限公司 A kind of method and terminal of monitoring distance inductor exception
CN107566161A (en) * 2017-08-08 2018-01-09 广东欧珀移动通信有限公司 Method for parameter configuration and Related product
CN107704132B (en) * 2017-09-28 2021-06-15 努比亚技术有限公司 Method for detecting frozen screen of terminal, terminal and computer readable storage medium

Also Published As

Publication number Publication date
CN108989576A (en) 2018-12-11

Similar Documents

Publication Publication Date Title
CN107835033B (en) Antenna tuning switch control method and device, terminal equipment and storage medium
CN107783803B (en) System optimization method and device of intelligent terminal, storage medium and intelligent terminal
CN107889092B (en) Bluetooth device communication control method, device, terminal device and storage medium
RU2686673C1 (en) Device and method of terminal control and terminal
CN108509176B (en) Method and device for playing audio data, storage medium and intelligent terminal
CN107844342B (en) Control method and device for keeping application program alive, storage medium and mobile terminal
CN107748685B (en) Application program starting control method and device, terminal equipment and storage medium
CN107797841B (en) Window control method and device, terminal equipment and storage medium
CN107770759B (en) Bluetooth voice link establishing method and device, storage medium and mobile terminal
CN107831886B (en) Control method and device for associated starting application, storage medium and intelligent terminal
EP2649859B1 (en) Automatically enabling wireless communication
CN108024128B (en) Control method and device for Bluetooth music playing, terminal equipment and storage medium
CN107844341B (en) Process starting control method and device, storage medium and mobile terminal
CN108093451B (en) Random access control method, device, storage medium and mobile terminal
US10956176B2 (en) Processing method, device and storage medium for implementing automatic startup
CN108829229B (en) Screen control method and device, storage medium and intelligent terminal
CN107943270B (en) Application service control method and device, storage medium and mobile terminal
CN107885588B (en) Application service control method and device, storage medium and mobile terminal
CN107423064B (en) Message processing method and device, terminal equipment and storage medium
CN106909250B (en) Touch operation processing method and device and mobile terminal
CN109165114B (en) Application program no-response processing method and device, storage medium and intelligent terminal
CN108966367B (en) Method and device for managing and controlling internet surfing behavior, storage medium and intelligent terminal
CN105807891A (en) Screen control method and device, and electronic equipment
CN107135305B (en) Message reminding method, device and terminal
CN108989576B (en) Variable value adjustment method and device, storage medium and mobile terminal

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