16fa9ad4afcd762aea519ff61811386c23d18ddb2Nick Pelly/* 26fa9ad4afcd762aea519ff61811386c23d18ddb2Nick Pelly * Copyright (C) 2012 The Android Open Source Project 36fa9ad4afcd762aea519ff61811386c23d18ddb2Nick Pelly * 46fa9ad4afcd762aea519ff61811386c23d18ddb2Nick Pelly * Licensed under the Apache License, Version 2.0 (the "License"); 56fa9ad4afcd762aea519ff61811386c23d18ddb2Nick Pelly * you may not use this file except in compliance with the License. 66fa9ad4afcd762aea519ff61811386c23d18ddb2Nick Pelly * You may obtain a copy of the License at 76fa9ad4afcd762aea519ff61811386c23d18ddb2Nick Pelly * 86fa9ad4afcd762aea519ff61811386c23d18ddb2Nick Pelly * http://www.apache.org/licenses/LICENSE-2.0 96fa9ad4afcd762aea519ff61811386c23d18ddb2Nick Pelly * 106fa9ad4afcd762aea519ff61811386c23d18ddb2Nick Pelly * Unless required by applicable law or agreed to in writing, software 116fa9ad4afcd762aea519ff61811386c23d18ddb2Nick Pelly * distributed under the License is distributed on an "AS IS" BASIS, 126fa9ad4afcd762aea519ff61811386c23d18ddb2Nick Pelly * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 136fa9ad4afcd762aea519ff61811386c23d18ddb2Nick Pelly * See the License for the specific language governing permissions and 146fa9ad4afcd762aea519ff61811386c23d18ddb2Nick Pelly * limitations under the License. 156fa9ad4afcd762aea519ff61811386c23d18ddb2Nick Pelly */ 166fa9ad4afcd762aea519ff61811386c23d18ddb2Nick Pelly 176fa9ad4afcd762aea519ff61811386c23d18ddb2Nick Pellypackage com.android.location.provider; 186fa9ad4afcd762aea519ff61811386c23d18ddb2Nick Pelly 196fa9ad4afcd762aea519ff61811386c23d18ddb2Nick Pellyimport com.android.internal.location.ProviderProperties; 206fa9ad4afcd762aea519ff61811386c23d18ddb2Nick Pelly 216fa9ad4afcd762aea519ff61811386c23d18ddb2Nick Pelly/** 22b03c8c508dcbbef364e624ad5bc0ab6fa6733dc7Nick Pelly * This class is an interface to Provider Properties for unbundled applications. 23b03c8c508dcbbef364e624ad5bc0ab6fa6733dc7Nick Pelly * 24b03c8c508dcbbef364e624ad5bc0ab6fa6733dc7Nick Pelly * <p>IMPORTANT: This class is effectively a public API for unbundled 25b03c8c508dcbbef364e624ad5bc0ab6fa6733dc7Nick Pelly * applications, and must remain API stable. See README.txt in the root 26b03c8c508dcbbef364e624ad5bc0ab6fa6733dc7Nick Pelly * of this package for more information. 276fa9ad4afcd762aea519ff61811386c23d18ddb2Nick Pelly */ 286fa9ad4afcd762aea519ff61811386c23d18ddb2Nick Pellypublic final class ProviderPropertiesUnbundled { 296fa9ad4afcd762aea519ff61811386c23d18ddb2Nick Pelly private final ProviderProperties mProperties; 306fa9ad4afcd762aea519ff61811386c23d18ddb2Nick Pelly 316fa9ad4afcd762aea519ff61811386c23d18ddb2Nick Pelly public static ProviderPropertiesUnbundled create(boolean requiresNetwork, 326fa9ad4afcd762aea519ff61811386c23d18ddb2Nick Pelly boolean requiresSatellite, boolean requiresCell, boolean hasMonetaryCost, 336fa9ad4afcd762aea519ff61811386c23d18ddb2Nick Pelly boolean supportsAltitude, boolean supportsSpeed, boolean supportsBearing, 346fa9ad4afcd762aea519ff61811386c23d18ddb2Nick Pelly int powerRequirement, int accuracy) { 356fa9ad4afcd762aea519ff61811386c23d18ddb2Nick Pelly return new ProviderPropertiesUnbundled(new ProviderProperties(requiresNetwork, 366fa9ad4afcd762aea519ff61811386c23d18ddb2Nick Pelly requiresSatellite, requiresCell, hasMonetaryCost, supportsAltitude, supportsSpeed, 376fa9ad4afcd762aea519ff61811386c23d18ddb2Nick Pelly supportsBearing, powerRequirement, accuracy)); 386fa9ad4afcd762aea519ff61811386c23d18ddb2Nick Pelly } 396fa9ad4afcd762aea519ff61811386c23d18ddb2Nick Pelly 406fa9ad4afcd762aea519ff61811386c23d18ddb2Nick Pelly private ProviderPropertiesUnbundled(ProviderProperties properties) { 416fa9ad4afcd762aea519ff61811386c23d18ddb2Nick Pelly mProperties = properties; 426fa9ad4afcd762aea519ff61811386c23d18ddb2Nick Pelly } 436fa9ad4afcd762aea519ff61811386c23d18ddb2Nick Pelly 446fa9ad4afcd762aea519ff61811386c23d18ddb2Nick Pelly public ProviderProperties getProviderProperties() { 456fa9ad4afcd762aea519ff61811386c23d18ddb2Nick Pelly return mProperties; 466fa9ad4afcd762aea519ff61811386c23d18ddb2Nick Pelly } 476fa9ad4afcd762aea519ff61811386c23d18ddb2Nick Pelly 486fa9ad4afcd762aea519ff61811386c23d18ddb2Nick Pelly @Override 496fa9ad4afcd762aea519ff61811386c23d18ddb2Nick Pelly public String toString() { 506fa9ad4afcd762aea519ff61811386c23d18ddb2Nick Pelly return mProperties.toString(); 516fa9ad4afcd762aea519ff61811386c23d18ddb2Nick Pelly } 526fa9ad4afcd762aea519ff61811386c23d18ddb2Nick Pelly} 53