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 749 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
760 shill::kSupportedCarriersProperty, | 760 shill::kSupportedCarriersProperty, |
761 carrier_list); | 761 carrier_list); |
762 | 762 |
763 services->AddService(kCellularServicePath, | 763 services->AddService(kCellularServicePath, |
764 "cellular1_guid", | 764 "cellular1_guid", |
765 "cellular1" /* name */, | 765 "cellular1" /* name */, |
766 shill::kTypeCellular, | 766 shill::kTypeCellular, |
767 state, | 767 state, |
768 add_to_visible); | 768 add_to_visible); |
769 base::StringValue technology_value(shill::kNetworkTechnologyGsm); | 769 base::StringValue technology_value(shill::kNetworkTechnologyGsm); |
| 770 devices->SetDeviceProperty("/device/cellular1", |
| 771 shill::kTechnologyFamilyProperty, |
| 772 technology_value); |
770 services->SetServiceProperty(kCellularServicePath, | 773 services->SetServiceProperty(kCellularServicePath, |
771 shill::kNetworkTechnologyProperty, | 774 shill::kNetworkTechnologyProperty, |
772 technology_value); | 775 technology_value); |
773 | 776 |
774 if (activated) { | 777 if (activated) { |
775 services->SetServiceProperty( | 778 services->SetServiceProperty( |
776 kCellularServicePath, | 779 kCellularServicePath, |
777 shill::kActivationStateProperty, | 780 shill::kActivationStateProperty, |
778 base::StringValue(shill::kActivationStateActivated)); | 781 base::StringValue(shill::kActivationStateActivated)); |
779 services->SetServiceProperty(kCellularServicePath, | 782 services->SetServiceProperty(kCellularServicePath, |
780 shill::kConnectableProperty, | 783 shill::kConnectableProperty, |
781 base::FundamentalValue(true)); | 784 base::FundamentalValue(true)); |
782 } else { | 785 } else { |
783 services->SetServiceProperty( | 786 services->SetServiceProperty( |
784 kCellularServicePath, | 787 kCellularServicePath, |
785 shill::kActivationStateProperty, | 788 shill::kActivationStateProperty, |
786 base::StringValue(shill::kActivationStateNotActivated)); | 789 base::StringValue(shill::kActivationStateNotActivated)); |
787 } | 790 } |
788 | 791 |
789 services->SetServiceProperty(kCellularServicePath, | 792 services->SetServiceProperty(kCellularServicePath, |
790 shill::kRoamingStateProperty, | 793 shill::kRoamingStateProperty, |
791 base::StringValue(shill::kRoamingStateHome)); | 794 base::StringValue(shill::kRoamingStateHome)); |
| 795 profiles->AddService(shared_profile, kCellularServicePath); |
792 } | 796 } |
793 | 797 |
794 // VPN | 798 // VPN |
795 state = GetInitialStateForType(shill::kTypeVPN, &enabled); | 799 state = GetInitialStateForType(shill::kTypeVPN, &enabled); |
796 if (state != kTechnologyUnavailable) { | 800 if (state != kTechnologyUnavailable) { |
797 // Set the "Provider" dictionary properties. Note: when setting these in | 801 // Set the "Provider" dictionary properties. Note: when setting these in |
798 // Shill, "Provider.Type", etc keys are used, but when reading the values | 802 // Shill, "Provider.Type", etc keys are used, but when reading the values |
799 // "Provider" . "Type", etc keys are used. Here we are setting the values | 803 // "Provider" . "Type", etc keys are used. Here we are setting the values |
800 // that will be read (by the UI, tests, etc). | 804 // that will be read (by the UI, tests, etc). |
801 base::DictionaryValue provider_properties_openvpn; | 805 base::DictionaryValue provider_properties_openvpn; |
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1109 *enabled = true; | 1113 *enabled = true; |
1110 if ((state == shill::kStatePortal && type != shill::kTypeWifi) || | 1114 if ((state == shill::kStatePortal && type != shill::kTypeWifi) || |
1111 (state == kNetworkActivated && type != shill::kTypeCellular)) { | 1115 (state == kNetworkActivated && type != shill::kTypeCellular)) { |
1112 LOG(WARNING) << "Invalid state: " << state << " for " << type; | 1116 LOG(WARNING) << "Invalid state: " << state << " for " << type; |
1113 return shill::kStateIdle; | 1117 return shill::kStateIdle; |
1114 } | 1118 } |
1115 return state; | 1119 return state; |
1116 } | 1120 } |
1117 | 1121 |
1118 } // namespace chromeos | 1122 } // namespace chromeos |
OLD | NEW |