Skip to content
This repository has been archived by the owner on Jun 7, 2024. It is now read-only.

Commit

Permalink
exa包 compiledsdk改为29
Browse files Browse the repository at this point in the history
  • Loading branch information
ewt45 committed Nov 27, 2023
1 parent 45311c3 commit d2455e3
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {
android {
namespace 'com.eltechs.ed'

compileSdk 28
compileSdk 29

defaultConfig {
applicationId "com.eltechs.ed"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import static android.text.InputType.TYPE_TEXT_VARIATION_NORMAL;
import static android.widget.LinearLayout.HORIZONTAL;
import static android.widget.LinearLayout.VERTICAL;
import static com.example.datainsert.exagear.RR.getS;
import static com.example.datainsert.exagear.RR.dimen.margin8Dp;
import static com.example.datainsert.exagear.RR.getS;
import static com.example.datainsert.exagear.RR.getSArr;
import static com.example.datainsert.exagear.containerSettings.otherargv.Argument.POS_EARLIER;
import static com.example.datainsert.exagear.containerSettings.otherargv.Argument.POS_FRONT;
Expand Down Expand Up @@ -43,7 +43,6 @@
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
Expand Down
41 changes: 41 additions & 0 deletions app/src/main/java/com/example/test.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
package com.example;

import android.annotation.SuppressLint;
import android.app.AlertDialog;
import android.content.Context;
import android.media.AudioAttributes;
import android.media.AudioManager;
import android.media.AudioPlaybackCaptureConfiguration;
import android.media.AudioPlaybackConfiguration;
import android.os.AsyncTask;
import android.os.Build;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;

import com.eltechs.axs.Globals;
import com.eltechs.axs.applicationState.ApplicationStateBase;
import com.eltechs.ed.R;
import com.eltechs.ed.fragments.ManageContainersFragment;
import com.eltechs.ed.guestContainers.GuestContainer;
Expand All @@ -18,6 +26,7 @@
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicReference;

Expand All @@ -31,6 +40,38 @@ public test() {

}

public static void test_call_audioset(){
test.setAllowAudioRecord();
test.viewNowPlayback();
}

@SuppressLint("WrongConstant")
public static void setAllowAudioRecord(){
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
AudioManager manager = Globals.getAppContext().getSystemService(AudioManager.class);
manager.setAllowedCapturePolicy(AudioAttributes.ALLOW_CAPTURE_BY_ALL);
//这个应该是此时正在播放的音频的设置?
// manager.getActivePlaybackConfigurations();
}
}

public static void viewNowPlayback(){
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
AudioManager manager = Globals.getAppContext().getSystemService(AudioManager.class);
//这个应该是此时正在播放的音频的设置?
List<AudioPlaybackConfiguration> list = manager.getActivePlaybackConfigurations();
StringBuilder builder = new StringBuilder();
for(AudioPlaybackConfiguration c:list){
AudioAttributes attr = c.getAudioAttributes();
builder.append("Usage: ").append(attr.getUsage()).append(", AllowedCapturePolicy").append(attr.getAllowedCapturePolicy()).append("\n");
}
if(list.size()==0)
builder.append("no active playback right now");
new AlertDialog.Builder(((ApplicationStateBase)Globals.getApplicationState()).getCurrentActivity())
.setMessage(builder.toString()).show();
}
}

private void test_get_string_from_context_with_resid(){
int stringId = 0x7f09452;
String str = Globals.getAppContext().getString(stringId);
Expand Down

0 comments on commit d2455e3

Please sign in to comment.