Loading packages/SystemUI/res/layout/ongoing_call_chip.xml +34 −26 Original line number Diff line number Diff line Loading @@ -13,17 +13,25 @@ ~ See the License for the specific language governing permissions and ~ limitations under the License. --> <LinearLayout <!-- Have the wrapper frame layout match the parent height so that we get a larger touch area for the chip. --> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/ongoing_call_chip" android:layout_width="wrap_content" android:layout_height="@dimen/ongoing_appops_chip_height" android:layout_height="match_parent" android:layout_gravity="center_vertical|start" android:gravity="center_vertical" > <LinearLayout android:layout_width="wrap_content" android:layout_height="@dimen/ongoing_appops_chip_height" android:layout_gravity="center_vertical" android:gravity="center" android:background="@drawable/ongoing_call_chip_bg" android:paddingStart="@dimen/ongoing_call_chip_side_padding" android:paddingEnd="@dimen/ongoing_call_chip_side_padding" android:contentDescription="@string/ongoing_phone_call_content_description" android:minWidth="@dimen/min_clickable_item_size" > <ImageView Loading @@ -33,7 +41,6 @@ android:tint="?android:attr/colorPrimary" /> <!-- TODO(b/183229367): The text in this view isn't quite centered within the chip. --> <com.android.systemui.statusbar.phone.ongoingcall.OngoingCallChronometer android:id="@+id/ongoing_call_chip_time" android:layout_width="wrap_content" Loading @@ -47,3 +54,4 @@ /> </LinearLayout> </FrameLayout> packages/SystemUI/src/com/android/systemui/statusbar/phone/CollapsedStatusBarFragment.java +1 −1 Original line number Diff line number Diff line Loading @@ -81,7 +81,7 @@ public class CollapsedStatusBarFragment extends Fragment implements CommandQueue private NetworkController mNetworkController; private LinearLayout mSystemIconArea; private View mClockView; private ViewGroup mOngoingCallChip; private View mOngoingCallChip; private View mNotificationIconAreaInner; private View mCenteredIconArea; private int mDisabled1; Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/ongoingcall/OngoingCallController.kt +3 −3 Original line number Diff line number Diff line Loading @@ -23,7 +23,7 @@ import android.app.Notification import android.app.Notification.CallStyle.CALL_TYPE_ONGOING import android.content.Intent import android.util.Log import android.view.ViewGroup import android.view.View import android.widget.Chronometer import com.android.systemui.R import com.android.systemui.animation.ActivityLaunchAnimator Loading Loading @@ -57,7 +57,7 @@ class OngoingCallController @Inject constructor( private var ongoingCallInfo: OngoingCallInfo? = null /** True if the application managing the call is visible to the user. */ private var isCallAppVisible: Boolean = true private var chipView: ViewGroup? = null private var chipView: View? = null private var uidObserver: IUidObserver.Stub? = null private val mListeners: MutableList<OngoingCallListener> = mutableListOf() Loading Loading @@ -105,7 +105,7 @@ class OngoingCallController @Inject constructor( * * Should only be called from [CollapsedStatusBarFragment]. */ fun setChipView(chipView: ViewGroup) { fun setChipView(chipView: View) { this.chipView = chipView if (hasOngoingCall()) { updateChip() Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/ongoingcall/OngoingCallChronometerTest.kt +1 −3 Original line number Diff line number Diff line Loading @@ -20,7 +20,6 @@ import android.testing.AndroidTestingRunner import android.testing.TestableLooper import android.view.LayoutInflater import android.view.View import android.widget.LinearLayout import androidx.test.filters.SmallTest import com.android.systemui.R import com.android.systemui.SysuiTestCase Loading Loading @@ -48,8 +47,7 @@ class OngoingCallChronometerTest : SysuiTestCase() { fun setUp() { allowTestableLooperAsMainThread() TestableLooper.get(this).runWithLooper { val chipView = LayoutInflater.from(mContext) .inflate(R.layout.ongoing_call_chip, null) as LinearLayout val chipView = LayoutInflater.from(mContext).inflate(R.layout.ongoing_call_chip, null) textView = chipView.findViewById(R.id.ongoing_call_chip_time)!! measureTextView() calculateDoesNotFixText() Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/ongoingcall/OngoingCallControllerTest.kt +5 −6 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import android.service.notification.NotificationListenerService.REASON_USER_STOP import android.testing.AndroidTestingRunner import android.testing.TestableLooper import android.view.LayoutInflater import android.view.View import android.widget.LinearLayout import androidx.test.filters.SmallTest import com.android.internal.logging.testing.UiEventLoggerFake Loading Loading @@ -80,14 +81,13 @@ class OngoingCallControllerTest : SysuiTestCase() { @Mock private lateinit var mockActivityStarter: ActivityStarter @Mock private lateinit var mockIActivityManager: IActivityManager private lateinit var chipView: LinearLayout private lateinit var chipView: View @Before fun setUp() { allowTestableLooperAsMainThread() TestableLooper.get(this).runWithLooper { chipView = LayoutInflater.from(mContext) .inflate(R.layout.ongoing_call_chip, null) as LinearLayout chipView = LayoutInflater.from(mContext).inflate(R.layout.ongoing_call_chip, null) } MockitoAnnotations.initMocks(this) Loading Loading @@ -225,10 +225,9 @@ class OngoingCallControllerTest : SysuiTestCase() { // Start an ongoing call. notifCollectionListener.onEntryUpdated(createOngoingCallNotifEntry()) lateinit var newChipView: LinearLayout lateinit var newChipView: View TestableLooper.get(this).runWithLooper { newChipView = LayoutInflater.from(mContext) .inflate(R.layout.ongoing_call_chip, null) as LinearLayout newChipView = LayoutInflater.from(mContext).inflate(R.layout.ongoing_call_chip, null) } // Change the chip view associated with the controller. Loading Loading
packages/SystemUI/res/layout/ongoing_call_chip.xml +34 −26 Original line number Diff line number Diff line Loading @@ -13,17 +13,25 @@ ~ See the License for the specific language governing permissions and ~ limitations under the License. --> <LinearLayout <!-- Have the wrapper frame layout match the parent height so that we get a larger touch area for the chip. --> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/ongoing_call_chip" android:layout_width="wrap_content" android:layout_height="@dimen/ongoing_appops_chip_height" android:layout_height="match_parent" android:layout_gravity="center_vertical|start" android:gravity="center_vertical" > <LinearLayout android:layout_width="wrap_content" android:layout_height="@dimen/ongoing_appops_chip_height" android:layout_gravity="center_vertical" android:gravity="center" android:background="@drawable/ongoing_call_chip_bg" android:paddingStart="@dimen/ongoing_call_chip_side_padding" android:paddingEnd="@dimen/ongoing_call_chip_side_padding" android:contentDescription="@string/ongoing_phone_call_content_description" android:minWidth="@dimen/min_clickable_item_size" > <ImageView Loading @@ -33,7 +41,6 @@ android:tint="?android:attr/colorPrimary" /> <!-- TODO(b/183229367): The text in this view isn't quite centered within the chip. --> <com.android.systemui.statusbar.phone.ongoingcall.OngoingCallChronometer android:id="@+id/ongoing_call_chip_time" android:layout_width="wrap_content" Loading @@ -47,3 +54,4 @@ /> </LinearLayout> </FrameLayout>
packages/SystemUI/src/com/android/systemui/statusbar/phone/CollapsedStatusBarFragment.java +1 −1 Original line number Diff line number Diff line Loading @@ -81,7 +81,7 @@ public class CollapsedStatusBarFragment extends Fragment implements CommandQueue private NetworkController mNetworkController; private LinearLayout mSystemIconArea; private View mClockView; private ViewGroup mOngoingCallChip; private View mOngoingCallChip; private View mNotificationIconAreaInner; private View mCenteredIconArea; private int mDisabled1; Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/ongoingcall/OngoingCallController.kt +3 −3 Original line number Diff line number Diff line Loading @@ -23,7 +23,7 @@ import android.app.Notification import android.app.Notification.CallStyle.CALL_TYPE_ONGOING import android.content.Intent import android.util.Log import android.view.ViewGroup import android.view.View import android.widget.Chronometer import com.android.systemui.R import com.android.systemui.animation.ActivityLaunchAnimator Loading Loading @@ -57,7 +57,7 @@ class OngoingCallController @Inject constructor( private var ongoingCallInfo: OngoingCallInfo? = null /** True if the application managing the call is visible to the user. */ private var isCallAppVisible: Boolean = true private var chipView: ViewGroup? = null private var chipView: View? = null private var uidObserver: IUidObserver.Stub? = null private val mListeners: MutableList<OngoingCallListener> = mutableListOf() Loading Loading @@ -105,7 +105,7 @@ class OngoingCallController @Inject constructor( * * Should only be called from [CollapsedStatusBarFragment]. */ fun setChipView(chipView: ViewGroup) { fun setChipView(chipView: View) { this.chipView = chipView if (hasOngoingCall()) { updateChip() Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/ongoingcall/OngoingCallChronometerTest.kt +1 −3 Original line number Diff line number Diff line Loading @@ -20,7 +20,6 @@ import android.testing.AndroidTestingRunner import android.testing.TestableLooper import android.view.LayoutInflater import android.view.View import android.widget.LinearLayout import androidx.test.filters.SmallTest import com.android.systemui.R import com.android.systemui.SysuiTestCase Loading Loading @@ -48,8 +47,7 @@ class OngoingCallChronometerTest : SysuiTestCase() { fun setUp() { allowTestableLooperAsMainThread() TestableLooper.get(this).runWithLooper { val chipView = LayoutInflater.from(mContext) .inflate(R.layout.ongoing_call_chip, null) as LinearLayout val chipView = LayoutInflater.from(mContext).inflate(R.layout.ongoing_call_chip, null) textView = chipView.findViewById(R.id.ongoing_call_chip_time)!! measureTextView() calculateDoesNotFixText() Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/ongoingcall/OngoingCallControllerTest.kt +5 −6 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import android.service.notification.NotificationListenerService.REASON_USER_STOP import android.testing.AndroidTestingRunner import android.testing.TestableLooper import android.view.LayoutInflater import android.view.View import android.widget.LinearLayout import androidx.test.filters.SmallTest import com.android.internal.logging.testing.UiEventLoggerFake Loading Loading @@ -80,14 +81,13 @@ class OngoingCallControllerTest : SysuiTestCase() { @Mock private lateinit var mockActivityStarter: ActivityStarter @Mock private lateinit var mockIActivityManager: IActivityManager private lateinit var chipView: LinearLayout private lateinit var chipView: View @Before fun setUp() { allowTestableLooperAsMainThread() TestableLooper.get(this).runWithLooper { chipView = LayoutInflater.from(mContext) .inflate(R.layout.ongoing_call_chip, null) as LinearLayout chipView = LayoutInflater.from(mContext).inflate(R.layout.ongoing_call_chip, null) } MockitoAnnotations.initMocks(this) Loading Loading @@ -225,10 +225,9 @@ class OngoingCallControllerTest : SysuiTestCase() { // Start an ongoing call. notifCollectionListener.onEntryUpdated(createOngoingCallNotifEntry()) lateinit var newChipView: LinearLayout lateinit var newChipView: View TestableLooper.get(this).runWithLooper { newChipView = LayoutInflater.from(mContext) .inflate(R.layout.ongoing_call_chip, null) as LinearLayout newChipView = LayoutInflater.from(mContext).inflate(R.layout.ongoing_call_chip, null) } // Change the chip view associated with the controller. Loading