ProviderRequestUnbundled.java revision 08ca1046fe4f1890f91241f8d082a024ef6cfd93
1/*
2 * Copyright (C) 2012 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
17package com.android.location.provider;
18
19import java.util.List;
20
21import android.location.LocationRequest;
22
23import com.android.internal.location.ProviderRequest;
24
25/**
26 * This class is a public API for unbundled providers,
27 * that hides the (hidden framework) ProviderRequest.
28 * <p>Do _not_ remove public methods on this class.
29 */
30public final class ProviderRequestUnbundled {
31    private final ProviderRequest mRequest;
32
33    public ProviderRequestUnbundled(ProviderRequest request) {
34        mRequest = request;
35    }
36
37    public boolean getReportLocation() {
38        return mRequest.reportLocation;
39    }
40
41    public long getInterval() {
42        return mRequest.interval;
43    }
44
45    /**
46     * Never null.
47     */
48    public List<LocationRequest> getLocationRequests() {
49        return mRequest.locationRequests;
50    }
51
52    @Override
53    public String toString() {
54        return mRequest.toString();
55    }
56}
57