commit dbc7ff3b7da3170069dcbe4a9c4b4ca82169169f Author: arrase arrase@gmail.com Date: Tue Nov 22 00:12:38 2016 +0100
flag for services created by user --- .../java/org/torproject/android/ui/hs/HiddenServicesActivity.java | 6 ++++-- .../main/java/org/torproject/android/ui/hs/database/HSDatabase.java | 1 + .../java/org/torproject/android/ui/hs/dialogs/HSDataDialog.java | 1 + .../org/torproject/android/ui/hs/providers/HSContentProvider.java | 1 + 4 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/app/src/main/java/org/torproject/android/ui/hs/HiddenServicesActivity.java b/app/src/main/java/org/torproject/android/ui/hs/HiddenServicesActivity.java index 57cc499..ae5e7fd 100644 --- a/app/src/main/java/org/torproject/android/ui/hs/HiddenServicesActivity.java +++ b/app/src/main/java/org/torproject/android/ui/hs/HiddenServicesActivity.java @@ -28,7 +28,9 @@ public class HiddenServicesActivity extends AppCompatActivity { HSContentProvider.HiddenService._ID, HSContentProvider.HiddenService.NAME, HSContentProvider.HiddenService.PORT, - HSContentProvider.HiddenService.DOMAIN}; + HSContentProvider.HiddenService.DOMAIN, + HSContentProvider.HiddenService.CREATED_BY_USER + };
@Override protected void onCreate(Bundle savedInstanceState) { @@ -53,7 +55,7 @@ public class HiddenServicesActivity extends AppCompatActivity { mAdapter = new OnionListAdapter( this, mCR.query( - HSContentProvider.CONTENT_URI, mProjection, null, null, null + HSContentProvider.CONTENT_URI, mProjection, "created_by_user=1", null, null ), 0 ); diff --git a/app/src/main/java/org/torproject/android/ui/hs/database/HSDatabase.java b/app/src/main/java/org/torproject/android/ui/hs/database/HSDatabase.java index cafa7ed..07e2ca2 100644 --- a/app/src/main/java/org/torproject/android/ui/hs/database/HSDatabase.java +++ b/app/src/main/java/org/torproject/android/ui/hs/database/HSDatabase.java @@ -16,6 +16,7 @@ public class HSDatabase extends SQLiteOpenHelper { "name TEXT, " + "domain TEXT, " + "onion_port INTEGER, " + + "created_by_user INTEGER DEFAULT 0, " + "port INTEGER);";
public HSDatabase(Context context) { diff --git a/app/src/main/java/org/torproject/android/ui/hs/dialogs/HSDataDialog.java b/app/src/main/java/org/torproject/android/ui/hs/dialogs/HSDataDialog.java index cdd9ce4..922b7f0 100644 --- a/app/src/main/java/org/torproject/android/ui/hs/dialogs/HSDataDialog.java +++ b/app/src/main/java/org/torproject/android/ui/hs/dialogs/HSDataDialog.java @@ -80,6 +80,7 @@ public class HSDataDialog extends DialogFragment { fields.put("name", name); fields.put("port", local); fields.put("onion_port", remote); + fields.put("created_by_user", 1);
ContentResolver cr = getContext().getContentResolver();
diff --git a/app/src/main/java/org/torproject/android/ui/hs/providers/HSContentProvider.java b/app/src/main/java/org/torproject/android/ui/hs/providers/HSContentProvider.java index efde07f..2c031d8 100644 --- a/app/src/main/java/org/torproject/android/ui/hs/providers/HSContentProvider.java +++ b/app/src/main/java/org/torproject/android/ui/hs/providers/HSContentProvider.java @@ -126,6 +126,7 @@ public class HSContentProvider extends ContentProvider { public static final String PORT = "port"; public static final String ONION_PORT = "onion_port"; public static final String DOMAIN = "domain"; + public static final String CREATED_BY_USER = "created_by_user";
private HiddenService() { }
tor-commits@lists.torproject.org