Summary of the invention
The invention reside in the above-mentioned deficiency overcoming prior art, it is provided that a kind of be capable of self-defined switching mode, the method for simple to operate, practical switching contextual model.
To achieve these goals, the technical solution used in the present invention is:
A kind of method of switching contextual model, it is applied to handheld terminal, described handheld terminal is provided with physical button, when detecting that described physical button sends the first feedback message, judge whether described screen of handheld terminal is in predetermined state, the switching of predetermined scenarios pattern is the most then performed according to predetermined switching law.
Further, any one during described predetermined state is breath screen state, screen lock state, main interface state.
Further, when described screen of handheld terminal is all not in breath screen state, screen lock state, main interface state, the switching of predetermined scenarios pattern is not performed.
Further, when being not detected by described physical button and sending the first feedback message, the switching of predetermined scenarios pattern is not performed.Further, after the switching of described predetermined scenarios pattern has performed, described handheld terminal sends the second feedback message.
Further, the switching of described execution predetermined scenarios pattern includes, if currently not setting up described predetermined switching law, then ejects template, and the switching performing predetermined scenarios pattern after described predetermined switching law completes is set up in wait.
Further, described set up described predetermined switching law and include, select at least 2 kinds of contextual models and be ranked up.
Further, described contextual model includes contextual model set in advance and/or the contextual model manually set up.
Further, every kind of described contextual model is to there being different described second feedback messages, and after the switching of described predetermined scenarios pattern has performed, handheld terminal sends described second feedback message of correspondence.
Further, described second feedback message is vibrations message.
In sum, owing to have employed technique scheme, the invention has the beneficial effects as follows:
1, the method for switching contextual model of the present invention is by the physical button feedback system on definition handheld terminal so that it is realizes the handoff functionality of contextual model, without entering in mobile phone menu, facilitates user to carry out the switching of contextual model.
2, the method for switching contextual model of the present invention is capable of User Defined transfer sequence and switching type, and the mode degree of freedom of the present invention is higher, it is possible to meet the switching demand of dissimilar user, practical.
Detailed description of the invention
In order to make the purpose of the present invention, technical scheme and advantage clearer, below in conjunction with drawings and Examples, the present invention is further elaborated.Should be appreciated that specific embodiment described herein, only in order to explain the present invention, is not intended to limit the present invention.
It it is the flow chart of the switching contextual model method of the first aspect of first embodiment of the invention shown in Fig. 1, it is applied to handheld terminal, described handheld terminal is provided with physical button, when detecting that described physical button sends the first feedback message, judge whether described screen of handheld terminal is in predetermined state, the switching of predetermined scenarios pattern is the most then performed according to predetermined switching law.
Physical button in the present invention is the physical button arranged on handheld terminal, it can be built-in button, such as volume+button, volume-button, it is also possible to be external button, such as the smart key equipment arranged by earphone jack, by the smart key equipment of the interface settings such as usb.
Concrete, the method for the present invention, based on mobile intelligent terminal, by the Framework layer of mobile intelligent terminal system is transformed, such that it is able to the method reaching switching contextual model.In some scenes, during as realized this patent by built-in volume+button, volume-button, owing to volume key itself has the effect of regulation volume, effect for the volume key in the case of not affecting Consumer's Experience and affecting other, use when pressing keys meets some requirements, just trigger contextual model handover operation, as inferior more than 3s, quick double hit two in Continued depression.
Described predetermined state is any one in breath screen state, screen lock state, main interface state.
When described screen of handheld terminal is all not in breath screen state, screen lock state, main interface state, do not perform the switching of predetermined scenarios pattern.
General, when handheld terminal works, at least to having breath screen state, screen lock state, three kinds of states of main interface state, the main interface state of the present invention is expressed as not at the interface of foreground initiation application program, these several states show that user not yet uses handheld terminal to carry out concrete application operating, in this case, the first feedback message that handheld terminal receives all is considered efficient message, now may proceed to perform the handover operation of predetermined scenarios pattern;And when user be in this case time, show that user is using handheld terminal to carry out concrete application operating, it is considered invalid message after the first feedback message that now handheld terminal receives, not performing the handover operation of predetermined scenarios pattern, if also having bound other response messages in this physical button, then being carried out judging or performing by other module correspondences, such as, when this physical button is volume-button, general, handheld terminal correspondence performs the operation of Att.Or, when being not detected by described physical button and sending the first feedback message, do not perform the switching of predetermined scenarios pattern.
Concrete, show a kind of detection scheme the most in one embodiment: such as running the handheld terminal of Android system, the scene of detection user is at Home interface or locking screen interface, or during breath screen state, and when the effect of key is not assigned to control in volume under volume, then can press key under volume by length and can trigger the switching of pattern.On remaining opportunity, Android is only capable of regulating the size of the tinkle of bells by volume key, is therefore accomplished by the PhoneWindowManager of the Framework layer of Android, these situations being transformed.
First in PWM, monitor the event of key under volume.Because the event of key is by driving layer to be first distributed to here under volume.If in other local monitoring volume key event, it is possible to failure can be monitored.During such as screen locking or breath screen state, system is by the event mask of volume key, user is under the two state, volume cannot be regulated, it is thus desirable to here monitor, if it find that be that under volume, the effect of key is not assigned to control in volume, then block long by event issue make it can not regulate tone (certain user can regulate tone size by taking pulse by one finger volume key, have no effect on the experience of user), then trigger the switching of pattern.If the effect of key is assigned to control in volume under volume, the most not blocking long by event, continue down to distribute this event, system then can complete In Call or the regulation of media volume.
During if not in screen locking and breath screen state, go to judge that current interface is in application interface or Home interface according to the corresponding API that Android provides.If just removing switch mode when being in Home interface.
This embodiment is fed back by the physical button on definition handheld terminal so that it is realizes the handoff functionality of contextual model, without entering in mobile phone menu, facilitates user to carry out the switching of contextual model.
Being the flow chart of the switching contextual model method of the second aspect of first embodiment of the invention shown in Fig. 2, concrete, after the switching of described predetermined scenarios pattern has performed, described handheld terminal sends the second feedback message.
Upon completion of the handover, it is desirable to be able to send prompting and inform that user has been switched to the pattern of correspondence.Generally switch prompting is all one icon of display in status bar, such as icon, the quiet icon etc. of vibrations.But when mobile phone is in breath screen state, user can not see icon well, it is impossible to knows exactly which whether be switched to corresponding state, the second feedback message that therefore present invention is sent by handheld terminal solves this problem.
It it is the flow chart of the switching contextual model method of second embodiment of the invention shown in Fig. 3, the switching of described execution predetermined scenarios pattern includes, if currently not setting up described predetermined switching law, then eject template, and the switching performing predetermined scenarios pattern after described predetermined switching law completes is set up in wait.
Described set up described predetermined switching law and include, select at least 2 kinds of contextual models and be ranked up.
Described contextual model includes contextual model set in advance and/or the contextual model manually set up.
Show foundation and the handover scheme of a kind of contextual model the most in an example,
If user is operation for the first time, now user needs to set up switching law, therefore ejects guide Dialog, instructs user to go to carry out the setting of contextual model.
A newly-increased contextual model menu, user can set desired pattern after clicking on this menu.This menu can be put under setting-> menu, and self-defined contextual model switching law under this contextual model menu.
Contextual model element is normally used: silent mode, conference model, outdoor pattern, normal mode.User can select at least two of which element, sets up switching law.
As certain user often comes in and goes out meeting room.May need most is to switch between conference model and normal mode.Therefore following rule can be set up:Normal mode-> conference model;
Now, in addition it is also necessary to define the state after current state to switching, such as, if current state is outdoor, but rule is " quiet-> normal-> meeting ".If at this moment switching, acquiescence is switched on the first element of rule, the most quiet;And if when current state is to recall, then according to switching law " quiet-> normal-> meeting ", being switched to mute state.
Certainly, concrete contextual model element is not limited to system and carries several element, and user can define contextual model element according to self-demand.
The method of switching contextual model of the present invention is capable of User Defined transfer sequence and switching type, and the mode degree of freedom of the present invention is higher, it is possible to meet the switching demand of dissimilar user, practical.
Every kind of described contextual model is to there being different described second feedback messages, and after the switching of described predetermined scenarios pattern has performed, handheld terminal sends described second feedback message of correspondence.
Described second feedback message is vibrations message.
Show a kind of feedback scheme the most in an example, when predetermined switching law be " normal mode--quiet mould--conference model--open air pattern ".
When being switched to normal mode, make mobile phone shake 1 time, send and solve sound, eject the general notification message Toast of Android.
During to silent mode, make mobile phone shake 2 times, eject Toast notice.
During to conference model, make mobile phone shake 3 times, eject Toast notice.
During to outdoor pattern, make mobile phone shake 4 times, eject Toast notice.
Wherein, when screen locking, Toast cannot show.The figure layer of the Toast that Android sets is under screen locking layer, and the Toast being now ejected is covered by screen locking layer.Therefore the invention provides a kind of method and solve this problem.Again transform Toast, change the position of Toast place figure layer so that it is layer is on screen locking layer, and is only capable of in switch mode using, and so can shield the use of other application, cause unnecessary Consumer's Experience.Concrete vibration mode can facilitate the current switch mode of user's perception according to the self-defined setting of the custom of user.