General [CLOSED] AOSP support -- working AOSP12 built from source.

Status
Not open for further replies.
Search This thread

96carboard

Senior Member
Jul 17, 2018
669
374
Here is a build of AOSP12r14
This is SD1A.210817.037

{Mod edit: Link removed}

Run flash-base.sh from the corresponding factory image to update bootloader and radio if you like.
Use "fastboot update" to install.

Very minor changes from pure AOSP;
1) selinux is permissive because I haven't got around to fixing a glitch.
2) Dialer/Messaging/Contacts have selective picks from lineageos for dark mode.
3) Dialer includes automatic call recording per the following;

Code:
From 945c17eabfdf9f108b26eda3d54266c0a2255234 Mon Sep 17 00:00:00 2001
Date: Mon, 8 Nov 2021 14:17:51 -0500
Subject: [PATCH] Automatic call recording

Change-Id: Icdb26fa6729e6a13dc6190a42dc75453900a6345
---
 .../dialer/app/res/values/cm_strings.xml      |  2 ++
 .../dialer/app/res/xml/sound_settings.xml     |  5 ++++
 .../dialer/callrecord/res/values/config.xml   |  4 +--
 .../android/incallui/CallButtonPresenter.java | 30 +++++++++++++++++--
 4 files changed, 37 insertions(+), 4 deletions(-)

diff --git a/java/com/android/dialer/app/res/values/cm_strings.xml b/java/com/android/dialer/app/res/values/cm_strings.xml
index 1dcdb2b81..3f7602d44 100644
--- a/java/com/android/dialer/app/res/values/cm_strings.xml
+++ b/java/com/android/dialer/app/res/values/cm_strings.xml
@@ -38,6 +38,8 @@
     <string name="call_recording_format">Audio format</string>
     <string name="wb_amr_format" translatable="false">AMR-WB</string>
     <string name="aac_format" translatable="false">AAC</string>
+    <string name="auto_call_recording_title">Auto call recording</string>
+    <string name="auto_call_recording_key" translatable="false">auto_call_recording</string>
 
     <string name="call_via">Call via</string>
     <string name="call_via_dialog_title">Call via\u2026</string>
diff --git a/java/com/android/dialer/app/res/xml/sound_settings.xml b/java/com/android/dialer/app/res/xml/sound_settings.xml
index aa025874f..d31ea9e5c 100644
--- a/java/com/android/dialer/app/res/xml/sound_settings.xml
+++ b/java/com/android/dialer/app/res/xml/sound_settings.xml
@@ -83,6 +83,11 @@
       android:entryValues="@array/call_recording_encoder_values"
       android:defaultValue="0" />
 
+    <SwitchPreference
+      android:defaultValue="false"
+      android:key="@string/auto_call_recording_key"
+      android:title="@string/auto_call_recording_title"/>
+
   </PreferenceCategory>
 
 </PreferenceScreen>
diff --git a/java/com/android/dialer/callrecord/res/values/config.xml b/java/com/android/dialer/callrecord/res/values/config.xml
index 7aabd6cac..2832c87bc 100644
--- a/java/com/android/dialer/callrecord/res/values/config.xml
+++ b/java/com/android/dialer/callrecord/res/values/config.xml
@@ -16,8 +16,8 @@
 -->
 
 <resources>
-    <bool name="call_recording_enabled">false</bool>
+    <bool name="call_recording_enabled">true</bool>
     <!-- 1 (MIC) for microphone audio source (default)
          4 (VOICE_CALL) if supported by device for voice call uplink + downlink audio source -->
-    <integer name="call_recording_audio_source">1</integer>
+    <integer name="call_recording_audio_source">4</integer>
 </resources>
diff --git a/java/com/android/incallui/CallButtonPresenter.java b/java/com/android/incallui/CallButtonPresenter.java
index 0fa833edd..175fe7cc2 100644
--- a/java/com/android/incallui/CallButtonPresenter.java
+++ b/java/com/android/incallui/CallButtonPresenter.java
@@ -21,6 +21,7 @@ import android.content.Context;
 import android.content.SharedPreferences;
 import android.content.pm.PackageManager;
 import android.os.Bundle;
+import android.os.Handler;
 import android.os.Trace;
 import android.preference.PreferenceManager;
 import android.support.v4.app.Fragment;
@@ -74,6 +75,7 @@ public class CallButtonPresenter
   private DialerCall call;
   private boolean isInCallButtonUiReady;
   private PhoneAccountHandle otherAccount;
