OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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.chrome.browser.preferences; | 5 package org.chromium.chrome.browser.preferences; |
6 | 6 |
7 import android.content.Context; | 7 import android.content.Context; |
8 import android.content.SharedPreferences; | 8 import android.content.SharedPreferences; |
9 import android.preference.PreferenceManager; | 9 import android.preference.PreferenceManager; |
10 | 10 |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
171 public void setAllowLowEndDeviceUi() { | 171 public void setAllowLowEndDeviceUi() { |
172 SharedPreferences.Editor sharedPreferencesEditor = mSharedPreferences.ed it(); | 172 SharedPreferences.Editor sharedPreferencesEditor = mSharedPreferences.ed it(); |
173 sharedPreferencesEditor.putBoolean(ALLOW_LOW_END_DEVICE_UI, true); | 173 sharedPreferencesEditor.putBoolean(ALLOW_LOW_END_DEVICE_UI, true); |
174 sharedPreferencesEditor.apply(); | 174 sharedPreferencesEditor.apply(); |
175 } | 175 } |
176 | 176 |
177 /** | 177 /** |
178 * @return Whether low end device ui is allowed. | 178 * @return Whether low end device ui is allowed. |
179 */ | 179 */ |
180 public boolean getAllowLowEndDeviceUi() { | 180 public boolean getAllowLowEndDeviceUi() { |
181 return mSharedPreferences.getBoolean(ALLOW_LOW_END_DEVICE_UI, false); | 181 return mSharedPreferences.getBoolean(ALLOW_LOW_END_DEVICE_UI, true); |
gone
2015/07/30 19:18:08
Man, this flip to true was confusing. Can you cha
Peter Wen
2015/07/30 19:42:11
Heh, agreed. Added detailed comments, removed the
| |
182 } | 182 } |
183 | 183 |
184 /** | 184 /** |
185 * Signin promo could be shown at most once every 12 weeks. This method chec ks | 185 * Signin promo could be shown at most once every 12 weeks. This method chec ks |
186 * wheter the signin promo has already been shown in the current cycle. | 186 * wheter the signin promo has already been shown in the current cycle. |
187 * @return Whether the signin promo has been shown in the current cycle. | 187 * @return Whether the signin promo has been shown in the current cycle. |
188 */ | 188 */ |
189 public boolean getSigninPromoShown() { | 189 public boolean getSigninPromoShown() { |
190 long signinPromoLastShown = mSharedPreferences.getLong(SIGNIN_PROMO_LAST _SHOWN, 0); | 190 long signinPromoLastShown = mSharedPreferences.getLong(SIGNIN_PROMO_LAST _SHOWN, 0); |
191 long numDaysElapsed = | 191 long numDaysElapsed = |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
273 * | 273 * |
274 * @param key The name of the preference to modify. | 274 * @param key The name of the preference to modify. |
275 * @param value The new value for the preference. | 275 * @param value The new value for the preference. |
276 */ | 276 */ |
277 private void writeInt(String key, int value) { | 277 private void writeInt(String key, int value) { |
278 SharedPreferences.Editor ed = mSharedPreferences.edit(); | 278 SharedPreferences.Editor ed = mSharedPreferences.edit(); |
279 ed.putInt(key, value); | 279 ed.putInt(key, value); |
280 ed.apply(); | 280 ed.apply(); |
281 } | 281 } |
282 } | 282 } |
OLD | NEW |