Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4946c636 authored by Chris Li's avatar Chris Li
Browse files

Update flicker app targetSDK

Update the following:
1. PendingIntent requires FLAG_MUTABLE
2. Bubble/Notification requires POST_NOTIFICATIONS
3. registerReceiver requires RECEIVER_EXPORTED
4. Opt-out force edge-to-edge

Bug: 306666082
Test: pass presubmit
Test: atest PlatformScenarioTests:BackAndHomeOnGMail
Change-Id: I90de055be9c9c270b6815b719209ca8407431d39
parent d885398d
Loading
Loading
Loading
Loading
+8 −5
Original line number Diff line number Diff line
@@ -18,7 +18,10 @@
          package="com.android.server.wm.flicker.testapp">

    <uses-sdk android:minSdkVersion="29"
              android:targetSdkVersion="29"/>
              android:targetSdkVersion="35"/>

    <uses-permission android:name="android.permission.POST_NOTIFICATIONS" />

    <application android:allowBackup="false"
                 android:supportsRtl="true">
        <uses-library android:name="androidx.window.extensions" android:required="false"/>
@@ -107,7 +110,7 @@
                  android:immersive="true"
                  android:resizeableActivity="true"
                  android:screenOrientation="portrait"
                  android:theme="@android:style/Theme.NoTitleBar"
                  android:theme="@style/OptOutEdgeToEdge.NoTitleBar"
                  android:configChanges="screenSize"
                  android:label="PortraitImmersiveActivity"
                  android:exported="true">
@@ -119,7 +122,7 @@
        <activity android:name=".LaunchTransparentActivity"
                  android:resizeableActivity="false"
                  android:screenOrientation="portrait"
                  android:theme="@android:style/Theme"
                  android:theme="@style/OptOutEdgeToEdge"
                  android:taskAffinity="com.android.server.wm.flicker.testapp.LaunchTransparentActivity"
                  android:label="LaunchTransparentActivity"
                  android:exported="true">
@@ -273,7 +276,7 @@
                  android:exported="true"
                  android:label="MailActivity"
                  android:taskAffinity="com.android.server.wm.flicker.testapp.MailActivity"
                  android:theme="@style/Theme.AppCompat.Light">
                  android:theme="@style/OptOutEdgeToEdge.AppCompatTheme">
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>
                <category android:name="android.intent.category.LAUNCHER"/>
@@ -282,7 +285,7 @@
        <activity android:name=".GameActivity"
                  android:taskAffinity="com.android.server.wm.flicker.testapp.GameActivity"
                  android:immersive="true"
                  android:theme="@android:style/Theme.NoTitleBar"
                  android:theme="@style/OptOutEdgeToEdge.NoTitleBar"
                  android:configChanges="screenSize"
                  android:label="GameActivity"
                  android:exported="true">
+17 −5
Original line number Diff line number Diff line
@@ -16,7 +16,19 @@
  -->

<resources>
    <style name="DefaultTheme" parent="@android:style/Theme.DeviceDefault">
    <style name="OptOutEdgeToEdge" parent="@android:style/Theme.DeviceDefault">
        <item name="android:windowOptOutEdgeToEdgeEnforcement">true</item>
    </style>

    <style name="OptOutEdgeToEdge.NoTitleBar" parent="@android:style/Theme.NoTitleBar">
        <item name="android:windowOptOutEdgeToEdgeEnforcement">true</item>
    </style>

    <style name="OptOutEdgeToEdge.AppCompatTheme" parent="@style/Theme.AppCompat.Light">
        <item name="android:windowOptOutEdgeToEdgeEnforcement">true</item>
    </style>

    <style name="DefaultTheme" parent="@style/OptOutEdgeToEdge">
        <item name="android:windowBackground">@android:color/darker_gray</item>
    </style>

@@ -32,7 +44,7 @@
        <item name="android:windowLayoutInDisplayCutoutMode">never</item>
    </style>

    <style name="DialogTheme" parent="@android:style/Theme.DeviceDefault">
    <style name="DialogTheme" parent="@style/OptOutEdgeToEdge">
        <item name="android:windowAnimationStyle">@null</item>
        <item name="android:windowIsTranslucent">true</item>
        <item name="android:windowBackground">@null</item>