+  private boolean isRecording = false;
 
   private CallRecorder.RecordingProgressListener recordingProgressListener =
       new CallRecorder.RecordingProgressListener() {
@@ -114,6 +116,11 @@ public class CallButtonPresenter
 
     CallRecorder recorder = CallRecorder.getInstance();
     recorder.addRecordingProgressListener(recordingProgressListener);
+    if(recorder.isRecording()){
+      inCallButtonUi.setCallRecordingState(true);
+    } else {
+      inCallButtonUi.setCallRecordingState(false);
+    }
 
     // Update the buttons state immediately for the current call
     onStateChange(InCallState.NO_CALLS, inCallPresenter.getInCallState(), CallList.getInstance());
@@ -144,6 +151,8 @@ public class CallButtonPresenter
   @Override
   public void onStateChange(InCallState oldState, InCallState newState, CallList callList) {
     Trace.beginSection("CallButtonPresenter.onStateChange");
+    CallRecorder recorder = CallRecorder.getInstance();
+    boolean isEnabled = PreferenceManager.getDefaultSharedPreferences(context).getBoolean(context.getString(R.string.auto_call_recording_key), false);
     if (call != null) {
       call.removeListener(this);
     }
@@ -152,6 +161,16 @@ public class CallButtonPresenter
     } else if (newState == InCallState.INCALL) {
       call = callList.getActiveOrBackgroundCall();
 
+    if (!isRecording && isEnabled && call != null) {
+                isRecording = true;
+                new Handler().postDelayed(new Runnable() {
+                    @Override
+                    public void run() {
+                        callRecordClicked(true);
+                    }
+                }, 500);
+    }
+
       // When connected to voice mail, automatically shows the dialpad.
       // (On previous releases we showed it when in-call shows up, before waiting for
       // OUTGOING.  We may want to do that once we start showing "Voice mail" label on
@@ -167,6 +186,9 @@ public class CallButtonPresenter
       }
       call = callList.getIncomingCall();
     } else {
+      if (isEnabled && recorder.isRecording()) {
+         recorder.finishRecording();
+      }
       call = null;
     }
 
