mirror of
https://github.com/nextcloud/talk-android
synced 2025-07-11 14:54:09 +01:00
Fix issues with db & permissions
Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
parent
601f8fa2a4
commit
b1722f81b3
@ -12,8 +12,8 @@ android {
|
|||||||
targetSdkVersion 27
|
targetSdkVersion 27
|
||||||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
||||||
|
|
||||||
versionCode 19
|
versionCode 20
|
||||||
versionName "1.0.9"
|
versionName "1.0.10"
|
||||||
|
|
||||||
// Enabling multidex support.
|
// Enabling multidex support.
|
||||||
multiDexEnabled true
|
multiDexEnabled true
|
||||||
|
@ -493,8 +493,13 @@ public class CallActivity extends AppCompatActivity {
|
|||||||
pipVideoView.setScalingType(RendererCommon.ScalingType.SCALE_ASPECT_FIT);
|
pipVideoView.setScalingType(RendererCommon.ScalingType.SCALE_ASPECT_FIT);
|
||||||
}
|
}
|
||||||
|
|
||||||
@AfterPermissionGranted(100)
|
|
||||||
private void checkPermissions() {
|
private void checkPermissions() {
|
||||||
|
EffortlessPermissions.requestPermissions(this, R.string.nc_permissions,
|
||||||
|
100, PERMISSIONS_CALL);
|
||||||
|
}
|
||||||
|
|
||||||
|
@AfterPermissionGranted(100)
|
||||||
|
private void onPermissionsGranted() {
|
||||||
if (EffortlessPermissions.hasPermissions(this, PERMISSIONS_CALL)) {
|
if (EffortlessPermissions.hasPermissions(this, PERMISSIONS_CALL)) {
|
||||||
if (!videoOn) {
|
if (!videoOn) {
|
||||||
onCameraClick();
|
onCameraClick();
|
||||||
@ -517,19 +522,24 @@ public class CallActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
} else if (EffortlessPermissions.somePermissionPermanentlyDenied(this,
|
} else if (EffortlessPermissions.somePermissionPermanentlyDenied(this,
|
||||||
PERMISSIONS_CALL)) {
|
PERMISSIONS_CALL)) {
|
||||||
|
checkIfSomeAreApproved();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void checkIfSomeAreApproved() {
|
||||||
if (cameraEnumerator.getDeviceNames().length == 0) {
|
if (cameraEnumerator.getDeviceNames().length == 0) {
|
||||||
cameraControlButton.setVisibility(View.GONE);
|
cameraControlButton.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (cameraSwitchButton != null && cameraEnumerator.getDeviceNames().length > 1) {
|
||||||
|
cameraSwitchButton.setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
|
|
||||||
if (EffortlessPermissions.hasPermissions(this, PERMISSIONS_CAMERA)) {
|
if (EffortlessPermissions.hasPermissions(this, PERMISSIONS_CAMERA)) {
|
||||||
if (!videoOn) {
|
if (!videoOn) {
|
||||||
onCameraClick();
|
onCameraClick();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cameraSwitchButton != null && cameraEnumerator.getDeviceNames().length > 1) {
|
|
||||||
cameraSwitchButton.setVisibility(View.VISIBLE);
|
|
||||||
}
|
|
||||||
} else if (!EffortlessPermissions.hasPermissions(this, PERMISSIONS_CAMERA)) {
|
} else if (!EffortlessPermissions.hasPermissions(this, PERMISSIONS_CAMERA)) {
|
||||||
cameraControlButton.setImageResource(R.drawable.ic_videocam_off_white_24px);
|
cameraControlButton.setImageResource(R.drawable.ic_videocam_off_white_24px);
|
||||||
if (cameraSwitchButton != null) {
|
if (cameraSwitchButton != null) {
|
||||||
@ -550,25 +560,19 @@ public class CallActivity extends AppCompatActivity {
|
|||||||
if (!inCall) {
|
if (!inCall) {
|
||||||
startCall();
|
startCall();
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
|
||||||
EffortlessPermissions.requestPermissions(this, R.string.nc_permissions,
|
|
||||||
100, PERMISSIONS_CALL);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@AfterPermissionDenied(100)
|
@AfterPermissionDenied(100)
|
||||||
private void onPermissionsDenied() {
|
private void onPermissionsDenied() {
|
||||||
if (cameraSwitchButton != null) {
|
if (cameraEnumerator.getDeviceNames().length == 0) {
|
||||||
|
cameraControlButton.setVisibility(View.GONE);
|
||||||
|
} else if (cameraEnumerator.getDeviceNames().length == 1) {
|
||||||
cameraSwitchButton.setVisibility(View.INVISIBLE);
|
cameraSwitchButton.setVisibility(View.INVISIBLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cameraEnumerator.getDeviceNames().length == 0) {
|
if (EffortlessPermissions.hasPermissions(this, PERMISSIONS_CAMERA) ||
|
||||||
cameraControlButton.setVisibility(View.GONE);
|
EffortlessPermissions.hasPermissions(this, PERMISSIONS_MICROPHONE)) {
|
||||||
}
|
checkIfSomeAreApproved();
|
||||||
|
|
||||||
if (!inCall) {
|
|
||||||
startCall();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -104,16 +104,24 @@ public final class MainActivity extends AppCompatActivity implements ActionBarPr
|
|||||||
hasDb = false;
|
hasDb = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!router.hasRootController() && hasDb && userUtils.anyUserExists()) {
|
if (!router.hasRootController()) {
|
||||||
sqlCipherDatabaseSource.close();
|
if (hasDb) {
|
||||||
|
if (userUtils.anyUserExists()) {
|
||||||
router.setRoot(RouterTransaction.with(new MagicBottomNavigationController())
|
router.setRoot(RouterTransaction.with(new MagicBottomNavigationController())
|
||||||
.pushChangeHandler(new HorizontalChangeHandler())
|
.pushChangeHandler(new HorizontalChangeHandler())
|
||||||
.popChangeHandler(new HorizontalChangeHandler()));
|
.popChangeHandler(new HorizontalChangeHandler()));
|
||||||
} else if (!router.hasRootController()) {
|
} else {
|
||||||
router.setRoot(RouterTransaction.with(new ServerSelectionController())
|
router.setRoot(RouterTransaction.with(new ServerSelectionController())
|
||||||
.pushChangeHandler(new HorizontalChangeHandler())
|
.pushChangeHandler(new HorizontalChangeHandler())
|
||||||
.popChangeHandler(new HorizontalChangeHandler()));
|
.popChangeHandler(new HorizontalChangeHandler()));
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
router.setRoot(RouterTransaction.with(new ServerSelectionController())
|
||||||
|
.pushChangeHandler(new HorizontalChangeHandler())
|
||||||
|
.popChangeHandler(new HorizontalChangeHandler()));
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user