@@ -43,18 +55,18 @@
        <item name="android:windowSoftInputMode">stateUnchanged</item>
    </style>

    <style name="TransparentTheme" parent="@android:style/Theme.DeviceDefault">
    <style name="TransparentTheme" parent="@style/OptOutEdgeToEdge">
        <item name="android:windowIsTranslucent">true</item>
        <item name="android:windowBackground">@android:color/transparent</item>
        <item name="android:windowContentOverlay">@null</item>
        <item name="android:backgroundDimEnabled">false</item>
    </style>

    <style name="no_starting_window" parent="@android:style/Theme.DeviceDefault">
    <style name="no_starting_window" parent="@style/OptOutEdgeToEdge">
        <item name="android:windowDisablePreview">true</item>
    </style>

    <style name="SplashscreenAppTheme" parent="@android:style/Theme.DeviceDefault">
    <style name="SplashscreenAppTheme" parent="@style/OptOutEdgeToEdge">
        <!-- Splashscreen Attributes -->
        <item name="android:windowSplashScreenAnimatedIcon">@drawable/avd_anim</item>
        <!-- Here we want to match the duration of our AVD -->
+2 −2
Original line number Diff line number Diff line
@@ -125,7 +125,7 @@ public class BubbleHelper {
                .setContentTitle("BubbleChat")
                .setContentIntent(PendingIntent.getActivity(mContext, 0,
                        new Intent(mContext, LaunchBubbleActivity.class),
                        PendingIntent.FLAG_UPDATE_CURRENT))
                        PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_MUTABLE))
                .setStyle(new Notification.MessagingStyle(chatBot)
                        .setConversationTitle("BubbleChat")
                        .addMessage("BubbleChat",
@@ -140,7 +140,7 @@ public class BubbleHelper {
        Intent target = new Intent(mContext, BubbleActivity.class);
        target.putExtra(EXTRA_BUBBLE_NOTIF_ID, info.id);
        PendingIntent bubbleIntent = PendingIntent.getActivity(mContext, info.id, target,
                PendingIntent.FLAG_UPDATE_CURRENT);
                PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_MUTABLE);

        return new Notification.BubbleMetadata.Builder()
                .setIntent(bubbleIntent)
+11 −0
Original line number Diff line number Diff line
@@ -17,6 +17,9 @@
package com.android.server.wm.flicker.testapp;


import static android.Manifest.permission.POST_NOTIFICATIONS;
import static android.content.pm.PackageManager.PERMISSION_GRANTED;

import android.app.Activity;
import android.app.Person;
import android.content.Context;
@@ -24,6 +27,7 @@ import android.content.Intent;
import android.content.pm.ShortcutInfo;
import android.content.pm.ShortcutManager;
import android.graphics.drawable.Icon;
import android.os.Build;
import android.os.Bundle;
import android.view.View;

@@ -36,6 +40,13 @@ public class LaunchBubbleActivity extends Activity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU
                && checkSelfPermission(POST_NOTIFICATIONS) != PERMISSION_GRANTED) {
            // POST_NOTIFICATIONS permission required for notification post sdk 33.
            requestPermissions(new String[] { POST_NOTIFICATIONS }, 0);
        }

        addInboxShortcut(getApplicationContext());
        mBubbleHelper = BubbleHelper.getInstance(this);
        setContentView(R.layout.activity_main);
+11 −0
Original line number Diff line number Diff line
@@ -16,6 +16,9 @@

package com.android.server.wm.flicker.testapp;

import static android.Manifest.permission.POST_NOTIFICATIONS;
import static android.content.pm.PackageManager.PERMISSION_GRANTED;

import android.app.Activity;
import android.app.Notification;
import android.app.NotificationChannel;
@@ -23,6 +26,7 @@ import android.app.NotificationManager;
import android.app.PendingIntent;
import android.app.TaskStackBuilder;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.view.WindowManager;
import android.widget.Button;
@@ -34,6 +38,13 @@ public class NotificationActivity extends Activity {
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU
                && checkSelfPermission(POST_NOTIFICATIONS) != PERMISSION_GRANTED) {
            // POST_NOTIFICATIONS permission required for notification post sdk 33.
            requestPermissions(new String[] { POST_NOTIFICATIONS }, 0);
        }

        WindowManager.LayoutParams p = getWindow().getAttributes();
        p.layoutInDisplayCutoutMode = WindowManager.LayoutParams
                .LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES;
Loading