Android定制过程中经常需要更改的需求!
--- a/frameworks/base/cmds/bootanimation/BootAnimation.cpp
+++ b/frameworks/base/cmds/bootanimation/BootAnimation.cpp
+#define EXIT_ANIM_NAME "persist.bootanim.exit"
void BootAnimation::checkExit() {
char value[PROPERTY_VALUE_MAX];
+ char jvalue[PROPERTY_VALUE_MAX];
+ static int i = 0;
+
+ if(!i)
+ property_set(EXIT_ANIM_NAME, "0");
+
property_get(EXIT_PROP_NAME, value, "0");
+ property_get(EXIT_ANIM_NAME, jvalue, "0");
+
int exitnow = atoi(value);
+ int jexitnow = atoi(jvalue);
if (exitnow) {
+ if((jexitnow == 0) && (i < 375)) {
+ i++;
+ return;
+ }
+ else
+ i = 0;
+
requestExit();
if (mAudioPlayer != NULL) {
mAudioPlayer->requestExit();
--- a/frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
+++ b/frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
import android.os.SystemClock;
import android.os.Trace;
import android.os.UserHandle;
+import android.os.SystemProperties;
import android.service.voice.IVoiceInteractionSession;
import android.util.EventLog;
import android.util.Log;
@@ -1173,6 +1174,13 @@ final class ActivityRecord {
public void reportFullyDrawnLocked() {
final long curTime = SystemClock.uptimeMillis();
+ if(shortComponentName != null && !shortComponentName.contains("FallbackHome")
+ SystemProperties.set("persist.bootanim.exit", "1");
+ }
if (displayStartTime != 0) {
reportLaunchTimeLocked(curTime);
}
@@ -1215,6 +1223,13 @@ final class ActivityRecord {
final long thisTime = curTime - displayStartTime;
final long totalTime = stack.mLaunchStartTime != 0
? (curTime - stack.mLaunchStartTime) : thisTime;
+ if(shortComponentName != null && !shortComponentName.contains("FallbackHome")
+ SystemProperties.set("persist.bootanim.exit", "1");
+ }
if (SHOW_ACTIVITY_START_TIME) {
Trace.asyncTraceEnd(Trace.TRACE_TAG_ACTIVITY_MANAGER, "launching: " + packageName, 0);
EventLog.writeEvent(EventLogTags.AM_ACTIVITY_LAUNCH_TIME,
@@ -1247,6 +1262,13 @@ final class ActivityRecord {
void windowsDrawnLocked() {
mStackSupervisor.mActivityMetricsLogger.notifyWindowsDrawn();
+ if(shortComponentName != null && !shortComponentName.contains("FallbackHome")
+ SystemProperties.set("persist.bootanim.exit", "1");
+ }
if (displayStartTime != 0) {
reportLaunchTimeLocked(SystemClock.uptimeMillis());
}
(END)
framwork定制 系统给应用程序默认授予权限 简单快捷的方案-CSDN博客