The question here is down to how Android build system works :

$ choosecombo 1 myprod ...
$ make

The build system will only load BoardConfig.mk file located in the product 
folder (ie, myprod/BoardConfig.mk). It will not load other BoardConfig.mk 
files, even those in the inherited product folder. You have to include 
explicitly any inherited BoardConfig.mk files.

By inheriting the BoarConfig.mk files, you also inherit all 
BOARD_SEPOLICY_UNION and BOARD_SEPOLICY_DIRS defined in them. In 
myprod/BoardConfig.mk file you then append your own DIRS and UNION.

You can also check in out/obj/.../policy.conf file to see what are loaded and 
in what order.

Regards!
Andrew

-----Original Message-----
From: Seandroid-list [mailto:[email protected]] On Behalf Of 
Joshua Brindle
Sent: 11 March 2015 15:49
To: Owain Davies
Cc: [email protected]
Subject: Re: union sepolicy files

Owain Davies wrote:
> I read their review, I am not sure that PRODUCT_SEPOLICY_* wouldn't
> have been a good idea. I don't know why they did not like it.
>
>     The current guidance is to make a device tree per product and
>     inherit from the main device, this is how tuna, maguro, etc use to work.
>
> So, let me check I have this write. If I am building for hammerhead
> and flounder then the original files are are at:
> - device/lge/hammerhead
> - device/htc/flounder
>
> If my product is creatively name "myprod" I would create the following tree:
>
> - device/myprod/common
> -- BoardConfigPartial.mk
> - device/myprod/hammerhead
> -- AndroidProducts.mk
> -- BoardConfig.mk
> - device/myprod/flounder
> -- AndroidProducts.mk
> -- BoardConfig.mk
>
> Then have each devices BoardConfig and AndroidProducts.mk inherit
> their respective parents makefile and include my product specific
> files as well? Then could I just put the BOARD_SEPOLICY_UNION setting
> in BoardConfigPartial.mk.
>
> How does the build system determine which BoardConfig.mk to use? If I
> were to lunch the aosp_hammerhead product rather than the
> myprod_hammerhead product how would it know not to use the
> BoardConfig.mk files in the myprod tree?
>

if you lunch aosp_hammerhead then it is correct to not use your BoardConfig. 
Yours should only be used with the correct lunch target.

We haven't done policy development in an AOSP tree for a while but it looks 
like they put multiple variants inside the device tree now:

device/lge/hammerhead/AndroidProducts.mk

So, you may be able to add yours there, include aosp_hammerhead.mk, and add 
your BOARD_SEPOLICY_UNION += files...

I have not done this though, so no promises.

> Sorry if this is very obvious.
>
> Thanks,
>
> Owain
>

_______________________________________________
Seandroid-list mailing list
[email protected]
To unsubscribe, send email to [email protected].
To get help, send an email containing "help" to 
[email protected].
This message and any attachment is intended only for the use of the individual 
or entity to which it is addressed and may contain information that is 
privileged, confidential and exempt from disclosure. If the reader of this 
message is not the intended recipient, or an employee or agent responsible for 
delivering the message to the intended recipient, you are hereby notified that 
any dissemination, distribution or copying of this communication is strictly 
prohibited. If you have received this communication in error, please accept our 
apology and we should be obliged if you would contact the sender. Please note 
that any views or opinions presented in this email are solely those of the 
sender and do not necessarily represent those of Vertu. The company therefore 
does not accept liability for any errors or omissions in the contents of this 
message, or which arise as a result of e-mail transmission.

_______________________________________________
Seandroid-list mailing list
[email protected]
To unsubscribe, send email to [email protected].
To get help, send an email containing "help" to 
[email protected].

Reply via email to