OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 package org.chromium.components.invalidation; | 5 package org.chromium.components.invalidation; |
6 | 6 |
7 import android.accounts.Account; | 7 import android.accounts.Account; |
8 import android.content.ComponentName; | 8 import android.content.ComponentName; |
9 import android.content.Intent; | 9 import android.content.Intent; |
10 import android.os.Bundle; | 10 import android.os.Bundle; |
(...skipping 28 matching lines...) Expand all Loading... |
39 | 39 |
40 /** Intents given to {@link #startService}. */ | 40 /** Intents given to {@link #startService}. */ |
41 final List<Intent> mStartedServices = new ArrayList<Intent>(); | 41 final List<Intent> mStartedServices = new ArrayList<Intent>(); |
42 | 42 |
43 /** Bundles given to {@link #requestSyncFromContentResolver}. */ | 43 /** Bundles given to {@link #requestSyncFromContentResolver}. */ |
44 final List<Bundle> mRequestedSyncs = new ArrayList<Bundle>(); | 44 final List<Bundle> mRequestedSyncs = new ArrayList<Bundle>(); |
45 | 45 |
46 final List<byte[]> mAcknowledgements = new ArrayList<byte[]>(); | 46 final List<byte[]> mAcknowledgements = new ArrayList<byte[]>(); |
47 | 47 |
48 /** Whether Chrome is in the foreground. */ | 48 /** Whether Chrome is in the foreground. */ |
49 private boolean mIsChromeInForeground = false; | 49 private boolean mIsChromeInForeground; |
50 | 50 |
51 /** Whether sync is enabled. */ | 51 /** Whether sync is enabled. */ |
52 private boolean mIsSyncEnabled = false; | 52 private boolean mIsSyncEnabled; |
53 | 53 |
54 @Override | 54 @Override |
55 public void acknowledge(byte[] ackHandle) { | 55 public void acknowledge(byte[] ackHandle) { |
56 mAcknowledgements.add(ackHandle); | 56 mAcknowledgements.add(ackHandle); |
57 } | 57 } |
58 | 58 |
59 @Override | 59 @Override |
60 public void register(byte[] clientId, Iterable<ObjectId> objectIds) { | 60 public void register(byte[] clientId, Iterable<ObjectId> objectIds) { |
61 List<ObjectId> objectIdList = CollectionUtil.newArrayList(objectIds); | 61 List<ObjectId> objectIdList = CollectionUtil.newArrayList(objectIds); |
62 mRegistrations.add(objectIdList); | 62 mRegistrations.add(objectIdList); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 /** | 98 /** |
99 * Sets the variables used to control whether or not a notification client s
hould be running. | 99 * Sets the variables used to control whether or not a notification client s
hould be running. |
100 * @param isChromeInForeground whether Chrome is in the foreground | 100 * @param isChromeInForeground whether Chrome is in the foreground |
101 * @param isSyncEnabled whether sync is enabled | 101 * @param isSyncEnabled whether sync is enabled |
102 */ | 102 */ |
103 void setShouldRunStates(boolean isChromeInForeground, boolean isSyncEnabled)
{ | 103 void setShouldRunStates(boolean isChromeInForeground, boolean isSyncEnabled)
{ |
104 this.mIsChromeInForeground = isChromeInForeground; | 104 this.mIsChromeInForeground = isChromeInForeground; |
105 this.mIsSyncEnabled = isSyncEnabled; | 105 this.mIsSyncEnabled = isSyncEnabled; |
106 } | 106 } |
107 } | 107 } |
OLD | NEW |