Skip to content

Commit 2915ab6

Browse files
Merge pull request #12462 from Isira-Seneviratne/Merge-dev-to-refactor
Merge dev to refactor
2 parents da36b8a + be662a9 commit 2915ab6

File tree

177 files changed

+1637
-701
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

177 files changed

+1637
-701
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ jobs:
7272
- api-level: 21
7373
target: default
7474
arch: x86
75-
- api-level: 33
76-
target: google_apis # emulator API 33 only exists with Google APIs
75+
- api-level: 35
76+
target: default
7777
arch: x86_64
7878

7979
permissions:

README.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,8 @@
99

1010
<p align="center">
1111
<a href="https://github.com/TeamNewPipe/NewPipe/releases" alt="GitHub NewPipe releases"><img src="https://img.shields.io/github/release/TeamNewPipe/NewPipe.svg" ></a>
12-
<a href="https://github.com/TeamNewPipe/NewPipe-nightly/releases" alt="GitHub NewPipe nightly releases">
13-
<img src="https://img.shields.io/github/release/TeamNewPipe/NewPipe-nightly.svg?labelColor=purple&label=dev%20nightly" >
14-
</a>
15-
<a href="https://github.com/TeamNewPipe/NewPipe-refactor-nightly/releases" alt="GitHub NewPipe refactor nightly releases">
16-
<img src="https://img.shields.io/github/release/TeamNewPipe/NewPipe-refactor-nightly.svg?labelColor=purple&label=refactor%20nightly" >
17-
</a>
12+
<a href="https://github.com/TeamNewPipe/NewPipe-nightly/releases" alt="GitHub NewPipe nightly releases"><img src="https://img.shields.io/github/release/TeamNewPipe/NewPipe-nightly.svg?labelColor=purple&label=dev%20nightly"></a>
13+
<a href="https://github.com/TeamNewPipe/NewPipe-refactor-nightly/releases" alt="GitHub NewPipe refactor nightly releases"><img src="https://img.shields.io/github/release/TeamNewPipe/NewPipe-refactor-nightly.svg?labelColor=purple&label=refactor%20nightly"></a>
1814
<a href="https://www.gnu.org/licenses/gpl-3.0" alt="License: GPLv3"><img src="https://img.shields.io/badge/License-GPL%20v3-blue.svg"></a>
1915
<a href="https://github.com/TeamNewPipe/NewPipe/actions" alt="Build Status"><img src="https://github.com/TeamNewPipe/NewPipe/actions/workflows/ci.yml/badge.svg?branch=dev&event=push"></a>
2016
<a href="https://hosted.weblate.org/engage/newpipe/" alt="Translation Status"><img src="https://hosted.weblate.org/widgets/newpipe/-/svg-badge.svg"></a>

app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ plugins {
1717
}
1818

