org.chromium.chrome.browser.webapps.ActivityAssigner Java Examples

The following examples show how to use org.chromium.chrome.browser.webapps.ActivityAssigner. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ChromeBrowserInitializer.java    From delion with Apache License 2.0 6 votes vote down vote up
/**
 * Pre-load shared prefs to avoid being blocked on the disk access async task in the future.
 * Running in an AsyncTask as pre-loading itself may cause I/O.
 */
private void warmUpSharedPrefs() {
    if (Build.VERSION.CODENAME.equals("N") || Build.VERSION.SDK_INT > Build.VERSION_CODES.M) {
        new AsyncTask<Void, Void, Void>() {
            @Override
            protected Void doInBackground(Void... params) {
                ContextUtils.getAppSharedPreferences();
                DocumentTabModelImpl.warmUpSharedPrefs(mApplication);
                ActivityAssigner.warmUpSharedPrefs(mApplication);
                return null;
            }
        }.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
    } else {
        ContextUtils.getAppSharedPreferences();
        DocumentTabModelImpl.warmUpSharedPrefs(mApplication);
        ActivityAssigner.warmUpSharedPrefs(mApplication);
    }
}
 
Example #2
Source File: ChromeBrowserInitializer.java    From AndroidChromium with Apache License 2.0 6 votes vote down vote up
/**
 * Pre-load shared prefs to avoid being blocked on the disk access async task in the future.
 * Running in an AsyncTask as pre-loading itself may cause I/O.
 */
private void warmUpSharedPrefs() {
    if (Build.VERSION.CODENAME.equals("N") || Build.VERSION.SDK_INT > Build.VERSION_CODES.M) {
        new AsyncTask<Void, Void, Void>() {
            @Override
            protected Void doInBackground(Void... params) {
                ContextUtils.getAppSharedPreferences();
                DocumentTabModelImpl.warmUpSharedPrefs(mApplication);
                ActivityAssigner.warmUpSharedPrefs(mApplication);
                return null;
            }
        }.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
    } else {
        ContextUtils.getAppSharedPreferences();
        DocumentTabModelImpl.warmUpSharedPrefs(mApplication);
        ActivityAssigner.warmUpSharedPrefs(mApplication);
    }
}
 
Example #3
Source File: ChromeBrowserInitializer.java    From 365browser with Apache License 2.0 6 votes vote down vote up
/**
 * Pre-load shared prefs to avoid being blocked on the disk access async task in the future.
 * Running in an AsyncTask as pre-loading itself may cause I/O.
 */
private void warmUpSharedPrefs() {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
        new AsyncTask<Void, Void, Void>() {
            @Override
            protected Void doInBackground(Void... params) {
                ContextUtils.getAppSharedPreferences();
                DocumentTabModelImpl.warmUpSharedPrefs(mApplication);
                ActivityAssigner.warmUpSharedPrefs(mApplication);
                DownloadManagerService.warmUpSharedPrefs(mApplication);
                return null;
            }
        }.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
    } else {
        ContextUtils.getAppSharedPreferences();
        DocumentTabModelImpl.warmUpSharedPrefs(mApplication);
        ActivityAssigner.warmUpSharedPrefs(mApplication);
        DownloadManagerService.warmUpSharedPrefs(mApplication);
    }
}
 
Example #4
Source File: SeparateTaskManagedCustomTabActivity.java    From delion with Apache License 2.0 5 votes vote down vote up
@Override
public void onStartWithNative() {
    super.onStartWithNative();

    if (!isFinishing()) {
        ActivityAssigner.instance(ActivityAssigner.SEPARATE_TASK_CCT_NAMESPACE)
                .markActivityUsed(getActivityIndex(), getIntent().getData().getAuthority());
    }
}
 
Example #5
Source File: SeparateTaskManagedCustomTabActivity.java    From AndroidChromium with Apache License 2.0 5 votes vote down vote up
@Override
public void onStartWithNative() {
    super.onStartWithNative();

    if (!isFinishing()) {
        ActivityAssigner.instance(ActivityAssigner.SEPARATE_TASK_CCT_NAMESPACE)
                .markActivityUsed(getActivityIndex(), getIntent().getData().getAuthority());
    }
}
 
Example #6
Source File: SeparateTaskManagedCustomTabActivity.java    From 365browser with Apache License 2.0 5 votes vote down vote up
@Override
public void onStartWithNative() {
    super.onStartWithNative();

    if (!isFinishing()) {
        ActivityAssigner.instance(ActivityAssigner.SEPARATE_TASK_CCT_NAMESPACE)
                .markActivityUsed(getActivityIndex(), getIntent().getData().getAuthority());
    }
}