Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Side by Side Diff: net/android/java/src/org/chromium/net/RegistrationPolicyApplicationStatus.java

Issue 2548013002: Remove redundant field initialization in Java code. (Closed)
Patch Set: rebase Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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.net; 5 package org.chromium.net;
6 6
7 import org.chromium.base.ApplicationState; 7 import org.chromium.base.ApplicationState;
8 import org.chromium.base.ApplicationStatus; 8 import org.chromium.base.ApplicationStatus;
9 import org.chromium.base.VisibleForTesting; 9 import org.chromium.base.VisibleForTesting;
10 10
11 /** 11 /**
12 * Regsitration policy which depends on the ApplicationState. 12 * Regsitration policy which depends on the ApplicationState.
13 */ 13 */
14 public class RegistrationPolicyApplicationStatus 14 public class RegistrationPolicyApplicationStatus
15 extends NetworkChangeNotifierAutoDetect.RegistrationPolicy 15 extends NetworkChangeNotifierAutoDetect.RegistrationPolicy
16 implements ApplicationStatus.ApplicationStateListener { 16 implements ApplicationStatus.ApplicationStateListener {
17 private boolean mDestroyed = false; 17 private boolean mDestroyed;
18 18
19 @Override 19 @Override
20 protected void init(NetworkChangeNotifierAutoDetect notifier) { 20 protected void init(NetworkChangeNotifierAutoDetect notifier) {
21 super.init(notifier); 21 super.init(notifier);
22 ApplicationStatus.registerApplicationStateListener(this); 22 ApplicationStatus.registerApplicationStateListener(this);
23 onApplicationStateChange(getApplicationState()); 23 onApplicationStateChange(getApplicationState());
24 } 24 }
25 25
26 protected void destroy() { 26 protected void destroy() {
27 if (mDestroyed) return; 27 if (mDestroyed) return;
(...skipping 13 matching lines...) Expand all
41 41
42 /** 42 /**
43 * Returns the activity's status. 43 * Returns the activity's status.
44 * @return an {@code int} that is one of {@code ApplicationState.HAS_*_ACTIV ITIES}. 44 * @return an {@code int} that is one of {@code ApplicationState.HAS_*_ACTIV ITIES}.
45 */ 45 */
46 @VisibleForTesting 46 @VisibleForTesting
47 int getApplicationState() { 47 int getApplicationState() {
48 return ApplicationStatus.getStateForApplication(); 48 return ApplicationStatus.getStateForApplication();
49 } 49 }
50 } 50 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698