基于MTK平台,多事对于客户需求的修改,原创请多支持。
N版本
(1)设置闹钟后多次显示在Stausbar的Notifacition区域多次显示相同的闹钟图标。
在函数
public void updateNotificationIcons(NotificationData notificationData)
中增加一个判断
主要是根据Notification的
PackageName
/**
* The resource id of a drawable to use as the icon in the status bar.
*
*/
public int icon;
/**
* If the icon in the status bar is to have more than one level, you can set this. Otherwise,
* leave it at its default value of 0.
*/
public int iconLevel;
NotificationIconAreaController.java文件中
+ HashMap uniqueIcon = new HashMap();
+
// Filter out ambient notifications and notification children.
for (int i = 0; i < size; i++) {
NotificationData.Entry ent = activeNotifications.get(i);
- if (shouldShowNotification(ent, notificationData)) {
- toShow.add(ent.icon);
+ String key = ent.notification.getPackageName()
+ + String.valueOf(ent.notification.getNotification().icon);
+ if (uniqueIcon.containsKey(key) && uniqueIcon.get(key)
+ == ent.notification.getNotification().iconLevel) {
+ continue;
+ }
+ if (!shouldShowNotification(ent, notificationData)) {
+ continue;
}
+ uniqueIcon.put(key, ent.notification.getNotification().iconLevel);
+ toShow.add(ent.icon);
(2)点击飞行模式图标,开启飞行模式时,动画不流畅。
base/packages/SystemUI/src/com/android/systemui/qs/tiles/AirplaneModeTile.java
以下为简单解决办法,也是自认为最有效的办法,由于等待动画启动时间不定,只能去除开启飞行模式的等待动画。保留关闭时的等待动画。
state.icon = mEnable;
} else {
state.icon = mDisable;
+ handleAnimationState(state, arg);
}
state.contentDescription = state.label;
state.minimalAccessibilityClassName = state.expandedAccessibilityClassName
= Switch.class.getName();
// /M: Maybe airplane mode need more time to turn on/off @{
- handleAnimationState(state, arg);
(3)移除状态栏编辑界面下方的预留个虚拟的按键位置。
ase/packages/SystemUI/res/layout/qs_customize_panel_content.xml
android:layout_width="match_parent"
android:layout_height="@dimen/navigation_bar_size"
android:layout_gravity="bottom"
- android:background="#ff000000" />
+ android:background="#ff000000"
+ android:visibility="gone"/>
O版本
(4)网络类型显示
SignalClusterView.java
/// M : Add for [Network Type on Statusbar]
private void setNetworkIcon() {
// Network type is CTA feature, so non CTA project should not set this.
if ((!FeatureOptions.MTK_CTA_SET) || mIsWfcCase) {
return;
}
if (mNetworkIcon == 0) {
mNetworkType.setVisibility(View.GONE);
} else {
if (!mPhoneStateExt.disableHostFunction()) {
mNetworkType.setImageResource(mNetworkIcon);
}
mNetworkType.setVisibility(View.VISIBLE);
}
}
(5)电池图标与电量百分比位置互换
BatteryMeterView.java
private void updateShowPercent() {
final boolean showing = mBatteryPercentView != null;
if ((0 != Settings.System.getInt(getContext().getContentResolver(),
SHOW_BATTERY_PERCENT, 0) || mForceShowPercent)
) {
if (!showing) {
mBatteryPercentView = loadHctPercentView();
if (mTextColor != 0) mBatteryPercentView.setTextColor(mTextColor);
updatePercentText();
addView(mBatteryPercentView,
1,
new ViewGroup.LayoutParams(
LayoutParams.WRAP_CONTENT,
LayoutParams.MATCH_PARENT));
}
} else {
if (showing) {
removeView(mBatteryPercentView);
mBatteryPercentView = null;
}
}
}
P版本
(1)指定桌面程序退出分屏,还是有些问题
--- a/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
+++ b/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
@@ -713,7 +713,6 @@ public class ActivityStackSupervisor extends ConfigurationContainer implements D
if (focusCandidate != mFocusedStack) {
mLastFocusedStack = mFocusedStack;
mFocusedStack = focusCandidate;
-
EventLogTags.writeAmFocusedStack(
mCurrentUser, mFocusedStack == null ? -1 : mFocusedStack.getStackId(),
mLastFocusedStack == null ? -1 : mLastFocusedStack.getStackId(), reason);
@@ -4488,6 +4487,15 @@ public class ActivityStackSupervisor extends ConfigurationContainer implements D
(preferredDisplayId != DEFAULT_DISPLAY && preferredDisplayId != INVALID_DISPLAY);
final boolean inSplitScreenMode = actualStack != null
&& actualStack.getDisplay().hasSplitScreenPrimaryStack();
+ // HCT lishuo for game mode Split Screen Window Error
+ String GAMEMODE_SETTING_KEY = "hct_game_mode";
+ int gameModeState = android.provider.Settings.Global.getInt(mService.mContext.getContentResolver(), GAMEMODE_SETTING_KEY, 0);
+ if(android.os.SystemProperties.get("ro.hct_gamemode_support").equals("1")
+ && gameModeState > 0 && actualStack.isActivityTypeHome() && actualStack.inSplitScreenWindowingMode()){
+ forceNonResizable = true;
+ actualStack.setWindowingMode(WINDOWING_MODE_FULLSCREEN);
+ }else
+ // HCT lishuo for game mode Split Screen Window Error end
if (((!inSplitScreenMode && preferredWindowingMode != WINDOWING_MODE_SPLIT_SCREEN_PRIMARY)
&& !isSecondaryDisplayPreferred) || !task.isActivityTypeStandardOrUndefined()) {
return;