mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-24 16:57:50 +00:00
Merge pull request #40 from loki-project/disable-permissions
Disabled unused permissions
This commit is contained in:
commit
28c5d0d11c
@ -11,9 +11,11 @@
|
||||
|
||||
<uses-feature android:name="android.hardware.camera" android:required="false" />
|
||||
<uses-feature android:name="android.hardware.bluetooth" android:required="false" />
|
||||
<!-- Loki - Enable again once we have location sharing
|
||||
<uses-feature android:name="android.hardware.location" android:required="false"/>
|
||||
<uses-feature android:name="android.hardware.location.network" android:required="false"/>
|
||||
<uses-feature android:name="android.hardware.location.gps" android:required="false"/>
|
||||
-->
|
||||
<uses-feature android:name="android.hardware.microphone" android:required="false"/>
|
||||
<uses-feature android:name="android.hardware.wifi" android:required="false"/>
|
||||
<uses-feature android:name="android.hardware.portrait" android:required="false"/>
|
||||
@ -26,10 +28,12 @@
|
||||
<uses-permission android:name="android.permission.WRITE_PROFILE"/>
|
||||
<uses-permission android:name="android.permission.BROADCAST_WAP_PUSH"
|
||||
tools:ignore="ProtectedPermissions"/>
|
||||
|
||||
<!-- Loki - We don't need these at all
|
||||
<uses-permission android:name="android.permission.READ_CONTACTS"/>
|
||||
<uses-permission android:name="android.permission.WRITE_CONTACTS"/>
|
||||
|
||||
<!-- <uses-permission android:name="android.permission.RECEIVE_SMS"/>
|
||||
<uses-permission android:name="android.permission.RECEIVE_SMS"/>
|
||||
<uses-permission android:name="android.permission.RECEIVE_MMS"/>
|
||||
<uses-permission android:name="android.permission.READ_SMS"/>
|
||||
<uses-permission android:name="android.permission.SEND_SMS"/>
|
||||
@ -40,12 +44,14 @@
|
||||
|
||||
<uses-permission android:name="android.permission.CAMERA" />
|
||||
|
||||
<!-- Loki - Enable again once we have location sharing
|
||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
|
||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
|
||||
-->
|
||||
|
||||
<uses-permission android:name="android.permission.RECORD_AUDIO" />
|
||||
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
|
||||
<uses-permission android:name="android.permission.READ_CALL_STATE"/>
|
||||
<!-- <uses-permission android:name="android.permission.READ_CALL_STATE"/> -->
|
||||
|
||||
<!-- For sending/receiving events -->
|
||||
<uses-permission android:name="android.permission.WRITE_CALENDAR"/>
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user