1919
android {
20-
compileSdk 35
20+
compileSdk 36
2121
namespace 'org.schabi.newpipe'
2222

2323
defaultConfig {
2424
applicationId "org.schabi.newpipe"
2525
resValue "string", "app_name", "NewPipe"
2626
minSdk 21
27-
targetSdk 33
27+
targetSdk 35
2828
if (System.properties.containsKey('versionCodeOverride')) {
2929
versionCode System.getProperty('versionCodeOverride') as Integer
3030
} else {

app/src/main/AndroidManifest.xml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
1111
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
1212
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC" />
13+
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PLAYBACK" />
1314
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
1415

1516
<!-- We need to be able to open links in the browser on API 30+ -->
@@ -58,6 +59,15 @@
5859
</intent-filter>
5960
</receiver>
6061

62+
<service
63+
android:name="androidx.appcompat.app.AppLocalesMetadataHolderService"
64+
android:enabled="false"
65+
android:exported="false">
66+
<meta-data
67+
android:name="autoStoreLocales"
68+
android:value="true" />
69+
</service>
70+
6171
<service
6272
android:name=".player.PlayerService"
6373
android:exported="true"
@@ -95,7 +105,10 @@
95105
android:name="androidx.work.impl.foreground.SystemForegroundService"
96106
android:foregroundServiceType="dataSync"
97107
tools:node="merge" />
98-
<service android:name=".local.feed.service.FeedLoadService" />
108+
109+
<service
110+
android:name=".local.feed.service.FeedLoadService"
111+
android:foregroundServiceType="dataSync" />
99112

100113
<activity
101114
android:name=".PanicResponderActivity"
@@ -127,7 +140,9 @@
127140
android:label="@string/app_name"
128141
android:launchMode="singleTask" />
129142

130-
<service android:name="us.shandian.giga.service.DownloadManagerService" />
143+
<service
144+
android:name="us.shandian.giga.service.DownloadManagerService"
145+
android:foregroundServiceType="dataSync" />
131146

132147
<activity
133148
android:name=".util.FilePickerActivityHelper"

app/src/main/java/org/schabi/newpipe/App.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ open class App :
9797
Localization.getPreferredLocalization(this),
9898
Localization.getPreferredContentCountry(this),
9999
)
100-
Localization.initPrettyTime(Localization.resolvePrettyTime(this))
100+
Localization.initPrettyTime(Localization.resolvePrettyTime())
101101

102102
BridgeStateSaverInitializer.init(this)
103103
StateSaver.init(this)

app/src/main/java/org/schabi/newpipe/MainActivity.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@
2020

2121
package org.schabi.newpipe;
2222

23-
import static org.schabi.newpipe.util.Localization.assureCorrectAppLanguage;
24-
2523
import android.content.BroadcastReceiver;
2624
import android.content.Context;
2725
import android.content.Intent;
@@ -49,6 +47,7 @@
4947
import androidx.appcompat.app.ActionBarDrawerToggle;
5048
import androidx.appcompat.app.AppCompatActivity;
5149
import androidx.core.app.ActivityCompat;
50+
import androidx.core.content.ContextCompat;
5251
import androidx.core.view.GravityCompat;
5352
import androidx.drawerlayout.widget.DrawerLayout;
5453
import androidx.fragment.app.Fragment;
@@ -76,6 +75,7 @@
7675
import org.schabi.newpipe.player.event.OnKeyDownListener;
7776
import org.schabi.newpipe.player.helper.PlayerHolder;
7877
import org.schabi.newpipe.player.playqueue.PlayQueue;
78+
import org.schabi.newpipe.settings.SettingMigrations;
7979
import org.schabi.newpipe.settings.UpdateSettingsFragment;
8080
import org.schabi.newpipe.util.Constants;
8181
import org.schabi.newpipe.util.DeviceUtils;
@@ -137,6 +137,7 @@ protected void onCreate(final Bundle savedInstanceState) {
137137
+ "savedInstanceState = [" + savedInstanceState + "]");
138138
}
139139

140+
Localization.migrateAppLanguageSettingIfNecessary(getApplicationContext());
140141
ThemeHelper.setDayNightMode(this);
141142
ThemeHelper.setTheme(this, ServiceHelper.getSelectedServiceId(this));
142143

@@ -153,7 +154,6 @@ protected void onCreate(final Bundle savedInstanceState) {
153154
}
154155
}
155156

156-
assureCorrectAppLanguage(this);
157157
super.onCreate(savedInstanceState);
158158
sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
159159
sharedPrefEditor = sharedPreferences.edit();
@@ -192,7 +192,7 @@ protected void onCreate(final Bundle savedInstanceState) {
192192
UpdateSettingsFragment.askForConsentToUpdateChecks(this);
193193
}
194194

195-
Localization.migrateAppLanguageSettingIfNecessary(getApplicationContext());
195+
SettingMigrations.showUserInfoIfPresent(this);
196196
}
197197

