Commit 9ba7e778 authored by /e/ robot's avatar /e/ robot
Browse files

Merge remote-tracking branch 'origin/lineage-17.1' into v1-q

parents 85543d87 ba6f3695
......@@ -169,11 +169,6 @@ public class ScreencastService extends Service implements MediaProviderHelper.On
mMediaProjectionManager = getSystemService(MediaProjectionManager.class);
IntentFilter filter = new IntentFilter();
filter.addAction(Intent.ACTION_USER_BACKGROUND);
filter.addAction(Intent.ACTION_SHUTDOWN);
registerReceiver(mBroadcastReceiver, filter);
mNotificationManager = getSystemService(NotificationManager.class);
if (mNotificationManager == null || mNotificationManager.getNotificationChannel(
......@@ -190,13 +185,6 @@ public class ScreencastService extends Service implements MediaProviderHelper.On
mNotificationManager.createNotificationChannel(notificationChannel);
}
@Override
public void onDestroy() {
stopCasting();
unregisterReceiver(mBroadcastReceiver);
super.onDestroy();
}
@Override
public void onContentWritten(@Nullable String uri) {
stopForeground(true);
......@@ -229,9 +217,14 @@ public class ScreencastService extends Service implements MediaProviderHelper.On
int resultCode = intent.getIntExtra(EXTRA_RESULT_CODE, Activity.RESULT_CANCELED);
mUseAudio = intent.getBooleanExtra(EXTRA_USE_AUDIO, false);
Intent data = intent.getParcelableExtra(EXTRA_DATA);
IntentFilter filter = new IntentFilter();
filter.addAction(Intent.ACTION_USER_BACKGROUND);
filter.addAction(Intent.ACTION_SHUTDOWN);
if (data != null) {
mMediaProjection = mMediaProjectionManager.getMediaProjection(resultCode, data);
new Thread(this::startRecording).start();
startRecording();
registerReceiver(mBroadcastReceiver, filter);
}
return START_STICKY;
}
......@@ -303,7 +296,9 @@ public class ScreencastService extends Service implements MediaProviderHelper.On
mNotificationManager.notify(NOTIFICATION_ID, mBuilder.build());
}
private void stopRecording() {
private void stopCasting() {
Utils.setStatus(getApplicationContext(), Utils.PREF_RECORDING_NOTHING);
mMediaRecorder.stop();
mMediaRecorder.release();
mMediaRecorder = null;
......@@ -311,22 +306,16 @@ public class ScreencastService extends Service implements MediaProviderHelper.On
mMediaProjection = null;
mInputSurface.release();
mVirtualDisplay.release();
if (mTimer != null) {
mTimer.cancel();
mTimer = null;
}
mTimer.cancel();
mTimer = null;
MediaProviderHelper.addVideoToContentProvider(getContentResolver(), mPath, this);
}
private void stopCasting() {
Utils.setStatus(getApplicationContext(), Utils.PREF_RECORDING_NOTHING);
stopRecording();
if (hasNoAvailableSpace()) {
Toast.makeText(this, R.string.screen_not_enough_storage, Toast.LENGTH_LONG).show();
}
unregisterReceiver(mBroadcastReceiver);
stopSelf();
}
private NotificationCompat.Builder createNotificationBuilder() {
......
/*
* Copyright (C) 2019 The LineageOS Project
* Copyright (C) 2019-2020 The LineageOS Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......@@ -124,12 +124,12 @@ public final class MediaProviderHelper {
if (pfd == null) {
return null;
}
final FileOutputStream oStream = new FileOutputStream(pfd.getFileDescriptor());
oStream.write(Files.readAllBytes(file.toPath()));
Files.copy(file.toPath(), oStream);
oStream.close();
pfd.close();
final ContentValues values = new ContentValues();
values.put(MediaStore.MediaColumns.IS_PENDING, 0);
cr.update(uri, values, null, null);
......
<?xml version="1.0" encoding="utf-8"?>
<!--Generated by crowdin.com-->
<!-- Copyright (c) 2017 The LineageOS Project
Licensed under the Apache License, Version 2.0 (the "License");
......
<?xml version="1.0" encoding="utf-8"?>
<!--Generated by crowdin.com-->
<!-- Copyright (c) 2017 The LineageOS Project
Licensed under the Apache License, Version 2.0 (the "License");
......
<?xml version="1.0" encoding="utf-8"?>
<!--Generated by crowdin.com-->
<!-- Copyright (c) 2017 The LineageOS Project
Licensed under the Apache License, Version 2.0 (the "License");
......
<?xml version="1.0" encoding="utf-8"?>
<!--Generated by crowdin.com-->
<!-- Copyright (c) 2017 The LineageOS Project
Licensed under the Apache License, Version 2.0 (the "License");
......@@ -40,6 +39,7 @@
<string name="screen_notification_message_done">Paylaşmaq üçün hazırdır</string>
<string name="screen_recording_message">Ekran yazılmağa başladı\u2026</string>
<string name="screen_last_title">Son yazma</string>
<string name="screen_last_message">Müddət: %1$d saniyə</string>
<string name="screen_overlay_notif_title">Yazmaq üçün hazırdır</string>
<string name="screen_overlay_notif_message">Başlamağa hazır olanda yazma düyməsinə basın</string>
<string name="screen_settings_title">Ekran yazma tənzimləmələri</string>
......@@ -49,8 +49,8 @@
<string name="screen_channel_desc">Ekran videosunu çəkəndə davamlı bildiriş göstər və tamamlandıqdan sonra bildiriş göstər</string>
<string name="dialog_permissions_title">İcazələr</string>
<string name="dialog_permissions_mic">Səsyazan-ın, səsi yazmaq üçün mikrofon icazəsinə ehtiyacı var</string>
<string name="dialog_permissions_phone">Zəng əsnasında bu tətbiqin yazmasını əngəlləmək üçün \"Səsyazan\" telefon vəziyyətinə müraciət etməlidir.</string>
<string name="dialog_permissions_mic_phone">Səsyazan-ın, zəng əsnasında yazmağı əngəlləmək üçün mikrofon icazəsinə və telefon vəziyyətinə müraciətə ehtiyacı yaranar</string>
<string name="dialog_permissions_phone">Zəng əsnasında bu tətbiqin yazmasını əngəlləmək üçün \"Səsyazan\" telefon vəziyyətinə müraciət etməlidir</string>
<string name="dialog_permissions_mic_phone">Səsyazan-ın, zəng əsnasında yazmağı əngəlləmək üçün mikrofon icazəsinə və telefon vəziyyətinə müraciətə ehtiyacı var</string>
<string name="dialog_permissions_ask">Təkrar soruş</string>
<string name="dialog_permissions_dismiss">Rədd et</string>
<string name="dialog_permissions_overlay">Səsyazan-ın, ekranınızı yazması üçün \"Digər tətbiqlərin üzərində görüntülə\" icazəsinə ehtiyacı var. İcazə ver düyməsinə basın, tənzimləmələrin icazələrini fəallaşdırın və Səsyazan-a geri qayıdın</string>
......
<?xml version="1.0" encoding="utf-8"?>
<!--Generated by crowdin.com-->
<!-- Copyright (c) 2017 The LineageOS Project
Licensed under the Apache License, Version 2.0 (the "License");
......@@ -40,6 +39,7 @@
<string name="screen_notification_message_done">Готово за споделяне</string>
<string name="screen_recording_message">Екрана се записва\u2026</string>
<string name="screen_last_title">Последен запис</string>
<string name="screen_last_message">Продължителност: %1$d секунди</string>
<string name="screen_overlay_notif_title">Готово за запис</string>
<string name="screen_overlay_notif_message">Натиснете бутона за запис, когато сте готови да започнете</string>
<string name="screen_settings_title">Настройки за запис на екрана</string>
......
<?xml version="1.0" encoding="utf-8"?>
<!--Generated by crowdin.com-->
<!-- Copyright (c) 2017 The LineageOS Project
Licensed under the Apache License, Version 2.0 (the "License");
......
<?xml version="1.0" encoding="utf-8"?>
<!--Generated by crowdin.com-->
<!-- Copyright (c) 2017 The LineageOS Project
Licensed under the Apache License, Version 2.0 (the "License");
......@@ -40,6 +39,7 @@
<string name="screen_notification_message_done">A punt per compartir</string>
<string name="screen_recording_message">La pantalla està sent gravada\u2026</string>
<string name="screen_last_title">Darrer enregistrament</string>
<string name="screen_last_message">Durada: %1$d segons</string>
<string name="screen_overlay_notif_title">Preparat per enregistrar</string>
<string name="screen_overlay_notif_message">Prem el botó de gravació quan estiguis a punt per començar</string>
<string name="screen_settings_title">Configuració de l\'enregistrador de pantalla</string>
......
<?xml version="1.0" encoding="utf-8"?>
<!--Generated by crowdin.com-->
<!-- Copyright (c) 2017 The LineageOS Project
Licensed under the Apache License, Version 2.0 (the "License");
......@@ -40,6 +39,7 @@
<string name="screen_notification_message_done">Připraven ke sdílení</string>
<string name="screen_recording_message">Obrazovka je zaznamenávána\u2026</string>
<string name="screen_last_title">Poslední záznam</string>
<string name="screen_last_message">Doba trvání: %1$d\u00a0s</string>
<string name="screen_overlay_notif_title">Připraveno k záznamu</string>
<string name="screen_overlay_notif_message">Pokud jste připraveni začít stiskněte nahrávací tlačítko</string>
<string name="screen_settings_title">Nastavení nahrávání obrazovky</string>
......
<?xml version="1.0" encoding="utf-8"?>
<!--Generated by crowdin.com-->
<!-- Copyright (c) 2017 The LineageOS Project
Licensed under the Apache License, Version 2.0 (the "License");
......@@ -40,6 +39,7 @@
<string name="screen_notification_message_done">Yn barod i rannu</string>
<string name="screen_recording_message">Mae\'r sgrin yn cael ei recordio\u2026</string>
<string name="screen_last_title">Recordiad diwethaf</string>
<string name="screen_last_message">Hyd: %1$d eiliad</string>
<string name="screen_overlay_notif_title">Yn barod i recordio</string>
<string name="screen_overlay_notif_message">Pwysa\'r botwm recordio pan wyt ti\'n barod i ddechrau</string>
<string name="screen_settings_title">Gosodiadau\'r recordydd sgrin</string>
......
<?xml version="1.0" encoding="utf-8"?>
<!--Generated by crowdin.com-->
<!-- Copyright (c) 2017 The LineageOS Project
Licensed under the Apache License, Version 2.0 (the "License");
......@@ -24,31 +23,31 @@
<string name="delete_title">Sletter optagelse</string>
<string name="delete_message">Er du sikker på, at du ønsker at slette %1$s? Dette kan ikke fortrydes</string>
<string name="sound_notification_title">Lydoptager</string>
<string name="sound_notification_message">Audiovarighed: %1$s</string>
<string name="sound_notification_message">Lydlængde: %1$s</string>
<string name="sound_recording_title_working">Optager</string>
<string name="sound_last_title">Sidste optagelse</string>
<string name="screen_audio_message_on">Lyd fra mikrofonen vil være inkluderet i videoen</string>
<string name="screen_audio_message_off">Lyd fra mikrofonen medtages ikke i videoen</string>
<string name="screen_audio_message_disabled">Det er ikke muligt at ændre denne indstilling, under skærmoptagelse</string>
<string name="screen_audio_message_on">Lyd fra mikrofonen vil blive inkluderet i videoen</string>
<string name="screen_audio_message_off">Lyd fra mikrofonen vil ikke blive inkluderet i videoen</string>
<string name="screen_audio_message_disabled">Det er ikke muligt at ændre denne indstilling, imens skærmen optages</string>
<string name="screen_audio_warning_button_ask">Spørg</string>
<string name="screen_insufficient_storage">Ikke nok lagerplads</string>
<string name="screen_insufficient_storage">Utilstrækkelig lagerplads</string>
<string name="screen_not_enough_storage">Ikke nok lagerplads tilgængelig</string>
<string name="screen_notification_title">Skærmoptager</string>
<string name="screen_notification_message">Videolængde: %s</string>
<string name="screen_notification_message_done">Klar til deling</string>
<string name="screen_recording_message">Skærmen optages</string>
<string name="screen_recording_message">Skærm bliver optaget\u2026</string>
<string name="screen_last_title">Sidste optagelse</string>
<string name="screen_overlay_notif_title">Klar til at optage</string>
<string name="screen_overlay_notif_message">Tryk på optage-knappen, når du er klar til at starte</string>
<string name="screen_overlay_notif_message">Tryk på optag-knappen, når du er klar til at begynde</string>
<string name="screen_settings_title">Skærmoptager-indstillinger</string>
<string name="dialog_permissions_title">Tilladelser</string>
<string name="dialog_permissions_mic">Lydoptager skal have adgang til mikrofonen for at optage lyd</string>
<string name="dialog_permissions_mic">Optager behøver mikrofon-tilladelse, for at optage lyd</string>
<string name="dialog_permissions_phone">Optager behøver telefonstatus-adgang, for at forhindre denne app i at optage, imens du ringer</string>
<string name="dialog_permissions_mic_phone">Optager behøver mikrofon-tilladelse, for at optage lyd og telefonstatus-adgang, for at forhindre denne app i at optage, imens du ringer</string>
<string name="dialog_permissions_ask">Spørg igen</string>
<string name="dialog_permissions_dismiss">Afvis</string>
<string name="dialog_permissions_overlay">Lydoptager skal bruge tilladelsen \"Tegne over andre apps\" til at optage skærmen. Tryk på Tillad, aktivér tilladelsen i indstillingerne og vend tilbage til Lydoptager</string>
<string name="snack_permissions_no_permission">Nødvendige tilladelser blev nægtet, aktivér dem fra Indstillinger for at starte optagelsen</string>
<string name="dialog_permissions_overlay">Optager behøver \"Tegn over andre apps\"-tilladelse, for at optage din skærm. Tryk på tillad, aktivér tilladelsen i indstillingerne og kom tilbage til Optager</string>
<string name="snack_permissions_no_permission">Påkrævede tilladelser blev afslået, aktivér dem fra Indstillinger-app, for at begynde optagelse</string>
<string name="main_screen_action">Optag skærm</string>
<string name="main_sound_action">Optag lyd</string>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<!--Generated by crowdin.com-->
<!-- Copyright (c) 2017 The LineageOS Project
Licensed under the Apache License, Version 2.0 (the "License");
......@@ -40,6 +39,7 @@
<string name="screen_notification_message_done">Bereit zu teilen</string>
<string name="screen_recording_message">Bildschirm wird aufgenommen\u2026</string>
<string name="screen_last_title">Letzte Aufnahme</string>
<string name="screen_last_message">Dauer: %1$d Sekunden</string>
<string name="screen_overlay_notif_title">Bereit zur Aufnahme</string>
<string name="screen_overlay_notif_message">Drücken Sie die Aufnahme-Schaltfläche, um die Aufnahme zu starten</string>
<string name="screen_settings_title">Bildschirmaufnahmeeinstellungen</string>
......
<?xml version="1.0" encoding="utf-8"?>
<!--Generated by crowdin.com-->
<!-- Copyright (c) 2017 The LineageOS Project
Licensed under the Apache License, Version 2.0 (the "License");
......@@ -40,6 +39,7 @@
<string name="screen_notification_message_done">Έτοιμο για κοινή χρήση</string>
<string name="screen_recording_message">Γίνεται εγγραφή της οθόνης\u2026</string>
<string name="screen_last_title">Τελευταία εγγραφή</string>
<string name="screen_last_message">Διάρκεια: %1$d δευτερόλεπτα</string>
<string name="screen_overlay_notif_title">Έτοιμο για εγγραφή</string>
<string name="screen_overlay_notif_message">Πατήστε το πλήκτρο εγγραφής όταν είστε έτοιμοι να ξεκινήσετε</string>
<string name="screen_settings_title">Ρυθμίσεις εγγραφής της οθόνης</string>
......
<?xml version="1.0" encoding="utf-8"?>
<!--Generated by crowdin.com-->
<!-- Copyright (c) 2017 The LineageOS Project
Licensed under the Apache License, Version 2.0 (the "License");
......@@ -40,6 +39,7 @@
<string name="screen_notification_message_done">Ready to share</string>
<string name="screen_recording_message">Screen is being recorded\u2026</string>
<string name="screen_last_title">Last record</string>
<string name="screen_last_message">Duration: %1$d seconds</string>
<string name="screen_overlay_notif_title">Ready to record</string>
<string name="screen_overlay_notif_message">Press the record button when you\'re ready to start</string>
<string name="screen_settings_title">Screen recorder settings</string>
......
<?xml version="1.0" encoding="utf-8"?>
<!--Generated by crowdin.com-->
<!-- Copyright (c) 2017 The LineageOS Project
Licensed under the Apache License, Version 2.0 (the "License");
......@@ -40,6 +39,7 @@
<string name="screen_notification_message_done">Ready to share</string>
<string name="screen_recording_message">Screen is being recorded\u2026</string>
<string name="screen_last_title">Last record</string>
<string name="screen_last_message">Duration: %1$d seconds</string>
<string name="screen_overlay_notif_title">Ready to record</string>
<string name="screen_overlay_notif_message">Press the record button when you\'re ready to start</string>
<string name="screen_settings_title">Screen recorder settings</string>
......
<?xml version="1.0" encoding="utf-8"?>
<!--Generated by crowdin.com-->
<!-- Copyright (c) 2017 The LineageOS Project
Licensed under the Apache License, Version 2.0 (the "License");
......@@ -40,6 +39,7 @@
<string name="screen_notification_message_done">Ready to share</string>
<string name="screen_recording_message">Screen is being recorded\u2026</string>
<string name="screen_last_title">Last record</string>
<string name="screen_last_message">Duration: %1$d seconds</string>
<string name="screen_overlay_notif_title">Ready to record</string>
<string name="screen_overlay_notif_message">Press the record button when you\'re ready to start</string>
<string name="screen_settings_title">Screen recorder settings</string>
......
<?xml version="1.0" encoding="utf-8"?>
<!--Generated by crowdin.com-->
<!-- Copyright (c) 2017 The LineageOS Project
Licensed under the Apache License, Version 2.0 (the "License");
......@@ -40,6 +39,7 @@
<string name="screen_notification_message_done">Ready to share</string>
<string name="screen_recording_message">Screen is being recorded\u2026</string>
<string name="screen_last_title">Last record</string>
<string name="screen_last_message">Duration: %1$d seconds</string>
<string name="screen_overlay_notif_title">Ready to record</string>
<string name="screen_overlay_notif_message">Press the record button when you\'re ready to start</string>
<string name="screen_settings_title">Screen recorder settings</string>
......
<?xml version="1.0" encoding="utf-8"?>
<!--Generated by crowdin.com-->
<!-- Copyright (c) 2017 The LineageOS Project
Licensed under the Apache License, Version 2.0 (the "License");
......
<?xml version="1.0" encoding="utf-8"?>
<!--Generated by crowdin.com-->
<!-- Copyright (c) 2017 The LineageOS Project
Licensed under the Apache License, Version 2.0 (the "License");
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment