android应用层相关设置及命令

网上搜了一些资料及同事指教,作如下笔记:


1.  去掉下拉状态栏:

frameworks/base/core/res/res/values/dimens.xml

-    <dimen name="status_bar_height">25dip</dimen>
+    <dimen name="status_bar_height">0dip</dimen>


2. 屏幕锁定方式改为无

frameworks/base/packages/SettingsProvider/res/values/defaults.xml

-    <bool name="def_lockscreen_disabled">false</bool>
+    <bool name="def_lockscreen_disabled">true</bool>

另外一种方式修改KeyguardViewMediator.java文件中 mExternallyEnabled 为False

frameworks/base/packages/Keyguard/src/com/android/keyguard/KeyguardViewMediator.java

但是系统灭屏时不会广播Intent.ACTION_SCRREN_OFF消息。


3. 设置转屏:

frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java

-    int mUserRotationMode = WindowManagerPolicy.USER_ROTATION_FREE;
+    int mUserRotationMode = WindowManagerPolicy.USER_ROTATION_LOCKED;


@@ -1477,6 +1480,7 @@
                     Settings.System.ACCELEROMETER_ROTATION, 0, UserHandle.USER_CURRENT) != 0 ?
                             WindowManagerPolicy.USER_ROTATION_FREE :
                                     WindowManagerPolicy.USER_ROTATION_LOCKED;
+            userRotationMode = WindowManagerPolicy.USER_ROTATION_LOCKED;


4. 去掉低电流提示框:

frameworks/base/packages/SystemUI/src/com/android/systemui/power/PowerUI.java

注释掉showLowBatteryWarning();


5. 去掉关机提示

frameworks/base/services/java/com/android/server/power/ShutdownThread.java

@@ -397,6 +397,8 @@
 
         synchronized (mEnableAnimatingSync) {
 
+        mEnableAnimating = false;
+
             if(!mEnableAnimating) {


6. 清除星历:

package com.example.testdemosuper;

import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.location.LocationManager;

public class MainActivity extends Activity {

    private static final String GPS_EXTRA_POSITION = "position";
    private static final String GPS_EXTRA_EPHEMERIS = "ephemeris";
    private static final String GPS_EXTRA_TIME = "time";
    private static final String GPS_EXTRA_IONO = "iono";
    private static final String GPS_EXTRA_UTC = "utc";
    private static final String GPS_EXTRA_HEALTH = "health";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        LocationManager mLocationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
        Bundle extras = new Bundle();
        extras.putBoolean(GPS_EXTRA_EPHEMERIS, true);
        extras.putBoolean(GPS_EXTRA_POSITION, true);
        extras.putBoolean(GPS_EXTRA_TIME, true);
        extras.putBoolean(GPS_EXTRA_IONO, true);
        extras.putBoolean(GPS_EXTRA_UTC, true);
        extras.putBoolean(GPS_EXTRA_HEALTH, true);
        mLocationManager.sendExtraCommand(LocationManager.GPS_PROVIDER,
                "delete_aiding_data", extras);
    }
}


7. 开机动画zip包的制作:

zip的压缩要在Linux制作,windows下打包会默认生成Thumbs.db文件。

zip -r -0 bootanimation.zip part0(文件夹名) part1(文件夹名) desc.txt


8. img包解压缩命令:
img解包:
python diff.pyc -o <output_dir>  <image_file>
img压缩:
python pack.pyc -<partition_size> <source_dir>


9.防止开机启动LAUNCHER时,瞬间有从竖屏到横屏的转动

frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
设置mRotation为1.


你可能感兴趣的:(android,开机动画,界面效果设置,清除星历)