198198
@Override
@@ -498,9 +498,8 @@ protected void onDestroy() {
498498

499499
@Override
500500
protected void onResume() {
501-
assureCorrectAppLanguage(this);
502501
// Change the date format to match the selected language on resume
503-
Localization.initPrettyTime(Localization.resolvePrettyTime(getApplicationContext()));
502+
Localization.initPrettyTime(Localization.resolvePrettyTime());
504503
super.onResume();
505504

506505
// Close drawer on return, and don't show animation,
@@ -870,7 +869,8 @@ public void onReceive(final Context context, final Intent intent) {
870869
};
871870
final IntentFilter intentFilter = new IntentFilter();
872871
intentFilter.addAction(VideoDetailFragment.ACTION_PLAYER_STARTED);
873-
registerReceiver(broadcastReceiver, intentFilter);
872+
ContextCompat.registerReceiver(this, broadcastReceiver, intentFilter,
873+
ContextCompat.RECEIVER_EXPORTED);
874874

875875
// If the PlayerHolder is not bound yet, but the service is running, try to bind to it.
876876
// Once the connection is established, the ACTION_PLAYER_STARTED will be sent.

app/src/main/java/org/schabi/newpipe/RouterActivity.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@
8484
import org.schabi.newpipe.util.Constants;
8585
import org.schabi.newpipe.util.DeviceUtils;
8686
import org.schabi.newpipe.util.ExtractorHelper;
87-
import org.schabi.newpipe.util.Localization;
8887
import org.schabi.newpipe.util.NavigationHelper;
8988
import org.schabi.newpipe.util.PermissionHelper;
9089
import org.schabi.newpipe.util.ThemeHelper;
@@ -132,7 +131,6 @@ protected void onCreate(final Bundle savedInstanceState) {
132131
ThemeHelper.setDayNightMode(this);
133132
setTheme(ThemeHelper.isLightThemeSelected(this)
134133
? R.style.RouterActivityThemeLight : R.style.RouterActivityThemeDark);
135-
Localization.assureCorrectAppLanguage(this);
136134

137135
// Pass-through touch events to background activities
138136
// so that our transparent window won't lock UI in the mean time

app/src/main/java/org/schabi/newpipe/about/AboutActivity.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,9 @@ import org.schabi.newpipe.R
99
import org.schabi.newpipe.ui.components.common.ScaffoldWithToolbar
1010
import org.schabi.newpipe.ui.screens.AboutScreen
1111
import org.schabi.newpipe.ui.theme.AppTheme
12-
import org.schabi.newpipe.util.Localization
1312

1413
class AboutActivity : AppCompatActivity() {
1514
override fun onCreate(savedInstanceState: Bundle?) {
16-
Localization.assureCorrectAppLanguage(this)
1715
enableEdgeToEdge()
1816
super.onCreate(savedInstanceState)
1917

app/src/main/java/org/schabi/newpipe/download/DownloadActivity.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@
2020
import us.shandian.giga.service.DownloadManagerService;
2121
import us.shandian.giga.ui.fragment.MissionsFragment;
2222

23-
import static org.schabi.newpipe.util.Localization.assureCorrectAppLanguage;
24-
2523
public class DownloadActivity extends AppCompatActivity {
2624

2725
private static final String MISSIONS_FRAGMENT_TAG = "fragment_tag";
@@ -33,7 +31,6 @@ protected void onCreate(final Bundle savedInstanceState) {
3331
i.setClass(this, DownloadManagerService.class);
3432
startService(i);
3533

36-
assureCorrectAppLanguage(this);
3734
ThemeHelper.setTheme(this);
3835

3936
super.onCreate(savedInstanceState);

app/src/main/java/org/schabi/newpipe/download/DownloadDialog.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import static org.schabi.newpipe.extractor.stream.DeliveryMethod.PROGRESSIVE_HTTP;
44
import static org.schabi.newpipe.util.ListHelper.getStreamsOfSpecifiedDelivery;
5-
import static org.schabi.newpipe.util.Localization.assureCorrectAppLanguage;
65

76
import android.app.Activity;
87
import android.content.ComponentName;
@@ -751,7 +750,6 @@ private String getNameEditText() {
751750
}
752751

753752
private void showFailedDialog(@StringRes final int msg) {
754-
assureCorrectAppLanguage(requireContext());
755753
new AlertDialog.Builder(context)
756754
.setTitle(R.string.general_error)
757755
.setMessage(msg)

0 commit comments

Comments
 (0)