mirror of
https://github.com/oxen-io/session-android.git
synced 2025-12-03 07:32:19 +00:00
Merge pull request #40 from loki-project/disable-permissions
Disabled unused permissions
This commit is contained in:
@@ -178,6 +178,7 @@ public class ContactSelectionListFragment extends Fragment
|
||||
showContactsDescription.setText(R.string.contact_selection_list_fragment__signal_needs_access_to_your_contacts_in_order_to_display_them);
|
||||
showContactsButton.setVisibility(View.VISIBLE);
|
||||
|
||||
/*
|
||||
showContactsButton.setOnClickListener(v -> {
|
||||
Permissions.with(this)
|
||||
.request(Manifest.permission.WRITE_CONTACTS, Manifest.permission.READ_CONTACTS)
|
||||
@@ -190,6 +191,7 @@ public class ContactSelectionListFragment extends Fragment
|
||||
})
|
||||
.execute();
|
||||
});
|
||||
*/
|
||||
}
|
||||
|
||||
public void setQueryFilter(String filter) {
|
||||
|
||||
@@ -144,6 +144,7 @@ public class ConversationListActivity extends PassphraseRequiredActionBarActivit
|
||||
|
||||
private void initializeSearchListener() {
|
||||
searchAction.setOnClickListener(v -> {
|
||||
/* Loki - We don't need contact permissions
|
||||
Permissions.with(this)
|
||||
.request(Manifest.permission.READ_CONTACTS, Manifest.permission.WRITE_CONTACTS)
|
||||
.ifNecessary()
|
||||
@@ -151,6 +152,7 @@ public class ConversationListActivity extends PassphraseRequiredActionBarActivit
|
||||
searchAction.getY() + (searchAction.getHeight() / 2)))
|
||||
.withPermanentDenialDialog(getString(R.string.ConversationListActivity_signal_needs_contacts_permission_in_order_to_search_your_contacts_but_it_has_been_permanently_denied))
|
||||
.execute();
|
||||
*/
|
||||
});
|
||||
|
||||
searchToolbar.setListener(new SearchToolbar.SearchListener() {
|
||||
|
||||
@@ -187,6 +187,8 @@ public class ContactsCursorLoader extends CursorLoader {
|
||||
ContactsDatabase contactsDatabase = DatabaseFactory.getContactsDatabase(getContext());
|
||||
List<Cursor> cursorList = new ArrayList<>(2);
|
||||
|
||||
return cursorList;
|
||||
/*
|
||||
if (!Permissions.hasAny(getContext(), Manifest.permission.READ_CONTACTS, Manifest.permission.WRITE_CONTACTS)) {
|
||||
return cursorList;
|
||||
}
|
||||
@@ -201,6 +203,7 @@ public class ContactsCursorLoader extends CursorLoader {
|
||||
cursorList.add(filterNonPushContacts(contactsDatabase.querySystemContacts(filter)));
|
||||
}
|
||||
return cursorList;
|
||||
*/
|
||||
}
|
||||
|
||||
private Cursor getGroupsCursor() {
|
||||
|
||||
@@ -1265,7 +1265,7 @@ public class ClassicOpenHelper extends SQLiteOpenHelper {
|
||||
db.execSQL("ALTER TABLE recipient_preferences ADD COLUMN system_contact_photo TEXT DEFAULT NULL");
|
||||
db.execSQL("ALTER TABLE recipient_preferences ADD COLUMN system_phone_label TEXT DEFAULT NULL");
|
||||
db.execSQL("ALTER TABLE recipient_preferences ADD COLUMN system_contact_uri TEXT DEFAULT NULL");
|
||||
|
||||
/*
|
||||
if (Permissions.hasAny(context, Manifest.permission.READ_CONTACTS, Manifest.permission.WRITE_CONTACTS)) {
|
||||
try (Cursor cursor = db.query("recipient_preferences", null, null, null, null, null, null)) {
|
||||
while (cursor != null && cursor.moveToNext()) {
|
||||
@@ -1295,6 +1295,7 @@ public class ClassicOpenHelper extends SQLiteOpenHelper {
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
db.setTransactionSuccessful();
|
||||
|
||||
@@ -410,6 +410,7 @@ public class AttachmentManager {
|
||||
}
|
||||
|
||||
public static void selectLocation(Activity activity, int requestCode) {
|
||||
/* Loki - Enable again once we have location sharing
|
||||
Permissions.with(activity)
|
||||
.request(Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION)
|
||||
.ifNecessary()
|
||||
@@ -422,6 +423,7 @@ public class AttachmentManager {
|
||||
}
|
||||
})
|
||||
.execute();
|
||||
*/
|
||||
}
|
||||
|
||||
public static void selectGif(Activity activity, int requestCode, boolean isForMms) {
|
||||
|
||||
@@ -121,6 +121,8 @@ public class SearchRepository {
|
||||
}
|
||||
|
||||
private CursorList<Recipient> queryContacts(String query) {
|
||||
return CursorList.emptyList();
|
||||
/* Loki - Don't need contact permissions
|
||||
if (!Permissions.hasAny(context, Manifest.permission.READ_CONTACTS, Manifest.permission.WRITE_CONTACTS)) {
|
||||
return CursorList.emptyList();
|
||||
}
|
||||
@@ -130,6 +132,7 @@ public class SearchRepository {
|
||||
MergeCursor contacts = new MergeCursor(new Cursor[]{ textSecureContacts, systemContacts });
|
||||
|
||||
return new CursorList<>(contacts, new RecipientModelBuilder(context));
|
||||
*/
|
||||
}
|
||||
|
||||
private CursorList<ThreadRecord> queryConversations(@NonNull String query) {
|
||||
|
||||
@@ -380,9 +380,11 @@ public class WebRtcCallService extends Service implements InjectableType,
|
||||
try {
|
||||
boolean isSystemContact = false;
|
||||
|
||||
/*
|
||||
if (Permissions.hasAny(WebRtcCallService.this, Manifest.permission.READ_CONTACTS, Manifest.permission.WRITE_CONTACTS)) {
|
||||
isSystemContact = ContactAccessor.getInstance().isSystemContact(WebRtcCallService.this, recipient.getAddress().serialize());
|
||||
}
|
||||
*/
|
||||
|
||||
boolean isAlwaysTurn = TextSecurePreferences.isTurnOnly(WebRtcCallService.this);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user