瀏覽代碼

Merge branch 'master' of https://git.tk.informatik.tu-darmstadt.de/scm-ssi-hostage-v3

Julien Clauter 9 年之前
父節點
當前提交
622998aca3

+ 5 - 0
AndroidManifest.xml

@@ -115,6 +115,11 @@
             android:exported="false" >
         </provider>
 
+        <provider
+            android:name=".sync.android.SyncContentProvider"
+            android:authorities="de.tudarmstadt.informatik.hostage.androidsync"
+            android:exported="false" />
+
         <!--<activity
             android:name=".sync.p2p.P2PSyncActivity"
             android:label="@string/title_activity_p2_psync"

+ 1 - 1
res/xml/syncadapter.xml

@@ -16,7 +16,7 @@ limitations under the License.
 -->
 
 <sync-adapter xmlns:android="http://schemas.android.com/apk/res/android"
-              android:contentAuthority="de.tudarmstadt.informatik.hostage"
+              android:contentAuthority="de.tudarmstadt.informatik.hostage.androidsync"
               android:accountType="de.tudarmstadt.informatik.hostage"
               android:userVisible="true"
               android:supportsUploading="true"

+ 38 - 0
src/de/tudarmstadt/informatik/hostage/sync/android/SyncContentProvider.java

@@ -0,0 +1,38 @@
+package de.tudarmstadt.informatik.hostage.sync.android;
+
+import android.content.ContentProvider;
+import android.content.ContentValues;
+import android.database.Cursor;
+import android.net.Uri;
+
+public class SyncContentProvider extends ContentProvider {
+    @Override
+    public boolean onCreate() {
+        return false;
+    }
+
+    @Override
+    public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) {
+        return null;
+    }
+
+    @Override
+    public String getType(Uri uri) {
+        return null;
+    }
+
+    @Override
+    public Uri insert(Uri uri, ContentValues values) {
+        return null;
+    }
+
+    @Override
+    public int delete(Uri uri, String selection, String[] selectionArgs) {
+        return 0;
+    }
+
+    @Override
+    public int update(Uri uri, ContentValues values, String selection, String[] selectionArgs) {
+        return 0;
+    }
+}

+ 1 - 1
src/de/tudarmstadt/informatik/hostage/sync/android/SyncUtils.java

@@ -67,7 +67,7 @@ public class SyncUtils {
     public static final int SYNC_SUCCESSFUL = 0x0;
     private static final long SYNC_FREQUENCY = 60 * 60;  // 1 hour (in seconds)
 
-    public static final String CONTENT_AUTHORITY = "de.tudarmstadt.informatik.hostage";
+    public static final String CONTENT_AUTHORITY = "de.tudarmstadt.informatik.hostage.androidsync";
     private static final String PREF_SETUP_COMPLETE = "sync_setup_complete";
 
     private static final Map<String, Integer> protocolsTypeMap;

+ 2 - 0
src/de/tudarmstadt/informatik/hostage/ui/adapter/ExpandableListAdapter.java

@@ -75,6 +75,8 @@ public abstract class ExpandableListAdapter extends BaseExpandableListAdapter {
 
     @Override
     public int getChildrenCount(int section) {
+        if(this._sectionTitleToChildData.size() == 0) return 0;
+
         return this._sectionTitleToChildData.get(this._sectionHeader.get(section))
                 .size();
     }