init: allow system UID to setenforce and set booleans

Allow system UID to setenforce and set booleans for SELinux.
Boolean ownerships must also be reset upon policy reload as
the boolean files in selinuxfs are regenerated to match the new policy.

Signed-off-by: Humberto Borba <humberos@gmail.com>
Change-Id: I0dae393892753b4745e6c956289196338bf771d5
bluetooth: Introduce new property type and permission

Introduce new property type and allow system and bluetooth
processes to set these properties so that transport layer of
AND and BT stack can set these properties for chip initialization
part

Fix: omni-318

Change-Id: I7735d4743d8b43ea935584901d5aa330df965868
pdp: introduce new property type and permission

Fix: omni-318

Signed-off-by: Humberto Borba <humberos@gmail.com>
Change-Id: I330efd4d551e87fa3211f427f3199c53d0ff981d
core: Add API to retrieve mtu size

Adding an API to libnetutils to retrieve mtu size of an interface
Made few utility functions from ifc_utils public

Change-Id: Iddec2dcd9f241b146d7f362e2df0724cf740d1f2
(cherry picked from commit 108cded7d96cc347f36b5b78c404c5ebccce13d7)
libnetutils: add ifc_set_mtu

Fix: omni-318

Change-Id: I3031e9ee38583648350f2c46baa7a9a714b9ea1e
Use RECOVERY_PRE_COMMAND before calling __reboot() recovery

For the Power menu,
frameworks/base/core/jni/android_os_Power.cpp#L180
already uses RECOVERY_PRE_COMMAND if
TARGET_RECOVERY_PRE_COMMAND is defined in the
BoardConfig.mk for a device to make a system() call before
calling __reboot() for recovery. This commit adds
the same thing to the other places that we know we are
getting into recovery using __reboot(), namely,
adb reboot recovery, the reboot binary and init
in the case of errors.

Signed-off-by: Humberto Borba <humberos@gmail.com>
Change-Id: If0a9c7f22de2aa187c921b60ad5edd77b49e095d
revert changes to main init.rc file

Move these to the Omni init, there's no need to have them here.

Revert "init: added missing permissions"
This reverts commit 012c4de62a414388aaa6193a5b1797e9bd02901c.

Revert "init: fixup cpufreq permissions"
This reverts commit c20a2550bd9c0b5311fe5aba716e8e885b9e2a56.

Signed-off-by: Humberto Borba <humberos@gmail.com>
Change-Id: I005c8a908edceda03a54e8ea5da31e5b3474b5cd
Merge "revert changes to main init.rc file" into android-4.4
Merge "init: allow system UID to setenforce and set booleans" into android-4.4
Merge "Use RECOVERY_PRE_COMMAND before calling __reboot() recovery" into android-4.4
Do not add default route during ifc_configure

Avoid duplicate default routes.
Remove adding of default routes during interface configuration as
route add/remove operation is managed by ConnectivityService via netd.
(cherry picked from commit 4a48635c72d91cf8decb7653948fe0c76de46098)

Change-Id: I982b95a44bf91d3850ca7752e307c1b1b6a66ecf
toolbox: Add levelFromUid categorization support to restorecon

This is necessary for the app data relabeling on migrated devices
to include the proper app context. Freshly installed apps get this
done automagically, as do newly created files.

Change-Id: If7421dac01c6ae8bd78e66f71e69298ed850a7ab
bootanim: introduce new property type and permission

<3>[   58.921827] init: sys_prop: permission denied uid:1003  name:service.bootanim.exit

Signed-off-by: Humberto Borba <humberos@gmail.com>
Change-Id: I98d4c79bc021381ee30d47d056522db248ff679b
core: Fix permissions for data and cache

 - Add /data/radio
 - Set gateway property after DNS
 - Allow radio users to set properties associated with
   all rmnet interfaces. Not just rmnet0
 - Check Cache and Dalvik perm
 - Check selinux enforced booleans

Change-Id: Ia60fcb8f90aa73ffd40e839b93356ee50a9e5072
sdcard: Allow building as a static library

 * Split main() out in order to allow linking with a multi-call
   executable such as recovery.

Conflicts:
	sdcard/Android.mk

Change-Id: I3325135e47e4dd5af3912f5ce67ec64007d54a63
sdcard: fix usage for -w and -s options

Change-Id: I0ef4299d2ccf99a18970f02d4bd4e7c28dc5335e
adb: configure /system file permission with fs_config

adbd changes the permissions of files uploaded by copying
owner's permission to group and other. This causes kernel
load failure if any changes are made to kernel modules
followed by ``adb push'' or ``adb sync'' because file mode
644 would become 666.

The change uses fs_config to get the target mode of files.

In addition, the SELinux file label is set incorrectly
on synced files. Set the label properly.

Change-Id: I354db848f39adfbf189d7e8d3b028e8d763c772f
Signed-off-by: Liang Cheng <licheng@nvidia.com>
Bug: 12264775
adb: Fix backup fallback

 * Check for existence of binary first

Conflicts:
	adb/backup_service.c

Change-Id: I5c1884655ae031f51cb935221ae7870b016e259d
init.rc: Restored TCP performance tuning

This patch tunes the TCP buffer sizes for high
performance data links including global max rmem
and wmem.

Change-Id: I78dc92bc8190883686678230b0a34a8e32507fa5
CRs-Fixed: 439205 435908
init: fix cache permissions

required fo dexopt

Signed-off-by: Humberto Borba <humberos@gmail.com>
Change-Id: I299509b68e82a2b3c60eabec1998eaa12c60bc71