mirror of
https://github.com/pierre42100/ComunicAndroid
synced 2024-11-23 13:59:29 +00:00
Added a ringtone to call notification
This commit is contained in:
parent
40fce5bef3
commit
039f6d994c
@ -179,6 +179,7 @@ public class CallActivity extends BaseActivity implements SignalExchangerCallbac
|
||||
//Make sure we have access to user camera and microphone
|
||||
askForPermissions();
|
||||
|
||||
//Make the screen keeps on during the call
|
||||
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
|
||||
}
|
||||
|
||||
@ -186,6 +187,7 @@ public class CallActivity extends BaseActivity implements SignalExchangerCallbac
|
||||
protected void onPause() {
|
||||
super.onPause();
|
||||
|
||||
//Allow screen lock
|
||||
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
|
||||
}
|
||||
|
||||
|
@ -7,6 +7,7 @@ import android.app.PendingIntent;
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.media.RingtoneManager;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Build;
|
||||
import android.support.annotation.Nullable;
|
||||
@ -83,12 +84,9 @@ public class PendingCallsBroadcastReceiver extends BroadcastReceiver {
|
||||
|
||||
//Get next pending notification
|
||||
GetNextPendingCallTask task = new GetNextPendingCallTask(context);
|
||||
task.setOnPostExecuteListener(new SafeAsyncTask.OnPostExecuteListener<NextPendingCallInformation>() {
|
||||
@Override
|
||||
public void OnPostExecute(NextPendingCallInformation nextPendingCallInformation) {
|
||||
task.setOnPostExecuteListener(nextPendingCallInformation -> {
|
||||
locked = false;
|
||||
onGotCall(context, nextPendingCallInformation);
|
||||
}
|
||||
});
|
||||
task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
||||
}
|
||||
@ -129,6 +127,8 @@ public class PendingCallsBroadcastReceiver extends BroadcastReceiver {
|
||||
.setContentText(UiUtils.getString(context, R.string.notification_call_content, info.getCallName()))
|
||||
//.setContentIntent(pendingAcceptIntent)
|
||||
.setFullScreenIntent(pendingFullScreenRequestIntent, true)
|
||||
.setSound(RingtoneManager.getActualDefaultRingtoneUri(context,
|
||||
RingtoneManager.TYPE_RINGTONE))
|
||||
.setPriority(PRIORITY_HIGH);
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user