本文整理匯總了Java中org.chromium.chrome.browser.omaha.OmahaClient類的典型用法代碼示例。如果您正苦於以下問題:Java OmahaClient類的具體用法?Java OmahaClient怎麽用?Java OmahaClient使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
OmahaClient類屬於org.chromium.chrome.browser.omaha包,在下文中一共展示了OmahaClient類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: preInflationStartup
import org.chromium.chrome.browser.omaha.OmahaClient; //導入依賴的package包/類
@Override
public void preInflationStartup() {
super.preInflationStartup();
// Decide whether to record startup UMA histograms. This is done early in the main
// Activity.onCreate() to avoid recording navigation delays when they require user input to
// proceed. For example, FRE (First Run Experience) happens before the activity is created,
// and triggers initialization of the native library. At the moment it seems safe to assume
// that uninitialized native library is an indication of an application start that is
// followed by navigation immediately without user input.
if (!LibraryLoader.isInitialized()) {
UmaUtils.setRunningApplicationStart(true);
}
CommandLine commandLine = CommandLine.getInstance();
if (commandLine.hasSwitch(ContentSwitches.ENABLE_TEST_INTENTS)
&& getIntent() != null
&& getIntent().hasExtra(
ChromeTabbedActivity.INTENT_EXTRA_TEST_RENDER_PROCESS_LIMIT)) {
int value = getIntent().getIntExtra(
ChromeTabbedActivity.INTENT_EXTRA_TEST_RENDER_PROCESS_LIMIT, -1);
if (value != -1) {
String[] args = new String[1];
args[0] = "--" + ContentSwitches.RENDER_PROCESS_LIMIT
+ "=" + Integer.toString(value);
commandLine.appendSwitchesAndArguments(args);
}
}
supportRequestWindowFeature(Window.FEATURE_ACTION_MODE_OVERLAY);
// We are starting from history with a URL after data has been cleared. On Samsung this
// can happen after user clears data and clicks on a recents item on pre-L devices.
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP
&& getIntent().getData() != null
&& (getIntent().getFlags() & Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY) != 0
&& OmahaClient.isFreshInstallOrDataHasBeenCleared(getApplicationContext())) {
getIntent().setData(null);
}
}
示例2: run
import org.chromium.chrome.browser.omaha.OmahaClient; //導入依賴的package包/類
/**
* Unless testing, do not override this function.
*/
@Override
public void run() {
Context context = ApplicationStatus.getApplicationContext();
// Resume communication with the Omaha Update Server.
if (ChromeVersionInfo.isOfficialBuild()) {
Intent omahaIntent = OmahaClient.createInitializeIntent(context);
context.startService(omahaIntent);
}
DelayedInvalidationsController.getInstance().notifyPendingInvalidations(context);
}
示例3: runActions
import org.chromium.chrome.browser.omaha.OmahaClient; //導入依賴的package包/類
/**
* Executed when all of the system conditions are met.
*/
public void runActions() {
Context context = ContextUtils.getApplicationContext();
OmahaClient.onForegroundSessionStart(context);
DelayedInvalidationsController.getInstance().notifyPendingInvalidations(context);
}
示例4: preInflationStartup
import org.chromium.chrome.browser.omaha.OmahaClient; //導入依賴的package包/類
@Override
public void preInflationStartup() {
super.preInflationStartup();
// Decide whether to record startup UMA histograms. This is done early in the main
// Activity.onCreate() to avoid recording navigation delays when they require user input to
// proceed. For example, FRE (First Run Experience) happens before the activity is created,
// and triggers initialization of the native library. At the moment it seems safe to assume
// that uninitialized native library is an indication of an application start that is
// followed by navigation immediately without user input.
if (!LibraryLoader.isInitialized()) {
UmaUtils.setRunningApplicationStart(true);
}
CommandLine commandLine = CommandLine.getInstance();
if (commandLine.hasSwitch(ContentSwitches.ENABLE_TEST_INTENTS)
&& getIntent() != null
&& getIntent().hasExtra(
ChromeTabbedActivity.INTENT_EXTRA_TEST_RENDER_PROCESS_LIMIT)) {
int value = getIntent().getIntExtra(
ChromeTabbedActivity.INTENT_EXTRA_TEST_RENDER_PROCESS_LIMIT, -1);
if (value != -1) {
String[] args = new String[1];
args[0] = "--" + ChromeSwitches.RENDER_PROCESS_LIMIT
+ "=" + Integer.toString(value);
commandLine.appendSwitchesAndArguments(args);
}
}
commandLine.appendSwitch(ChromeSwitches.ENABLE_HIGH_END_UI_UNDO);
supportRequestWindowFeature(Window.FEATURE_ACTION_MODE_OVERLAY);
// We are starting from history with a URL after data has been cleared. On Samsung this
// can happen after user clears data and clicks on a recents item on pre-L devices.
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP
&& getIntent().getData() != null
&& (getIntent().getFlags() & Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY) != 0
&& OmahaClient.isFreshInstallOrDataHasBeenCleared(getApplicationContext())) {
getIntent().setData(null);
}
}