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

Side by Side Diff: components/policy/android/java/src/org/chromium/policy/AbstractAppRestrictionsProvider.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.policy; 5 package org.chromium.policy;
6 6
7 import android.content.BroadcastReceiver; 7 import android.content.BroadcastReceiver;
8 import android.content.Context; 8 import android.content.Context;
9 import android.content.Intent; 9 import android.content.Intent;
10 import android.content.IntentFilter; 10 import android.content.IntentFilter;
11 import android.os.Bundle; 11 import android.os.Bundle;
12 import android.os.Handler; 12 import android.os.Handler;
13 import android.os.StrictMode; 13 import android.os.StrictMode;
14 14
15 import org.chromium.base.Log; 15 import org.chromium.base.Log;
16 import org.chromium.base.ThreadUtils; 16 import org.chromium.base.ThreadUtils;
17 import org.chromium.base.VisibleForTesting; 17 import org.chromium.base.VisibleForTesting;
18 18
19 /** 19 /**
20 * Retrieves app restrictions and provides them to the parent class as Bundles. 20 * Retrieves app restrictions and provides them to the parent class as Bundles.
21 * 21 *
22 * Needs to be subclassed to specify how to retrieve the restrictions. 22 * Needs to be subclassed to specify how to retrieve the restrictions.
23 */ 23 */
24 public abstract class AbstractAppRestrictionsProvider extends PolicyProvider { 24 public abstract class AbstractAppRestrictionsProvider extends PolicyProvider {
25 private static final String TAG = "policy"; 25 private static final String TAG = "policy";
26 26
27 /** {@link Bundle} holding the restrictions to be used during tests. */ 27 /** {@link Bundle} holding the restrictions to be used during tests. */
28 private static Bundle sTestRestrictions = null; 28 private static Bundle sTestRestrictions;
29 29
30 private final Context mContext; 30 private final Context mContext;
31 private final BroadcastReceiver mAppRestrictionsChangedReceiver = new Broadc astReceiver() { 31 private final BroadcastReceiver mAppRestrictionsChangedReceiver = new Broadc astReceiver() {
32 @Override 32 @Override
33 public void onReceive(Context context, Intent intent) { 33 public void onReceive(Context context, Intent intent) {
34 refresh(); 34 refresh();
35 } 35 }
36 }; 36 };
37 37
38 /** 38 /**
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 * restrictions to an empty bundle if nothing is specified. To stop using a test bundle, 122 * restrictions to an empty bundle if nothing is specified. To stop using a test bundle,
123 * provide {@code null} as value instead. 123 * provide {@code null} as value instead.
124 */ 124 */
125 @VisibleForTesting 125 @VisibleForTesting
126 public static void setTestRestrictions(Bundle policies) { 126 public static void setTestRestrictions(Bundle policies) {
127 Log.d(TAG, "Test Restrictions: %s", 127 Log.d(TAG, "Test Restrictions: %s",
128 (policies == null ? null : policies.keySet().toArray())); 128 (policies == null ? null : policies.keySet().toArray()));
129 sTestRestrictions = policies; 129 sTestRestrictions = policies;
130 } 130 }
131 } 131 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698