version:2.6
fix: update:优化爱心提醒
This commit is contained in:
@@ -49,6 +49,8 @@ public class ApkUtils {
|
||||
this.add("com.alldocube.store");
|
||||
this.add("com.android.email");
|
||||
this.add("com.android.calendar");
|
||||
this.add("com.android.uiuios");
|
||||
this.add("com.uiui.os");
|
||||
}};
|
||||
private static HashSet<String> showPackageName = new HashSet<String>() {{
|
||||
this.add("com.android.dialer");
|
||||
@@ -58,6 +60,7 @@ public class ApkUtils {
|
||||
this.add("com.android.camera2");
|
||||
this.add("com.mediatek.camera");
|
||||
this.add("com.android.mms");
|
||||
this.add("com.uiui.city");
|
||||
}};
|
||||
private static HashSet<String> allHintPackage = new HashSet<String>() {{
|
||||
this.add("com.android.uiuios");
|
||||
|
||||
37
app/src/main/java/com/uiui/aios/utils/AudioUtils.java
Normal file
37
app/src/main/java/com/uiui/aios/utils/AudioUtils.java
Normal file
@@ -0,0 +1,37 @@
|
||||
package com.uiui.aios.utils;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.rxjava3.annotations.NonNull;
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import io.reactivex.rxjava3.core.ObservableEmitter;
|
||||
import io.reactivex.rxjava3.core.ObservableOnSubscribe;
|
||||
import io.reactivex.rxjava3.core.Observer;
|
||||
import io.reactivex.rxjava3.schedulers.Schedulers;
|
||||
import wseemann.media.FFmpegMediaMetadataRetriever;
|
||||
|
||||
public class AudioUtils {
|
||||
/**
|
||||
* 获取在线音频时间长度
|
||||
*
|
||||
* @param url
|
||||
* @return
|
||||
*/
|
||||
public static void getDurationInMilliseconds(String url, Observer<Integer> observer) {
|
||||
Observable.create(new ObservableOnSubscribe<Integer>() {
|
||||
@Override
|
||||
public void subscribe(@NonNull ObservableEmitter<Integer> emitter) throws Throwable {
|
||||
long time = System.currentTimeMillis();
|
||||
FFmpegMediaMetadataRetriever mmr = new FFmpegMediaMetadataRetriever();
|
||||
mmr.setDataSource(url);
|
||||
int duration = Integer.parseInt(mmr.extractMetadata(FFmpegMediaMetadataRetriever.METADATA_KEY_DURATION));
|
||||
Log.e("AudioUtils", "getDurationInMilliseconds: " + (System.currentTimeMillis() - time));
|
||||
mmr.release();//释放资源
|
||||
emitter.onNext(duration / 1000);
|
||||
}
|
||||
}).subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(observer);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user