Преглед изворни кода

Add permission to receive context updates

master
Chris Smith пре 14 година
родитељ
комит
79b56003a1

+ 5
- 0
code/ContextAnalyser/AndroidManifest.xml Прегледај датотеку

@@ -12,6 +12,11 @@
12 12
         <service android:name=".ContextAnalyserService" android:label="Context Analyser Service"/>
13 13
     </application>
14 14
 
15
+    <permission android:name="uk.co.md87.android.contextanalyser.RECEIVE_UPDATES"
16
+        android:label="@string/permlab_receiveUpdates"
17
+        android:description="@string/permdesc_receiveUpdates"
18
+        android:protectionLevel="dangerous" />
19
+
15 20
     <uses-permission android:name="android.permission.READ_PHONE_STATE"/>
16 21
     <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
17 22
     <uses-permission android:name="android.permission.INTERNET"/>

BIN
code/ContextAnalyser/dist/ContextAnalyser.apk Прегледај датотеку


+ 6
- 0
code/ContextAnalyser/res/values/strings.xml Прегледај датотеку

@@ -1,4 +1,10 @@
1 1
 <?xml version="1.0" encoding="UTF-8"?>
2 2
 <resources>
3 3
     <string name="app_name">ContextAnalyser</string>
4
+
5
+    <string name="permlab_receiveUpdates">receive context updates</string>
6
+    <string name="permdesc_receiveUpdates">Allows the application to query and
7
+        receive updates about your current context, which includes your
8
+        location and activity.</string>
9
+
4 10
 </resources>

+ 2
- 2
code/ContextAnalyser/src/uk/co/md87/android/contextanalyser/ContextAnalyserService.java Прегледај датотеку

@@ -183,7 +183,7 @@ public class ContextAnalyserService extends Service {
183 183
             intent.putExtra("type", CONTEXT_PLACE);
184 184
             intent.putExtra("old", oldId);
185 185
             intent.putExtra("new", lastLocation.getId());
186
-            sendBroadcast(intent);
186
+            sendBroadcast(intent, Manifest.permission.RECEIVE_UPDATES);
187 187
         }
188 188
     }
189 189
 
@@ -200,7 +200,7 @@ public class ContextAnalyserService extends Service {
200 200
             final Intent intent = new Intent(ACTIVITY_CHANGED_INTENT);
201 201
             intent.putExtra("old", lastActivity);
202 202
             intent.putExtra("new", newActivity);
203
-            sendBroadcast(intent);
203
+            sendBroadcast(intent, Manifest.permission.RECEIVE_UPDATES);
204 204
 
205 205
             lastActivity = newActivity;
206 206
         }

+ 14
- 0
code/ContextAnalyser/src/uk/co/md87/android/contextanalyser/Manifest.java Прегледај датотеку

@@ -0,0 +1,14 @@
1
+/* AUTO-GENERATED FILE.  DO NOT MODIFY.
2
+ *
3
+ * This class was automatically generated by the
4
+ * aapt tool from the resource data it found.  It
5
+ * should not be modified by hand.
6
+ */
7
+
8
+package uk.co.md87.android.contextanalyser;
9
+
10
+public final class Manifest {
11
+    public static final class permission {
12
+        public static final String RECEIVE_UPDATES="uk.co.md87.android.contextanalyser.RECEIVE_UPDATES";
13
+    }
14
+}

+ 2
- 0
code/ContextAnalyser/src/uk/co/md87/android/contextanalyser/R.java Прегледај датотеку

@@ -21,5 +21,7 @@ public final class R {
21 21
     }
22 22
     public static final class string {
23 23
         public static final int app_name=0x7f050000;
24
+        public static final int permdesc_receiveUpdates=0x7f050002;
25
+        public static final int permlab_receiveUpdates=0x7f050001;
24 26
     }
25 27
 }

Loading…
Откажи
Сачувај