@@ -337,6 +359,7 @@ public class CallButtonPresenter
   public void callRecordClicked(boolean checked) {
     CallRecorder recorder = CallRecorder.getInstance();
     if (checked) {
+        /*
       final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
       boolean warningPresented = prefs.getBoolean(KEY_RECORDING_WARNING_PRESENTED, false);
       if (!warningPresented) {
@@ -354,6 +377,10 @@ public class CallButtonPresenter
       } else {
         startCallRecordingOrAskForPermission();
       }
+      */
+      if(!recorder.isRecording()) {
+        startCallRecordingOrAskForPermission();
+      }
     } else {
       if (recorder.isRecording()) {
         recorder.finishRecording();
@@ -566,8 +593,7 @@ public class CallButtonPresenter
             && call.getState() != DialerCallState.CONNECTING;
 
     final CallRecorder recorder = CallRecorder.getInstance();
-    final boolean showCallRecordOption = recorder.canRecordInCurrentCountry()
-        && !isVideo && call.getState() == DialerCallState.ACTIVE;
+    final boolean showCallRecordOption = !isVideo && call.getState() == DialerCallState.ACTIVE;
 
     otherAccount = TelecomUtil.getOtherAccount(getContext(), call.getAccountHandle());
     boolean showSwapSim =
--
2.27.0
 
Last edited by a moderator:

CZ Eddie

Senior Member
Sep 27, 2011
6,244
2,346
Austin, TX
Pixel has had very poor aftermarket custom ROM support since the beginning.
Most devs just aren't interested in it. Would be nice if that changes with the 6 series but I won't get my hopes up.
 

CZ Eddie

Senior Member
Sep 27, 2011
6,244
2,346
Austin, TX
What are you talking about? ONLY Nexus/Pixel is supported by AOSP.
I don't understand your response.
I've been flashing custom ROM's since the Samsung Skyrocket and while development has generally fallen off a cliff since those days, there are some phones with more active support and Pixel has not been one of the leaders in this regard.
Go look at OnePlus forums and compare custom (not customized stock) ROM quantity to any of the Pixel phone forums.
 

96carboard

Senior Member
Jul 17, 2018
669
374
I don't understand your response.
I've been flashing custom ROM's since the Samsung Skyrocket and while development has generally fallen off a cliff since those days, there are some phones with more active support and Pixel has not been one of the leaders in this regard.
Go look at OnePlus forums and compare custom (not customized stock) ROM quantity to any of the Pixel phone forums.

That's not support, that's broken crap made by people who are so pissed off with the LACK of support that they do it themselves. Kind-of.

Nexus/Pixel are *ACTUALLY* supported in AOSP. You don't need broken hacker projects to make them work. You repo init, repo sync, lunch, make, install.


EDIT: This is AOSP - https://android.googlesource.com/?format=HTML
If your device isn't in there, then its not supported.

The primary reason you buy a Nexus/Pixel is *BECAUSE* it is supported in there and doesn't depend on hacks.
 

96carboard

Senior Member
Jul 17, 2018
669
374
Interesting, there seem to be 3 variations. Regular, 64-bit only, and pKVM. The second wont run 32bit code and will therefore create compatibility problems. The last... protected kernel based virtual machine... no idea what the implication is.
 
  • Like
Reactions: roirraW "edor" ehT

96carboard

Senior Member
Jul 17, 2018
669
374
I wish I could justify a high end SSD for my build server. Been just sitting here for several minutes waiting for lunch just to spit out the build menu.

And of course, what comes up is aosp_slider-userdebug and aosp_whitefin-userdebug. So... the bootloader version says "slider-1.0-7753224".

The build files for slider don't correspond to what's on the filesystem.

Going to try....
```lunch aosp_raven-userdebug```

And mustn't forget the propblobs.... https://developers.google.com/android/drivers

This looks familiar... BUILD_ID=SD1A.210817.019.C4
Note that its r7 I'm building.

Made it past the first stage of build, now its actually compiling stuff.
[ 3% 4357/125906] build ..... etc.

Hopefully when I look in the morning it will be built and working and not a broken mess.
 
Last edited:

96carboard

Senior Member
Jul 17, 2018
669
374
So, it built and it installed and it sort-of works.

When I put in the sim card, it did a bunch of strange reboot and wipes, but eventually booted. Checked the logs and it was going crazy with a couple of selinux denials;

[ 38.787756] type=1400 audit(1635512778.460:87): avc: denied { read } for comm="pool-3-thread-1" name="u:eek:bject_r:vendor_rild_prop:s0" dev="tmpfs" ino=326 scontext=u:r:platform_app:s0:c512,c768 tcontext=u:eek:bject_r:vendor_rild_prop:s0 tclass=file permissive=0 app=com.shannon.imsservice
[ 38.788763] type=1107 audit(1635512778.464:88): uid=0 auid=4294967295 ses=4294967295 subj=u:r:init:s0 msg='avc: denied { set } for property=persist.vendor.radio.call_waiting_for_sync_0 pid=4573 uid=10086 gid=10086 scontext=u:r:platform_app:s0:c512,c768 tcontext=u:eek:bject_r:vendor_rild_prop:s0 tclass=property_service permissive=0'

Setting it to permissive briefly (i.e. # setenforce 0) lets it do what it has to do.

Not too bad for a first try!

Download: <removed, out of date. See first post.>

UPDATE!!!
Here's a vendor_boot.img (fastboot flash vendor_boot vendor_boot.img) that sets selinux to permissive:
<removed, out of date. See first post.>

That pretty much makes it all work. Obviously making it enforce is better, but this at least is usable now.
 
Last edited:

96carboard

Senior Member
Jul 17, 2018
669
374
Since I have AOSP running nicely on this phone, I've started really liking it (really hated it with all the google [bloat|spy]ware. Previously was using a Nexus 6 over Pixel 2XL because of its width. I was a little worried because this phone isn't quite as wide as the N6, but turns out its close enough that I can't really tell the difference.

Really working well.
The only issue I'm having is that the wide angle camera isn't available, which I think is because no camera software I've been able to find has been able to send a zoom level of 0.7 to the hal. The hal switches dynamically between the normal and telephoto based on zoom level.
 
Last edited:

AlexDalas

Member
Oct 31, 2021
10
6
Google Pixel 6 Pro
I've just found out that you can flash aosp from flash.android.com
Screenshot_20211031_231629.png
 
Status
Not open for further replies.

Top Liked Posts

  • There are no posts matching your filters.
  • 7
    Here is a build of AOSP12r14
    This is SD1A.210817.037

    {Mod edit: Link removed}

    Run flash-base.sh from the corresponding factory image to update bootloader and radio if you like.
    Use "fastboot update" to install.

    Very minor changes from pure AOSP;
    1) selinux is permissive because I haven't got around to fixing a glitch.
    2) Dialer/Messaging/Contacts have selective picks from lineageos for dark mode.
    3) Dialer includes automatic call recording per the following;

    Code:
    From 945c17eabfdf9f108b26eda3d54266c0a2255234 Mon Sep 17 00:00:00 2001
    Date: Mon, 8 Nov 2021 14:17:51 -0500
    Subject: [PATCH] Automatic call recording
    
    Change-Id: Icdb26fa6729e6a13dc6190a42dc75453900a6345
    ---
     .../dialer/app/res/values/cm_strings.xml      |  2 ++
     .../dialer/app/res/xml/sound_settings.xml     |  5 ++++
     .../dialer/callrecord/res/values/config.xml   |  4 +--
     .../android/incallui/CallButtonPresenter.java | 30 +++++++++++++++++--
     4 files changed, 37 insertions(+), 4 deletions(-)
    
    diff --git a/java/com/android/dialer/app/res/values/cm_strings.xml b/java/com/android/dialer/app/res/values/cm_strings.xml
    index 1dcdb2b81..3f7602d44 100644
    --- a/java/com/android/dialer/app/res/values/cm_strings.xml
    +++ b/java/com/android/dialer/app/res/values/cm_strings.xml
    @@ -38,6 +38,8 @@
         <string name="call_recording_format">Audio format</string>
         <string name="wb_amr_format" translatable="false">AMR-WB</string>
         <string name="aac_format" translatable="false">AAC</string>
    +    <string name="auto_call_recording_title">Auto call recording</string>
    +    <string name="auto_call_recording_key" translatable="false">auto_call_recording</string>
     
         <string name="call_via">Call via</string>
         <string name="call_via_dialog_title">Call via\u2026</string>
    diff --git a/java/com/android/dialer/app/res/xml/sound_settings.xml b/java/com/android/dialer/app/res/xml/sound_settings.xml
    index aa025874f..d31ea9e5c 100644
    --- a/java/com/android/dialer/app/res/xml/sound_settings.xml
    +++ b/java/com/android/dialer/app/res/xml/sound_settings.xml
    @@ -83,6 +83,11 @@
           android:entryValues="@array/call_recording_encoder_values"
           android:defaultValue="0" />
     
    +    <SwitchPreference
    +      android:defaultValue="false"
    +      android:key="@string/auto_call_recording_key"
    +      android:title="@string/auto_call_recording_title"/>
    +
       </PreferenceCategory>
     
     </PreferenceScreen>
    diff --git a/java/com/android/dialer/callrecord/res/values/config.xml b/java/com/android/dialer/callrecord/res/values/config.xml
    index 7aabd6cac..2832c87bc 100644
    --- a/java/com/android/dialer/callrecord/res/values/config.xml
    +++ b/java/com/android/dialer/callrecord/res/values/config.xml
    @@ -16,8 +16,8 @@
     -->
     
     <resources>
    -    <bool name="call_recording_enabled">false</bool>
    +    <bool name="call_recording_enabled">true</bool>
         <!-- 1 (MIC) for microphone audio source (default)
              4 (VOICE_CALL) if supported by device for voice call uplink + downlink audio source -->
    -    <integer name="call_recording_audio_source">1</integer>
    +    <integer name="call_recording_audio_source">4</integer>
     </resources>
    diff --git a/java/com/android/incallui/CallButtonPresenter.java b/java/com/android/incallui/CallButtonPresenter.java
    index 0fa833edd..175fe7cc2 100644
    --- a/java/com/android/incallui/CallButtonPresenter.java
    +++ b/java/com/android/incallui/CallButtonPresenter.java
    @@ -21,6 +21,7 @@ import android.content.Context;
     import android.content.SharedPreferences;
     import android.content.pm.PackageManager;
     import android.os.Bundle;
    +import android.os.Handler;
     import android.os.Trace;
     import android.preference.PreferenceManager;
     import android.support.v4.app.Fragment;
    @@ -74,6 +75,7 @@ public class CallButtonPresenter
       private DialerCall call;
       private boolean isInCallButtonUiReady;
       private PhoneAccountHandle otherAccount;
    +  private boolean isRecording = false;
     
       private CallRecorder.RecordingProgressListener recordingProgressListener =
           new CallRecorder.RecordingProgressListener() {
    @@ -114,6 +116,11 @@ public class CallButtonPresenter
     
         CallRecorder recorder = CallRecorder.getInstance();
         recorder.addRecordingProgressListener(recordingProgressListener);
    +    if(recorder.isRecording()){
    +      inCallButtonUi.setCallRecordingState(true);
    +    } else {
    +      inCallButtonUi.setCallRecordingState(false);
    +    }
     
         // Update the buttons state immediately for the current call
         onStateChange(InCallState.NO_CALLS, inCallPresenter.getInCallState(), CallList.getInstance());
    @@ -144,6 +151,8 @@ public class CallButtonPresenter
       @Override
       public void onStateChange(InCallState oldState, InCallState newState, CallList callList) {
         Trace.beginSection("CallButtonPresenter.onStateChange");
    +    CallRecorder recorder = CallRecorder.getInstance();
    +    boolean isEnabled = PreferenceManager.getDefaultSharedPreferences(context).getBoolean(context.getString(R.string.auto_call_recording_key), false);
         if (call != null) {
           call.removeListener(this);
         }
    @@ -152,6 +161,16 @@ public class CallButtonPresenter
         } else if (newState == InCallState.INCALL) {
           call = callList.getActiveOrBackgroundCall();
     
    +    if (!isRecording && isEnabled && call != null) {
    +                isRecording = true;
    +                new Handler().postDelayed(new Runnable() {
    +                    @Override
    +                    public void run() {
    +                        callRecordClicked(true);
    +                    }
    +                }, 500);
    +    }
    +
           // When connected to voice mail, automatically shows the dialpad.
           // (On previous releases we showed it when in-call shows up, before waiting for
           // OUTGOING.  We may want to do that once we start showing "Voice mail" label on
    @@ -167,6 +186,9 @@ public class CallButtonPresenter
           }
           call = callList.getIncomingCall();
         } else {
    +      if (isEnabled && recorder.isRecording()) {
    +         recorder.finishRecording();
    +      }
           call = null;
         }
     
    @@ -337,6 +359,7 @@ public class CallButtonPresenter
       public void callRecordClicked(boolean checked) {
         CallRecorder recorder = CallRecorder.getInstance();
         if (checked) {
    +        /*
           final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
           boolean warningPresented = prefs.getBoolean(KEY_RECORDING_WARNING_PRESENTED, false);
           if (!warningPresented) {
    @@ -354,6 +377,10 @@ public class CallButtonPresenter
           } else {
             startCallRecordingOrAskForPermission();
           }
    +      */
    +      if(!recorder.isRecording()) {
    +        startCallRecordingOrAskForPermission();
    +      }
         } else {
           if (recorder.isRecording()) {
             recorder.finishRecording();
    @@ -566,8 +593,7 @@ public class CallButtonPresenter
                 && call.getState() != DialerCallState.CONNECTING;
     
         final CallRecorder recorder = CallRecorder.getInstance();
    -    final boolean showCallRecordOption = recorder.canRecordInCurrentCountry()
    -        && !isVideo && call.getState() == DialerCallState.ACTIVE;
    +    final boolean showCallRecordOption = !isVideo && call.getState() == DialerCallState.ACTIVE;
     
         otherAccount = TelecomUtil.getOtherAccount(getContext(), call.getAccountHandle());
         boolean showSwapSim =
    --
    2.27.0
    5
    So, it built and it installed and it sort-of works.

    When I put in the sim card, it did a bunch of strange reboot and wipes, but eventually booted. Checked the logs and it was going crazy with a couple of selinux denials;

    [ 38.787756] type=1400 audit(1635512778.460:87): avc: denied { read } for comm="pool-3-thread-1" name="u:eek:bject_r:vendor_rild_prop:s0" dev="tmpfs" ino=326 scontext=u:r:platform_app:s0:c512,c768 tcontext=u:eek:bject_r:vendor_rild_prop:s0 tclass=file permissive=0 app=com.shannon.imsservice
    [ 38.788763] type=1107 audit(1635512778.464:88): uid=0 auid=4294967295 ses=4294967295 subj=u:r:init:s0 msg='avc: denied { set } for property=persist.vendor.radio.call_waiting_for_sync_0 pid=4573 uid=10086 gid=10086 scontext=u:r:platform_app:s0:c512,c768 tcontext=u:eek:bject_r:vendor_rild_prop:s0 tclass=property_service permissive=0'

    Setting it to permissive briefly (i.e. # setenforce 0) lets it do what it has to do.

    Not too bad for a first try!

    Download: <removed, out of date. See first post.>

    UPDATE!!!
    Here's a vendor_boot.img (fastboot flash vendor_boot vendor_boot.img) that sets selinux to permissive:
    <removed, out of date. See first post.>

    That pretty much makes it all work. Obviously making it enforce is better, but this at least is usable now.
    5
    I am not sure if it is AOSP (think it is, but can never be so sure), but it doesn't have gapps so it's doable for me

    edit: i am getting micro g working hopefully

    Yes microg is a great transitional tool. I used it for a little while, but not any more. I'm completely free of google. Nextcloud is a great replacement. I've also noticed that most software that claims to require google services actually works just fine without it. Including google maps 😂
    3
    I think i might try doing aosp (i dont know where to start, but ill try fastboot flash), but have you tried the GrapheneOS camera app? (https://github.com/GrapheneOS/Camera) I have tried the one from here ( ) and it works, but i am not sure about on AOSP.