File tree Expand file tree Collapse file tree 2 files changed +27
-0
lines changed
policy/src/com/android/internal/policy/impl/keyguard Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -166,6 +166,7 @@ public void hide() {
166166 // from AudioManager
167167 KeyguardHostView .this .addView (mTransportControl );
168168 mTransportControl .setVisibility (View .GONE );
169+ showAppropriateWidgetPage ();
169170 }
170171 }
171172
@@ -178,6 +179,7 @@ public void show() {
178179 mTransportControl .setVisibility (View .VISIBLE );
179180 // Once shown, leave it showing
180181 mSticky = true ;
182+ showAppropriateWidgetPage ();
181183 }
182184 }
183185 });
@@ -736,6 +738,15 @@ private void maybePopulateWidgets() {
736738 addWidget (widgets [i ]);
737739 }
738740 }
741+ showAppropriateWidgetPage ();
742+ }
743+
744+ private void showAppropriateWidgetPage () {
745+ int page = mAppWidgetContainer .indexOfChild (findViewById (R .id .keyguard_status_view ));
746+ if (mAppWidgetContainer .indexOfChild (mTransportControl ) != -1 ) {
747+ page = mAppWidgetContainer .indexOfChild (mTransportControl );
748+ }
749+ mAppWidgetContainer .setCurrentPage (page );
739750 }
740751
741752 private void inflateAndAddUserSelectorWidgetIfNecessary () {
Original file line number Diff line number Diff line change 1818import android .content .Context ;
1919import android .util .AttributeSet ;
2020import android .view .View ;
21+ import android .view .ViewGroup ;
2122import android .widget .LinearLayout ;
2223
2324import com .android .internal .R ;
@@ -70,5 +71,20 @@ public void showPagingFeedback() {
7071 @ Override
7172 public void onPageSwitch (View newPage , int newPageIndex ) {
7273 mPage = newPageIndex ;
74+
75+ // If we're showing the default system status widget, then we want to hide the clock
76+ boolean hideClock = false ;
77+ if ((newPage instanceof ViewGroup )) {
78+ ViewGroup vg = (ViewGroup ) newPage ;
79+ if (vg .getChildAt (0 ) instanceof KeyguardStatusView ) {
80+ hideClock = true ;
81+ }
82+ }
83+
84+ if (hideClock ) {
85+ setSystemUiVisibility (getSystemUiVisibility () | View .STATUS_BAR_DISABLE_CLOCK );
86+ } else {
87+ setSystemUiVisibility (getSystemUiVisibility () & ~View .STATUS_BAR_DISABLE_CLOCK );
88+ }
7389 }
7490}
You can’t perform that action at this time.
0 commit comments