Hide exit button from statusbar while in call
This commit is contained in:
parent
dd85cada65
commit
a3931bf307
4 changed files with 11 additions and 10 deletions
|
@ -548,7 +548,7 @@ public class InCallActivity extends FragmentActivity implements
|
||||||
public void onCallEncryptionChanged(LinphoneCall call, boolean encrypted,
|
public void onCallEncryptionChanged(LinphoneCall call, boolean encrypted,
|
||||||
String authenticationToken) {
|
String authenticationToken) {
|
||||||
if (status != null) {
|
if (status != null) {
|
||||||
status.refreshEncryptionIcon();
|
status.refreshStatusItems();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -969,7 +969,7 @@ public final class LinphoneManager implements LinphoneCoreListener {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (state == IncomingReceived || (state == state.CallIncomingEarlyMedia && mR.getBoolean(R.bool.allow_ringing_while_early_media))) {
|
if (state == IncomingReceived || (state == State.CallIncomingEarlyMedia && mR.getBoolean(R.bool.allow_ringing_while_early_media))) {
|
||||||
// Brighten screen for at least 10 seconds
|
// Brighten screen for at least 10 seconds
|
||||||
WakeLock wl = mPowerManager.newWakeLock(
|
WakeLock wl = mPowerManager.newWakeLock(
|
||||||
PowerManager.ACQUIRE_CAUSES_WAKEUP
|
PowerManager.ACQUIRE_CAUSES_WAKEUP
|
||||||
|
|
|
@ -40,7 +40,7 @@ public class StatusFragment extends Fragment {
|
||||||
private static StatusFragment instance;
|
private static StatusFragment instance;
|
||||||
private Handler mHandler = new Handler();
|
private Handler mHandler = new Handler();
|
||||||
private Handler refreshHandler = new Handler();
|
private Handler refreshHandler = new Handler();
|
||||||
private TextView statusText;
|
private TextView statusText, exit;
|
||||||
private ImageView statusLed, callQuality, encryption;
|
private ImageView statusLed, callQuality, encryption;
|
||||||
private SlidingDrawer drawer;
|
private SlidingDrawer drawer;
|
||||||
private Runnable mCallQualityUpdater;
|
private Runnable mCallQualityUpdater;
|
||||||
|
@ -58,7 +58,8 @@ public class StatusFragment extends Fragment {
|
||||||
encryption = (ImageView) view.findViewById(R.id.encryption);
|
encryption = (ImageView) view.findViewById(R.id.encryption);
|
||||||
|
|
||||||
drawer = (SlidingDrawer) view.findViewById(R.id.statusBar);
|
drawer = (SlidingDrawer) view.findViewById(R.id.statusBar);
|
||||||
view.findViewById(R.id.exit).setOnClickListener(new OnClickListener() {
|
exit = (TextView) view.findViewById(R.id.exit);
|
||||||
|
exit.setOnClickListener(new OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
LinphoneActivity.instance().exit();
|
LinphoneActivity.instance().exit();
|
||||||
|
@ -191,7 +192,7 @@ public class StatusFragment extends Fragment {
|
||||||
|
|
||||||
if (isInCall) {
|
if (isInCall) {
|
||||||
startCallQuality();
|
startCallQuality();
|
||||||
refreshEncryptionIcon();
|
refreshStatusItems();
|
||||||
|
|
||||||
// We are obviously connected
|
// We are obviously connected
|
||||||
statusLed.setImageResource(R.drawable.led_connected);
|
statusLed.setImageResource(R.drawable.led_connected);
|
||||||
|
@ -219,11 +220,12 @@ public class StatusFragment extends Fragment {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void refreshEncryptionIcon() {
|
public void refreshStatusItems() {
|
||||||
LinphoneCall call = LinphoneManager.getLc().getCurrentCall();
|
LinphoneCall call = LinphoneManager.getLc().getCurrentCall();
|
||||||
if (call != null && encryption != null) {
|
if (call != null && encryption != null) {
|
||||||
MediaEncryption mediaEncryption = call.getCurrentParamsCopy().getMediaEncryption();
|
MediaEncryption mediaEncryption = call.getCurrentParamsCopy().getMediaEncryption();
|
||||||
|
|
||||||
|
exit.setVisibility(View.GONE);
|
||||||
encryption.setVisibility(View.VISIBLE);
|
encryption.setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
if (mediaEncryption == MediaEncryption.SRTP || (mediaEncryption == MediaEncryption.ZRTP && call.isAuthenticationTokenVerified())) {
|
if (mediaEncryption == MediaEncryption.SRTP || (mediaEncryption == MediaEncryption.ZRTP && call.isAuthenticationTokenVerified())) {
|
||||||
|
@ -233,6 +235,8 @@ public class StatusFragment extends Fragment {
|
||||||
} else {
|
} else {
|
||||||
encryption.setImageResource(R.drawable.security_ko);
|
encryption.setImageResource(R.drawable.security_ko);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
exit.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,6 @@ import java.util.Set;
|
||||||
|
|
||||||
import org.linphone.Contact;
|
import org.linphone.Contact;
|
||||||
import org.linphone.core.LinphoneAddress;
|
import org.linphone.core.LinphoneAddress;
|
||||||
import org.linphone.core.Log;
|
|
||||||
import org.linphone.mediastream.Version;
|
import org.linphone.mediastream.Version;
|
||||||
|
|
||||||
import android.annotation.TargetApi;
|
import android.annotation.TargetApi;
|
||||||
|
@ -137,7 +136,6 @@ public class ApiFivePlus {
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
@TargetApi(11)
|
|
||||||
public static Cursor getContactsCursor(ContentResolver cr) {
|
public static Cursor getContactsCursor(ContentResolver cr) {
|
||||||
String req = Data.MIMETYPE + " = '" + CommonDataKinds.Phone.CONTENT_ITEM_TYPE
|
String req = Data.MIMETYPE + " = '" + CommonDataKinds.Phone.CONTENT_ITEM_TYPE
|
||||||
+ "' AND " + CommonDataKinds.Phone.NUMBER + " IS NOT NULL";
|
+ "' AND " + CommonDataKinds.Phone.NUMBER + " IS NOT NULL";
|
||||||
|
@ -261,7 +259,6 @@ public class ApiFivePlus {
|
||||||
String username = address.getUserName();
|
String username = address.getUserName();
|
||||||
String domain = address.getDomain();
|
String domain = address.getDomain();
|
||||||
String sipUri = username + "@" + domain;
|
String sipUri = username + "@" + domain;
|
||||||
Log.e("Looking for " + sipUri);
|
|
||||||
|
|
||||||
Cursor cursor = getSIPContactCursor(cr, sipUri);
|
Cursor cursor = getSIPContactCursor(cr, sipUri);
|
||||||
Contact contact = getContact(cr, cursor, 0);
|
Contact contact = getContact(cr, cursor, 0);
|
||||||
|
|
Loading…
Reference in a new issue