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.sync.notifier; | 5 package org.chromium.components.sync.notifier; |
6 | 6 |
7 import android.accounts.Account; | 7 import android.accounts.Account; |
8 import android.content.SharedPreferences; | 8 import android.content.SharedPreferences; |
9 import android.util.Base64; | 9 import android.util.Base64; |
10 | 10 |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 @VisibleForTesting | 70 @VisibleForTesting |
71 public static final String SYNC_ACCT_NAME = "sync_acct_name"; | 71 public static final String SYNC_ACCT_NAME = "sync_acct_name"; |
72 | 72 |
73 /** Shared preference key to store the type of account in use. */ | 73 /** Shared preference key to store the type of account in use. */ |
74 static final String SYNC_ACCT_TYPE = "sync_acct_type"; | 74 static final String SYNC_ACCT_TYPE = "sync_acct_type"; |
75 | 75 |
76 /** Shared preference key to store internal notification client library
state. */ | 76 /** Shared preference key to store internal notification client library
state. */ |
77 static final String SYNC_TANGO_INTERNAL_STATE = "sync_tango_internal_sta
te"; | 77 static final String SYNC_TANGO_INTERNAL_STATE = "sync_tango_internal_sta
te"; |
78 } | 78 } |
79 | 79 |
80 private static final String TAG = "InvalidationPreferences"; | 80 private static final String TAG = "InvalidationPrefs"; |
81 | 81 |
82 // Only one commit call can be in progress at a time. | 82 // Only one commit call can be in progress at a time. |
83 private static final Object sCommitLock = new Object(); | 83 private static final Object sCommitLock = new Object(); |
84 | 84 |
85 /** Returns a new {@link EditContext} to modify the preferences managed by t
his class. */ | 85 /** Returns a new {@link EditContext} to modify the preferences managed by t
his class. */ |
86 public EditContext edit() { | 86 public EditContext edit() { |
87 return new EditContext(); | 87 return new EditContext(); |
88 } | 88 } |
89 | 89 |
90 /** | 90 /** |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 int objectSource; | 200 int objectSource; |
201 try { | 201 try { |
202 objectSource = Integer.parseInt(objectIdString.substring(0, separato
rPos)); | 202 objectSource = Integer.parseInt(objectIdString.substring(0, separato
rPos)); |
203 } catch (NumberFormatException e) { | 203 } catch (NumberFormatException e) { |
204 return null; | 204 return null; |
205 } | 205 } |
206 byte[] objectName = objectIdString.substring(separatorPos + 1).getBytes(
); | 206 byte[] objectName = objectIdString.substring(separatorPos + 1).getBytes(
); |
207 return ObjectId.newInstance(objectSource, objectName); | 207 return ObjectId.newInstance(objectSource, objectName); |
208 } | 208 } |
209 } | 209 } |
OLD | NEW |