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 #include "chromeos/dbus/fake_shill_manager_client.h" | 5 #include "chromeos/dbus/fake_shill_manager_client.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
(...skipping 758 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
769 shill::kSupportedCarriersProperty, | 769 shill::kSupportedCarriersProperty, |
770 carrier_list); | 770 carrier_list); |
771 | 771 |
772 services->AddService(kCellularServicePath, | 772 services->AddService(kCellularServicePath, |
773 "cellular1_guid", | 773 "cellular1_guid", |
774 "cellular1" /* name */, | 774 "cellular1" /* name */, |
775 shill::kTypeCellular, | 775 shill::kTypeCellular, |
776 state, | 776 state, |
777 add_to_visible); | 777 add_to_visible); |
778 base::StringValue technology_value(shill::kNetworkTechnologyGsm); | 778 base::StringValue technology_value(shill::kNetworkTechnologyGsm); |
| 779 devices->SetDeviceProperty("/device/cellular1", |
| 780 shill::kTechnologyFamilyProperty, |
| 781 technology_value); |
779 services->SetServiceProperty(kCellularServicePath, | 782 services->SetServiceProperty(kCellularServicePath, |
780 shill::kNetworkTechnologyProperty, | 783 shill::kNetworkTechnologyProperty, |
781 technology_value); | 784 technology_value); |
782 | 785 |
783 if (activated) { | 786 if (activated) { |
784 services->SetServiceProperty( | 787 services->SetServiceProperty( |
785 kCellularServicePath, | 788 kCellularServicePath, |
786 shill::kActivationStateProperty, | 789 shill::kActivationStateProperty, |
787 base::StringValue(shill::kActivationStateActivated)); | 790 base::StringValue(shill::kActivationStateActivated)); |
788 services->SetServiceProperty(kCellularServicePath, | 791 services->SetServiceProperty(kCellularServicePath, |
789 shill::kConnectableProperty, | 792 shill::kConnectableProperty, |
790 base::FundamentalValue(true)); | 793 base::FundamentalValue(true)); |
791 } else { | 794 } else { |
792 services->SetServiceProperty( | 795 services->SetServiceProperty( |
793 kCellularServicePath, | 796 kCellularServicePath, |
794 shill::kActivationStateProperty, | 797 shill::kActivationStateProperty, |
795 base::StringValue(shill::kActivationStateNotActivated)); | 798 base::StringValue(shill::kActivationStateNotActivated)); |
796 } | 799 } |
797 | 800 |
798 services->SetServiceProperty(kCellularServicePath, | 801 services->SetServiceProperty(kCellularServicePath, |
799 shill::kRoamingStateProperty, | 802 shill::kRoamingStateProperty, |
800 base::StringValue(shill::kRoamingStateHome)); | 803 base::StringValue(shill::kRoamingStateHome)); |
| 804 profiles->AddService(shared_profile, kCellularServicePath); |
801 } | 805 } |
802 | 806 |
803 // VPN | 807 // VPN |
804 state = GetInitialStateForType(shill::kTypeVPN, &enabled); | 808 state = GetInitialStateForType(shill::kTypeVPN, &enabled); |
805 if (state != kTechnologyUnavailable) { | 809 if (state != kTechnologyUnavailable) { |
806 // Set the "Provider" dictionary properties. Note: when setting these in | 810 // Set the "Provider" dictionary properties. Note: when setting these in |
807 // Shill, "Provider.Type", etc keys are used, but when reading the values | 811 // Shill, "Provider.Type", etc keys are used, but when reading the values |
808 // "Provider" . "Type", etc keys are used. Here we are setting the values | 812 // "Provider" . "Type", etc keys are used. Here we are setting the values |
809 // that will be read (by the UI, tests, etc). | 813 // that will be read (by the UI, tests, etc). |
810 base::DictionaryValue provider_properties_openvpn; | 814 base::DictionaryValue provider_properties_openvpn; |
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1118 *enabled = true; | 1122 *enabled = true; |
1119 if ((state == shill::kStatePortal && type != shill::kTypeWifi) || | 1123 if ((state == shill::kStatePortal && type != shill::kTypeWifi) || |
1120 (state == kNetworkActivated && type != shill::kTypeCellular)) { | 1124 (state == kNetworkActivated && type != shill::kTypeCellular)) { |
1121 LOG(WARNING) << "Invalid state: " << state << " for " << type; | 1125 LOG(WARNING) << "Invalid state: " << state << " for " << type; |
1122 return shill::kStateIdle; | 1126 return shill::kStateIdle; |
1123 } | 1127 } |
1124 return state; | 1128 return state; |
1125 } | 1129 } |
1126 | 1130 |
1127 } // namespace chromeos | 1131 } // namespace chromeos |
OLD | NEW |