Skip to content

Commit 853226b

Browse files
committed
Move LocationTracker test app from vendor/google to frameworks/base/tests
Change-Id: I49f1bfe2081f2c48fcb22b74aa2377857c2bae6d Signed-off-by: Mike Lockwood <lockwood@android.com>
1 parent 9a35230 commit 853226b

File tree

17 files changed

+1809
-0
lines changed

17 files changed

+1809
-0
lines changed

tests/LocationTracker/Android.mk

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
LOCAL_PATH:= $(call my-dir)
2+
include $(CLEAR_VARS)
3+
4+
LOCAL_SRC_FILES := $(call all-subdir-java-files)
5+
6+
LOCAL_PACKAGE_NAME := LocationTracker
7+
8+
LOCAL_MODULE_TAGS := tests
9+
10+
include $(BUILD_PACKAGE)
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2+
package="com.android.locationtracker">
3+
4+
<!-- Permissions for the Location Service -->
5+
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
6+
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
7+
8+
<!-- Permission for wifi -->
9+
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
10+
11+
<!-- give the location tracker ability to induce device insomnia -->
12+
<uses-permission android:name="android.permission.WAKE_LOCK" />
13+
14+
<!-- Permission for SD card -->
15+
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
16+
17+
<application android:label="@string/app_label">
18+
<activity android:name="TrackerActivity" android:label="Location Tracker">
19+
<intent-filter>
20+
<action android:name="android.intent.action.MAIN" />
21+
<category android:name="android.intent.category.LAUNCHER" />
22+
</intent-filter>
23+
</activity>
24+
<service android:name=".TrackerService" />
25+
<activity android:label="@string/settings_menu" android:name="SettingsActivity" />
26+
<provider android:name=".data.TrackerProvider"
27+
android:authorities="com.android.locationtracker" />
28+
</application>
29+
30+
</manifest>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
/*
4+
* Copyright (C) 2006-2008 The Android Open Source Project
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
-->
19+
20+
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
21+
android:id="@+id/entrylist_item"
22+
android:layout_width="wrap_content"
23+
android:layout_height="wrap_content"
24+
android:textAppearance="?android:attr/textAppearanceSmall"
25+
/>
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
/**
4+
* Copyright (c) 2008 The Android Open Source Project
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
-->
19+
<menu xmlns:android="http://schemas.android.com/apk/res/android">
20+
<item android:id="@+id/start_service_menu"
21+
android:title="@string/start_service_menu" />
22+
<item android:id="@+id/stop_service_menu"
23+
android:title="@string/stop_service_menu" />
24+
<item android:id="@+id/settings_menu"
25+
android:title="@string/settings_menu" />
26+
<item android:id="@+id/export_sub_menu"
27+
android:title="@string/export_sub_menu">
28+
<menu>
29+
<item android:id="@+id/export_kml"
30+
android:title="@string/export_kml" />
31+
<item android:id="@+id/export_csv"
32+
android:title="@string/export_csv" />
33+
</menu>
34+
</item>
35+
<item android:title="@string/clear_data"
36+
android:id="@+id/clear_data_menu"/>
37+
</menu>
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
/*
4+
* Copyright (C) 2008 The Android Open Source Project
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
-->
19+
20+
<resources>
21+
<string name="start_service_menu">Start Service</string>
22+
<string name="stop_service_menu">Stop Service</string>
23+
<string name="settings_menu">Settings</string>
24+
<string name="update_preference">Update frequency</string>
25+
<string name="title_mintime_preference">Minimum update time</string>
26+
<string name="summary_mintime_preference">The suggested minimum time interval for location updates, in seconds</string>
27+
<string name="dialog_title_mintime_preference">Minimum update time</string>
28+
<string name="title_mindistance_preference">Minimum distance</string>
29+
<string name="summary_mindistance_preference">Minimum distance interval for location updates, in meters</string>
30+
<string name="dialog_title_mindistance_preference">Minimum distance</string>
31+
<string name="provider_preferences">Location providers</string>
32+
<string name="title_network_preference">Network location</string>
33+
<string name="summary_network_preference">Listen for updates to network location (Wi-Fi/cellid)</string>
34+
<string name="title_gps_preference">GPS location</string>
35+
<string name="summary_gps_preference">Listen for updates to GPS location</string>
36+
<string name="title_signal_preference">Signal strength</string>
37+
<string name="summary_signal_preference">Listen for updates to signal strength</string>
38+
<string name="advanced_preferences">Advanced</string>
39+
<string name="title_advanced_log_preference">Location debug logging</string>
40+
<string name="summary_advanced_preference">Logs detailed location data, only relevant for location/test engineers</string>
41+
<string name="app_label">Location Tracker</string>
42+
<string name="export_sub_menu">Export\u2026</string>
43+
<string name="export_kml">Export As KML</string>
44+
<string name="export_csv">Export As CSV</string>
45+
<string name="clear_data">Clear data</string>
46+
<string name="delete_confirm">All current tracking data will be deleted.</string>
47+
<string name="confirm_title">Clear data</string>
48+
</resources>
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- Copyright (C) 2008 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+
<!-- The Location preferences UI -->
18+
<PreferenceScreen
19+
xmlns:android="http://schemas.android.com/apk/res/android">
20+
21+
<PreferenceCategory android:title="@string/update_preference">
22+
<EditTextPreference android:key="mintime_preference"
23+
android:defaultValue="0"
24+
android:title="@string/title_mintime_preference"
25+
android:summary="@string/summary_mintime_preference"
26+
android:dialogTitle="@string/dialog_title_mintime_preference" />
27+
28+
<EditTextPreference android:key="mindistance_preference"
29+
android:defaultValue="0"
30+
android:title="@string/title_mindistance_preference"
31+
android:summary="@string/summary_mindistance_preference"
32+
android:dialogTitle="@string/dialog_title_mindistance_preference" />
33+
34+
</PreferenceCategory>
35+
36+
<PreferenceCategory android:title="@string/provider_preferences">
37+
38+
<CheckBoxPreference android:key="network_preference"
39+
android:defaultValue="true"
40+
android:title="@string/title_network_preference"
41+
android:summary="@string/summary_network_preference" />
42+
43+
<CheckBoxPreference android:key="gps_preference"
44+
android:defaultValue="true"
45+
android:title="@string/title_gps_preference"
46+
android:summary="@string/summary_gps_preference" />
47+
48+
<CheckBoxPreference android:key="signal_preference"
49+
android:defaultValue="false"
50+
android:title="@string/title_signal_preference"
51+
android:summary="@string/summary_signal_preference" />
52+
53+
</PreferenceCategory>
54+
55+
<PreferenceCategory android:title="@string/advanced_preferences">
56+
57+
<CheckBoxPreference android:key="advanced_log_preference"
58+
android:defaultValue="false"
59+
android:title="@string/title_advanced_log_preference"
60+
android:summary="@string/summary_advanced_preference" />
61+
</PreferenceCategory>
62+
63+
</PreferenceScreen>
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/*
2+
* Copyright (C) 2008 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 com.android.locationtracker;
18+
19+
import android.os.Bundle;
20+
import android.preference.PreferenceActivity;
21+
22+
/**
23+
* Settings preference screen for location tracker
24+
*/
25+
public class SettingsActivity extends PreferenceActivity {
26+
27+
@Override
28+
protected void onCreate(Bundle savedInstanceState) {
29+
super.onCreate(savedInstanceState);
30+
31+
// Load the preferences from an XML resource
32+
addPreferencesFromResource(R.xml.preferences);
33+
}
34+
35+
}

0 commit comments

Comments
 (0)