Search in sources :

Example 1 with ThrottledDebouncer

use of org.thoughtcrime.securesms.util.ThrottledDebouncer in project Signal-Android by WhisperSystems.

the class WebRtcCallActivity method onCreate.

@SuppressLint("SourceLockedOrientationActivity")
@Override
public void onCreate(Bundle savedInstanceState) {
    Log.i(TAG, "onCreate()");
    getWindow().addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED);
    getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
    super.onCreate(savedInstanceState);
    boolean isLandscapeEnabled = getResources().getConfiguration().smallestScreenWidthDp >= 480;
    if (!isLandscapeEnabled) {
        setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
    }
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    setContentView(R.layout.webrtc_call_activity);
    fullscreenHelper = new FullscreenHelper(this);
    setVolumeControlStream(AudioManager.STREAM_VOICE_CALL);
    initializeResources();
    initializeViewModel(isLandscapeEnabled);
    processIntent(getIntent());
    enableVideoIfAvailable = getIntent().getBooleanExtra(EXTRA_ENABLE_VIDEO_IF_AVAILABLE, false);
    getIntent().removeExtra(EXTRA_ENABLE_VIDEO_IF_AVAILABLE);
    windowManager = new androidx.window.WindowManager(this);
    windowLayoutInfoConsumer = new WindowLayoutInfoConsumer();
    windowManager.registerLayoutChangeCallback(SignalExecutors.BOUNDED, windowLayoutInfoConsumer);
    requestNewSizesThrottle = new ThrottledDebouncer(TimeUnit.SECONDS.toMillis(1));
}
Also used : ThrottledDebouncer(org.thoughtcrime.securesms.util.ThrottledDebouncer) FullscreenHelper(org.thoughtcrime.securesms.util.FullscreenHelper) SuppressLint(android.annotation.SuppressLint)

Example 2 with ThrottledDebouncer

use of org.thoughtcrime.securesms.util.ThrottledDebouncer in project Signal-Android by signalapp.

the class WebRtcCallActivity method onCreate.

@SuppressLint("SourceLockedOrientationActivity")
@Override
public void onCreate(Bundle savedInstanceState) {
    Log.i(TAG, "onCreate()");
    getWindow().addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED);
    getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
    super.onCreate(savedInstanceState);
    boolean isLandscapeEnabled = getResources().getConfiguration().smallestScreenWidthDp >= 480;
    if (!isLandscapeEnabled) {
        setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
    }
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    setContentView(R.layout.webrtc_call_activity);
    fullscreenHelper = new FullscreenHelper(this);
    setVolumeControlStream(AudioManager.STREAM_VOICE_CALL);
    initializeResources();
    initializeViewModel(isLandscapeEnabled);
    processIntent(getIntent());
    enableVideoIfAvailable = getIntent().getBooleanExtra(EXTRA_ENABLE_VIDEO_IF_AVAILABLE, false);
    getIntent().removeExtra(EXTRA_ENABLE_VIDEO_IF_AVAILABLE);
    windowManager = new androidx.window.WindowManager(this);
    windowLayoutInfoConsumer = new WindowLayoutInfoConsumer();
    windowManager.registerLayoutChangeCallback(SignalExecutors.BOUNDED, windowLayoutInfoConsumer);
    requestNewSizesThrottle = new ThrottledDebouncer(TimeUnit.SECONDS.toMillis(1));
}
Also used : ThrottledDebouncer(org.thoughtcrime.securesms.util.ThrottledDebouncer) FullscreenHelper(org.thoughtcrime.securesms.util.FullscreenHelper) SuppressLint(android.annotation.SuppressLint)

Aggregations

SuppressLint (android.annotation.SuppressLint)2 FullscreenHelper (org.thoughtcrime.securesms.util.FullscreenHelper)2 ThrottledDebouncer (org.thoughtcrime.securesms.util.ThrottledDebouncer)2