Adds a valid Activity target for Bubble metadata

Test: atest BubbleControllerTest
Bug: 123631037
Change-Id: Ied0e686febd2d1a7478e84faade958e187db0ef7
This commit is contained in:
Mark Renouf
2019-02-11 12:48:22 -05:00
parent c20de15455
commit a9fbb6ed90
3 changed files with 44 additions and 1 deletions

View File

@@ -68,6 +68,13 @@
</intent-filter>
</receiver>
<activity android:name="com.android.systemui.bubbles.BubblesTestActivity"
android:allowEmbedded="true"
android:documentLaunchMode="always"
android:excludeFromRecents="true"
android:exported="false"
android:resizeableActivity="true" />
<provider
android:name="androidx.lifecycle.ProcessLifecycleOwnerInitializer"
tools:replace="android:authorities"

View File

@@ -0,0 +1,34 @@
/*
* Copyright (C) 2019 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.systemui.bubbles;
import android.app.Activity;
import android.os.Bundle;
import com.android.systemui.R;
/**
* Referenced by NotificationTestHelper#makeBubbleMetadata
*/
public class BubblesTestActivity extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
}

View File

@@ -36,6 +36,7 @@ import android.view.LayoutInflater;
import android.widget.RemoteViews;
import com.android.systemui.R;
import com.android.systemui.bubbles.BubblesTestActivity;
import com.android.systemui.statusbar.notification.collection.NotificationEntry;
import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow;
import com.android.systemui.statusbar.notification.row.NotificationInflater.InflationFlag;
@@ -290,7 +291,8 @@ public class NotificationTestHelper {
}
private Notification.BubbleMetadata makeBubbleMetadata() {
PendingIntent bubbleIntent = PendingIntent.getActivity(mContext, 0, new Intent(), 0);
Intent target = new Intent(mContext, BubblesTestActivity.class);
PendingIntent bubbleIntent = PendingIntent.getActivity(mContext, 0, target, 0);
return new Notification.BubbleMetadata.Builder()
.setIntent(bubbleIntent)
.setTitle("bubble title")