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

Commit 2f3bd778 authored by Matthew Fritze's avatar Matthew Fritze
Browse files

Add SettingsPanel Intent Actions

A Settings Panel is a dialog that contains a fixed subset of
settings to address a particular user problem. The ultimate
goal is that users can solve problems in-app rather than going
into settings. This is limitted to to "safe" settings which do
not need the full context of the settings.

The Settings are hosted in a Settings activity, which prevents
scraping from the calling app.

Test: make -j40 RunSettingsRobotests, manual app
Test: atest SettingsPanelTest
Fixes: 117804442
Change-Id: I3afb9e235959d0e4bc889747c4518de89918674c
parent fe2f96e0
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -38191,6 +38191,11 @@ package android.provider {
    field public static final java.lang.String VALUE = "value";
  }
  public static final class Settings.Panel {
    field public static final java.lang.String ACTION_INTERNET_CONNECTIVITY = "android.settings.panel.action.INTERNET_CONNECTIVITY";
    field public static final java.lang.String ACTION_VOLUME = "android.settings.panel.action.VOLUME";
  }
  public static final class Settings.Secure extends android.provider.Settings.NameValueTable {
    ctor public Settings.Secure();
    method public static float getFloat(android.content.ContentResolver, java.lang.String, float);
+38 −0
Original line number Diff line number Diff line
@@ -14195,6 +14195,44 @@ public final class Settings {
        }
    }
    /**
     * <p>
     *     A Settings panel is floating UI that contains a fixed subset of settings to address a
     *     particular user problem. For example, the
     *     {@link #ACTION_INTERNET_CONNECTIVITY Internet Panel} surfaces settings related to
     *     connecting to the internet.
     * <p>
     *     Settings panels appear above the calling app to address the problem without
     *     the user needing to open Settings and thus leave their current screen.
     */
    public static final class Panel {
        private Panel() {
        }
        /**
         * Activity Action: Show a settings dialog containing settings to enable internet
         * connection.
         * <p>
         * Input: Nothing.
         * <p>
         * Output: Nothing.
         */
        @SdkConstant(SdkConstant.SdkConstantType.ACTIVITY_INTENT_ACTION)
        public static final String ACTION_INTERNET_CONNECTIVITY =
                "android.settings.panel.action.INTERNET_CONNECTIVITY";
        /**
         * Activity Action: Show a settings dialog containing all volume streams.
         * <p>
         * Input: Nothing.
         * <p>
         * Output: Nothing.
         */
        @SdkConstant(SdkConstant.SdkConstantType.ACTIVITY_INTENT_ACTION)
        public static final String ACTION_VOLUME =
                "android.settings.panel.action.VOLUME";
    }
    private static final String[] PM_WRITE_SETTINGS = {
        android.Manifest.permission.WRITE_SETTINGS
    };