Repository navigation
Expand file tree
/
Copy pathframeworks_base.diff
More file actions
executable file
·182 lines (169 loc) · 9.56 KB
/
Copy pathframeworks_base.diff
File metadata and controls
executable file
·182 lines (169 loc) · 9.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
index 5c343c94..2f3ca09e 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
@@ -743,34 +743,39 @@ public class KeyguardViewMediator extends SystemUI {
mDeviceInteractive = mPM.isInteractive();
- mLockSounds = new SoundPool.Builder()
- .setMaxStreams(1)
- .setAudioAttributes(
- new AudioAttributes.Builder()
- .setUsage(AudioAttributes.USAGE_ASSISTANCE_SONIFICATION)
- .setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION)
- .build())
- .build();
- String soundPath = Settings.Global.getString(cr, Settings.Global.LOCK_SOUND);
- if (soundPath != null) {
- mLockSoundId = mLockSounds.load(soundPath, 1);
- }
- if (soundPath == null || mLockSoundId == 0) {
- Log.w(TAG, "failed to load lock sound from " + soundPath);
- }
- soundPath = Settings.Global.getString(cr, Settings.Global.UNLOCK_SOUND);
- if (soundPath != null) {
- mUnlockSoundId = mLockSounds.load(soundPath, 1);
- }
- if (soundPath == null || mUnlockSoundId == 0) {
- Log.w(TAG, "failed to load unlock sound from " + soundPath);
- }
- soundPath = Settings.Global.getString(cr, Settings.Global.TRUSTED_SOUND);
- if (soundPath != null) {
- mTrustedSoundId = mLockSounds.load(soundPath, 1);
- }
- if (soundPath == null || mTrustedSoundId == 0) {
- Log.w(TAG, "failed to load trusted sound from " + soundPath);
+ // P7 Wi-Fi bring-up defers the legacy audio/ION decoder path.
+ if (!SystemProperties.getBoolean("ro.p7.skip_lock_sounds", false)) {
+ mLockSounds = new SoundPool.Builder()
+ .setMaxStreams(1)
+ .setAudioAttributes(
+ new AudioAttributes.Builder()
+ .setUsage(AudioAttributes.USAGE_ASSISTANCE_SONIFICATION)
+ .setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION)
+ .build())
+ .build();
+ String soundPath = Settings.Global.getString(cr, Settings.Global.LOCK_SOUND);
+ if (soundPath != null) {
+ mLockSoundId = mLockSounds.load(soundPath, 1);
+ }
+ if (soundPath == null || mLockSoundId == 0) {
+ Log.w(TAG, "failed to load lock sound from " + soundPath);
+ }
+ soundPath = Settings.Global.getString(cr, Settings.Global.UNLOCK_SOUND);
+ if (soundPath != null) {
+ mUnlockSoundId = mLockSounds.load(soundPath, 1);
+ }
+ if (soundPath == null || mUnlockSoundId == 0) {
+ Log.w(TAG, "failed to load unlock sound from " + soundPath);
+ }
+ soundPath = Settings.Global.getString(cr, Settings.Global.TRUSTED_SOUND);
+ if (soundPath != null) {
+ mTrustedSoundId = mLockSounds.load(soundPath, 1);
+ }
+ if (soundPath == null || mTrustedSoundId == 0) {
+ Log.w(TAG, "failed to load trusted sound from " + soundPath);
+ }
+ } else {
+ Log.i(TAG, "P7 Wi-Fi bring-up: lock sounds disabled");
}
int lockSoundDefaultAttenuation = mContext.getResources().getInteger(
diff --git a/packages/SystemUI/src/com/android/systemui/power/PowerUI.java b/packages/SystemUI/src/com/android/systemui/power/PowerUI.java
index 75dc3972..2b83175e 100644
--- a/packages/SystemUI/src/com/android/systemui/power/PowerUI.java
+++ b/packages/SystemUI/src/com/android/systemui/power/PowerUI.java
@@ -322,6 +322,11 @@ public class PowerUI extends SystemUI {
mLowBatteryReminderLevels[0]);
}
+ // The first sticky battery broadcast has no previous snapshot yet.
+ // Use the current state as its baseline before evaluating warning deltas.
+ if (mLastBatteryStateSnapshot == null) {
+ mLastBatteryStateSnapshot = mCurrentBatteryStateSnapshot;
+ }
mWarnings.updateSnapshot(mCurrentBatteryStateSnapshot);
if (mCurrentBatteryStateSnapshot.isHybrid()) {
maybeShowHybridWarning(mCurrentBatteryStateSnapshot, mLastBatteryStateSnapshot);
diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java
index 7b8212a0..3e91bb33 100644
--- a/services/core/java/com/android/server/am/ActivityManagerService.java
+++ b/services/core/java/com/android/server/am/ActivityManagerService.java
@@ -5252,10 +5252,17 @@ public class ActivityManagerService extends IActivityManager.Stub
Trace.traceBegin(Trace.TRACE_TAG_ACTIVITY_MANAGER, "FinishBooting");
synchronized (this) {
- if (!mBootAnimationComplete) {
+ final boolean p7LegacyBoot = "hi6620oem".equals(
+ SystemProperties.get("ro.boot.hardware", ""));
+ if (!mBootAnimationComplete && !p7LegacyBoot) {
mCallFinishBooting = true;
return;
}
+ if (!mBootAnimationComplete) {
+ Slog.w(TAG, "P7 legacy display: completing framework boot before "
+ + "bootanimation callback");
+ mBootAnimationComplete = true;
+ }
mCallFinishBooting = false;
}
diff --git a/services/core/java/com/android/server/audio/AudioService.java b/services/core/java/com/android/server/audio/AudioService.java
index 0f80050f..6198a52f 100644
--- a/services/core/java/com/android/server/audio/AudioService.java
+++ b/services/core/java/com/android/server/audio/AudioService.java
@@ -5285,6 +5285,10 @@ public class AudioService extends IAudioService.Stub
}
private boolean onLoadSoundEffects() {
+ if (SystemProperties.getBoolean("ro.p7.skip_ui_sounds", false)) {
+ Log.i(TAG, "P7 Wi-Fi bring-up: UI sound decoding disabled");
+ return true;
+ }
int status;
synchronized (mSoundEffectsLock) {
@@ -5438,6 +5442,7 @@ public class AudioService extends IAudioService.Stub
}
private void onPlaySoundEffect(int effectType, int volume) {
+ if (SystemProperties.getBoolean("ro.p7.skip_ui_sounds", false)) return;
synchronized (mSoundEffectsLock) {
onLoadSoundEffects();
diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java
index f025aa4d..a04e0cb4 100644
--- a/services/core/java/com/android/server/wm/WindowManagerService.java
+++ b/services/core/java/com/android/server/wm/WindowManagerService.java
@@ -3318,7 +3318,14 @@ public class WindowManagerService extends IWindowManager.Stub
return;
}
- if (!mShowingBootMessages && !mPolicy.canDismissBootAnimation()) {
+ final boolean p7LegacyBoot = "hi6620oem".equals(
+ SystemProperties.get("ro.boot.hardware", ""));
+ if (p7LegacyBoot && !mForceDisplayEnabled) {
+ Slog.w(TAG_WM, "P7 legacy display: forcing bootanimation dismissal");
+ mForceDisplayEnabled = true;
+ }
+
+ if (!mShowingBootMessages && !mPolicy.canDismissBootAnimation() && !p7LegacyBoot) {
return;
}
diff --git a/services/usb/java/com/android/server/usb/UsbDeviceManager.java b/services/usb/java/com/android/server/usb/UsbDeviceManager.java
index 19b86b21..58e16735 100644
--- a/services/usb/java/com/android/server/usb/UsbDeviceManager.java
+++ b/services/usb/java/com/android/server/usb/UsbDeviceManager.java
@@ -1505,6 +1505,23 @@ public class UsbDeviceManager implements ActivityTaskManagerInternal.ScreenObser
@Override
protected void setEnabledFunctions(long usbFunctions, boolean forceRestart) {
+ // Temporary P7 userdebug bring-up: keep the initial ADB-only gadget
+ // bound while collecting a boot failure. The legacy driver must not
+ // be disconnected/rebound by framework policy during this test.
+ // Preserve normal ADB authentication and report the real init state.
+ if ("hi6620oem".equals(SystemProperties.get("ro.boot.hardware", ""))
+ && SystemProperties.getBoolean("ro.debuggable", false)
+ && SystemProperties.getBoolean("ro.p7.bringup_usb_static", false)) {
+ mCurrentFunctions = UsbManager.FUNCTION_ADB;
+ mCurrentFunctionsStr = UsbManager.USB_FUNCTION_ADB;
+ mCurrentOemFunctions = UsbManager.USB_FUNCTION_ADB;
+ mCurrentFunctionsApplied = UsbManager.USB_FUNCTION_ADB.equals(
+ getSystemProperty(USB_STATE_PROPERTY, ""));
+ mUsbDataUnlocked = false;
+ Slog.i(TAG, "P7 bring-up: retaining initial ADB-only USB, applied="
+ + mCurrentFunctionsApplied);
+ return;
+ }
boolean usbDataUnlocked = isUsbDataTransferActive(usbFunctions);
if (DEBUG) {
Slog.d(TAG, "setEnabledFunctions functions=" + usbFunctions + ", "