Merging HALO code?

Search This thread

ZacksBuilds

Senior Member
Dec 9, 2012
2,043
530
How do I merge HALO into my ROM? I'm a little lost here lol

Device: Nexus 5 16GB Black
ROM: PABETA3 (ZacksBuild) w/ Franco r32
 

jabza

Senior Member
Aug 20, 2012
521
708
Open a terminal and cd to the directory that you set up your repo. Then, in your browser, open up [1/2] Settings: HALO and [2/2] Frameworks: HALO from the gerrit.

Because it's titled [1/2], we'll start with the settings entry.

See where it says "Project AOSPA/android_packages_apps_Settings"? That's important. It says that this change is in packages/apps/Settings. So, in terminal:
Code:
cd packages/apps/Settings

Now, in the top right of the page, there's a download button. Click that, then choose "anonymous http" from the dropdown, instead of "repo". Click the clipboard button next to the one titled "cherry pick". It will copy the command to your clipboard, then paste it in terminal. It should look like this:

Code:
git fetch https://gerrit.paranoidandroid.co/AOSPA/android_packages_apps_Settings refs/changes/39/239/13 && git cherry-pick FETCH_HEAD

Press enter, and it'll download the changes. If all goes well, you'll see a message saying it's done. If not, you'll need to fix the errors. I'll get to that later.

Now, bring your terminal back to the top of your build directory with

Code:
cd ../../..

Now that you've put the settings entry for Halo in, now you need to add the frameworks. Go to the second gerrit entry, [2/2] Fameworks HALO.

You'll notice on the build page that, under project, it says AOSPA/android_frameworks_base. This means you have to go to the frameworks/base folder.

Code:
cd frameworks/base

Again, go to the download tab and copy the cherry-pick

Code:
git fetch https://gerrit.paranoidandroid.co/AOSPA/android_frameworks_base refs/changes/44/244/21 && git cherry-pick FETCH_HEAD

Press enter, and it'll try to merge. Chances are, this is where it doesn't work. The terminal output will tell you if it didn't work. If it didn't work, enter this command to check the problem:

Code:
git status

The terminal will then output all the changes to files this cherry pick consists of. In green are the files that work, and in red are the problem files. Here is the trickiest part.

Usually, for the frameworks cherry pick, my "git status" output tells me the problem is in packages/SystemUI/res/values/pa_strings.xml. So, in terminal:

Code:
gedit packages/SystemUI/res/values/pa_strings.xml

