sonic-android/docs/javadoc/com/tencent/sonic/sdk/SonicSession.html
com.tencent.sonic.sdk
java.lang.Object
所有已实现的接口:android.os.Handler.Callback直接已知子类:QuickSonicSession, StandardSonicSession
public abstract classSonicSessionextends java.lang.Object
implements android.os.Handler.Callback
In Sonic, SonicSessions are used to manage the entire process,include obtain the latest data from the server, provide local and latest data to kernel, separate html to template and data, build template and data to html and so on. Each url involves one session at a time, that session will be destroyed when the page is destroyed.
嵌套类 | 限定符和类型 | 类和说明 |
| --- | --- |
| static interface | SonicSession.Callback
The interface is used to inform the listeners that the state of the session has changed.
|
字段 | 限定符和类型 | 字段和说明 |
| --- | --- |
| static java.lang.String | CHROME_FILE_THREAD
Name of chrome file thread
|
| protected static int | CLIENT_MSG_NOTIFY_RESULT
The message to record sonic mode.
|
| protected static int | CLIENT_MSG_ON_WEB_READY
The message of page ready, its means page want to get the latest session data.
|
| protected java.util.concurrent.atomic.AtomicBoolean | clientIsReady
Whether the client is ready.
|
| protected java.util.concurrent.atomic.AtomicBoolean | clientIsReload
Indicate current session is reload or not.
|
| protected static int | COMMON_MSG_BEGIN |
| protected static int | COMMON_MSG_END |
| SonicSessionConfig | config |
| long | createdTime
The time of current session created.
|
| static java.lang.String | DATA_UPDATE_BUNDLE_PARAMS_DIFF |
| protected SonicDiffDataCallback | diffDataCallback |
| protected static int | FILE_THREAD_MSG_BEGIN |
| protected static int | FILE_THREAD_SAVE_CACHE_ON_SERVER_CLOSE
The message of saving sonic cache while server close.
|
| protected static int | FILE_THREAD_SAVE_CACHE_ON_SESSION_FINISHED
The message of saving sonic cache while session finish.
|
| protected android.os.Handler | fileHandler |
| protected int | finalResultCode
Sonic final mode.
|
| java.lang.String | id |
| protected android.content.Intent | intent
This intent saves all of the initialization param.
|
| protected boolean | isPreload
Whether current session is preload.
|
| protected java.util.concurrent.atomic.AtomicBoolean | isWaitingForDestroy
Whether the session is waiting for destroy.
|
| protected java.util.concurrent.atomic.AtomicBoolean | isWaitingForSaveFile
Whether it is waiting for the file to be saved.
|
| protected java.util.concurrent.atomic.AtomicBoolean | isWaitingForSessionThread
Whether the session is waiting for data.
|
| protected android.os.Handler | mainHandler |
| static java.lang.String | OFFLINE_MODE_FALSE
The value of "cache-offline" in http(s) response headers.
|
| static java.lang.String | OFFLINE_MODE_HTTP
The value of "cache-offline" in http(s) response headers.
|
| static java.lang.String | OFFLINE_MODE_STORE
The value of "cache-offline" in http(s) response headers.
|
| static java.lang.String | OFFLINE_MODE_TRUE
The value of "cache-offline" in http(s) response headers.
|
| protected java.lang.String | pendingDiffData
The difference data between local and server data.
|
| protected java.io.InputStream | pendingWebResourceStream
The response for client interception.
|
| protected java.util.List<java.lang.String> | preloadLinks |
| protected static int | RESOURCE_INTERCEPT_STATE_IN_FILE_THREAD
Resource Intercept State : intercepting in file thread
|
| protected static int | RESOURCE_INTERCEPT_STATE_IN_OTHER_THREAD
Resource Intercept State : intercepting in other thread(may be IOThread or other else)
|
| protected static int | RESOURCE_INTERCEPT_STATE_NONE
Resource Intercept State : none
|
| protected SonicDownloadEngine | resourceDownloaderEngine
Sonic sub resource downloader
|
| protected java.util.concurrent.atomic.AtomicInteger | resourceInterceptState
Resource intercept state, include RESOURCE_INTERCEPT_STATE_NONE, RESOURCE_INTERCEPT_STATE_IN_FILE_THREAD, RESOURCE_INTERCEPT_STATE_IN_OTHER_THREAD More about it at {https://codereview.chromium.org/1350553005/#ps20001}
|
| protected SonicServer | server
Sonic server
|
| protected static int | SESSION_MSG_FORCE_DESTROY
The message of forced to destroy the session.
|
| protected java.util.concurrent.CopyOnWriteArrayList<java.lang.ref.WeakReference<com.tencent.sonic.sdk.SonicSessionCallback>> | sessionCallbackList |
| protected SonicSessionClient | sessionClient |
| protected java.util.concurrent.atomic.AtomicInteger | sessionState
Session state, include STATE_NONE, STATE_RUNNING, STATE_READY and STATE_DESTROY.
|
| long | sId
The integer id of current session
|
| protected static long | sNextSessionLogId
Log id
|
| static int | SONIC_RESULT_CODE_DATA_UPDATE
Sonic mode : data update.
|
| static int | SONIC_RESULT_CODE_FIRST_LOAD
Sonic mode : first load.
|
| static int | SONIC_RESULT_CODE_HIT_CACHE
Sonic mode : 304.
|
| static int | SONIC_RESULT_CODE_TEMPLATE_CHANGE
Sonic mode : template change.
|
| static int | SONIC_RESULT_CODE_UNKNOWN
Sonic mode : unknown.
|
| protected int | srcResultCode
Sonic original mode.
|
| java.lang.String | srcUrl
The original url
|
| static int | STATE_DESTROY
Session state : destroyed.
|
| static int | STATE_NONE
Session state : original.
|
| static int | STATE_READY
Session state : ready.
|
| static int | STATE_RUNNING
Session state : running.
|
| protected java.util.concurrent.CopyOnWriteArrayList<java.lang.ref.WeakReference<SonicSession.Callback>> | stateChangedCallbackList |
| protected SonicSessionStatistics | statistics
Session statics var
|
| static java.lang.String | TAG
Log filter
|
| protected java.util.concurrent.atomic.AtomicBoolean | wasInterceptInvoked
Whether the client initiates a resource interception.
|
| protected java.util.concurrent.atomic.AtomicBoolean | wasOnPageFinishInvoked
Whether the local html is loaded, it is used only the template changes.
|
| static java.lang.String | WEB_RESPONSE_CODE
The result keyword to page : the value is finalResultCode
|
| static java.lang.String | WEB_RESPONSE_DATA
The all data keyword to page
|
| static java.lang.String | WEB_RESPONSE_EXTRA |
| static java.lang.String | WEB_RESPONSE_LOCAL_REFRESH_TIME |
| static java.lang.String | WEB_RESPONSE_SRC_CODE
The result keyword to page : the value is srcResultCode
|
所有方法 实例方法 抽象方法 具体方法 | 限定符和类型 | 方法和说明 |
| --- | --- |
| boolean | addSessionCallback(com.tencent.sonic.sdk.SonicSessionCallback callback) |
| protected boolean | addSessionStateChangedCallback(SonicSession.Callback callback) |
| boolean | bindClient(SonicSessionClient client) |
| protected boolean | canDestroy() |
| protected void | clearSessionData() |
| protected android.content.Intent | createConnectionIntent(com.tencent.sonic.sdk.SonicDataHelper.SessionData sessionData) |
| void | destroy() |
| protected void | destroy(boolean force) |
| protected void | doSaveSonicCache(SonicServer sonicServer, java.lang.String htmlString) |
| protected java.util.HashMap<java.lang.String,java.lang.String> | getCacheHeaders()
Get header info from local cache headers
|
| protected java.lang.String | getCharsetFromHeaders()
Get the charset from the latest response http header.
|
| java.lang.String | getCharsetFromHeaders(java.util.Map<java.lang.String,java.lang.String> headers) |
| java.lang.String | getCurrentUrl() |
| int | getFinalResultCode() |
| protected java.util.HashMap<java.lang.String,java.lang.String> | getHeaders()
Get header info with the original url of current session.
|
| SonicSessionClient | getSessionClient() |
| int | getSrcResultCode() |
| SonicSessionStatistics | getStatistics() |
| protected void | handleFlow_Connection(boolean hasCache, com.tencent.sonic.sdk.SonicDataHelper.SessionData sessionData)
Initiate a network request to obtain server data.
|
| protected abstract void | handleFlow_DataUpdate(java.lang.String serverRsp)
Handle data update SONIC_RESULT_CODE_DATA_UPDATE logic.
|
| protected abstract void | handleFlow_FirstLoad()
Handle sonic first SONIC_RESULT_CODE_FIRST_LOAD logic.
|
| protected abstract void | handleFlow_HttpError(int responseCode) |
| protected abstract void | handleFlow_LoadLocalCache(java.lang.String cacheHtml) |
| protected void | handleFlow_NotModified() |
| protected abstract void | handleFlow_ServiceUnavailable() |
| protected abstract void | handleFlow_TemplateChange(java.lang.String newHtml)
Handle template update SONIC_RESULT_CODE_TEMPLATE_CHANGE logic.
|
| boolean | handleMessage(android.os.Message msg)
Subclasses must implement this to receive messages.
|
| boolean | isDestroyedOrWaitingForDestroy() |
| boolean | isMatchCurrentUrl(java.lang.String url)
Whether the incoming url matches the current url,it will ignore url parameters
|
| boolean | isPreload() |
| protected void | notifyStateChange(int oldState, int newState, android.os.Bundle extraData)
When the session state changes, notify the listeners.
|
| boolean | onClientPageFinished(java.lang.String url) |
| boolean | onClientReady()
Client informs sonic that it is ready.
|
| java.lang.Object | onClientRequestResource(java.lang.String url)
When the webview initiates a resource interception, the client invokes the method to retrieve the data
|
| protected java.lang.Object | onRequestResource(java.lang.String url)
When the webview initiates a main resource interception, the client invokes this method to retrieve the data
|
| void | onServerClosed(SonicServer sonicServer, boolean readComplete)
If the kernel obtain inputStream from a SonicSessionStream, the inputStream will be closed when the kernel reads the data.This method is invoked when the sonicSessionStream close.
|
| boolean | onWebReady(SonicDiffDataCallback diffDataCallback)
Client will call this method to obtain the update data when the page shows the content.
|
| protected boolean | postForceDestroyIfNeed()
Destroy the session if it is waiting for destroy and it is can be destroyed.
|
| protected void | postTaskToSaveSonicCache(java.lang.String htmlString) |
| boolean | refresh() |
| boolean | removeSessionCallback(com.tencent.sonic.sdk.SonicSessionCallback callback) |
| protected boolean | removeSessionStateChangedCallback(SonicSession.Callback callback) |
| protected boolean | setCookiesFromHeaders(java.util.Map<java.lang.String,java.util.List<java.lang.String>> headers, boolean executeInNewThread)
Set cookies to webview from headers
|
| protected void | setResult(int srcCode, int finalCode, boolean notify)
Record the sonic mode, notify the result to page if necessary.
|
| protected boolean | shouldSetCookieAsynchronous()
Whether should set cookie asynchronous or not , if onClientRequestResource is calling in IOThread, it should not call set cookie synchronous which will handle in IOThread as it may cause deadlock More about it see {https://issuetracker.google.com/issues/36989494#c8} Fix VasSonic issue {https://github.com/Tencent/VasSonic/issues/90}
|
| void | start()
Start the sonic process
|
| protected boolean | switchState(int fromState, int toState, boolean notify) |
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
public static final java.lang.String TAG
Log filter 另请参阅:常量字段值
-
public static final java.lang.String WEB_RESPONSE_SRC_CODE
The result keyword to page : the value is srcResultCode
另请参阅:常量字段值
-
public static final java.lang.String WEB_RESPONSE_CODE
The result keyword to page : the value is finalResultCode
另请参阅:常量字段值
-
public static final java.lang.String WEB_RESPONSE_EXTRA
另请参阅:常量字段值
-
public static final java.lang.String WEB_RESPONSE_DATA
The all data keyword to page 另请参阅:常量字段值
-
public static final java.lang.String DATA_UPDATE_BUNDLE_PARAMS_DIFF
另请参阅:常量字段值
-
public static final java.lang.String WEB_RESPONSE_LOCAL_REFRESH_TIME
另请参阅:常量字段值
-
public static final java.lang.String CHROME_FILE_THREAD
Name of chrome file thread 另请参阅:常量字段值
-
public static final int STATE_NONE
Session state : original.
This state means session has not start.
另请参阅:常量字段值
-
public static final int STATE_RUNNING
Session state : running.
This state means session has begun to request data from the server and is processing the data.
另请参阅:常量字段值
-
public static final int STATE_READY
Session state : ready.
This state means session data is available when the page initiates a resource interception. In other stats the client(kernel) will wait.
另请参阅:常量字段值
-
public static final int STATE_DESTROY
Session state : destroyed.
This state means the session is destroyed.
另请参阅:常量字段值
-
public static final java.lang.String OFFLINE_MODE_HTTP
The value of "cache-offline" in http(s) response headers.
This value means sonic server unavailable, the terminal does not take sonic logic for the next period of time,the value of time is defined in SonicConfig.SONIC_UNAVAILABLE_TIME
另请参阅:常量字段值
-
public static final java.lang.String OFFLINE_MODE_STORE
The value of "cache-offline" in http(s) response headers.
This value means sonic will save the latest data, but not refresh page.For example, when sonic mode is data update, sonic will not provide the difference data between local and server to page to refresh the content.
另请参阅:常量字段值
-
public static final java.lang.String OFFLINE_MODE_TRUE
The value of "cache-offline" in http(s) response headers.
This value means sonic will save the latest data and refresh page content.
另请参阅:常量字段值
-
public static final java.lang.String OFFLINE_MODE_FALSE
The value of "cache-offline" in http(s) response headers.
This value means sonic will refresh page content but not save date, sonic will remove the local data also.
另请参阅:常量字段值
-
public static final int SONIC_RESULT_CODE_UNKNOWN
Sonic mode : unknown. 另请参阅:常量字段值
-
public static final int SONIC_RESULT_CODE_FIRST_LOAD
Sonic mode : first load. 另请参阅:常量字段值
-
public static final int SONIC_RESULT_CODE_TEMPLATE_CHANGE
Sonic mode : template change. 另请参阅:常量字段值
-
public static final int SONIC_RESULT_CODE_DATA_UPDATE
Sonic mode : data update. 另请参阅:常量字段值
-
public static final int SONIC_RESULT_CODE_HIT_CACHE
Sonic mode : 304. 另请参阅:常量字段值
-
protected int srcResultCode
Sonic original mode.
For example, when local data does not exist, the value is SONIC_RESULT_CODE_FIRST_LOAD
-
protected int finalResultCode
Sonic final mode.
For example, when local data does not exist, the srcResultCode value is SONIC_RESULT_CODE_FIRST_LOAD. If the server data is read finished, sonic will provide the latest data to kernel when the kernel initiates a resource interception.This effect is the same as loading local data, so the sonic mode will be set as SONIC_RESULT_CODE_HIT_CACHE
-
protected static final int COMMON_MSG_BEGIN
另请参阅:常量字段值
-
protected static final int CLIENT_MSG_NOTIFY_RESULT
The message to record sonic mode. 另请参阅:常量字段值
-
protected static final int CLIENT_MSG_ON_WEB_READY
The message of page ready, its means page want to get the latest session data. 另请参阅:常量字段值
-
protected static final int SESSION_MSG_FORCE_DESTROY
The message of forced to destroy the session. 另请参阅:常量字段值
-
protected static final int COMMON_MSG_END
另请参阅:常量字段值
-
protected static final int FILE_THREAD_MSG_BEGIN
另请参阅:常量字段值
-
protected static final int FILE_THREAD_SAVE_CACHE_ON_SERVER_CLOSE
The message of saving sonic cache while server close. 另请参阅:常量字段值
-
protected static final int FILE_THREAD_SAVE_CACHE_ON_SESSION_FINISHED
The message of saving sonic cache while session finish. 另请参阅:常量字段值
-
protected static final int RESOURCE_INTERCEPT_STATE_NONE
Resource Intercept State : none 另请参阅:常量字段值
-
protected static final int RESOURCE_INTERCEPT_STATE_IN_FILE_THREAD
Resource Intercept State : intercepting in file thread 另请参阅:常量字段值
-
protected static final int RESOURCE_INTERCEPT_STATE_IN_OTHER_THREAD
Resource Intercept State : intercepting in other thread(may be IOThread or other else) 另请参阅:常量字段值
-
protected final java.util.concurrent.atomic.AtomicInteger sessionState
Session state, include STATE_NONE, STATE_RUNNING, STATE_READY and STATE_DESTROY.
-
protected final java.util.concurrent.atomic.AtomicBoolean wasInterceptInvoked
Whether the client initiates a resource interception.
-
protected final java.util.concurrent.atomic.AtomicBoolean clientIsReady
Whether the client is ready.
-
protected final java.util.concurrent.atomic.AtomicBoolean isWaitingForSaveFile
Whether it is waiting for the file to be saved. If it is true, the session can not be destroyed.
-
protected final java.util.concurrent.atomic.AtomicBoolean isWaitingForDestroy
Whether the session is waiting for destroy.
-
protected final java.util.concurrent.atomic.AtomicBoolean isWaitingForSessionThread
Whether the session is waiting for data. If it is true, the session can not be destroyed.
-
protected final java.util.concurrent.atomic.AtomicBoolean wasOnPageFinishInvoked
Whether the local html is loaded, it is used only the template changes.
-
protected final java.util.concurrent.atomic.AtomicInteger resourceInterceptState
Resource intercept state, include RESOURCE_INTERCEPT_STATE_NONE, RESOURCE_INTERCEPT_STATE_IN_FILE_THREAD, RESOURCE_INTERCEPT_STATE_IN_OTHER_THREAD More about it at {https://codereview.chromium.org/1350553005/#ps20001}
-
protected final java.util.concurrent.atomic.AtomicBoolean clientIsReload
Indicate current session is reload or not.
-
protected[SonicSessionStatistics](../../../../com/tencent/sonic/sdk/SonicSessionStatistics.html "com.tencent.sonic.sdk中的类")statistics
Session statics var
-
protected volatile[SonicServer](../../../../com/tencent/sonic/sdk/SonicServer.html "com.tencent.sonic.sdk中的类")server
Sonic server
-
protected volatile[SonicDownloadEngine](../../../../com/tencent/sonic/sdk/download/SonicDownloadEngine.html "com.tencent.sonic.sdk.download中的类")resourceDownloaderEngine
Sonic sub resource downloader
-
protected volatile java.io.InputStream pendingWebResourceStream
The response for client interception.
-
protected java.lang.String pendingDiffData
The difference data between local and server data.
-
protected static long sNextSessionLogId
Log id
-
public final[SonicSessionConfig](../../../../com/tencent/sonic/sdk/SonicSessionConfig.html "com.tencent.sonic.sdk中的类")config
-
public final java.lang.String id
-
protected boolean isPreload
Whether current session is preload.
-
public long createdTime
The time of current session created.
-
public final long sId
The integer id of current session
-
public java.lang.String srcUrl
The original url
-
protected volatile[SonicSessionClient](../../../../com/tencent/sonic/sdk/SonicSessionClient.html "com.tencent.sonic.sdk中的类")sessionClient
-
protected final android.os.Handler mainHandler
-
protected final java.util.concurrent.CopyOnWriteArrayList<java.lang.ref.WeakReference<[SonicSession.Callback](../../../../com/tencent/sonic/sdk/SonicSession.Callback.html "com.tencent.sonic.sdk中的接口")>> stateChangedCallbackList
-
protected[SonicDiffDataCallback](../../../../com/tencent/sonic/sdk/SonicDiffDataCallback.html "com.tencent.sonic.sdk中的接口")diffDataCallback
-
protected final android.os.Handler fileHandler
-
protected java.util.List<java.lang.String> preloadLinks
-
protected final java.util.concurrent.CopyOnWriteArrayList<java.lang.ref.WeakReference<com.tencent.sonic.sdk.SonicSessionCallback>> sessionCallbackList
-
protected final android.content.Intent intent
This intent saves all of the initialization param.
-
public boolean handleMessage(android.os.Message msg)
Subclasses must implement this to receive messages.
指定者:handleMessage 在接口中 android.os.Handler.Callback
-
public void start()
Start the sonic process
-
public boolean refresh()
-
protected android.content.Intent createConnectionIntent(com.tencent.sonic.sdk.SonicDataHelper.SessionData sessionData)
-
protected void handleFlow_Connection(boolean hasCache,
com.tencent.sonic.sdk.SonicDataHelper.SessionData sessionData)
Initiate a network request to obtain server data.
参数:hasCache - Indicates local sonic cache is exist or not.sessionData - SessionData holds eTag templateTag
-
protected abstract void handleFlow_LoadLocalCache(java.lang.String cacheHtml)
-
protected abstract void handleFlow_FirstLoad()
Handle sonic first SONIC_RESULT_CODE_FIRST_LOAD logic.
-
protected abstract void handleFlow_DataUpdate(java.lang.String serverRsp)
Handle data update SONIC_RESULT_CODE_DATA_UPDATE logic.
参数:serverRsp - Server response data.
-
protected abstract void handleFlow_TemplateChange(java.lang.String newHtml)
Handle template update SONIC_RESULT_CODE_TEMPLATE_CHANGE logic.
参数:newHtml - new Html string from web-server
-
protected abstract void handleFlow_HttpError(int responseCode)
-
protected abstract void handleFlow_ServiceUnavailable()
-
protected void handleFlow_NotModified()
-
public boolean isPreload()
-
public[SonicSessionStatistics](../../../../com/tencent/sonic/sdk/SonicSessionStatistics.html "com.tencent.sonic.sdk中的类")getStatistics()
-
protected boolean addSessionStateChangedCallback([SonicSession.Callback](../../../../com/tencent/sonic/sdk/SonicSession.Callback.html "com.tencent.sonic.sdk中的接口")callback)
-
protected boolean removeSessionStateChangedCallback([SonicSession.Callback](../../../../com/tencent/sonic/sdk/SonicSession.Callback.html "com.tencent.sonic.sdk中的接口")callback)
-
public boolean addSessionCallback(com.tencent.sonic.sdk.SonicSessionCallback callback)
-
public boolean removeSessionCallback(com.tencent.sonic.sdk.SonicSessionCallback callback)
-
public java.lang.String getCurrentUrl()
-
public int getFinalResultCode()
-
public int getSrcResultCode()
-
public boolean isDestroyedOrWaitingForDestroy()
-
protected boolean postForceDestroyIfNeed()
Destroy the session if it is waiting for destroy and it is can be destroyed. 返回:Return true if the session is waiting for destroy and it is can be destroyed.
-
protected boolean canDestroy()
-
protected boolean switchState(int fromState,
int toState,
boolean notify)
-
public void onServerClosed([SonicServer](../../../../com/tencent/sonic/sdk/SonicServer.html "com.tencent.sonic.sdk中的类")sonicServer,
boolean readComplete)
If the kernel obtain inputStream from a SonicSessionStream, the inputStream will be closed when the kernel reads the data.This method is invoked when the sonicSessionStream close.
If the html is read complete, sonic will separate the html to template and data, and save these data.
参数:sonicServer - The actual server connection of current SonicSession.readComplete - Whether the html is read complete.
-
protected void postTaskToSaveSonicCache(java.lang.String htmlString)
-
protected void doSaveSonicCache([SonicServer](../../../../com/tencent/sonic/sdk/SonicServer.html "com.tencent.sonic.sdk中的类")sonicServer,
java.lang.String htmlString)
-
protected void notifyStateChange(int oldState,
int newState,
android.os.Bundle extraData)
When the session state changes, notify the listeners.
参数:oldState - The old state.newState - The nex state.extraData - The extra data.
-
protected void setResult(int srcCode,
int finalCode,
boolean notify)
Record the sonic mode, notify the result to page if necessary.
参数:srcCode - The original mode.finalCode - The final mode.notify - Whether notify te result to page.
-
public boolean bindClient([SonicSessionClient](../../../../com/tencent/sonic/sdk/SonicSessionClient.html "com.tencent.sonic.sdk中的类")client)
-
public boolean onClientReady()
Client informs sonic that it is ready. Client ready means it's webview has been initialized, can start load url or load data. 返回:True if it is set for the first time
-
public final java.lang.Object onClientRequestResource(java.lang.String url)
When the webview initiates a resource interception, the client invokes the method to retrieve the data
参数:url - The url of this session返回:Return the data to kernel
-
protected boolean shouldSetCookieAsynchronous()
Whether should set cookie asynchronous or not , if onClientRequestResource is calling in IOThread, it should not call set cookie synchronous which will handle in IOThread as it may cause deadlock More about it see {https://issuetracker.google.com/issues/36989494#c8} Fix VasSonic issue {https://github.com/Tencent/VasSonic/issues/90}
返回:Return the data to kernel
-
protected boolean setCookiesFromHeaders(java.util.Map<java.lang.String,java.util.List<java.lang.String>> headers,
boolean executeInNewThread)
Set cookies to webview from headers
参数:headers - headers from server responseexecuteInNewThread - whether execute in new thread or not返回:Set cookie success or not
-
protected java.lang.Object onRequestResource(java.lang.String url)
When the webview initiates a main resource interception, the client invokes this method to retrieve the data
参数:url - The url of this session返回:Return the data to kernel
-
public boolean onWebReady([SonicDiffDataCallback](../../../../com/tencent/sonic/sdk/SonicDiffDataCallback.html "com.tencent.sonic.sdk中的接口")diffDataCallback)
Client will call this method to obtain the update data when the page shows the content.
参数:diffDataCallback - Sonic provides the latest data to the page through this callback返回:The result
-
public boolean onClientPageFinished(java.lang.String url)
-
public boolean isMatchCurrentUrl(java.lang.String url)
Whether the incoming url matches the current url,it will ignore url parameters
参数:url - The incoming url.返回:Whether the incoming url matches the current url.
-
protected java.util.HashMap<java.lang.String,java.lang.String> getHeaders()
Get header info with the original url of current session. 返回:The header info.
-
protected java.lang.String getCharsetFromHeaders()
Get the charset from the latest response http header. 返回:The charset.
-
public java.lang.String getCharsetFromHeaders(java.util.Map<java.lang.String,java.lang.String> headers)
-
protected java.util.HashMap<java.lang.String,java.lang.String> getCacheHeaders()
Get header info from local cache headers 返回:The header info.
-
public[SonicSessionClient](../../../../com/tencent/sonic/sdk/SonicSessionClient.html "com.tencent.sonic.sdk中的类")getSessionClient()
-
public void destroy()
-
protected void destroy(boolean force)
-
protected void clearSessionData()