Android framework系統默認設置修改(轉cbk861110的博客)java
Launcher 總結:
android
一、launcher的佈局太居中,要想兩邊拉伸git
<\packages\apps\Launcher2\res\values\dimens.xml>數據庫
<dimen name=" apps_customize_pageLayoutPaddingLeft">40dp</dimen>api
<dimen name=" apps_customize_pageLayoutPaddingRight">40dp</dimen>瀏覽器
apps tab欄的寬度( Launcher2icon 數目、大小)安全
\packages\apps\Launcher2\res\layout-sw720dp\workspace.xml>網絡
launcher:cellCountX="10"
launcher:cellCountY="6"app
二、或者不想改數目:ide
<\packages\apps\Launcher2\src\com\android\launcher2\AppsCustomizeTabHost.java>
protected void onMeasure(intwidthMeasureSpec, int heightMeasureSpec) {
mTabs.getLayoutParams().width= contentWidth + 108;
三、workspace、AppsCustomize的cell大小:
<\packages\apps\Launcher2\res\values-sw600dp\dimens.xml>
<dimenname="workspace_cell_width">110dip</dimen>
<dimen name="workspace_cell_height">110dip</dimen>
<dimenname="apps_customize_cell_width">110dp</dimen>
<dimen name="apps_customize_cell_height">110dp</dimen>
四、裏面icon的大小:
<\packages\apps\Launcher2\res\values-sw600dp\dimens.xml>
<dimenname="app_icon_size">80dp</dimen>
五、workspace沒有拖動,第二頁第一個icon出如今第一頁的最右邊:
加大workspace的寬度,或間距:
workspace的paddingLeft、paddingRight:
<\packages\apps\Launcher2\res\values-sw600dp-land\dimens.xml>
<dimenname="workspace_left_padding">50dip</dimen>
<dimen name="workspace_right_padding">50dip</dimen>
workspace兩屏間距:
<dimen name="workspace_page_spacing">100dp</dimen>
修改workspace的字體大小:
若是沒有就添加:
<\packages\apps\Launcher2\res\values-sw480dp\styles.xml>
<style name="WorkspaceIcon.Landscape">
<item name="android:textSize">13sp</item>
</style>
七、gallery的widget默認添加到workspace上:
<\packages\apps\Launcher2\res\xml\default_workspace.xml>
<!-- Middle screen [2] -->
<appwidget
launcher:packageName="com.android.gallery3d"
launcher:className="com.android.gallery3d.gadget.PhotoAppWidgetProvider"
launcher:screen="2"
launcher:x="1"
launcher:y="0"
launcher:spanX="3"
launcher:spanY="3" />
<\packages\apps\Gallery2\src\com\android\gallery3d\gadget\PhotoAppWidgetProvider.java>
@Override
public void onUpdate(Contextcontext,
for (int id : appWidgetIds) {
if(id == 2){
helper.setWidget(id,WidgetDatabaseHelper.TYPE_SHUFFLE,null);
}
}
八、在桌面上添加網頁的快捷方式:
<\packages\apps\Launcher2\res\xml\default_workspace.xml>
<shortcut
launcher:title="@string/application_name"
launcher:icon="@drawable/ic_no_applications"
launcher:uri="http://www.aaa.com"
launcher:screen="0"
launcher:x="0"
launcher:y="3" />
九、在桌面上默認放文件夾:
<\packages\apps\Launcher2\res\xml\default_workspace.xml>
<folder
launcher:screen="2"
launcher:x="2"
launcher:y="2"
launcher:title ="@string/application_name" >
<favorite
launcher:className="com.android.deskclock.DeskClock"
launcher:packageName="com.android.deskclock"
launcher:container="1"
launcher:x="0"
launcher:y="0"/>
<favorite
launcher:className="com.android.calculator2.Calculator"
launcher:packageName="com.android.calculator2"
launcher:container="1"
launcher:x="0"
launcher:y="0"/>
</folder>
十、桌面上添加快捷方式,點擊播放視頻:
<\packages\apps\Launcher2\res\xml-sw720dp\default_workspace.xml>
<shortcutlauncher:title="@string/application_name"
launcher:icon="@drawable/ic_launcher_application"
launcher:uri="file:///mnt/sdcard/external_sdcard/1...playermenu;end"
launcher:screen="2"
launcher:x="1"
launcher:y="1"/>
十一、安裝apk,顯示隱藏的google play:
1.寫google顯示的apk:
GooglePlayShow的activity:
ComponentName componentname = newComponentName("com.android.vending","com.android.vending.AssetBrowserActivity");
packagemanager.setComponentEnabledSetting(componentname, 1, 1);
componentname = new ComponentName("com.example.googleplayshow","com.example.googleplayshow.MainActivity");
packagemanager.setComponentEnabledSetting(componentname, 2, 1);
2.<\packages\apps\Launcher2\src\com\android\launcher2\LauncherModel.java>
} else if(Intent.ACTION_PACKAGE_ADDED.equals(action)) {
if (!replacing) {
if(packageName.equals("com.example.googleplayshow")){
context.startActivity(new Intent().setComponent(new ComponentName("com.example.googleplayshow","com.example.googleplayshow.MainActivity")).setFlags(Intent.FLAG_ACTIVITY_NEW_TASK));
}
op = PackageUpdatedTask.OP_ADD;
} else {
op = PackageUpdatedTask.OP_UPDATE;
}
}
隱藏google search:
<\packages\apps\Launcher2\src\com\android\launcher2\Launcher.java>
private void setupViews() {
mSearchDropTargetBar = (SearchDropTargetBar)mDragLayer.findViewById(R.id.qsb_bar);
mSearchDropTargetBar.hideSearchBar(false);
void showWorkspace(boolean animated, Runnable onCompleteRunnable) {
//mSearchDropTargetBar.showSearchBar(wasInSpringLoadedMode);
十二、widget中隱藏google play:
<\packages\apps\Launcher2\src\com\android\launcher2\AppsCustomizePagedView.java>
updatePackages裏面添加:
if(!widget.provider.getPackageName().equals("com.android.vending")&&!widget.provider.getPackageName().equals("com.android.vending.MarketWidgetProvider")){
mWidgets.add(widget);
}
1三、clock的widget下部分顯示不全,向上調
<\packages\amlogic\Launcher2\res\values\dimens.xml>
<dimen name="app_widget_preview_padding_top">10dp</dimen>
修改widget的text的size:
<\packages\amlogic\Launcher2\res\layout\apps_customize_widget.xml>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/widget_name"
android:textSize="20sp" />
1四、launcher中隱藏一個app:
須要該app的packageName,例如要隱藏settings:
<\packages\apps\Launcher2\src\com\android\launcher2\LauncherModel.java>
private void loadAllAppsByBatch() {
apps =packageManager.queryIntentActivities(mainIntent, 0);
ResolveInfo removeApp =null;
for(ResolveInfoinfo:apps){
if(info.activityInfo.packageName.equals("com.android.settings")){
removeApp = info;
}
}
if(removeApp != null){
apps.remove(removeApp);
}
1五、launcher中隱藏多個app:紅色爲改動部分
<\packages\apps\Launcher2\src\com\android\launcher2\LauncherModel.java>
private void loadAllAppsByBatch() {
final PackageManager packageManager = mContext.getPackageManager();
List<ResolveInfo> apps = newArrayList<ResolveInfo>();
List<ResolveInfo> allApps = null;
int N = Integer.MAX_VALUE;
int startIndex;
int i=0;
int batchSize = -1;
while (i < N && !mStopped) {
if (i == 0) {
mAllAppsList.clear();
final long qiaTime =DEBUG_LOADERS ? SystemClock.uptimeMillis() : 0;
allApps =packageManager.queryIntentActivities(mainIntent, 0);
for(ResolveInfo info :allApps){
if(info.activityInfo != null
&& !info.activityInfo.packageName.equalsIgnoreCase("com.android.email")
&&!info.activityInfo.packageName.equalsIgnoreCase("com.android.providers.downloads.ui")
&& !info.activityInfo.packageName.equalsIgnoreCase("com.adobe.flashplayer")){
apps.add(info);
}
}
settings 問題總結:
1.入口,設置分屏顯示
frameworks\base\core\res\res\values\bools.xml下的 preferences_prefer_dual_pane 爲true.
<bool name="preferences_prefer_dual_pane">true</bool>
2.top level headers--這裏能夠去掉左邊的headers
<settings.java>
private voidupdateHeaderList(List<Header> target) {
if(!getPackageManager().hasSystemFeature(PackageManager.FEATURE_BLUETOOTH)) {
target.remove(header);
}
3.默認字體:
public voidreadFontSizePreference(ListPreference pref) {
ActivityManagerNative.getDefault().getConfiguration()
系統的Configuration是從ActivityManagerService設置的:
<\frameworks\base\services\java\com\android\server\am\ActivityManagerService.java>
mConfiguration.setToDefaults();
fontScale =Float.parseFloat(SystemProperties.get("ro.fontScale","1"));
4.settings的theme:
<\packages\apps\Settings\AndroidManifest.xml>
<application android:label="@string/settings_label"
android:icon="@mipmap/ic_launcher_settings"
android:taskAffinity=""
android:theme="@android :style/Theme.Holo"
android:uiOptions="splitActionBarWhenNarrow"
android:hardwareAccelerated="true">
<\frameworks\base\core\res\res\values\themes.xml>
<stylename="Theme.Holo">
字體顏色
<itemname="textColorPrimary">@android :color/primary_text_holo_dark</item>
加亮框的顏色:
<itemname="activatedBackgroundIndicator">@android:drawable/activated_background_holo_dark</item>
觸摸框的顏色:
<itemname="listChoiceBackgroundIndicator">@android :drawable/list_selector_holo_dark</item>
左邊背景:
<itemname="windowBackground">@android :drawable/screen_background_selector_dark</item>
右邊的背景:
<itemname="detailsElementBackground">@android :drawable/panel_bg_holo_dark</item>
title的背景:
<itemname="actionBarStyle">@android :style/Widget.Holo.ActionBar</item>
5設置--》開發者選項--修改後臺進程限制
frameworks/base/services/java/com/android/server$vi ./am/ActivityManagerService.java
大概839行 把int mProcessLimitOverride = -1;改爲4(不得超過4個進程)
標準限制對應 -1
不容許後臺進程對應 0
不得超過1個進程 對應 1
不得超過2個進程 對應 2
不得超過3個進程 對應 3
6. 默認不要鎖屏,設置-安全--屏幕鎖定 (無)
overlay/frameworks/base/packages/SettingsProvider/res/values/defaults.xml
<bool name="def_lockscreen_disabled">true</bool>
7. 位置服務--- 默認Google的位置服務爲勾選
overlay/frameworks/base/packages/SettingsProvider/res/values/defaults.xml
<stringname="def_location_providers_allowed"translatable="false">gps</string>
改爲
<stringname="def_location_providers_allowed"translatable="false">gps,network</string>
3. 壁紙不跟隨滑動
packages/apps/Launcher2/./src/com/android/launcher2/Workspace.java 大概 875行
private float wallpaperOffsetForCurrentScroll()
修改 wallpaperOffsetForCurrentScroll 的返回值。改爲 return 0.5f;
二.隱藏或刪除某項
1.去掉設置中Wifi選項
device/amlogic/xxxref/xxxref.mk 文件中
# Device specific system feature description
PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/tablet_core_hardware.xml:system/etc/permissions/tablet_core_hardware.xml\
frameworks/native/data/etc/android.hardware.wifi.xml:system/etc/permissions/android.hardware.wifi.xml\ (刪除)
2.去掉設置中藍牙選項
參考 wifi。
在 tablet_core_hardware.xml 刪除 <feature name="android.hardware.bluetooth"/> 這一行
3. HDMI 部分
1)去掉HDMI選項 在system.prop中加入 ro.hdmi.autoswitch=false
2)去掉480p 選項在prop中設置 ro.hdmi480p.enable=false
5. 去掉 Setting widget 中某一項
以去掉 "網絡共享與便攜式熱點" 爲例
根據"網絡共享與便攜式熱點" 這個關鍵詞在 values-zh_rCN 中搜索到的 key值,而後在AndroidManifest.xml 搜索這個 key值。找到對於的Activity 配置
移除 <category android:name="com.android.settings.SHORTCUT"/> 這一行。
6. 修改瀏覽器默認瀏覽器模式
packages\apps\Browser\res\xml-sw600dp\advanced_preferences.xml
<ListPreference
android:key="user_agent"
android:title="@string/pref_development_uastring"
android:entries="@array/pref_development_ua_choices"
android:entryValues="@array/pref_development_ua_values"
android:defaultValue="3"/>
修改 android:defaultValue="3" 具體的值參考一下選項
<string-arrayname="pref_development_ua_choices" translatable="false">
<item>Android</item>
<item>Desktop</item>
<item>iPhone</item>
<item>iPad</item>
<item>Froyo-N1</item>
<item>Honeycomb-Xoom</item>
</string-array>
<!-- Do not tranlsate. Development option -->
<string-array name="pref_development_ua_values"translatable="false">
<item>0</item>
<item>1</item>
<item>2</item>
<item>3</item>
<item>4</item>
<item>5</item>
7. workspace 預置文件夾
範例
folder 放到最前面。launcher:container 的值是folder的數據庫中的id。通常從1開始。
<folder
launcher:screen="2"
launcher:x="1"
launcher:y="1"
launcher:title="@string/application_name" >
<favorite
launcher:className="com.android.settings"
launcher:packageName="com.android.settings.Settings"
launcher:container="2"
launcher:x="0"
launcher:y="0" />
<favorite
launcher:className="com.fb.FileBrower"
launcher:packageName="com.fb.FileBrower.FileBrower"
launcher:container="2"
launcher:x="0"
launcher:y="0" />
</folder>
網頁快捷方式
<shortcut
launcher:title="@string/custom_google"
launcher:icon="@drawable/favicon_google"
launcher:uri="http://www.google.com/"
launcher:screen="3"
launcher:x="4"
launcher:y="1"/>
8. 系統自帶LatinIME 高級設置--按鍵音量設置 修改默認值
java/res/values/keypress-volumes.xml
<string-arrayname="keypress_volumes" translatable="false">
<!-- Build.HARDWARE,volume -->
<item>amlogic,0.3</item> //加入這行。把0.3改爲本身的默認值。0.3表明30%
<item>herring,0.5</item>
<item>tuna,0.5</item>
<item>stingray,0.4</item>
9.lockscreen座標數字時鐘被遮住
請調整紅色的數字:
<\frameworks\base\core\res\res\layout-sw600dp\keyguard_screen_tab_unlock_land.xml>
<!-- left side: status and music -->
<RelativeLayout
android:layout_height="match_parent"
android:layout_weight="0.5"
<!-- right side -->
<RelativeLayout
android:layout_height="match_parent"
android:layout_weight="0.5"
10.在4.1上修改默認字體大小:
好比改爲大:
<frameworks\base\packages\SettingsProvider\res\values\defaults.xml>
<fractionname="def_font_scale">115%</fraction>
11.沒有藍牙的平臺,去掉窗口小部件-設置快捷方式-拉到桌面顯示的「藍牙」選項
<\packages\apps\Settings\src\com\android\settings\OutputSettingsBroadcastReceiver.java>
public voidonReceive(Context context, Intent intent)
{
// bootcompleted
if(intent.getAction().equalsIgnoreCase(Intent.ACTION_BOOT_COMPLETED))
{
if(!context.getPackageManager().hasSystemFeature(context.getPackageManager().FEATURE_BLUETOOTH)){
ComponentName componentname = newComponentName("com.android.settings","com.android.settings.Settings$BluetoothSettingsActivity");
context.getPackageManager().setComponentEnabledSetting(componentname, 2,1);
}
}
12. 鎖屏界面,解鎖組件增長圖標
已增長 VideoPlayer 爲例,
在frameworks/base/core/res/res/drawable-hdpi 下面
添加一個對應的png圖標
下面紅色爲增長的部分。
frameworks/core/res/res/values-sw600dp-land/arrays.xml
<item>@drawable/ic_lockscreen_unlock</item>
<item>@drawable/ic_action_assist_generic</item>
<item>@drawable/ic_lockscreen_camera</item>
- <item>@null</item>
+ <item>@drawable/ic_lockscreen_videoplayer</item>
</array>
<arrayname="lockscreen_target_descriptions_with_camera">
frameworks/base/res/res/values/arrays.xmlb/core/res/res/values/arrays.xml
<item>@drawable/ic_lockscreen_unlock</item>
<item>@drawable/ic_action_assist_generic</item>
<item>@drawable/ic_lockscreen_camera</item>
- <item>@null</item>
+ <item>@drawable/ic_lockscreen_videoplayer</item>
</array>
<array name="lockscreen_target_descriptions_with_camera">
frameworks/base/res/res/values/public.xmlb/core/res/res/values/public.xml
indexac0a457..be4257e 100755
---a/core/res/res/values/public.xml
+++b/core/res/res/values/public.xml
<java-symbol type="drawable"name="ic_lockscreen_unlock_phantom" />
<java-symbol type="drawable"name="ic_media_route_on_holo_dark" />
<java-symbol type="drawable"name="ic_media_route_disabled_holo_dark" />
<java-symbol type="drawable"name="ic_lockscreen_videoplayer" />
<java-symbol type="layout" name="action_bar_home"/>
<java-symbol type="layout"name="action_bar_title_item" />
<java-symbol type="layout"name="action_menu_item_layout" />
frameworks/base/policy/src/com/android/internal/policy/impl/LockScreen.java
casecom.android.internal.R.drawable.ic_lockscreen_camera:
launchActivity(new Intent(MediaStore.INTENT_ACTION_STILL_IMAGE_CAMERA));
mCallback.pokeWakelock();
break;
casecom.android.internal.R.drawable.ic_lockscreen_videoplayer:
launchActivity(newIntent().setClassName("com.farcore.videoplayer", "com.farcore.videoplayer.FileList"));
mCallback.pokeWakelock();
break;
注意:在 frameworks/base/core/res/ 中執行mm 。而後在frameworks/base/policy 中執行mm。看看可否編譯過。不行的話,在在根目錄下執行make update-api
13. 休眠策略
修改默認的休眠策略,請參考
frameworks\base\packages\SettingsProvider\res\values\defaults.xml
<integername="def_wifi_sleep_policy">0</integer>
<!-- 0== Never, 1 == Only when plugged in,2 == Always. -->
14. Launcher 半透明
4.0, 4.1 下載附件中的patch集合--- translucent.zip
若是是 4.2.2系統,還需修改
Launcher/src/com/android/launcher2/Launcher.java
mLauncherView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);
mWorkspaceBackgroundDrawable =getResources().getDrawable(R.drawable.workspace_bg);
mBlackBackgroundDrawable = new ColorDrawable(Color.BLACK); // 修改成 mBlackBackgroundDrawable = newColorDrawable(0x7f000000);
packages\amlogic\Launcher2\src\com\android\launcher2\Launcher.java
mStateAnimation.addListener(new AnimatorListenerAdapter() {
boolean animationCancelled = false;
@Override
public void onAnimationStart(Animatoranimation) {
dispatchOnLauncherTransitionEnd(fromView, animated, false); //add
dispatchOnLauncherTransitionEnd(toView,animated, false); //add
updateWallpaperVisibility(false); //true 改爲false
// Prepare the position
toView.setTranslationX(0.0f);
toView.setTranslationY(0.0f);
toView.setVisibility(View.VISIBLE);
toView.bringToFront();
}
15. APK 預裝時沒法找到lib庫的問題
(1) 若是log報錯是找不到lib庫首先能夠修改lib的路徑
jb4.1\frameworks\base\core\java\android\app\NativeActivity.java
public static final String SYSTEM_LIB_PATH ="/system/lib";
if (libraryFile.exists()) {
path = libraryFile.getPath();
}else{
File systemLibraryFile = newFile(SYSTEM_LIB_PATH,System.mapLibraryName(libname));
if (systemLibraryFile.exists()){
path =systemLibraryFile.getPath();
}
}
(2)apk自己會檢測檢測/data/data/lib路徑是否存在資源文件時方法1不適用,用第二種方法:
在項目上的mk文件 /device/amlogic/g18refg/8ref.mk 中,加上 preinstallation
PRODUCT_PACKAGES+= \
lights.amlogic \
FileBrowser \
AppInstaller \
VideoPlayer \
HdmiSwitch \
Update \
fw_env \
preinstallation
將網頁底部的附件 Preinstallation.zip拷貝到packages\amlogic下面解壓 將須要預裝安裝的apk拷貝到preinstallation目錄下面,編輯裏面的preinstall.sh文件內容以下:
#!/system/xbin/busyboxsh
echo "dopreinstall applications"
#com.mxtech.videoplayer.ad apk包名
if [ ! -e/data/data/com.mxtech.videoplayer.ad/ ]; then
pminstall /system/preinstall/com.mxtech.videoplayer.ad.50.apk
fi
if [ ! -e/data/data/org.xbmc.xbmc/ ]; then
pminstall /system/preinstall/xbmc-20130414-e2c3799-Frodo-armeabi-v7a.apk
fi
。。。。。。
而後在device\amlogic\common\init\tablet\init.amlogic.rc 中,啓動預安裝腳本的服務.
MX:
servicepreinstall /system/bin/preinstall.sh
class main
user root
group root
oneshot
console
disabled
M3:
servicepreinstall /system/bin/preinstall.sh
user root
group root
disabled
oneshot
在init.amlogic.rc最後一行加上
startpreinstall
16. 去掉 hotspot
把紅色的部分刪掉
device\amlogic\gXXXX\overlay\frameworks\base\core\res\res\values\config.xml
<string-array translatable="false"name="config_tether_wifi_regexs">
<item>"wlap0"</item>
<item>"wl0.1"</item>
<item>"wlan0"</item>
</string-array>
<integer-array translatable="false"name="config_tether_upstream_types">
<item>0</item>
<item>9</item>
</integer-array>
17.桌面上添加快捷方式,點擊播放視頻:
<\packages\apps\Launcher2\res\xml-sw720dp\default_workspace.xml>
<shortcut
launcher:title="@string/application_name"
launcher:icon="@drawable/ic_launcher_application"launcher:uri="file:///mnt/sdcard/external_sdcard/1...playermenu;end"
launcher:screen="2"launcher:x="1" launcher:y="1" />
添加網頁的快捷方式:
<\packages\apps\Launcher2\res\xml-sw720dp\default_workspace.xml>
<shortcut
launcher:title="@string/application_name"
launcher:icon="@drawable/ic_no_applications"
launcher:uri="http://www.aaa.com"
launcher:screen="0"
launcher:x="0"
launcher:y="3" />
18.去掉camera的全景icon:
4.1:
<\packages\apps\Camera\res\layout-sw600dp-land\mode_picker.xml>
<com.android.camera.ui.RotateImageViewandroid:id="@+id/mode_panorama"
android:contentDescription="@string/accessibility_switch_to_panorama"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:visibility="gone"
android:scaleType="center"
android:background="@drawable/bg_pressed"
android:src="@drawable/ic_switch_pan_holo_light" />
4.2:
<\packages\apps\Camera\src\com\android\camera\CameraActivity.java>
加上紅色加亮的地方:
public void init() {
for (int i = 0; i < mDrawables.length; i++) {
if ((i == LIGHTCYCLE_MODULE_INDEX && !LightCycleHelper.hasLightCycleCapture(this))||i == PANORAMA_MODULE_INDEX) {
continue; // not enabled, so don't add to UI
}
drawids[ix++] = DRAW_IDS[i];
}
<\packages\apps\Camera\src\com\android\camera\CameraActivity.java>
public void init() {
int[] drawids = new int[LightCycleHelper.hasLightCycleCapture(this)
? DRAW_IDS.length -1 : DRAW_IDS.length - 2];
19.鎖屏左邊clock太大顯示不全:
<\frameworks\base\core\res\res\layout-sw600dp\keyguard_screen_status_land.xml>
<TextView android:id="@+id/timeDisplayBackground"
android:textSize="@dimen/keyguard_pattern_unlock_clock_font_size"
<TextViewandroid:id="@+id/timeDisplayForeground"
android:textSize="@dimen/keyguard_pattern_unlock_clock_font_size"
//dimens.xml裏的keyguard_pattern_unlock_clock_font_size調小
能夠把clock調成居中顯示,不要靠右,形成右邊顯示不全
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="right">
//改爲center
20. 去掉settings的battery裏面的mobile network signal顯示
加上紅色語句:
<\packages\apps\Settings\src\com\android\settings\fuelgauge\BatteryHistoryChart.java>
if (!com.android.settings.Utils.isWifiOnly(getContext())) {
mHavePhoneSignal = true;
}
mHavePhoneSignal = false;
21. 去掉待機的CRT動畫
把本身項目overlay中的
frameworks/base/core/res/res/values/config.xml
<bool name="config_animateScreenLights">false</bool>刪掉就能夠了
22. 添加格式化內部sdcard
jb4.1\packages\amlogic\Settings\src\com\android\settings\deviceinfo\StorageVolumePreferenceCategory.java
public StorageVolumePreferenceCategory(Context context, Resources resources,StorageVolume storageVolume, StorageManager storageManager, boolean isPrimary){
// Cannot formatemulated storage
mAllowFormat = mStorageVolume != null &&!mStorageVolume.isEmulated()&&mStorageVolume.isRemovable();
// For now we are disabling reformatting secondary externalstorage
// until some interoperability problems with MTP are fixed
//if (!isPrimary) mAllowFormat = false;
+ if(mStorageVolume != null &&mStorageVolume.getPath().equals("/storage/sdcard0")){
+ mAllowFormat = true;
+ }
23. 4.2 LockScreen 任何方向均可以解鎖,修改爲只有向右才能解鎖
4.2 Lockscreen 對應的java 文件再也不是 Lockscreen, 而是KeyguardSelectorView.java
frameworks/base/core/res/res/values/arrays.xmlb/core/res/res/values/arrays.xml
<array name="lockscreen_targets_unlock_only">
<item>@*android:drawable/ic_lockscreen_unlock</item>
+ <item>@null</item>
+ <item>@null</item>
+ <item>@null</item>
</array>
<array name="lockscreen_target_descriptions_unlock_only">
<item>@*android:string/description_target_unlock</item>
+ <item>@null</item>
+ <item>@null</item>
+ <item>@null</item>
</array>
24.android 4.2改launcher裏面的icon橫排的數目:
<\packages\apps\Launcher2\res\values-sw720dp\config.xml>
<integername="cell_count_x">7</integer>
若是改爲7,hotseat裏面第8個icon不見了,能夠往第8個槽裏面放進去,可是重啓後,icon又不見了,能夠這樣修改:
<\packages\apps\Launcher2\src\com\android\launcher2\LauncherModel.java>
final ItemInfo occupied[][][] =
new ItemInfo[Launcher.SCREEN_COUNT + 1][mCellCountX + 2][mCellCountY + 1]; //原來這裏是+1
25. 4.2 LockScreen 解鎖界面四個方向添加一個setting入口
frameworks\base\core\res\res\values/arrays.xml
<array name="lockscreen_targets_with_camera">
<item>@drawable/ic_lockscreen_unlock</item>
<item>@drawable/ic_action_assist_generic</item>
<item>@drawable/ic_lockscreen_camera</item>
<item>@drawable/ic_lockscreen_settings</item>
</array>
在 frameworks\base\core\res\res\drawable 增長 ic_lockscreen_settings.xml 文件並添加ic_lockscreen_settings_normal.phg ic_lockscreen_settings_activated.png 資源文件
<selectorxmlns:android="http://schemas.android.com/apk/res/android">
<item
android:state_enabled="true"
android:state_active="false"
android:state_focused="false"
android:drawable="@drawable/ic_lockscreen_settings_normal" />
<item
android:state_enabled="true"
android:state_active="true"
android:state_focused="false"
android:drawable="@drawable/ic_lockscreen_settings_activated" />
<item
android:state_enabled="true"
android:state_active="false"
android:state_focused="true"
android:drawable="@drawable/ic_lockscreen_settings_activated" />
</selector>
frameworks\base\policy\src\com\android\internal\policy\impl\LockScreen.java
public void onTrigger(View v, int target) {
final int resId =mGlowPadView.getResourceIdForTarget(target);
switch (resId) {
casecom.android.internal.R.drawable.ic_lockscreen_settings: //啓動setting 應用
launchActivity(newIntent().setComponent(newComponentName("com.android.settings","com.android.settings.Settings")));
mCallback.pokeWakelock();
break;
26. 4.2 上隱藏 Wifi Display
去掉項目overlay/frameworks/base/core/res/res/config.xml 中的config_enableWifiDisplay
27. 默認音量修改
frameworks/base/media/java/android/media/AudioService.java
private finalint[] MAX_STREAM_VOLUME = new int[] {
5, // STREAM_VOICE_CALL
7, // STREAM_SYSTEM
。。。
};
frameworks/base/media/java/android/media/AudioManager.java
/** @hide Default volume index values for audio streams */
public static final int[] DEFAULT_STREAM_VOLUME = new int[] {
4, // STREAM_VOICE_CALL
7, // STREAM_SYSTEM
。。。
};
28.widget中隱藏google play:
<\packages\apps\Launcher2\src\com\android\launcher2\AppsCustomizePagedView.java>
updatePackages裏面添加:
if(!widget.provider.getPackageName().equals("com.android.vending")&& !widget.provider.getPackageName().equals("com.android.vending.MarketWidgetProvider")){
mWidgets.add(widget);
}
29.去掉設置-->顯示-->亮度裏的「自動調整亮度」選項
<\packages\apps\Settings\res\layout\preference_dialog_brightness.xml>
<CheckBox android:id="@+id/automatic_mode"
加上
android:visibility="invisible"
30.設置-位置信息訪問權限默認關閉
<\frameworks\base\packages\SettingsProvider\res\values\defaults.xml>
<stringname="def_location_providers_allowed"translatable="false"></string>
這裏不要填寫gps或者network,清空
31.設置-安全-驗證應用默認不勾允
<\frameworks\base\packages\SettingsProvider\res\values\defaults.xml>
<boolname="def_package_verifier_enable">false</bool>
32.設置-聲音-觸摸提示音與鎖屏提示音默認不勾允狀態
<\frameworks\base\packages\SettingsProvider\res\values\defaults.xml>
<integername="def_lockscreen_sounds_enabled">0</integer>
<boolname="def_sound_effects_enabled">false</bool>
33.設置-以太網菜單請移動「更多」菜單下
請用附件ethernet.patch,開關是ro.ethernet.more,設置爲true,ethernet移到more裏面
在settings的git下打這個patch
34.窗口小部件「指針時鐘」顯示不全
把clock的widget向上調,下面的值改小:
<\packages\amlogic\Launcher2\res\values\dimens.xml>
<dimenname="app_widget_preview_padding_top">10dp</dimen>
35.去掉settings的more裏面的網絡共享與便攜式熱點
ro.tether.denied=true
36.平臺主界面底部工具欄上的圖標所有居中顯示,從左至右的圖標依次爲:vol-、back、home、窗口切換、vol+
1.在prop裏面將ro.statusbar.volume設置爲true
2.<\frameworks\base\packages\SystemUI\res\layout-sw600dp\navigation_bar.xml>
將
<com.android.systemui.statusbar.policy.KeyButtonViewandroid:id="@+id/sub"
……
/>
這段放到
<com.android.systemui.statusbar.policy.KeyButtonViewandroid:id="@+id/back"
……
/>
這段以前
<com.android.systemui.statusbar.policy.KeyButtonViewandroid:id="@+id/add"
……
/>
這段放到
<com.android.systemui.statusbar.policy.KeyButtonView
android:id="@+id/recent_apps"
……
/>
這段以後
注意這個文件有兩處須要調換上面的
3八、settings中的developer options的開關打開,debug關掉:
<\frameworks\base\packages\SettingsProvider\src\com\android\providers\settings\DatabaseHelper.java>
private void loadSecureSettings(SQLiteDatabase db) {
loadSetting(stmt,Settings.Secure.ADB_ENABLED, 0);
loadSetting(stmt,Settings.Secure.DEVELOPMENT_SETTINGS_ENABLED, 1);
41.secure的unknown的設置默認打開:
<\frameworks\base\packages\SettingsProvider\res\values\defaults.xml>
<boolname="def_install_non_market_apps">true</bool>