28
28
import android .content .Context ;
29
29
import android .content .Intent ;
30
30
import android .content .SharedPreferences ;
31
- import android .content .res .AssetFileDescriptor ;
32
31
import android .graphics .Color ;
33
32
import android .graphics .drawable .Drawable ;
34
33
import android .hardware .Sensor ;
49
48
import android .preference .PreferenceManager ;
50
49
import android .util .Log ;
51
50
import android .view .MotionEvent ;
52
- import android .view .OrientationEventListener ;
53
51
import android .view .SurfaceHolder ;
54
52
import android .view .View ;
55
53
import android .view .ViewGroup ;
61
59
import android .widget .TextView ;
62
60
63
61
import com .etiennelawlor .discreteslider .library .ui .DiscreteSlider ;
64
- import com .google .common .util .concurrent .ListenableFuture ;
65
62
import com .google .speech .levelmeter .BarLevelDrawable ;
66
63
import com .mikepenz .google_material_typeface_library .GoogleMaterial ;
67
64
import com .mikepenz .iconics .IconicsDrawable ;
68
65
69
- import java .io .FileInputStream ;
70
66
import java .io .IOException ;
71
67
import java .nio .ByteBuffer ;
72
- import java .nio .MappedByteBuffer ;
73
- import java .nio .channels .FileChannel ;
74
- import java .util .concurrent .Executors ;
75
68
76
- import androidx .annotation .NonNull ;
77
69
import androidx .annotation .RequiresApi ;
78
70
import androidx .appcompat .app .AppCompatActivity ;
79
- import androidx .camera .core .CameraSelector ;
80
- import androidx .camera .core .ImageAnalysis ;
81
- import androidx .camera .core .Preview ;
82
- import androidx .camera .lifecycle .ProcessCameraProvider ;
83
- import androidx .camera .view .PreviewView ;
84
- import androidx .core .content .ContextCompat ;
85
- import androidx .lifecycle .LifecycleOwner ;
86
71
87
72
import static android .media .MediaCodec .BUFFER_FLAG_END_OF_STREAM ;
88
73
import static com .zoffcc .applications .nativeaudio .NativeAudio .get_aec_active ;
@@ -174,14 +159,8 @@ public class CallingActivity extends AppCompatActivity implements CameraWrapper.
174
159
static boolean trifa_is_MicrophoneMute = false ;
175
160
private static final String TAG = "trifa.CallingActivity" ;
176
161
static CameraSurfacePreview cameraSurfacePreview = null ;
177
- static PreviewView cameraXPreview = null ;
178
162
static CameraDrawingOverlay drawingOverlay = null ;
179
- static ProcessCameraProvider cameraProvider = null ;
180
- static ListenableFuture <ProcessCameraProvider > cameraProviderListenableFuture = null ;
181
163
static float mPreviewRate = -1f ;
182
- // static int front_camera_id = -1;
183
- // static int back_camera_id = -1;
184
- // static int active_camera_id = 0;
185
164
static AudioRecording audio_thread = null ;
186
165
static AudioReceiver audio_receiver_thread = null ;
187
166
private SensorManager sensor_manager = null ;
@@ -515,8 +494,8 @@ public void onProgressChanged(SeekBar s, int progress_value, boolean from_user)
515
494
try
516
495
{
517
496
int res = toxav_option_set (tox_friend_by_public_key__wrapper (Callstate .friend_pubkey ),
518
- ToxVars .TOXAV_OPTIONS_OPTION .TOXAV_DECODER_VIDEO_ADD_DELAY_MS .value ,
519
- -PREF__video_play_delay_ms );
497
+ ToxVars .TOXAV_OPTIONS_OPTION .TOXAV_DECODER_VIDEO_ADD_DELAY_MS .value ,
498
+ -PREF__video_play_delay_ms );
520
499
Log .i (TAG , "play_delay_ms=" + -PREF__video_play_delay_ms + ":res=" + res );
521
500
}
522
501
catch (Exception e )
@@ -1254,7 +1233,8 @@ public boolean onTouch(View v, MotionEvent event)
1254
1233
}
1255
1234
else
1256
1235
{
1257
- Log .i (TAG , "accept_button:onTouch:003 " + Callstate .accepted_call + " " + Callstate .friend_pubkey );
1236
+ Log .i (TAG ,
1237
+ "accept_button:onTouch:003 " + Callstate .accepted_call + " " + Callstate .friend_pubkey );
1258
1238
if (Callstate .accepted_call != 1 )
1259
1239
{
1260
1240
Log .i (TAG , "answer button pressed" );
@@ -1677,7 +1657,7 @@ protected void onResume()
1677
1657
sensor_manager .registerListener (this , proximity_sensor , SensorManager .SENSOR_DELAY_NORMAL );
1678
1658
sensor_manager .registerListener (this , accelerometer_sensor , SensorManager .SENSOR_DELAY_NORMAL );
1679
1659
1680
- Log .i (TAG ,"restart_audio_system__normal_call:101" );
1660
+ Log .i (TAG , "restart_audio_system__normal_call:101" );
1681
1661
HelperGeneric .restart_audio_system ();
1682
1662
1683
1663
// update call time every second -----------
@@ -1818,7 +1798,7 @@ protected void onPause()
1818
1798
{
1819
1799
set_rec_preset (true );
1820
1800
}
1821
- catch (Exception ignored )
1801
+ catch (Exception ignored )
1822
1802
{
1823
1803
}
1824
1804
@@ -1834,7 +1814,7 @@ else if (Callstate.audio_ngc_group_active)
1834
1814
}
1835
1815
else
1836
1816
{
1837
- Log .i (TAG ,"restart_audio_system__normal_call:005:preset_TRUE" );
1817
+ Log .i (TAG , "restart_audio_system__normal_call:005:preset_TRUE" );
1838
1818
HelperGeneric .restart_audio_system ();
1839
1819
}
1840
1820
}
@@ -2004,11 +1984,9 @@ public void run()
2004
1984
2005
1985
private void initUI ()
2006
1986
{
2007
- cameraXPreview = findViewById (R .id .camera_preview_view );
2008
1987
drawingOverlay = findViewById (R .id .camera_drawing_overlay );
2009
1988
cameraSurfacePreview = (CameraSurfacePreview ) findViewById (R .id .camera_surfaceview );
2010
1989
2011
- cameraXPreview .setVisibility (View .INVISIBLE );
2012
1990
drawingOverlay .setVisibility (View .INVISIBLE );
2013
1991
}
2014
1992
@@ -2074,7 +2052,6 @@ public void turnOnScreen__new()
2074
2052
{
2075
2053
try
2076
2054
{
2077
- // calling_activity_top_viewgroup_vg.setVisibility(View.VISIBLE);
2078
2055
mContentView .setVisibility (View .VISIBLE );
2079
2056
}
2080
2057
catch (Exception e )
@@ -2093,7 +2070,6 @@ public void turnOffScreen__new()
2093
2070
{
2094
2071
// in case the phone does not really turn the screen off
2095
2072
mContentView .setVisibility (View .INVISIBLE );
2096
- // calling_activity_top_viewgroup_vg.setVisibility(View.INVISIBLE);
2097
2073
}
2098
2074
catch (Exception e )
2099
2075
{
0 commit comments