CN108989576A - Variable-value method of adjustment, device, storage medium and mobile terminal - Google Patents
Variable-value method of adjustment, device, storage medium and mobile terminal Download PDFInfo
- Publication number
- CN108989576A CN108989576A CN201811056687.5A CN201811056687A CN108989576A CN 108989576 A CN108989576 A CN 108989576A CN 201811056687 A CN201811056687 A CN 201811056687A CN 108989576 A CN108989576 A CN 108989576A
- 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.)
- Granted
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04M—TELEPHONIC COMMUNICATION
- H04M1/00—Substation equipment, e.g. for use by subscribers
- H04M1/72—Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
- H04M1/724—User interfaces specially adapted for cordless or mobile telephones
- H04M1/72403—User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04M—TELEPHONIC COMMUNICATION
- H04M1/00—Substation equipment, e.g. for use by subscribers
- H04M1/72—Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
- H04M1/724—User interfaces specially adapted for cordless or mobile telephones
- H04M1/72448—User interfaces specially adapted for cordless or mobile telephones with means for adapting the functionality of the device according to specific conditions
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04M—TELEPHONIC COMMUNICATION
- H04M1/00—Substation equipment, e.g. for use by subscribers
- H04M1/72—Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
- H04M1/724—User interfaces specially adapted for cordless or mobile telephones
- H04M1/72448—User interfaces specially adapted for cordless or mobile telephones with means for adapting the functionality of the device according to specific conditions
- H04M1/72454—User 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
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04M—TELEPHONIC COMMUNICATION
- H04M1/00—Substation equipment, e.g. for use by subscribers
- H04M1/72—Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
- H04M1/724—User interfaces specially adapted for cordless or mobile telephones
- H04M1/72484—User 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 present application discloses variable-value method of adjustment, device, storage medium and mobile terminal.This method comprises: detecting the black state that mobile terminal is in communication process;The corresponding movable working condition of call interface is monitored before end of conversation, if enter the second state from first state, then restore to first state;If so, being adjusted to the value of the first variable corresponding with working condition, wherein the value of the first variable and the bivariate value corresponding with activity codetermine whether allow mobile terminal into bright screen state.The embodiment of the present application is by using above-mentioned technical proposal, the value adjustable strategies of the existing variable for determining whether that mobile terminal is allowed to enter bright screen state can be improved, optimize the control flow of the bright screen of screen, when user being avoided to use the call function of mobile terminal, the case where screen is lighted extremely.
Description
Technical field
The invention relates to technical field of mobile terminals more particularly to variable-value method of adjustment, device, storage Jie
Matter and mobile terminal.
Background technique
Currently, display screen has become the standard configuration of most mobile terminals, user can be checked mobile whole by display screen
Display content abundant in end, and good human-computer interaction is established with mobile terminal.
Mobile terminal generally requires built-in power and is powered, and to meet the portability of mobile terminal, and display screen is aobvious
Show the power consumption that will increase mobile terminal.In order to rationally control the power consumption of mobile terminal, extends stand-by time, need to mobile terminal
The bright screen of screen and the screen that goes out rationally are controlled.However, the bright screen control program of mobile terminal is still incomplete at present, need to change
Into.
Summary of the invention
The embodiment of the present application provides a kind of variable-value method of adjustment, device, storage medium and mobile terminal, can pass through
Optimized variable value adjustable strategies optimize the bright screen control program of mobile terminal.
In a first aspect, the embodiment of the present application provides a kind of variable-value method of adjustment, comprising:
Detect the black state that mobile terminal is in communication process;
The corresponding movable working condition of call interface is monitored before end of conversation, if enter second from first state
State, then restore to the first state;Wherein, the activity is when the mobile terminal is in proximity state relative to user
Into first state, the activity enters the second state when the mobile terminal is in relative to user far from state;
If so, being adjusted to the value of the first variable corresponding with the working condition, wherein first variable
Value and bivariate value corresponding with the activity, codetermine whether allow the mobile terminal into bright screen
State.
Second aspect, the embodiment of the present application provide a kind of variable-value adjustment device, comprising:
Black state detection module, the black state whether being in communication process for detecting mobile terminal;
Condition judgment module, for monitoring when detecting the black state that the mobile terminal is in communication process
The corresponding movable working condition of call interface is before end of conversation, if enters the second state from first state, then restores
To the first state;Wherein, the activity enters the first shape when the mobile terminal is in proximity state relative to user
State, the activity enter the second state when the mobile terminal is in relative to user far from state;
Variable-value adjust module, for the judging result in the condition judgment module be when, to the work
The value of corresponding first variable of state is adjusted, wherein the value of first variable and corresponding with the activity
Bivariate value, codetermine whether allow the mobile terminal into bright screen state.
The third aspect, the embodiment of the present application provide a kind of computer readable storage medium, are stored thereon with computer journey
Sequence realizes the variable-value method of adjustment as described in the embodiment of the present application when the program is executed by processor.
Fourth aspect, the embodiment of the present application provide a kind of mobile terminal, including memory, processor and are stored in storage
It can realize on device and when the computer program of processor operation, the processor execute the computer program as the application is real
Apply variable-value method of adjustment described in example.
The variable-value Adjusted Option provided in the embodiment of the present application detects that mobile terminal is in black in communication process
When screen state, the corresponding movable working condition of monitoring call interface is before end of conversation, if enters the from first state
Two-state, then restore to first state, if so, being adjusted to the value of the first variable corresponding with working condition, wherein
Whether the value of the first variable and bivariate value co-determination corresponding with activity allow mobile terminal to enter bright screen shape
State.It, can be to the existing change for determining whether that mobile terminal is allowed to enter bright screen state by using above-mentioned technical proposal
The value adjustable strategies of amount improve, and optimize the control flow of the bright screen of screen, and user is avoided to use the call function of mobile terminal
Can when, the case where screen is lighted extremely.
Detailed description of the invention
Fig. 1 is a kind of flow diagram of variable-value method of adjustment provided by the embodiments of the present application;
Fig. 2 is the flow diagram of another variable-value method of adjustment provided by the embodiments of the present application;
Fig. 3 is the structural block diagram that a kind of variable-value provided by the embodiments of the present application adjusts device;
Fig. 4 is a kind of structural schematic diagram of mobile terminal provided by the embodiments of the present application;
Fig. 5 is the structural schematic diagram of another mobile terminal provided by the embodiments of the present application.
Specific embodiment
Further illustrate the technical solution of the application below with reference to the accompanying drawings and specific embodiments.It is understood that
It is that specific embodiment described herein is used only for explaining the application, rather than the restriction to the application.It further needs exist for illustrating
, part relevant to the application is illustrated only for ease of description, in attached drawing rather than entire infrastructure.
It should be mentioned that some exemplary embodiments are described as before exemplary embodiment is discussed in greater detail
The processing or method described as flow chart.Although each step is described as the processing of sequence by flow chart, many of these
Step can be implemented concurrently, concomitantly or simultaneously.In addition, the sequence of each step can be rearranged.When its operation
The processing can be terminated when completion, it is also possible to have the additional step being not included in attached drawing.The processing can be with
Corresponding to method, function, regulation, subroutine, subprogram etc..
Fig. 1 is a kind of flow diagram of variable-value method of adjustment provided by the embodiments of the present application, and this method can be by
Variable-value adjusts device and executes, and wherein the device can be implemented by software and/or hardware, and can generally integrate in the terminal.
As shown in Figure 1, this method comprises:
Step 101 detects the black state that mobile terminal is in communication process.
Illustratively, the mobile terminal in the embodiment of the present application may include that mobile phone and tablet computer etc. have call function
Mobile device.Call function in the embodiment of the present application may include the electricity that the telephony application in mobile terminal system provides
Function is talked about, the service that can be generally provided based on mobile communication carrier (such as China Mobile or China Unicom) is realized;It can be with
Including other third party applications in mobile terminal, such as the call function etc. that wechat or QQ social category application program provide,
It can generally be realized based on wireless network.
In general, having can be arranged just like voice collection devices such as microphones in the mobile device of call function and such as listen
The sound play devices such as cylinder, to realize the speech exchange in communication process.In order to be bonded the use habit of user, generally by Mike
The bottom of mobile terminal is arranged in wind, and for acquiring user's mouth one's voice in speech, earpiece is arranged in the top of mobile terminal,
For the sound of partner to be sent into user's ear.User, in order to guarantee communication effect, can will generally move when answering call
Dynamic terminal is placed on head side, in most cases the display screen of mobile terminal can with user face or ear contacts, due to this
When user need not look at the content of display screen, in order to save power consumption, and also to avoid the positions such as user face or ear
It is contacted with display screen and generates and accidentally touch, mobile terminal can control display screen and enter black state or put out screen state, namely extinguish aobvious
Display screen.Range sensor would generally be set in mobile terminal near earpiece, for detecting between mobile terminal and user's head
Distance, when distance is less than the first setting value, it is believed that mobile terminal is in proximity state relative to user, control display screen into
Enter black state, when distance is greater than the second preset value, it is believed that mobile terminal is in relative to user far from state, control display
Screen enters bright screen state.Wherein, range sensor can be by proximity sensor (such as infrared proximity transducer) or supersonic sensing
The sensors such as device are realized.
In this step, the black state in communication process includes that mobile terminal is on call, and due to mobile terminal
When being in proximity state relative to user, the black state that is entered.
Step 102, the corresponding movable working condition of monitoring call interface are before end of conversation, if from first state
Into the second state, then restore to the first state.
Wherein, the activity enters first state when the mobile terminal is in proximity state relative to user, described
Activity enters the second state when the mobile terminal is in relative to user far from state.
In the embodiment of the present application, activity can be regarded as the independent interface for being directly facing user and providing interaction and operating
Or the page, the interface may be named using different nouns in different operating system.In order to make it easy to understand, below with peace
Following explanation is carried out for tall and erect (Android) operating system.In android system, activity is referred to as Activity.
Activity is one and is responsible for the component that interacts with user, one screen of offer (it can be understood as screen interface, and non-physical
Display screen), so that a certain task is completed in user's interaction.In an android application program, an Activity is usual
It is exactly an individual screen, it can show some controls or monitor and handle the event of user above.Call interface
Corresponding activity can be regarded as being currently used in the corresponding Activity of call interface in the application program of call.Activity generally may be used
With there are many working conditions, such as runs, suspends, stops, closing and return to.Generally may include for Activity
Running, pause, stopped, killed and resume etc..In the embodiment of the present application, first state can be pause
(pause), the second state, which can be, returns to (resume).
In the embodiment of the present application, the call interface may include in the telephony application in the mobile terminal system
Call interface may also comprise the call interface in the mobile terminal in third party's social category application program, can also include simultaneously
Above two call interface.
Illustratively, during user is conversed using mobile terminal, may need for some reason by
Then mobile terminal continues to listen to dialog context close to ear again far from ear.For example, user may need to check mobile terminal
In telephone number, file or web page contents etc.;Alternatively, user may need temporarily to put down the mobile terminal in hand, release is double
Hand goes for thing etc..In this way, the corresponding activity of call interface, which will be undergone from first state, enters second before end of conversation
State, then restore to the process of first state.
In the related technology, when mobile terminal is in the black state in communication process, the process that display screen is lighted is triggered
Can there are many kinds of.Two variables involved in the process lighted of one of which triggering display screen, when the two variables value all
When indicating that display screen is allowed to enter bright screen state, display screen can be just lighted, then again restores the corresponding value of the two variables
To default value (if do not allowed), one in the two variables is next the first variable that the embodiment of the present application is mentioned, separately
One is referred to as the second variable in the embodiment of the present application.First variable is movable working condition pair corresponding with call interface
The variable answered, the variable be used to determine whether to allow the mobile terminal into bright screen state.In the related technology, when first becomes
When the value of amount is arranged to indicate to allow, if the second variable is not configured to allow always, then the value of the first variable is just
It can not be restored to default value, even if the value of the first variable remains as after activity restores from the second state to first state
Allow.When activity is in first state, illustrate that mobile terminal is in proximity state relative to user, and when the second variable is set
After being set to permission, it can indicate to allow and overdue bright screen due to the value of two variables, the display screen of mobile terminal is caused to exist
Enter bright screen state when being close with user, not only waste power consumption, is also easy to occur accidentally to touch, make troubles to the use of user.
Step 103, if so, being adjusted to the value of the first variable corresponding with the working condition.
Wherein, the value of first variable and bivariate value corresponding with the activity, whether co-determination
Allow the mobile terminal into bright screen state.
In the embodiment of the present application, in order to avoid above-mentioned display screen is occurred by overdue bright situation, if call interface is corresponding
Movable working condition enters the second state before end of conversation, from first state, then restores to first state, then actively right
The value of first variable is adjusted, and such as restoring it into default value or other does not indicate the value allowed, by taking for the first variable
Value is set as not will lead to the value for allowing display screen to enter bright screen state, in this way, even if the second variable is arranged to allow, at this time
First variable is not permission, and display screen would not enter bright screen state.
The variable-value method of adjustment provided in the embodiment of the present application detects that mobile terminal is in black in communication process
When screen state, the corresponding movable working condition of monitoring call interface is before end of conversation, if enters the from first state
Two-state, then restore to first state, if so, being adjusted to the value of the first variable corresponding with working condition, wherein
Whether the value of the first variable and bivariate value co-determination corresponding with activity allow mobile terminal to enter bright screen shape
State.It, can be to the existing change for determining whether that mobile terminal is allowed to enter bright screen state by using above-mentioned technical proposal
The value adjustable strategies of amount improve, and optimize the control flow of the bright screen of screen, and user is avoided to use the call function of mobile terminal
Can when, the case where screen is lighted extremely.
In some embodiments, the value to the first variable corresponding with the working condition is adjusted, comprising:
The value of the first variable corresponding with the working condition is revised as the second preset value from the first preset value;Wherein, when described
When activity enters the second state from first state, the value of first variable is arranged to first preset value;When described
The value of first variable is first preset value, and when the bivariate value is third preset value, it is described it is mobile eventually
End is allowed to enter bright screen state, and the value of first variable is arranged to second preset value;Described is bivariate
Value is arranged to the third preset value when partner terminates call.The advantages of this arrangement are as follows to different operating
The value of the first variable is preset under state, when needing to be adjusted, is directly revised as preset value, is promoted and stablized
Property.Illustratively, the first preset value is the value for indicating to allow, such as true (true) or 1;The expression of second preset value does not allow
Value, such as false (false) or 0;Third preset value is the value for indicating to allow, and such as true (true) or 1, third preset value can be with first
Preset value is identical, can also be different, and the embodiment of the present application is without limitation;Bivariate value can also have the 4th preset value, table
Showing does not allow, such as false (false) or 0.For example, the value of the first variable is when activity enters the second state from first state
true.When partner terminates call, bivariate value is arranged to true.When the value of the first variable is true, the
When bivariate value is true, mobile terminal is allowed to enter bright screen state, while the value of the first variable and the second variable
Value be arranged to false.In the related technology, the activity of call interface enters the second state from first state, if second becomes
The value of amount is always false before activity restores to first state, then the value of the first variable is still true, it will not be extensive
Again to false, after this, if bivariate value is arranged to true because partner terminates call, then will
Because the first variable and the second variable are true, and cause display screen by overdue bright.In the embodiment of the present application, restore extremely in activity
After first state, false is set by the value of the first variable in time, then can effectively avoid display screen and sent out by overdue bright situation
Raw, i.e., in partner kill-call, before mobile terminal is not removed head by user, display screen will not enter bright screen shape
State saves power consumption and prevents accidentally to touch.
In some embodiments, it is modified by the value of the first variable corresponding with the working condition from the first preset value
After the second preset value, further includes: it in the value for detecting first variable is second preset value, and described second
When the value of variable is third preset value, the mobile terminal is prevented to enter bright screen state.The advantages of this arrangement are as follows into one
In the case that step guarantees that the first variable and the second variable do not allow display screen to enter bright screen state simultaneously, mobile terminal enters by mistake through bright
Screen state.
In some embodiments, further includes: when detecting that partner terminates call, called again by the activity
The bivariate value is set the third preset value by layout function;Wherein, the activity, which carries, lights screen
Curtain mark.The advantages of this arrangement are as follows the set-up mode of the second variable-value is rationally arranged.In general, call local terminal is wanted
When terminating call, it usually needs realized by clicking the conclusion button on screen, at this moment display screen has lighted.And when call
When other side hangs up the telephone, mobile terminal is still in black state, and after end of conversation, call interface needs change, so needing
Again it is laid out, screen identification can be lighted for the activity setting of call interface, in this way, calling layout function again in activity
When, it can identify that call interface needs to restore display.
In some embodiments, first variable includes that application widget corresponding with the activity extracts
The variable into bright screen state for being used to determine whether to allow the mobile terminal in AppWindowToken object;Institute
Stating the second variable includes in Window state WindowState corresponding with the activity for determining whether to allow the movement
Another variable into bright screen state of terminal.By taking Android operation system as an example, the first variable and the second variable are carried out
Further restriction, ensure that the compatibility of the embodiment of the present application and Android operation system.
In some embodiments, the value by the first variable corresponding with the working condition is repaired from the first preset value
It is changed to the second preset value, comprising: by successively calling active stack ActivityStack class, application widget container controller
Preset function in AppWindowContainerController class and AppWindowToken class, will be with the working condition
The value of corresponding first variable is set as the second preset value.Wherein, preset function is in the embodiment of the present application to realize pair
The modification of first variable-value and newly-increased function can be pacified by the above function call process in Android operation system
It is accurately realized the modification to the first variable-value entirely, guarantees system stability.
Fig. 2 is the flow diagram of another variable-value method of adjustment provided by the embodiments of the present application, and this method is to move
Dynamic terminal is illustrated for being equipped with Android operation system, is understood for convenience, first to the related skill being next related to
Art is illustrated.
Service there are two types of existing in android system, campaign management services (ActivityManagerService, AMS)
It is in system for managing the clothes of all Activity with window management service (WindowManagerService, WMS), AMS
Business, WMS are in system for managing the service of all Window.Each Activity component is all corresponding with one inside AMS
A ActivityRecord object, this ActivityRecord object are created during Activity component starts,
For describing the operating status of Activity component.One Activity component will create an association during starting
ViewRootImpl object, manage the Window state of the Activity component for cooperating WMS service.ViewRootImpl
Class has a static member variable sWindowSession, it, which has been directed toward one, realizes IWindowSession interface
Session agent object.In the start-up course of Activity component, member's letter of this IWindowSession interface is called
One associated W object can be transmitted to WMS service by number add, so that WMS service can be Activity component creation one
A WindowState object.In the operational process of Activity component, the member of this IWindowSession interface is called
Function relayout is laid out the UI of the Activity component to request WMS service, so as to the Activity component
UI can be correctly displayed in screen, namely when the window of the call interface in the embodiment of the present application changes,
WMS is re-requested, the window (generally may include the size and location etc. of window) at current talking interface is updated.In addition,
Activity component can also call the member function of ActivityStack class during starting
StartActivityLocked, the function can request WMS service to create one for the Activity component currently started
AppWindowToken object.Each of program process Activity component is all corresponding with one in AMS
ActivityRecord object.Each ActivityRecord object is corresponding with one in WMS in AMS
AppWindowToken object.In WMS, AppWindowToken object is for describing one group of window for having identical token
, each window is described by a WindowState object.In addition it is also necessary to illustratively FLAG_
TURN_SCREEN_ON, when the corresponding Activity of application program (APP) or window have the mark, when Activity starts
When can light screen.
There is APP in android system lights the primary process of screen using FLAG_TURN_SCREEN_ON.When one
A Activiy (the corresponding Activiy of call interface in such as the embodiment of the present application) with FLAG_TURN_SCREEN_ON is called
When relayout function, the mTurnOnScreen of corresponding WindowState (can be equivalent in the embodiment of the present application
Two variables) it is set as true.It, can will be corresponding when the Activiy is by calling onResume method to enter resume state
The mCanTurnScreenOn (the first variable being equivalent in the embodiment of the present application) of AppWindowToken is set as true.When
After mTurnOnScreen and mCanTurnScreenOn is simultaneously true, by mTurnOnScreen and mCanTurnScreenOn
It is set as false simultaneously and lights screen.This primary process the problem is that, AppWindowToken's
This variable of mCanTurnScreenOn once by resume (i.e. because Activity enters resume state) be set as true it
Afterwards, the mTuenOnScreen of windowState is arranged unless there are relayout (i.e. Activiy calls relayout function)
For true, two conditions enter bright screen process after reaching, and are set to false, can not be by this variable in the case of other
(mCanTurnScreenOn) it is set as false.Even if this result in sometimes Activity be not resume state (such as pause
State), this mCanTurnScreenOn also or true, reaches bright set of hanging scrolls part and leads to abnormal bright screen.The embodiment of the present application
The variable-value Adjusted Option of offer, the problem of can effectively solve the problem that the exception bright screen.
Specifically, this method comprises the following steps:
Step 201 detects the black state that mobile terminal is in communication process.
Step 202 detects that the corresponding activity of call interface, will be with the work from halted state into state is returned to
The first variable in the corresponding application widget extracting object of dynamic working condition is set as the first preset value.
Illustratively, when detecting that mobile terminal is in relative to user far from state, call interface is corresponding
Activity can enter resume state from original pause state when calling onResume method, at this point, by corresponding
The mCanTurnScreenOn of AppWindowToken is set as true (becoming true from false).User is in communication process
In, mobile terminal temporarily may be removed into head, such as check short message content.It should be noted that after mobile terminal is removed,
It can detect that mobile terminal is in relative to user far from state, it is mobile eventually to light Row control based on another screen at this time
End enters bright screen state, such as issues bright screen request, which lights the APP in process and the embodiment of the present application and utilize FLAG_
The process that TURN_SCREEN_ON lights screen is mutually independent.
Step 203 detects that the corresponding activity of call interface enters halted state, sets second for the first variable and presets
Value.
Illustratively, after user has checked short message content, mobile terminal can be put back in one's ear, continues to converse, this
When mobile terminal can return to black state.When detecting that mobile terminal is in proximity state relative to user, call interface pair
The Activity answered can enter pause state when calling onPause method, but will not be right in primary process
The value of mCanTurnScreenOn is modified, i.e., is still true, because the value of mTurnOnScreen is not at this time
true.Although the value of mCanTurnScreenOn is still true that is, mobile terminal returns to black state.The application
In embodiment, in order to avoid abnormal bright screen occurs, false actively is set by the value of mCanTurnScreenOn.
Illustratively, it can be locked in the activity suspension in active stack class (ActivityStack.java)
(activityPausedLocked) function increases the judgement to the Activity for being currently at pause state, if it is call
Relevant Activity can then trigger application pause notice (notifyAppPaused) function, which is the embodiment of the present application
In newly-increased preset function.Increase notifyAppPaused function newly such as in ActivityRecord.java,
Increase notifyAppPaused function in AppWindowContainerController.java newly,
It increases notifyAppPaused function in AppWindowToken.java newly, using call relation from top to down, finally will
The mCanTurnScreenOn of AppWindowToken is set as false.
Step 204, when detecting that partner terminates call, pass through the activity and call layout function again, will
The bivariate value is set as the third preset value.
Illustratively, after partner terminates call, call interface needs change, so call interface is corresponding
Activity can call relayout function, and the corresponding Activity of call interface carries FLAG_TURN_SCREEN_ON
Mark, so true can be set by the mTurnOnScreen of corresponding WindowState.And at this point, due to
The value of mCanTurnScreenOn is false, so screen will not be lighted.
Step 205 detects that the corresponding activity of call interface, will be with the movable work shape into state is returned to
The first variable in the corresponding application widget extracting object of state is set as the first preset value.
Illustratively, when partner has just terminated call, user also has not enough time to mobile terminal removing head, and
Shortly after, after mobile terminal is removed head by user, it can detect that mobile terminal is in relative to user far from state, at this point,
The corresponding Activity of call interface calls onResume method to enter resume state again, and will be corresponding
The mCanTurnScreenOn of AppWindowToken is re-set as true.
Step 206, control mobile terminal enter bright screen state, and set the second preset value for the value of the first variable,
The 4th preset value is set by bivariate value.
At this point, mTurnOnScreen and mCanTurnScreenOn is simultaneously true, meet APP (i.e. talk application here
Program) condition that screen is lighted using FLAG_TURN_SCREEN_ON, the display screen for controlling mobile terminal lights, and will
MTurnOnScreen and mCanTurnScreenOn revert to false.
Variable-value method of adjustment provided by the embodiments of the present application utilizes FLAG_ to APP existing in android system
The primary process that TURN_SCREEN_ON lights screen improves, and changes bright for determining whether that mobile terminal is allowed to enter
The value adjustable strategies of one of variable of screen state can effectively improve bright screen logic, enhance the adaptability of code, avoid different
The phenomenon that being always on screen generation.
Fig. 3 is the structural block diagram that a kind of variable-value provided by the embodiments of the present application adjusts device, which can be by software
And/or hardware realization, it is typically integrated in mobile terminal, variable-value tune can be carried out by performance variable value method of adjustment
It is whole.As shown in figure 3, the device includes:
Black state detection module 301, the black state whether being in communication process for detecting mobile terminal;
Condition judgment module 302, for supervising when detecting the black state that the mobile terminal is in communication process
The corresponding movable working condition of call interface is surveyed before end of conversation, if enter the second state from first state, then extensive
The multiple extremely first state;Wherein, the activity enters first when the mobile terminal is in proximity state relative to user
State, the activity enter the second state when the mobile terminal is in relative to user far from state;
Variable-value adjust module 303, for the judging result in the condition judgment module be when, to the work
The value for making corresponding first variable of state is adjusted, wherein the value of first variable and corresponding with the activity
Bivariate value, codetermine whether allow the mobile terminal into bright screen state.
Variable-value provided by the embodiments of the present application adjusts device, detects the blank screen that mobile terminal is in communication process
When state, the corresponding movable working condition of monitoring call interface is before end of conversation, if enters second from first state
State, then restore to first state, if so, being adjusted to the value of the first variable corresponding with working condition, wherein the
Whether the value of one variable and bivariate value co-determination corresponding with activity allow mobile terminal to enter bright screen state.
It, can be to the existing variable for determining whether that mobile terminal is allowed to enter bright screen state by using above-mentioned technical proposal
Value adjustable strategies improve, and optimize the control flow of the bright screen of screen, when user being avoided to use the call function of mobile terminal,
The case where screen is lighted extremely.
Optionally, the value to the first variable corresponding with the working condition is adjusted, comprising:
The value of the first variable corresponding with the working condition is revised as the second preset value from the first preset value;Its
In, when the activity enters the second state from first state, it is default that the value of first variable is arranged to described first
Value;When the value of first variable is first preset value, and the bivariate value is third preset value, institute
It states mobile terminal and is allowed to enter bright screen state, the value of first variable is arranged to second preset value;Described
Bivariate value is arranged to the third preset value when partner terminates call.
Optionally, the device further include:
Bright screen prevents module, for repairing by the value of the first variable corresponding with the working condition from the first preset value
It is changed to after the second preset value, is second preset value, and second variable in the value for detecting first variable
Value be third preset value when, prevent the mobile terminal enter bright screen state.
Optionally, the device further include:
Layout function calling module, for being called again by the activity when detecting that partner terminates call
The bivariate value is set the third preset value by layout function;Wherein, the activity, which carries, lights screen
Curtain mark.
Optionally, first variable includes that application widget corresponding with the activity extracts AppWindowToken object
In for determining whether to allow the variable into bright screen state of the mobile terminal;Second variable includes and institute
State in the corresponding Window state WindowState of activity for determine whether to allow the mobile terminal into bright screen state
Another variable.
Optionally, the value by the first variable corresponding with the working condition is revised as second from the first preset value
Preset value, comprising:
By successively calling activation record ActivityRecord class, application widget container controller
Preset function in AppWindowContainerController class and AppWindowToken class, will be with the working condition
The value of corresponding first variable is set as the second preset value.
Optionally, the call interface includes the call interface in the telephony application in the mobile terminal system,
And/or the call interface in the mobile terminal in third party's social category application program.
The embodiment of the present application also provides a kind of storage medium comprising computer executable instructions, and the computer is executable
Instruction is used for performance variable value method of adjustment when being executed by computer processor, this method comprises:
Detect the black state that mobile terminal is in communication process;
The corresponding movable working condition of call interface is monitored before end of conversation, if enter second from first state
State, then restore to the first state;Wherein, the activity is when the mobile terminal is in proximity state relative to user
Into first state, the activity enters the second state when the mobile terminal is in relative to user far from state;
If so, being adjusted to the value of the first variable corresponding with the working condition, wherein first variable
Value and bivariate value corresponding with the activity, codetermine whether allow the mobile terminal into bright screen
State.
Storage medium --- any various types of memory devices or storage equipment.Term " storage medium " is intended to wrap
It includes: install medium, such as CD-ROM, floppy disk or magnetic tape equipment;Computer system memory or random access memory, such as
DRAM, DDRRAM, SRAM, EDORAM, blue Bath (Rambus) RAM etc.;Nonvolatile memory, such as flash memory, magnetic medium (example
Such as hard disk or optical storage);Register or the memory component of other similar types etc..Storage medium can further include other types
Memory or combinations thereof.In addition, storage medium can be located at program in the first computer system being wherein performed, or
It can be located in different second computer systems, second computer system is connected to the first meter by network (such as internet)
Calculation machine system.Second computer system can provide program instruction to the first computer for executing.Term " storage medium " can
To include two or more that may reside in different location (such as in the different computer systems by network connection)
Storage medium.Storage medium can store the program instruction that can be performed by one or more processors and (such as be implemented as counting
Calculation machine program).
Certainly, a kind of storage medium comprising computer executable instructions, computer provided by the embodiment of the present application
The variable-value that executable instruction is not limited to the described above adjusts operation, can also be performed provided by the application any embodiment
Relevant operation in variable-value method of adjustment.
The embodiment of the present application provides a kind of mobile terminal, and change provided by the embodiments of the present application can be integrated in the mobile terminal
Measure value adjuster.Fig. 4 is a kind of structural schematic diagram of mobile terminal provided by the embodiments of the present application.Mobile terminal 400 can
To include: memory 401, processor 402 and it is stored in the computer program that can be run on memory 401 and in processor 402,
The processor 402 realizes the variable-value method of adjustment as described in the embodiment of the present application when executing the computer program.
Mobile terminal provided by the embodiments of the present application, can be to existing bright for determining whether that mobile terminal is allowed to enter
The value adjustable strategies of the variable of screen state improve, and optimize the control flow of the bright screen of screen, avoid user from using mobile whole
When the call function at end, the case where screen is lighted extremely.
Fig. 5 is the structural schematic diagram of another mobile terminal provided by the embodiments of the present application, which may include:
Shell (not shown), memory 501, central processing unit (central processing unit, CPU) 502 (are also known as located
Manage device, hereinafter referred to as CPU), circuit board (not shown) and power circuit (not shown).The circuit board is placed in institute
State the space interior that shell surrounds;The CPU502 and the memory 501 are arranged on the circuit board;The power supply electricity
Road, for each circuit or the device power supply for the mobile terminal;The memory 501, for storing executable program generation
Code;The CPU502 is run and the executable journey by reading the executable program code stored in the memory 501
The corresponding computer program of sequence code, to perform the steps of
Detect the black state that mobile terminal is in communication process;
The corresponding movable working condition of call interface is monitored before end of conversation, if enter second from first state
State, then restore to the first state;Wherein, the activity is when the mobile terminal is in proximity state relative to user
Into first state, the activity enters the second state when the mobile terminal is in relative to user far from state;
If so, being adjusted to the value of the first variable corresponding with the working condition, wherein first variable
Value and bivariate value corresponding with the activity, codetermine whether allow the mobile terminal into bright screen
State.
The mobile terminal further include: Peripheral Interface 503, RF (Radio Frequency, radio frequency) circuit 505, audio-frequency electric
Road 506, loudspeaker 511, power management chip 508, input/output (I/O) subsystem 509, other input/control devicess 510,
Touch screen 512, other input/control devicess 510 and outside port 504, these components pass through one or more communication bus
Or signal wire 507 communicates.
It should be understood that illustrating the example that mobile terminal 500 is only mobile terminal, and mobile terminal 500
It can have than shown in the drawings more or less component, can combine two or more components, or can be with
It is configured with different components.Various parts shown in the drawings can include one or more signal processings and/or dedicated
It is realized in the combination of hardware, software or hardware and software including integrated circuit.
Just the mobile terminal provided in this embodiment for variable-value adjustment is described in detail below, and the movement is whole
End takes the mobile phone as an example.
Memory 501, the memory 501 can be accessed by CPU502, Peripheral Interface 503 etc., and the memory 501 can
It can also include nonvolatile memory to include high-speed random access memory, such as one or more disk memory,
Flush memory device or other volatile solid-state parts.
The peripheral hardware that outputs and inputs of equipment can be connected to CPU502 and deposited by Peripheral Interface 503, the Peripheral Interface 503
Reservoir 501.
I/O subsystem 509, the I/O subsystem 509 can be by the input/output peripherals in equipment, such as touch screen 512
With other input/control devicess 510, it is connected to Peripheral Interface 503.I/O subsystem 509 may include 5091 He of display controller
For controlling one or more input controllers 5092 of other input/control devicess 510.Wherein, one or more input controls
Device 5092 processed receives electric signal from other input/control devicess 510 or sends electric signal to other input/control devicess 510,
Other input/control devicess 510 may include physical button (push button, rocker buttons etc.), dial, slide switch, behaviour
Vertical pole clicks idler wheel.It is worth noting that input controller 5092 can with it is following any one connect: keyboard, infrared port,
The indicating equipment of USB interface and such as mouse.
Touch screen 512, the touch screen 512 are the input interface and output interface between customer mobile terminal and user,
Visual output is shown to user, visual output may include figure, text, icon, video etc..
Display controller 5091 in I/O subsystem 509 receives electric signal from touch screen 512 or sends out to touch screen 512
Electric signals.Touch screen 512 detects the contact on touch screen, and the contact that display controller 5091 will test is converted to and is shown
The interaction of user interface object on touch screen 512, i.e. realization human-computer interaction, the user interface being shown on touch screen 512
Object can be the icon of running game, the icon for being networked to corresponding network etc..It is worth noting that equipment can also include light
Mouse, light mouse are the extensions for the touch sensitive surface for not showing the touch sensitive surface visually exported, or formed by touch screen.
RF circuit 505 is mainly used for establishing the communication of mobile phone Yu wireless network (i.e. network side), realizes mobile phone and wireless network
The data receiver of network and transmission.Such as transmitting-receiving short message, Email etc..Specifically, RF circuit 505 receives and sends RF letter
Number, RF signal is also referred to as electromagnetic signal, and RF circuit 505 converts electrical signals to electromagnetic signal or electromagnetic signal is converted to telecommunications
Number, and communicated by the electromagnetic signal with communication network and other equipment.RF circuit 505 may include for executing
The known circuit of these functions comprising but it is not limited to antenna system, RF transceiver, one or more amplifiers, tuner, one
A or multiple oscillators, digital signal processor, CODEC (COder-DECoder, coder) chipset, user identifier mould
Block (Subscriber Identity Module, SIM) etc..
Voicefrequency circuit 506 is mainly used for receiving audio data from Peripheral Interface 503, which is converted to telecommunications
Number, and the electric signal is sent to loudspeaker 511.
Loudspeaker 511 is reduced to sound for mobile phone to be passed through RF circuit 505 from the received voice signal of wireless network
And the sound is played to user.
Power management chip 508, the hardware for being connected by CPU502, I/O subsystem and Peripheral Interface are powered
And power management.
It is any that the application can be performed in variable-value adjustment device, storage medium and the mobile terminal provided in above-described embodiment
Variable-value method of adjustment provided by embodiment has and executes the corresponding functional module of this method and beneficial effect.Not upper
The technical detail of detailed description in embodiment is stated, reference can be made to variable-value method of adjustment provided by the application any embodiment.
Note that above are only the preferred embodiment and institute's application technology principle of the application.It will be appreciated by those skilled in the art that
The application is not limited to specific embodiment described here, be able to carry out for a person skilled in the art it is various it is apparent variation,
The protection scope readjusted and substituted without departing from the application.Therefore, although being carried out by above embodiments to the application
It is described in further detail, but the application is not limited only to above embodiments, in the case where not departing from the application design, also
It may include more other equivalent embodiments, and scope of the present application is determined by the scope of the appended claims.
Claims (10)
1. a kind of variable-value method of adjustment characterized by comprising
Detect the black state that mobile terminal is in communication process;
The corresponding movable working condition of call interface is monitored before end of conversation, if enter the second shape from first state
State, then restore to the first state;Wherein, it is described activity when the mobile terminal is in proximity state relative to user into
Enter first state, the activity enters the second state when the mobile terminal is in relative to user far from state;
If so, being adjusted to the value of the first variable corresponding with the working condition, wherein first variable takes
Value and bivariate value corresponding with the activity, co-determination whether allow the mobile terminal into bright screen shape
State.
2. the method according to claim 1, wherein described to the first variable corresponding with the working condition
Value is adjusted, comprising:
The value of the first variable corresponding with the working condition is revised as the second preset value from the first preset value;Wherein, when
When the activity enters the second state from first state, the value of first variable is arranged to first preset value;When
The value of first variable be first preset value, and the bivariate value be third preset value when, the shifting
Dynamic terminal is allowed to enter bright screen state, and the value of first variable is arranged to second preset value;Described second becomes
The value of amount is arranged to the third preset value when partner terminates call.
3. according to the method described in claim 2, it is characterized in that, in taking the first variable corresponding with the working condition
Value is revised as after the second preset value from the first preset value, further includes:
It is second preset value in the value for detecting first variable, and the bivariate value is default for third
When value, the mobile terminal is prevented to enter bright screen state.
4. according to the method described in claim 2, it is characterized by further comprising:
When detecting that partner terminates call, layout function again is called by the activity, by second variable
Value be set as the third preset value;Wherein, the activity, which carries, lights screen identification.
5. according to the method described in claim 2, it is characterized in that, first variable includes application corresponding with the activity
Window extract in AppWindowToken object for determine whether to allow the mobile terminal into the one of bright screen state
A variable;Second variable includes in Window state WindowState corresponding with the activity for determining whether to permit
Perhaps another variable into bright screen state of the described mobile terminal.
6. according to the method described in claim 5, it is characterized in that, described by the first variable corresponding with the working condition
Value is revised as the second preset value from the first preset value, comprising:
By successively calling activation record ActivityRecord class, application widget container controller
Preset function in AppWindowContainerController class and AppWindowToken class, will be with the working condition
The value of corresponding first variable is set as the second preset value.
7. the method according to claim 1, wherein the call interface includes in the mobile terminal system
Call interface in telephony application, and/or, call circle in the mobile terminal in third party's social category application program
Face.
8. a kind of variable-value adjusts device characterized by comprising
Black state detection module, the black state whether being in communication process for detecting mobile terminal;
Condition judgment module, for when detecting the black state that the mobile terminal is in communication process, monitoring to be conversed
The corresponding movable working condition in interface is before end of conversation, if enters the second state from first state, then restores to institute
State first state;Wherein, the activity enters first state when the mobile terminal is in proximity state relative to user, institute
It states activity and enters the second state when the mobile terminal is in relative to user far from state;
Variable-value adjust module, for the judging result in the condition judgment module be when, to the working condition
The value of corresponding first variable is adjusted, wherein the value of first variable and corresponding with the activity second becomes
The value of amount, codetermine whether allow the mobile terminal into bright screen state.
9. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that the program is held by processor
The variable-value method of adjustment as described in any in claim 1-7 is realized when row.
10. a kind of mobile terminal, which is characterized in that including memory, processor and storage are on a memory and can be in processor
The computer program of operation, the processor realize change as claimed in claim 1 when executing the computer program
Measure value adjustment method.
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 true CN108989576A (en) | 2018-12-11 |
CN108989576B 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) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
TWI699991B (en) * | 2019-02-26 | 2020-07-21 | 華碩電腦股份有限公司 | Electronic device and controlling method thereof |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20100067181A1 (en) * | 2008-09-15 | 2010-03-18 | 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 |
CN106412243A (en) * | 2016-09-05 | 2017-02-15 | 努比亚技术有限公司 | Method for monitoring abnormity of distance sensor, and terminal |
CN107566161A (en) * | 2017-08-08 | 2018-01-09 | 广东欧珀移动通信有限公司 | Method for parameter configuration and Related product |
CN107704132A (en) * | 2017-09-28 | 2018-02-16 | 努比亚技术有限公司 | Terminal freezes detection method, terminal and the computer-readable recording medium of screen |
-
2018
- 2018-09-11 CN CN201811056687.5A patent/CN108989576B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20100067181A1 (en) * | 2008-09-15 | 2010-03-18 | 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 |
CN106412243A (en) * | 2016-09-05 | 2017-02-15 | 努比亚技术有限公司 | Method for monitoring abnormity of distance sensor, and terminal |
CN107566161A (en) * | 2017-08-08 | 2018-01-09 | 广东欧珀移动通信有限公司 | Method for parameter configuration and Related product |
CN107704132A (en) * | 2017-09-28 | 2018-02-16 | 努比亚技术有限公司 | Terminal freezes detection method, terminal and the computer-readable recording medium of screen |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
TWI699991B (en) * | 2019-02-26 | 2020-07-21 | 華碩電腦股份有限公司 | Electronic device and controlling method thereof |
Also Published As
Publication number | Publication date |
---|---|
CN108989576B (en) | 2020-09-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107783803B (en) | System optimization method and device of intelligent terminal, storage medium and intelligent terminal | |
CN107734616B (en) | Application program closing method and device, storage medium and electronic equipment | |
CN107861773A (en) | Associate management-control method, device, storage medium and the mobile terminal started | |
CN107944258A (en) | Start control method, device, storage medium and the terminal of application with method of service | |
CN107465841B (en) | Fault information reporting method and terminal | |
CN105306727A (en) | Method and system for mobile terminal to answer call | |
CN106936993B (en) | Terminal screen control method and device | |
CN107844341B (en) | Process starting control method and device, storage medium and mobile terminal | |
CN109669662A (en) | A kind of pronunciation inputting method, device, storage medium and mobile terminal | |
CN108616915A (en) | A kind of call mode switching method, device, storage medium and electronic equipment | |
CN107197082A (en) | A kind of information prompting method and terminal | |
CN112199246B (en) | Terminal test method and device, storage medium and mobile terminal | |
US9503556B2 (en) | Handling voice calls | |
CN107135305B (en) | Message reminding method, device and terminal | |
CN112394901A (en) | Audio output mode adjusting method and device and electronic equipment | |
CN107766218A (en) | system optimization method, device, storage medium and terminal device | |
CN107832131B (en) | Application program closing method and device, storage medium and electronic equipment | |
CN108989576A (en) | Variable-value method of adjustment, device, storage medium and mobile terminal | |
CN106686210B (en) | Incoming call processing method, device and system | |
CN201974797U (en) | Mobile phone desktop dynamic content generator based on mobile phone events | |
CN106658457A (en) | Reminding method of flow shared by hotspot and terminal | |
CN111049679A (en) | Server warning method and system | |
CN107395888B (en) | Processing method, device, storage medium and the mobile terminal of blank screen gesture | |
CN106843440B (en) | A kind of mobile terminal restarts control method, device and mobile terminal | |
CN109831714A (en) | Identify the method, apparatus and electronic equipment of earphone keystroke |
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 |