Skip to content

Commit

Permalink
Fixing data not passed down in execution path of shell scripts
Browse files Browse the repository at this point in the history
Removing old and unneeded apk files
  • Loading branch information
Evengard committed Jul 28, 2019
1 parent f8dd1df commit 4246426
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
Binary file removed apk/aa_mirror.apk
Binary file not shown.
Binary file removed apk/aa_unlock.apk
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -1153,6 +1153,7 @@ private void SaveSharedPreferences() {

private void AlternateRequestAudioFocus(CarAudioManager carAM) throws CarNotConnectedException
{
Log.d(TAG, "AlternateRequestAudioFocus");
currentCarFocusListener = focus -> {
Log.d(TAG, "CarAudioFocusChange: " + Integer.toString(focus));
if (focus >= AUDIOFOCUS_GAIN)
Expand Down Expand Up @@ -1203,7 +1204,8 @@ private HashMap<String, Integer> GetAudioDump()
HashMap<String, Integer> focusInfo = new HashMap<String, Integer>();

Boolean isInsideFocusStack = false;
for(String info : Shell.exec("dumpsys audio"))
List<String> focusData = Shell.exec("dumpsys audio");
for(String info : focusData)
{
if (isInsideFocusStack)
{
Expand Down
13 changes: 8 additions & 5 deletions app/src/main/java/com/github/slashmax/aamirror/Shell.java
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,6 @@ public static List<String> exec(String cmd, boolean withSelinuxOverride)
public static List<String> exec(String[] cmds, boolean withSelinuxOverride)
{
List<Entry<String, Boolean>> commands = new ArrayList<Entry<String, Boolean>>();
@SuppressWarnings("unchecked")
final List<String>[] results = new List[]{new ArrayList<String>(), new ArrayList<String>()};
for(String cmd : cmds)
{
commands.add(getCommandEntry(cmd, true));
Expand All @@ -91,10 +89,15 @@ public static List<String> exec(String[] cmds, boolean withSelinuxOverride)
commands.add(0, getCommandEntry("setenforce 0", false));
commands.add(getCommandEntry("setenforce 1", false));
}
exec(commands);
List<Entry<List<String>, List<String>>> results = exec(commands);
List<String> merged = new ArrayList<String>();
merged.addAll(results[0]);
merged.addAll(results[1]);
for(Entry<List<String>, List<String>> entry : results)
{
List<String> stdout = entry.getKey();
List<String> stderr = entry.getValue();
merged.addAll(stdout);
merged.addAll(stderr);
}
return merged;
}

Expand Down

0 comments on commit 4246426

Please sign in to comment.