OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 package com.google.android.apps.chrome.variations; | |
6 | |
7 import android.content.Context; | |
8 | |
9 /** | |
10 * Sets up communication with the VariationsService. This is primarily used for | |
11 * triggering seed fetches on application startup. | |
12 */ | |
13 public class VariationsSession { | |
Yaron
2015/03/23 14:39:44
You don't want this one. Only the one in the other
| |
14 private boolean mInitialized; | |
15 private String mRestrictMode; | |
16 | |
17 /** | |
18 * Triggers to the native VariationsService that the application has entered the foreground. | |
19 */ | |
20 public void start(Context context) { | |
21 if (!mInitialized) { | |
22 mInitialized = true; | |
23 // Check the restrict mode only once initially to avoid doing extra work each time the | |
24 // app enters foreground. | |
25 mRestrictMode = getRestrictMode(context); | |
26 } | |
27 nativeStartVariationsSession(mRestrictMode); | |
28 } | |
29 | |
30 /** | |
31 * Returns the value of the "restrict" URL param that the variations service should use for | |
32 * variation seed requests. | |
33 */ | |
34 protected String getRestrictMode(Context context) { | |
35 return ""; | |
36 } | |
37 | |
38 private native void nativeStartVariationsSession(String restrictMode); | |
39 } | |
OLD | NEW |