Compare commits
5 Commits
Author | SHA1 | Date | |
---|---|---|---|
92ab814f75 | |||
f43acdec83 | |||
f88713544c | |||
018d2ecf0c | |||
d2d933ed8f |
@ -1,11 +1,6 @@
|
||||
apply plugin: 'com.android.application'
|
||||
|
||||
android {
|
||||
lintOptions {
|
||||
disable 'MissingTranslation'
|
||||
disable 'ExtraTranslation'
|
||||
}
|
||||
|
||||
compileSdkVersion rootProject.ext.compileSdkVersion
|
||||
|
||||
defaultConfig {
|
||||
@ -24,7 +19,9 @@ android {
|
||||
|
||||
lintOptions {
|
||||
abortOnError false
|
||||
disable 'MissingTranslation', 'ExtraTranslation'
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
@ -31,10 +31,14 @@ THE SOFTWARE.
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
|
||||
<!-- This is needed for isWiredHeadsetOn() to work in some cases. (bug?) -->
|
||||
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE"/>
|
||||
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
|
||||
<!-- Playlist shortcuts -->
|
||||
<uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT" />
|
||||
|
||||
<!-- Needed for resume playback on bluetooth headset connected feature -->
|
||||
<uses-permission android:name="android.permission.BLUETOOTH" />
|
||||
|
||||
<!-- Allow us to query plugins -->
|
||||
<queries>
|
||||
<intent>
|
||||
|
@ -445,8 +445,8 @@ public class MediaScanner implements Handler.Callback {
|
||||
if (!dir.isDirectory())
|
||||
return;
|
||||
|
||||
if (new File(dir, ".nomedia").exists())
|
||||
return;
|
||||
// if (new File(dir, ".nomedia").exists())
|
||||
// return;
|
||||
|
||||
if (isDotfile(dir))
|
||||
return;
|
||||
|
@ -36,9 +36,12 @@ import android.content.res.Resources;
|
||||
import android.database.Cursor;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Color;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Environment;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.provider.Settings;
|
||||
import android.support.iosched.tabs.VanillaTabLayout;
|
||||
import android.text.TextUtils;
|
||||
import android.view.KeyEvent;
|
||||
@ -54,6 +57,7 @@ import android.widget.TextView;
|
||||
import android.widget.SearchView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.RequiresApi;
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
|
||||
import java.io.File;
|
||||
@ -155,6 +159,7 @@ public class LibraryActivity
|
||||
private LibraryAdapter mCurrentAdapter;
|
||||
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.R)
|
||||
@Override
|
||||
public void onCreate(Bundle state)
|
||||
{
|
||||
@ -188,6 +193,11 @@ public class LibraryActivity
|
||||
PermissionRequestActivity.showWarning(this, getIntent());
|
||||
}
|
||||
|
||||
if (!Environment.isExternalStorageManager()) {
|
||||
Intent intent = new Intent(Settings.ACTION_MANAGE_ALL_FILES_ACCESS_PERMISSION);
|
||||
startActivity(intent);
|
||||
}
|
||||
|
||||
mVanillaTabLayout = (VanillaTabLayout)findViewById(R.id.sliding_tabs);
|
||||
mVanillaTabLayout.setOnPageChangeListener(pagerAdapter);
|
||||
|
||||
|
@ -26,11 +26,15 @@ package ch.blinkenlights.android.vanilla;
|
||||
import ch.blinkenlights.android.medialibrary.MediaLibrary;
|
||||
import ch.blinkenlights.android.medialibrary.LibraryObserver;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Notification;
|
||||
import android.app.PendingIntent;
|
||||
import android.app.Service;
|
||||
import android.app.backup.BackupManager;
|
||||
import android.appwidget.AppWidgetManager;
|
||||
import android.bluetooth.BluetoothDevice;
|
||||
import android.bluetooth.BluetoothHeadset;
|
||||
import android.bluetooth.BluetoothProfile;
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
@ -437,6 +441,7 @@ public final class PlaybackService extends Service
|
||||
*/
|
||||
private BastpUtil mBastpUtil;
|
||||
|
||||
@SuppressLint("InvalidWakeLockTag")
|
||||
@Override
|
||||
public void onCreate()
|
||||
{
|
||||
@ -496,6 +501,7 @@ public final class PlaybackService extends Service
|
||||
IntentFilter filter = new IntentFilter();
|
||||
filter.addAction(AudioManager.ACTION_AUDIO_BECOMING_NOISY);
|
||||
filter.addAction(Intent.ACTION_SCREEN_ON);
|
||||
filter.addAction(BluetoothHeadset.ACTION_CONNECTION_STATE_CHANGED);
|
||||
registerReceiver(mReceiver, filter);
|
||||
|
||||
MediaLibrary.registerLibraryObserver(mObserver);
|
||||
@ -1157,7 +1163,7 @@ public final class PlaybackService extends Service
|
||||
|
||||
long[] androidIds = MediaUtils.getAndroidMediaIds(getApplicationContext(), song);
|
||||
if (mStockBroadcast) {
|
||||
Intent intent = new Intent("com.android.music.playstatechanged");
|
||||
Intent intent = new Intent("com.android.music.playstatechanged"); // TODO: Scrobbler interface
|
||||
intent.putExtra("playing", (mState & FLAG_PLAYING) != 0);
|
||||
intent.putExtra("track", song.title);
|
||||
intent.putExtra("album", song.album);
|
||||
@ -1474,6 +1480,22 @@ public final class PlaybackService extends Service
|
||||
}
|
||||
} else if (Intent.ACTION_SCREEN_ON.equals(action)) {
|
||||
userActionTriggered();
|
||||
} else if (BluetoothHeadset.ACTION_CONNECTION_STATE_CHANGED.equals(action)) {
|
||||
// Resume playback on bluetooth headset connected
|
||||
// TODO: Resume playback only if playback was paused by BECOMING NOISY
|
||||
int state = intent.getIntExtra(BluetoothProfile.EXTRA_STATE, -1);
|
||||
int prevState = intent.getIntExtra(BluetoothProfile.EXTRA_PREVIOUS_STATE, -1);
|
||||
BluetoothDevice device = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
|
||||
|
||||
if (state == BluetoothProfile.STATE_CONNECTED) {
|
||||
// Move to -2.8 secs on resume
|
||||
int deltedPosition = getPosition() - 2800;
|
||||
if (deltedPosition > 0) {
|
||||
seekToPosition(deltedPosition);
|
||||
}
|
||||
|
||||
play();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -63,7 +63,7 @@ public class PlaylistObserver extends SQLiteOpenHelper implements Handler.Callba
|
||||
/**
|
||||
* Extension to use for M3U files
|
||||
*/
|
||||
private static final String M3U_EXT = ".m3u";
|
||||
private static final String M3U_EXT = ".m3u8";
|
||||
/**
|
||||
* Line comment prefix for M3U files
|
||||
*/
|
||||
|
@ -4,7 +4,7 @@ buildscript {
|
||||
jcenter()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:4.0.0'
|
||||
classpath 'com.android.tools.build:gradle:7.2.2'
|
||||
}
|
||||
}
|
||||
allprojects {
|
||||
|
7
gradle/wrapper/gradle-wrapper.properties
vendored
7
gradle/wrapper/gradle-wrapper.properties
vendored
@ -1,7 +1,6 @@
|
||||
#Wed Jun 27 14:32:00 EDT 2018
|
||||
#Sun Aug 14 22:38:11 MSK 2022
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-all.zip
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
|
||||
distributionSha256Sum=10065868c78f1207afb3a92176f99a37d753a513dff453abb6b5cceda4058cda
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
Loading…
x
Reference in New Issue
Block a user