AndroidO,AndroidP SystemUI问题修改笔记
@VisibleForTesting
NearestTouchFrame(Context context, AttributeSet attrs, Configuration c) {
super(context, attrs);
//mIsActive = c.smallestScreenWidthDp < 600;
mIsActive = false
}
<string name="config_navBarLayout" translatable="false">left,recent;home;back,rightstring>
/**
* Notifies this manager that the back button has been pressed.
*
* @param hideImmediately Hide bouncer when {@code true}, keep it around otherwise.
* Non-scrimmed bouncers have a special animation tied to the expansion
* of the notification panel.
* @return whether the back press has been handled
*/
public boolean onBackPressed(boolean hideImmediately) {
Log.d(TAG, "onBackPressed()");
if (mBouncer.isShowing()) {
mStatusBar.endAffordanceLaunch();
reset(true/*hideImmediately*/);//add by [email protected] for defect 7216010
///M : fix ALPS01852958, clear mAfterKeyguardGoneAction when leaving bouncer.
mAfterKeyguardGoneAction = null ;
return true;
}
if (DEBUG) Log.d(TAG, "onBackPressed() - reset & return false");
return false;
}
<dimen name="screen_pinning_request_button_height">85dpdimen>
<dimen name="screen_pinning_request_nav_icon_padding">0dpdimen>
public boolean isPinPukOrMeRequiredOfPhoneId(int phoneId) {
KeyguardUpdateMonitor updateMonitor = KeyguardUpdateMonitor.getInstance(mContext);
if (updateMonitor != null) {
final IccCardConstants.State simState = updateMonitor.getSimStateOfPhoneId(phoneId);
Log.d(TAG, "isPinPukOrMeRequiredOfSubId() - phoneId = " + phoneId +
", simState = " + simState) ;
return (
// check PIN required
(simState == IccCardConstants.State.PIN_REQUIRED
&& !updateMonitor.getPinPukMeDismissFlagOfPhoneId(phoneId))
// check PUK required
|| (simState == IccCardConstants.State.PUK_REQUIRED
&& !updateMonitor.getPinPukMeDismissFlagOfPhoneId(phoneId)
&& updateMonitor.getRetryPukCountOfPhoneId(phoneId) != 0)
// check ME required
|| (simState == IccCardConstants.State.NETWORK_LOCKED
&& !updateMonitor.getPinPukMeDismissFlagOfPhoneId(phoneId)
&& updateMonitor.getSimMeLeftRetryCountOfPhoneId(phoneId) != 0
&& KeyguardUtils.isMediatekSimMeLockSupport()
&& !updateMonitor.getSimmeDismissFlagOfPhoneId(phoneId)
&& KeyguardUtils.isSimMeLockValid(phoneId)&&isShowSimMeLock)
);
} else {
return false;
}
}
private void launchMessage() {
Intent messageIntent = new Intent();
mActivityStarter.startActivity(messageIntent, true);
}
SystemUI/src/com/android/systemui/ActivityStarterDelegate.java
@Override
public void startActivity(Intent intent, boolean dismissShade, Callback callback) {
if (mActualStarter == null) return;
mActualStarter.startActivity(intent, dismissShade, callback);
}
SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
@Override
public void startActivity(Intent intent, boolean dismissShade, Callback callback) {
startActivityDismissingKeyguard(intent, false, dismissShade, callback);
}
//隐藏NotificationPanelView
mStatusBarView.collapsePanel(true, false /* delayed */, 100.0f /* speedUpFactor */);
private void setLockScreenisDisable(){
LockPatternUtils lockPatternUtils = new LockPatternUtils(mContext);
if(lockPatternUtils == null)return;
boolean isOTA;
try {
if(AppGlobals.getPackageManager() == null)return;
isOTA = AppGlobals.getPackageManager().isUpgrade();
Log.d(TAG,"setLockScreenisDisable...isOTA = :"+isOTA+",isLockScreenDisable = :"+(lockPatternUtils.isLockScreenDisabled(UserHandle.USER_OWNER))+",!ro.lockscreen.disable.default = :"+(!(SystemProperties.getBoolean("ro.lockscreen.disable.default", false))));
} catch (RemoteException e) {
throw new IllegalStateException("Package manager not available");
}
if(lockPatternUtils.isLockScreenDisabled(UserHandle.USER_OWNER) && isOTA && !(SystemProperties.getBoolean("ro.lockscreen.disable.default", false))){
lockPatternUtils.setLockScreenDisabled(false, UserHandle.USER_OWNER);
}
}
@Override
protected void onMeasure(int widthSpec, int heightSpec) {
....
for (int i = 0; i < count; i++) {
final View child = getChildAt(i);
final LayoutParams lp = (LayoutParams) child.getLayoutParams();
//add by [email protected] for defect 7485624 begin
if(child.getVisibility() == View.INVISIBLE || child.getVisibility() == View.GONE){
continue;
}
//add by [email protected] for defect 7485624 end
......
}
void launchHomeFromHotKey(final boolean awakenFromDreams, final boolean respectKeyguard)
SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
if (mBouncer.isShowing()) {
if (mShowing) {
mStatusBar.hideKeyguard();
mBouncer.hide(false /* destroyView */);
KeyguardUpdateMonitor.getInstance(mContext).sendKeyguardReset();
updateStates();
}
}
<com.android.keyguard.KeyguardPasswordView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:androidprv="http://schemas.android.com/apk/res-auto"
android:id="@+id/keyguard_password_view"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
androidprv:layout_maxWidth="@dimen/keyguard_security_width"
androidprv:layout_maxHeight="@dimen/keyguard_security_height"
android:gravity="bottom"
>
//PasswordMetrics 存储密码的矩阵
public void setActivePasswordState(PasswordMetrics metrics, int userHandle)
public LockscreenWallpaper(Context ctx, StatusBar bar, Handler h) {
......
//add by [email protected] for defect 9245999 begin
if(isFristBoot()){
mWallpaperManager.setStream(
mContext.getResources().openRawResource(R.drawable.default_lock_wallpaper),
null,
true,
WallpaperManager.FLAG_LOCK);
Settings.System.putInt(mContext.getContentResolver(), "isDefaultWallpaper",1);
}else{
Settings.System.putInt(mContext.getContentResolver(), "isDefaultWallpaper",0);
}
//add by [email protected] for defect 9245999 begin
} catch (RemoteException e) {
Log.e(TAG, "System dead?" + e);
} catch (IOException e) {
Log.e(TAG, "Exception = :" + e);
}
}
}
//add by [email protected] for defect 9245999 begin
private boolean isFristBoot(){
IPackageManager pm = AppGlobals.getPackageManager();
try {
return pm.isFirstBoot();
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
}
//add by [email protected] for defect 9245999 end
//frameworks/base/core/java/android/app/WallpaperManager.java
public ParcelFileDescriptor getWallpaperFile(@SetWallpaperFlags int which, int userId) {
//add by [email protected] for defect 9245999 begin
if(Settings.System.getInt(mContext.getContentResolver(), "isDefaultWallpaper",-1)==1 && which==2){
String pkg = mContext.getPackageName();
if(pkg.startsWith("com.android.cts") || pkg.startsWith("com.android.vts") || pkg.contains("gts"))
return null;
}
//add by [email protected] for defect 9245999 end
......
}
public void expand(final boolean animate){
......
getViewTreeObserver().addOnGlobalLayoutListener(
new ViewTreeObserver.OnGlobalLayoutListener() {
@Override
public void onGlobalLayout() {
if (!mInstantExpanding) {
getViewTreeObserver().removeOnGlobalLayoutListener(this);
return;
}//add by [email protected] for defect 7226148 begin
if (mStatusBar.getStatusBarWindow().getHeight()
!= mStatusBar.getStatusBarHeight()&&!mStatusBar.isBouncerShowing()
|| (mStatusBar.isKeyguardSecure() ?
mStatusBar.getBarState() != StatusBarState.SHADE : true)) {
//add by [email protected] for defect 7226148 end
......
}
private void updateNotificationTranslucency() {
float alpha = 1f;
if (mClosingWithAlphaFadeOut && !mExpandingFromHeadsUp &&
!mHeadsUpManager.hasPinnedHeadsUp()) {
alpha = getFadeoutAlpha();
}
if (mBarState == StatusBarState.KEYGUARD && !mHintAnimationRunning) {
alpha *= mClockPositionResult.clockAlpha;
}
//add by [email protected] for defect 8503312 begin
if(!mUnlockMethodCache.isMethodSecure() && mNotificationStackScroller.getAlpha() != 1 && mNotificationStackScroller.getAlpha() != 0){
mStatusBar.getLockIcon().setAlpha(alpha);
}
//add by [email protected] for defect 8503312 end
mNotificationStackScroller.setAlpha(alpha);
}
private void apply(State state) {
applyKeyguardFlags(state);
applyForceStatusBarVisibleFlag(state);
applyFocusableFlag(state);
applyForceShowNavigationFlag(state);
adjustScreenOrientation(state);
applyHeight(state);
applyUserActivityTimeout(state);
applyInputFeatures(state);
applyFitsSystemWindows(state);
applyModalFlag(state);
applyBrightness(state);
applyHasTopUi(state);
applyNotTouchable(state);
applyStatusBarColorSpaceAgnosticFlag(state);
if (mLp != null && mLp.copyFrom(mLpChanged) != 0) {
//寬高封装在mLp
mWindowManager.updateViewLayout(mStatusBarView, mLp);
}
if (mHasTopUi != mHasTopUiChanged) {
try {
mActivityManager.setHasTopUi(mHasTopUiChanged);
} catch (RemoteException e) {
Log.e(TAG, "Failed to call setHasTopUi", e);
}
mHasTopUi = mHasTopUiChanged;
}
notifyStateChangedCallbacks();
}