android 系统裁剪

android 系统裁剪

有时候编译android 镜像会用到一些不需要的app 和 系统服务,我们尝试将其裁剪出去。
####1、源码目录
build/target/product/*

在此下面有不少*.mk 文件,这一找到相应的app 进行规避修改:

diff --git a/target/product/core.mk b/target/product/core.mk
index afae7c0..7b1dae7 100644
--- a/target/product/core.mk
+++ b/target/product/core.mk
@@ -27,17 +27,12 @@ PRODUCT_PACKAGES += \
     org.simalliance.openmobileapi.xml \
     BasicDreams \
     BlockedNumberProvider \
-    BookmarkProvider \
-    Browser2 \
-    Calendar \
     CalendarProvider \
     CaptivePortalLogin \
     CertInstaller \
-    Contacts \
     DeskClock \
     DocumentsUI \
     DownloadProviderUi \
-    Email \
     ExactCalculator \
     ExternalStorageProvider \
     FusedLocation \
@@ -54,7 +49,6 @@ PRODUCT_PACKAGES += \
     PrintSpooler \
     PrintRecommendationService \
     ProxyHandler \
-    QuickSearchBox \
     Settings \
     SharedStorageBackup \
     Telecom \
diff --git a/target/product/full_base.mk b/target/product/full_base.mk
index 65bdf0f..da6eb4f 100644
--- a/target/product/full_base.mk
+++ b/target/product/full_base.mk
@@ -29,10 +29,6 @@ PRODUCT_PACKAGES := \
 
 PRODUCT_PACKAGES += \
     Galaxy4 \
-    HoloSpiralWallpaper \
-    LiveWallpapers \
-    LiveWallpapersPicker \
-    MagicSmokeWallpapers \
     NoiseField \
     PhaseBeam \
     PhotoTable
diff --git a/target/product/generic_no_telephony.mk b/target/product/generic_no_telephony.mk
index 5c48358..4f9b27a 100644
--- a/target/product/generic_no_telephony.mk
+++ b/target/product/generic_no_telephony.mk
@@ -20,10 +20,6 @@
 PRODUCT_PACKAGES := \
     Bluetooth \
     BluetoothMidiService \
-    Camera2 \
-    Gallery2 \
-    Music \
-    MusicFX \
     OneTimeInitializer \
     Provision \
     SystemUI \
diff --git a/target/product/sdk_base.mk b/target/product/sdk_base.mk
index fa257ae..13997ad 100644
--- a/target/product/sdk_base.mk
+++ b/target/product/sdk_base.mk
@@ -18,23 +18,16 @@ PRODUCT_PROPERTY_OVERRIDES :=
 
 PRODUCT_PACKAGES := \
 	ApiDemos \
-	CubeLiveWallpapers \
 	CustomLocale \
 	Development \
-	Dialer \
 	EmulatorSmokeTests \
 	Fallback \
-	Gallery \
 	GestureBuilder \
 	Launcher3 \
-	LegacyCamera \
 	librs_jni \
 	libwnndict \
 	libWnnEngDic \
 	libWnnJpnDic \
-	LiveWallpapersPicker \
-	Mms \
-	Music \
 	OpenWnn \
 	Protips \
 	rild \
diff --git a/target/product/telephony.mk b/target/product/telephony.mk
index e840ba1..5c05fa1 100644
--- a/target/product/telephony.mk
+++ b/target/product/telephony.mk
@@ -19,7 +19,6 @@
 
 PRODUCT_PACKAGES := \
     CarrierConfig \
-    Dialer \
     CallLogBackup \
     CellBroadcastReceiver \
     EmergencyInfo \

对于一些服务 可以修改 frameworks/base/services/java/com/android/server/SystemServer.java

将里面的相关的 systemserver.java 去掉。

例如:


            mContentResolver = context.getContentResolver();

//            Slog.i(TAG, "Camera Service");
            // mSystemServiceManager.startService(CameraService.class);

          
            traceBeginAndSlog("StartAccountManagerService");

你可能感兴趣的:(Framework)