flag for services created by user

This commit is contained in:
arrase 2016-11-22 00:12:38 +01:00
parent f58265ae9f
commit dbc7ff3b7d
4 changed files with 7 additions and 2 deletions

View File

@ -28,7 +28,9 @@ public class HiddenServicesActivity extends AppCompatActivity {
HSContentProvider.HiddenService._ID, HSContentProvider.HiddenService._ID,
HSContentProvider.HiddenService.NAME, HSContentProvider.HiddenService.NAME,
HSContentProvider.HiddenService.PORT, HSContentProvider.HiddenService.PORT,
HSContentProvider.HiddenService.DOMAIN}; HSContentProvider.HiddenService.DOMAIN,
HSContentProvider.HiddenService.CREATED_BY_USER
};
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
@ -53,7 +55,7 @@ public class HiddenServicesActivity extends AppCompatActivity {
mAdapter = new OnionListAdapter( mAdapter = new OnionListAdapter(
this, this,
mCR.query( mCR.query(
HSContentProvider.CONTENT_URI, mProjection, null, null, null HSContentProvider.CONTENT_URI, mProjection, "created_by_user=1", null, null
), ),
0 0
); );

View File

@ -16,6 +16,7 @@ public class HSDatabase extends SQLiteOpenHelper {
"name TEXT, " + "name TEXT, " +
"domain TEXT, " + "domain TEXT, " +
"onion_port INTEGER, " + "onion_port INTEGER, " +
"created_by_user INTEGER DEFAULT 0, " +
"port INTEGER);"; "port INTEGER);";
public HSDatabase(Context context) { public HSDatabase(Context context) {

View File

@ -80,6 +80,7 @@ public class HSDataDialog extends DialogFragment {
fields.put("name", name); fields.put("name", name);
fields.put("port", local); fields.put("port", local);
fields.put("onion_port", remote); fields.put("onion_port", remote);
fields.put("created_by_user", 1);
ContentResolver cr = getContext().getContentResolver(); ContentResolver cr = getContext().getContentResolver();

View File

@ -126,6 +126,7 @@ public class HSContentProvider extends ContentProvider {
public static final String PORT = "port"; public static final String PORT = "port";
public static final String ONION_PORT = "onion_port"; public static final String ONION_PORT = "onion_port";
public static final String DOMAIN = "domain"; public static final String DOMAIN = "domain";
public static final String CREATED_BY_USER = "created_by_user";
private HiddenService() { private HiddenService() {
} }