1 /* 2 * Copyright (C) 2010 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package android.net.wifi; 18 19 import static android.net.wifi.WifiConfiguration.INVALID_NETWORK_ID; 20 21 class NetworkUpdateResult { 22 int netId; 23 boolean ipChanged; 24 boolean proxyChanged; 25 boolean isNewNetwork = false; 26 27 public NetworkUpdateResult(int id) { 28 netId = id; 29 ipChanged = false; 30 proxyChanged = false; 31 } 32 33 public NetworkUpdateResult(boolean ip, boolean proxy) { 34 netId = INVALID_NETWORK_ID; 35 ipChanged = ip; 36 proxyChanged = proxy; 37 } 38 39 public void setNetworkId(int id) { 40 netId = id; 41 } 42 43 public int getNetworkId() { 44 return netId; 45 } 46 47 public void setIpChanged(boolean ip) { 48 ipChanged = ip; 49 } 50 51 public boolean hasIpChanged() { 52 return ipChanged; 53 } 54 55 public void setProxyChanged(boolean proxy) { 56 proxyChanged = proxy; 57 } 58 59 public boolean hasProxyChanged() { 60 return proxyChanged; 61 } 62 63 public boolean isNewNetwork() { 64 return isNewNetwork; 65 } 66 67 public void setIsNewNetwork(boolean isNew) { 68 isNewNetwork = isNew; 69 } 70 } 71