This will open up the file in question in a text editor. Now, on the gerrit entry for the Halo frameworks, there's a list of changed files. Click on the entry for pa_strings.xml (it's toward the bottom) (or here's a link). It'll show you the difference in the base file and the file needed for Halo frameworks. Everything in green is added, and everything in red is removed. So check this against your file, and make sure the changes are done. Frequently when you run into cherry picking errors, all you need to do is remove the line "<<<<< HEAD" that gets mistakenly put into the file.

Once you've edited the problem file, in this case pa_strings.xml, you need to tell your terminal you've fixed the problem. So save and exit the text editor, and type this in terminal:

Code:
git add packages/SystemUI/res/values/pa_strings.xml

Once again, check for any errors.

Code:
git status

If everything turns up green, you're good to go. Commit these changes to your build.

Code:
git commit

Now, go back to the base of your build in terminal.

Code:
cd ../..

From here, you just have to build to see if it works.

Code:
./rom-build.sh hammerhead

Wait for it to do its thing. If it compiles and tells you where the output file is, congratulations! You have a build with halo! If not, look at the output and do your best to fix the error that stopped it from building.

Then, at the end of the day, when you want to get rid of whatever cherry picking you've done, sync with the PA source code and it'll wipe out all cherry picks.

Code:
repo sync

This reverts it to a clean build, using the latest code from PA and all the commits from the "merged" section of the gerrit.
 
Last edited:

ZacksBuilds

Senior Member
Dec 9, 2012
2,043
530
My build failed with 20 errors lol. I'm going to repo sync and try again using only HALO

Device: Nexus 5 16GB Black
ROM: PABETA3 (ZacksBuild) w/ Franco r32
 

Crostantin

Senior Member
Dec 1, 2012
875
2,301
Rome
Well it depends. What are the errors you're getting?

Sent from my Nexus 5

@jabza
target R.java/Manifest.java: SystemUI (/home/crostantin/AOSPA/out/target/common/obj/APPS/SystemUI_intermediates/src/R.stamp)
frameworks/base/packages/SystemUI/res/values/pa_strings.xml:74: error: Error parsing XML: not well-formed (invalid token)
frameworks/base/packages/SystemUI/res/layout/status_bar_expanded_header.xml:91: error: Error: No resource found that matches the given name (at 'contentDescription' with value '@string/accessibility_halo').
make: *** [/home/crostantin/AOSPA/out/target/common/obj/APPS/SystemUI_intermediates/src/R.stamp] Errore 1
 
Last edited:

jabza

Senior Member
Aug 20, 2012
521
708
@jabza
target R.java/Manifest.java: SystemUI (/home/crostantin/AOSPA/out/target/common/obj/APPS/SystemUI_intermediates/src/R.stamp)
frameworks/base/packages/SystemUI/res/values/pa_strings.xml:74: error: Error parsing XML: not well-formed (invalid token)
frameworks/base/packages/SystemUI/res/layout/status_bar_expanded_header.xml:91: error: Error: No resource found that matches the given name (at 'contentDescription' with value '@string/accessibility_halo').
make: *** [/home/crostantin/AOSPA/out/target/common/obj/APPS/SystemUI_intermediates/src/R.stamp] Errore 1

That doesn't look too hard to fix. Edit frameworks/base/packages/SystemUI/res/values/pa_strings.xml

The terminal says there's an error at line 74 of pa_strings.xml, so I'd start there. Chances are it's something as simple as a missing "/ >". If you can't figure it out just by looking at it, you can check it with the pa_strings.xml listed under the android_frameworks_base gerrit entry and see what's different.

Edit: Also, the error you're getting about status_bar_expanded_header.xml is because of an error in the pa_strings.xml, so you don't have to worry about that.

Sent from my Nexus 5
 
Last edited:

Crostantin

Senior Member
Dec 1, 2012
875
2,301
Rome
That doesn't look too hard to fix. Edit frameworks/base/packages/SystemUI/res/values/pa_strings.xml

The terminal says there's an error at line 74 of pa_strings.xml, so I'd start there. Chances are it's something as simple as a missing "/ >". If you can't figure it out just by looking at it, you can check it with the pa_strings.xml listed under the android_frameworks_base gerrit entry and see what's different.

Edit: Also, the error you're getting about status_bar_expanded_header.xml is because of an error in the pa_strings.xml, so you don't have to worry about that.

Sent from my Nexus 5

did it...everything fine...
Thx

Inviato dal mio Nexus 4 utilizzando Tapatalk
 
  • Like
Reactions: jabza

jabza

Senior Member
Aug 20, 2012
521
708
thanks a million for the tips, jabza.

along with gedit, i use diffuse to compare files when merging:

http://sourceforge.net/projects/diffuse/files/diffuse/

it highlights differences between files, which makes merging and resolving conflicts a bit easier.

I think Ubuntu and some other major Linux distros come with diff, which does the same thing and it's what I use. Its a little harder to use, though, as it outputs the differences in the terminal rather than a GUI.

But that's a good tip, I might have to take a look.

Sent from my Nexus 5
 

Top Liked Posts

  • There are no posts matching your filters.
  • 10
    Open a terminal and cd to the directory that you set up your repo. Then, in your browser, open up [1/2] Settings: HALO and [2/2] Frameworks: HALO from the gerrit.

    Because it's titled [1/2], we'll start with the settings entry.

    See where it says "Project AOSPA/android_packages_apps_Settings"? That's important. It says that this change is in packages/apps/Settings. So, in terminal:
    Code:
    cd packages/apps/Settings

    Now, in the top right of the page, there's a download button. Click that, then choose "anonymous http" from the dropdown, instead of "repo". Click the clipboard button next to the one titled "cherry pick". It will copy the command to your clipboard, then paste it in terminal. It should look like this:

    Code:
    git fetch https://gerrit.paranoidandroid.co/AOSPA/android_packages_apps_Settings refs/changes/39/239/13 && git cherry-pick FETCH_HEAD

    Press enter, and it'll download the changes. If all goes well, you'll see a message saying it's done. If not, you'll need to fix the errors. I'll get to that later.

    Now, bring your terminal back to the top of your build directory with

    Code:
    cd ../../..

    Now that you've put the settings entry for Halo in, now you need to add the frameworks. Go to the second gerrit entry, [2/2] Fameworks HALO.

    You'll notice on the build page that, under project, it says AOSPA/android_frameworks_base. This means you have to go to the frameworks/base folder.

    Code:
    cd frameworks/base

    Again, go to the download tab and copy the cherry-pick

    Code:
    git fetch https://gerrit.paranoidandroid.co/AOSPA/android_frameworks_base refs/changes/44/244/21 && git cherry-pick FETCH_HEAD

    Press enter, and it'll try to merge. Chances are, this is where it doesn't work. The terminal output will tell you if it didn't work. If it didn't work, enter this command to check the problem:

    Code:
    git status

    The terminal will then output all the changes to files this cherry pick consists of. In green are the files that work, and in red are the problem files. Here is the trickiest part.

    Usually, for the frameworks cherry pick, my "git status" output tells me the problem is in packages/SystemUI/res/values/pa_strings.xml. So, in terminal:

    Code:
    gedit packages/SystemUI/res/values/pa_strings.xml

    This will open up the file in question in a text editor. Now, on the gerrit entry for the Halo frameworks, there's a list of changed files. Click on the entry for pa_strings.xml (it's toward the bottom) (or here's a link). It'll show you the difference in the base file and the file needed for Halo frameworks. Everything in green is added, and everything in red is removed. So check this against your file, and make sure the changes are done. Frequently when you run into cherry picking errors, all you need to do is remove the line "<<<<< HEAD" that gets mistakenly put into the file.

    Once you've edited the problem file, in this case pa_strings.xml, you need to tell your terminal you've fixed the problem. So save and exit the text editor, and type this in terminal:

    Code:
    git add packages/SystemUI/res/values/pa_strings.xml

    Once again, check for any errors.

    Code:
    git status

    If everything turns up green, you're good to go. Commit these changes to your build.

    Code:
    git commit

    Now, go back to the base of your build in terminal.

    Code:
    cd ../..

    From here, you just have to build to see if it works.

    Code:
    ./rom-build.sh hammerhead

    Wait for it to do its thing. If it compiles and tells you where the output file is, congratulations! You have a build with halo! If not, look at the output and do your best to fix the error that stopped it from building.

    Then, at the end of the day, when you want to get rid of whatever cherry picking you've done, sync with the PA source code and it'll wipe out all cherry picks.

    Code:
    repo sync

    This reverts it to a clean build, using the latest code from PA and all the commits from the "merged" section of the gerrit.
    2
    jabza is a great guy,maybe the best one i have meet here.
    Thanks for your help pal.
    2
    jabza is a great guy,maybe the best one i have meet here.
    Thanks for your help pal.

    +1 bro. Be is good!! He has helped me out a lot!!!

    Sent from my Nexus5™. On PA™.
    " Nothing's ever locked..."
    1
    That doesn't look too hard to fix. Edit frameworks/base/packages/SystemUI/res/values/pa_strings.xml

    The terminal says there's an error at line 74 of pa_strings.xml, so I'd start there. Chances are it's something as simple as a missing "/ >". If you can't figure it out just by looking at it, you can check it with the pa_strings.xml listed under the android_frameworks_base gerrit entry and see what's different.

    Edit: Also, the error you're getting about status_bar_expanded_header.xml is because of an error in the pa_strings.xml, so you don't have to worry about that.

    Sent from my Nexus 5

    did it...everything fine...
    Thx

    Inviato dal mio Nexus 4 utilizzando Tapatalk
    1
    thanks a million for the tips, jabza.

    along with gedit, i use diffuse to compare files when merging:

    http://sourceforge.net/projects/diffuse/files/diffuse/

    it highlights differences between files, which makes merging and resolving conflicts a bit easier.