1.亮度
alps\device\rockchip\common\overlay\frameworks\base\packages\SettingsProvider\res\values\defaults.xml
<resources>
<!-- Default screen brightness, translate to 85 in kernel -->
<integer name="def_screen_brightness">192</integer>
<bool name="def_bluetooth_on">false</bool>
</resources>
2.音量
alps\kernel\arch\arm64\boot\dts\rockchip\rk3566-rk817-tablet.dts
hp-volume = <24>;
spk-volume = <26>;
capture-volume = <28>;
3、默认主页
alps\packages\providers\PartnerBookmarksProvider\src\com\android\providers\partnerbookmarks
新建一个PartnerHomepageProvider.java
4、语言和时区
alps\build\make\tools\buildinfo.sh
persist.sys.timezone=Atlantic/Azores
ro.product.locale=en-GB
5、查询指纹
alps\mkcombinedroot\vendor\build.prop
ro.bootimage.build.fingerprint=rockchip/rk3399_Android11/rk3399_Android11:R/RP1A.200428.001/kenjc05210930:userdebug/test-keys
6、Build number版本号
build\make\tools\buildinfo.sh
echo “ro.build.display.id=$BUILD_DISPLAY_ID”
7、开机动画
device/rockchip/common/BoardConfig.mk
内容 #for boot and shutdown animation ringing
BOOT_SHUTDOWN_ANIMATION_RINGING ?= true
device/rockchip/common/bootshutdown/bootanimation.zip 开机动画打包
device/rockchip/common/device.mk
8、开机logo
kernel/logo.bmp 1024x600 8位 第一张log,一定要8位,否则u-boot采用时有问题
kernel/logo_kernel.bmp 1024x600 24位 第而张log,32位有问题,若客户只提供一个log,
9、亮度
device/rockchip/common/overlay/frameworks/base/packages/SettingsProvider/res/values/defaults.xml
10、蓝牙
device/rockchip/rk356x/bluetooth/bdroid_buildcfg.h蓝牙名称
device/rockchip/rk356x/device.mk
93行 ro.rk.homepage_base=www.mobiletjd.com
11.去掉通话apk
alps\vendor\partner_gms\products\google_go_comms_suite.mk
alps\vendor\partner_gms\products\google_comms_suite.mk
去掉 GoogleDialer \
alps\packages\apps\Launcher3\res\xml\device_profiles.xml
<grid-option
launcher:name="5_by_5"
launcher:numRows="5"
launcher:numColumns="5"
launcher:numFolderRows="4"
launcher:numFolderColumns="4"
launcher:numHotseatIcons="4"rockchip/common/apps/homeworkapp/homeworkapp.apk
launcher:dbFile="launcher.db"
launcher:defaultLayoutId="@xml/default_workspace_5x5" >
launcher:dbFile="launcher.db"
launcher:defaultLayoutId="@xml/default_workspace_5x5" >
alps\packages\apps\Launcher3\res\xml\default_workspace_5x5.xml
注释掉下面这段,后面的段落里红字部分往前推
<resolve
launcher:container="-101"
launcher:screen="0"
launcher:x="0"
launcher:y="0" >
<favorite launcher:uri="#Intent;action=android.intent.action.DIAL;end" />
<favorite launcher:uri="tel:123" />
<favorite launcher:uri="#Intent;action=android.intent.action.CALL_BUTTON;end" />
</resolve>
alps\vendor\partner_gms\apps\GmsSampleIntegration\res_dhs_full\xml\partner_default_layout.xml
<!--<favorite container="-101" screen="0" x="0" y="0" packageName="com.google.android.dialer" className="com.google.android.dialer.extensions.GoogleDialtactsActivity"/>-->
<favorite container="-101" screen="0" x="0" y="0" packageName="com.google.android.apps.messaging" className="com.google.android.apps.messaging.ui.ConversationListActivity"/>
<favorite container="-101" screen="1" x="1" y="0" packageName="com.google.android.calendar" className="com.android.calendar.event.LaunchInfoActivity"/>
<favorite container="-101" screen="2" x="2" y="0" packageName="com.google.android.contacts" className="com.android.contacts.activities.PeopleActivity"/>
<favorite container="-101" screen="3" x="3" y="0" packageName="com.android.camera2" className="com.android.camera.CameraActivity"/>
12、分区问题
原因:分区太小
改动方法:
else
ifeq ($(PRODUCT_USE_DYNAMIC_PARTITIONS), true)
ifeq ($(BUILD_WITH_GO_OPT), true)
BOARD_SUPER_PARTITION_SIZE ?= 2516582400
else
BOARD_SUPER_PARTITION_SIZE ?= 3263168512
endif
13、Wifi时会断问题
alps\device\rockchip\rk356x\overlay\frameworks\base\packages\SettingsProvider\res\values\defaults.xml
<integer name="def_wifi_sleep_policy">2</integer>
14、Wifi默认打开
frameworks/base/packages/SettingsProvider/res/valuse/defaults.xml
<bool name="def_wifi_display_on">true</bool>
<bool name="def_wifi_on">true</bool>
15、默认壁纸
- alps\device\rockchip\rk356x\overlay\frameworks\base\core\res\res\drawable-nodpi
- alps\device\rockchip\rk356x\overlay\frameworks\base\core\res\res\drawable-sw600dp-nodpi
- alps\device\rockchip\rk356x\overlay\frameworks\base\core\res\res\drawable-sw720dp-nodpi
- /rk3326/overlay/frameworks/base/core/res/res/drawable-sw600dp-nodpi
16、预置壁纸
- alps\packages\apps\WallpaperPicker2\res\drawable-nodpi
- alps\packages\apps\WallpaperPicker2\res\values-nodpi\wallpapers.xml
17、预置某apk位置
- device/softwinner/ceres/ceres_b3.mk
- vendor/aw/public/prebuild/apk/MDM-30/
18、网络受限
连接大陆Wifi显示limited connection,同时右上角显示wifi符号为空,提示This network has no internet access.stay connected?
frameworks\base\packages\SettingsLib\res\values\strings.xml
Connected 此法确认无用
19、开启自动旋转
device\rockchip\rk3126c\overlay\frameworks\base\packages\SettingsProvider\res\values\defaults.xml
<integer name="def_screen_off_timeout">60000</integer>
<bool name="def_accelerometer_rotation">true</bool>
//false -> true 默认不旋转屏幕 -> 默认旋转屏幕
20、删除模块
21、git部分命令
- git format常用命令: git format-patch -3 //从当前分支最新提交点往下共生成3个补丁 git
format-patch -1 指定commit号 //生成指定commit号的补丁 eg:git format-patch -1
5f123e379cc97c317d6094bcfa2281e1189d61f3
生成5f123e379cc97c317d6094bcfa2281e1189d61f3号的补丁,该commit号不一定在该分支开头,可以在该分支的任意位置。 - patch -p1 <WallpaperPicker2-support-add-app-resource.patch 打补丁命令
- 在out目录下执行命令 find -name default_wallpaper.png |xargs rm -rf
删除default_wallpaper.png命令 - git reset --hard 回档
22、去除热点等三项
-
packages/apps/Settings/res/values-es-rUS/strings.xml
Notificación -
packages/apps/Settings/res/xml/hardware_info.xml
-
packages/apps/Settings/res/xml/network_and_internet.xml
ttether_settings_title_all data_saver_title select_private_dns_configuration_title
ethernet_settings_title -
packages/apps/Settings/src/com/android/settings/network/NetworkDashboardFragment.java
privateDnsPreferenceController -
packages/apps/Settings/src/com/android/settings/network/TopLevelNetworkEntryPreferenceController.java
hotspot -
Z:\disk04\zjh_work\RK_Z79\alps\packages\apps\Settings\src\com\android\settings\network\EthernetTetherPreferenceController.java
@Override
public boolean shouldEnable() {
String[] available = mCm.getTetherableIfaces();
for (String s : available) {
if (s.matches(mEthernetRegex)) {
return false;
}
}
return false;
}
23、去掉自动调节亮度按钮
alps\packages\apps\Settings\res\xml\display_settings.xml
注释掉
<!-- <Preference
android:key="auto_brightness_entry"
android:title="@string/auto_brightness_title"
android:summary="@string/summary_placeholder"
android:fragment="com.android.settings.display.AutoBrightnessSettings"
settings:controller="com.android.settings.display.AutoBrightnessPreferenceController"/>
-->
alps\packages\apps\Settings\src\com\android\settings\display\AutoBrightnessPreferenceController.java
@Override
public boolean setChecked(boolean isChecked) {
Settings.System.putInt(mContext.getContentResolver(), SYSTEM_KEY,
isChecked ? SCREEN_BRIGHTNESS_MODE_AUTOMATIC : DEFAULT_VALUE);
return false;
}
24、网络限制 国内热点 语言设置西班牙语
frameworks opt/net/wifi/libs/WifiTrackerLib/res/values-es-rUS/strings.xml:37:
<string name="wifi_limited_connection" msgid="3646701342701276239">"Conexión limitada"</string>
frameworks opt/net/wifi/libs/WifiTrackerLib/res/values-es/strings.xml:37:
<string name="wifi_limited_connection" msgid="3646701342701276239">"Conexión limitada"</string>
alps\packages\apps\Settings\res\values-es\strings.xml
alps\frameworks\base\packages\SettingsLib\res\values-es\strings.xml
25、去掉锁屏
alps\frameworks\base\packages\SettingsProvider\res\values\defaults.xml
<bool name="def_lockscreen_disabled">true</bool>
26、预置apk (1)
按照官方文档,步骤如下:
1、在device/rockchip/rk3399/xxx/目录下新建preinstall_del、preinstall_del_forever或preinstall文件夹。
preinstall_del:可卸载预装,恢复出厂后应用会恢复
preinstall_del_forever:可卸载预装,恢复出厂后应用不会恢复
preinstall:不可卸载预装
2、拷贝预安装的APK到上述新建的文件夹中,注意文件名尽量使用英文,避免空格
3、编译。auto_generator.py会在编译过程中,将拷贝的apk解包,自动生成编译mk文件。编译完之后预置的APK会拷贝到system固件中,烧录后,系统启动的时候会自动安装到data/app目录中(通过PackageManager)
预置apk(2)
frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
});
return true;
}
public boolean setDefaultHomeApp(String packageName, int userId){
if(packageName == null) return false;
mPermissionManager.setDefaultHome(packageName, userId, (successful) -> {
if (successful) {
postPreferredActivityChangedBroadcast(userId);
}
});
return true;
}
@Override
public void setHomeActivity(ComponentName comp, int userId) {
frameworks/base/services/java/com/android/server/SystemServer.java
import android.app.ApplicationErrorReport;
import android.app.INotificationManager;
import android.app.SystemServiceRegistry;
import android.app.usage.UsageStatsManagerInternal;
+import android.content.ComponentName;
import android.content.ContentResolver;
import android.content.Context;
import android.content.Intent;
@@ -618,7 +619,11 @@ public final class SystemServer {
"SystemServer init took too long. uptimeMillis=" + uptimeMillis);
}
}
+
+ if(mPackageManagerService.isFirstBoot()){
+ Slog.e(TAG,"set default home app");
+ mPackageManagerService.setDefaultHomeApp("com.dbc.mumars.skyworthhw",0);
+ }
// Diagnostic to ensure that the system is in a base healthy state. Done here as a common
// non-zygote process.
if (!VMRuntime.hasBootImageSpaces()) {
alps\vendor\rockchip\common\apps\apps.mk
ifneq ($(strip $(BUILD_WITH_GOOGLE_MARKET)), true)
PRODUCT_PACKAGES += \
Lightning \
homeworkapp
Endif
27、取消app安装弹框
packages/apps/Settings/src/com/android/settings/applications/AppInfoBase.java
import static com.android.settingslib.RestrictedLockUtils.EnforcedAdmin;
+import android.app.AppOpsManager;
import android.app.Activity;
import android.app.Dialog;
import android.app.admin.DevicePolicyManager;
@@ -143,10 +145,15 @@ public abstract class AppInfoBase extends SettingsPreferenceFragment
if (mAppEntry != null) {
// Get application info again to refresh changed properties of application
try {
+ Context context = getActivity();
+ AppOpsManager mAppOpsManager = (AppOpsManager) context.getSystemService(Context.APP_OPS_SERVICE);
mPackageInfo = mPm.getPackageInfoAsUser(mAppEntry.info.packageName,
- PackageManager.MATCH_DISABLED_COMPONENTS |
+ PackageManager.MATCH_DISABLED_COMPONENTS |
PackageManager.GET_SIGNING_CERTIFICATES |
PackageManager.GET_PERMISSIONS, mUserId);
+ mAppOpsManager.setMode(AppOpsManager.OP_REQUEST_INSTALL_PACKAGES,
+ mPackageInfo.applicationInfo.uid, "com.dbc.mumars.skyworthhw",AppOpsManager.MODE_ALLOWED);
} catch (NameNotFoundException e) {
Log.e(TAG, "Exception when retrieving package:" + mAppEntry.info.packageName, e);
}
packages/apps/Settings/src/com/android/settings/applications/appinfo/ExternalSourcesDetails.java
@@ -39,6 +39,9 @@ import com.android.settings.applications.AppStateInstallAppsBridge.InstallAppsSt
import com.android.settingslib.RestrictedSwitchPreference;
import com.android.settingslib.applications.ApplicationsState.AppEntry;
+import android.util.Log;
+import android.content.Intent;
public class ExternalSourcesDetails extends AppInfoWithHeader
implements OnPreferenceChangeListener {
@@ -64,12 +67,17 @@ public class ExternalSourcesDetails extends AppInfoWithHeader
addPreferencesFromResource(R.xml.external_sources_details);
mSwitchPref = (RestrictedSwitchPreference) findPreference(KEY_EXTERNAL_SOURCE_SWITCH);
mSwitchPref.setOnPreferenceChangeListener(this);
+ Intent intent = new Intent();
+ intent.setAction("com.dbc.mumars.skyworthhw.view.MainActivity");
+ context.startActivity(intent);
}
@Override
public boolean onPreferenceChange(Preference preference, Object newValue) {
final boolean checked = (Boolean) newValue;
if (preference == mSwitchPref) {
+ //Log.d("-----xcc-----ExternalSourcesDetails.java---onPreferenceChange---11111111-----","----------------111111-------Settings.ManageAppExternalSourcesActivity.class.getName()-----"+Settings.ManageAppExternalSourcesActivity.class.getName());
if (mInstallAppsState != null && checked != mInstallAppsState.canInstallApps()) {
if (Settings.ManageAppExternalSourcesActivity.class.getName().equals(
getIntent().getComponent().getClassName())) {
28、隐藏导航栏
alps\frameworks\base\core\res\res\values\dimens.xml
<dimen name="navigation_bar_height">0dp</dimen>
<dimen name="navigation_bar_height_landscape">0dp</dimen>
29、固定电量显示
system/core/healthd/BatteryMonitor.cpp
else
props.batteryPresent = mBatteryDevicePresent;
- props.batteryLevel = mBatteryFixedCapacity ?
- mBatteryFixedCapacity :
- getIntField(mHealthdConfig->batteryCapacityPath);
+ props.batteryLevel = 100;
30、Android Q 移除电池电量图标及设置项等
https://blog.csdn.net/shenfengchen/article/details/112943789?spm=1001.2101.3001.6650.4&utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7Edefault-4.no_search_link&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7Edefault-4.no_search_link
(1)主页右上角电池图标:
/frameworks/base/packages/SystemUI/res/layout/status_bar.xml =>
/frameworks/base/packages/SystemUI/res/layout/system_icons.xml => L37
<com.android.systemui.BatteryMeterView android:id=“@+id/battery” + android:visibility=“gone” (2)下拉菜单右上角的电池图标和电量显示:
\frameworks\base\packages\SystemUI\res\layout\quick_qs_status_icons.xml
=> L55
<com.android.systemui.BatteryMeterView
+ android:visibility=“gone”
31、Android7.1 删除下拉通知栏中的系统图标(mtk)
在frameworks/base/packages/Systemui/res/values/config.xml这个文件中有如下配置:
<string name="quick_settings_tiles_default" translatable="false">
wifi,bt,inversion,cell,airplane,rotation,flashlight,location,cast,hotspot
</string>
分配对应着quick settings中的:wifi开关、bluetooth开关、inversion?、cell-sim卡、飞行模式、转屏锁、手电筒、位置信息、cast-wifi屏幕投射、wifi热点
去掉相应的项就可以将quick settings中的对应的图标给去掉。
32、电池部分操作
去掉状态栏电池图标
frameworks/base/packages/SystemUI/src/com/android/systemui/BatteryMeterView.java
getResources().getDimensionPixelSize(R.dimen.status_bar_battery_icon_height));
mlp.setMargins(0, 0, 0,
getResources().getDimensionPixelOffset(R.dimen.battery_margin_bottom));
1. addView(mBatteryIconView, mlp);
2. //addView(mBatteryIconView, mlp);
去掉状态栏电池百分比
alps\frameworks\base\packages\SystemUI\src\com\android\systemui\tuner\BatteryPreference.java
@Override
protected boolean persistString(String value) {
final boolean v = PERCENT.equals(value);
MetricsLogger.action(getContext(), MetricsEvent.TUNER_BATTERY_PERCENTAGE, v);
Settings.System.putInt(getContext().getContentResolver(), SHOW_BATTERY_PERCENT, v ? 0 : 0);
if (DISABLED.equals(value)) {
去掉下拉栏电池百分比
alps\frameworks\base\packages\SystemUI\src\com\android\systemui\BatteryMeterView.java
33、去掉转储SysUI堆
alps\frameworks\base\packages\SystemUI\src\com\android\systemui\qs\tileimpl\QSFactoryImpl.java
if (Build.IS_DEBUGGABLE) {
if (tileSpec.equals(GarbageMonitor.MemoryTile.TILE_SPEC)) {
-- // return mMemoryTileProvider.get(); 转储SysUI堆
++ return null;
}
34、修改默认launcher
alps\frameworks\base\services\core\java\com\android\server\pm\permission\DefaultPermissionGrantPolicy.java
grantSystemFixedPermissionsToSystemPackage(pm, "com.skyworth.skyworthhw", userId,
CAMERA_PERMISSIONS);
grantSystemFixedPermissionsToSystemPackage(pm, "com.skyworth.skyworthhw", userId,
MANAGE_EXTERNAL_STORAGE_PERMISSIONS);
grantSystemFixedPermissionsToSystemPackage(pm, "com.skyworth.skyworthhw", userId,
STORAGE_PERMISSIONS);
grantSystemFixedPermissionsToSystemPackage(pm, "com.skyworth.skyworthhw", userId,
REQUEST_INSTALL_PACKAGES_PERMISSIONS);
alps\frameworks\base\services\java\com\android\server\SystemServer.java
if(mPackageManagerService.isFirstBoot()){
Slog.e(TAG,"set default home app");
mPackageManagerService.setDefaultHomeApp("com.skyworth.skyworthhw",0);
}
35、取消通知栏
frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationFilter.java
return mUserManager;
}
+ boolean isDefaultShowNotifi = false;
/**
* @return true if the provided notification should NOT be shown right now.
*/
public boolean shouldFilterOut(NotificationEntry entry) {
final StatusBarNotification sbn = entry.getSbn();
+
+ if(!isDefaultShowNotifi) {
+ return true;
+ }
+
if (!(getEnvironment().isDeviceProvisioned()
|| showNotificationEvenIfUnprovisioned(sbn))) {
return true;
36、去掉下拉状态栏的设置按钮,编辑按钮,用户按钮
frameworks/base/packages/SystemUI/src/com/android/systemui/qs/QSFooterImpl.java
private void updateClickabilities() {
- mMultiUserSwitch.setClickable(mMultiUserSwitch.getVisibility() == View.VISIBLE);
+ mMultiUserSwitch.setClickable(mMultiUserSwitch.getVisibility() == View.GONE);
- mEdit.setClickable(mEdit.getVisibility() == View.VISIBLE);
+ mEdit.setClickable(mEdit.getVisibility() == View.GONE);
- mSettingsButton.setClickable(mSettingsButton.getVisibility() == View.VISIBLE);
+ mSettingsButton.setClickable(mSettingsButton.getVisibility() == View.GONE);
}
private void updateVisibilities() {
mSettingsContainer.setVisibility(mQsDisabled ? View.GONE : View.VISIBLE);
mSettingsContainer.findViewById(R.id.tuner_icon).setVisibility(
TunerService.isTunerEnabled(mContext) ? View.VISIBLE : View.INVISIBLE);
final boolean isDemo = UserManager.isDeviceInDemoMode(mContext);
- mMultiUserSwitch.setVisibility(showUserSwitcher() ? View.VISIBLE : View.INVISIBLE);
+ mMultiUserSwitch.setVisibility(showUserSwitcher() ? View.GONE: View.INVISIBLE);
- mEditContainer.setVisibility(isDemo || !mExpanded ? View.INVISIBLE : View.VISIBLE);
+ mEditContainer.setVisibility(isDemo || !mExpanded ? View.INVISIBLE : View.GONE);
- mSettingsButton.setVisibility(isDemo || !mExpanded ? View.INVISIBLE : View.VISIBLE);
+ mSettingsButton.setVisibility(isDemo || !mExpanded ? View.INVISIBLE : View.GONE);
}
private boolean showUserSwitcher() {
37、覆盖apk通讯录
alps\vendor\partner_gms\apps\Gmail2\Android.mk
+ LOCAL_OVERRIDES_PACKAGES := Email Exchange2 Contacts
38、adb推入debug机器命令
adb root
adb remount
adb push alps\out\target\product\rk3566_r\system_ext\priv-app\SystemUI\SystemUI.apk system_ext/priv-app/SystemUI
adb reboot
debug模式下推代码进入文件
rk 普通版本编译方式:
source build/envsetup.sh;
lunch rk3566_r-userdebug
./build.sh -AUCKu -d rk3566-rk817-tablet
39、安全补丁日期
alps\build\core\version_defaults.mk
PLATFORM_SECURITY_PATCH := 2021-09-05
40、系统签名改为第三方签名
alps\vendor\rockchip\common\apps\homeworkapp\Android.mk
-LOCAL_CERTIFICATE :=platform
+LOCAL_CERTIFICATE :=PRESIGNED
41、修改导航栏高度,配置文件地址:
frameworks/base/core/res/res/values/dimens.xml
竖屏导航栏高度修改到48dp
<dimen name="navigation_bar_height">48dp</dimen>
横屏导航栏高度修改48dp
<dimen name="navigation_bar_height_landscape">48dp</dimen>
高度为0即为隐藏。
42、GMS-Verifier-Camera FOV Calibration测试
按照测试文档设置好距离之后,测试不同的分辨率拍照,发现两边黑线无法对齐(或者能对齐,但是Reported FOV和Displayed FOV差值过大,一般要求正负1左右)。
需要修改的 camera3_profiles.xml 中字段:
<lens.info.availableFocalLengths value=“x.xx”/>
43、MADA
vendor/rockchip/common/gms/gms.prop
CLIENT ID, MUST set it with your own MADA ID!
-ro.com.google.clientidbase=android-rockchip
+ro.com.google.clientidbase=android-myMADA
44、EDLA不得走Funding, 請移除funding feature
vendor/rockchip/common/gms-express.xml
-
<feature name="com.google.android.feature.GMSEXPRESS_PLUS_BUILD" />
45、android12.1,api却显示31
device/rockchip/rk356x/rk3566_s/rk3566_s.mk
-# First lunching is S, api_level is 31
-PRODUCT_SHIPPING_API_LEVEL := 31
+# First lunching is S, api_level is 32
+PRODUCT_SHIPPING_API_LEVEL := 32
PRODUCT_DTBO_TEMPLATE := $(LOCAL_PATH)/dt-overlay.in
另增加device/rockchip/common/manifests/manifest_level_32.xml