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

Commit 19c0a2c9 authored by Gaurav Bhola's avatar Gaurav Bhola
Browse files

Move the NotificationAccessConfirmationActivity component name to resource...

Move the NotificationAccessConfirmationActivity component name to resource config so that it can be overlayed.

- It will be overlayed by car_product.

Test: atest CompanionDeviceManagerTest
Bug: 191699828
Change-Id: I0f7d19d9a5e43d68affed8293745789d9b1b0adc
parent 45d0421a
Loading
Loading
Loading
Loading
+13 −5
Original line number Diff line number Diff line
@@ -17,19 +17,27 @@
package com.android.internal.notification;

import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;

import com.android.internal.R;

/**
 * This class provides methods to create intents for NotificationAccessConfirmationActivity.
 */
public final class NotificationAccessConfirmationActivityContract {
    private static final ComponentName COMPONENT_NAME = new ComponentName(
            "com.android.settings",
            "com.android.settings.notification.NotificationAccessConfirmationActivity");
    public static final String EXTRA_USER_ID = "user_id";
    public static final String EXTRA_COMPONENT_NAME = "component_name";
    public static final String EXTRA_PACKAGE_TITLE = "package_title";

    public static Intent launcherIntent(int userId, ComponentName component, String packageTitle) {
    /**
     * Creates a launcher intent for NotificationAccessConfirmationActivity.
     */
    public static Intent launcherIntent(Context context, int userId, ComponentName component,
            String packageTitle) {
        return new Intent()
                .setComponent(COMPONENT_NAME)
                .setComponent(ComponentName.unflattenFromString(context.getString(
                        R.string.config_notificationAccessConfirmationActivity)))
                .putExtra(EXTRA_USER_ID, userId)
                .putExtra(EXTRA_COMPONENT_NAME, component)
                .putExtra(EXTRA_PACKAGE_TITLE, packageTitle);
+6 −0
Original line number Diff line number Diff line
@@ -5135,6 +5135,12 @@
        <item>@array/config_secondaryBuiltInDisplayWaterfallCutout</item>
    </array>

    <!-- The component name of the activity for the companion-device-manager notification access
     confirmation. -->
    <string name="config_notificationAccessConfirmationActivity" translatable="false">
        com.android.settings/com.android.settings.notification.NotificationAccessConfirmationActivity
    </string>

    <!-- Whether the airplane mode should be reset when device boots in non-safemode after exiting
         from safemode.
         This flag should be enabled only when the product does not have any UI to toggle airplane
+1 −0
Original line number Diff line number Diff line
@@ -2218,6 +2218,7 @@
  <java-symbol type="bool" name="config_enableSecondaryLocationTimeZoneProvider" />
  <java-symbol type="string" name="config_secondaryLocationTimeZoneProviderPackageName" />
  <java-symbol type="bool" name="config_autoResetAirplaneMode" />
  <java-symbol type="string" name="config_notificationAccessConfirmationActivity" />

  <java-symbol type="layout" name="resolver_list" />
  <java-symbol type="id" name="resolver_list" />
+1 −1
Original line number Diff line number Diff line
@@ -566,7 +566,7 @@ public class CompanionDeviceManagerService extends SystemService implements Bind
                return PendingIntent.getActivityAsUser(getContext(),
                        0 /* request code */,
                        NotificationAccessConfirmationActivityContract.launcherIntent(
                                userId, component, packageTitle),
                                getContext(), userId, component, packageTitle),
                        PendingIntent.FLAG_IMMUTABLE | PendingIntent.FLAG_ONE_SHOT
                                | PendingIntent.FLAG_CANCEL_CURRENT,
                        null /* options */,