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

Commit b38ad5f5 authored by Hall Liu's avatar Hall Liu
Browse files

Add system service for accessing SystemConfig

Add SystemConfigService and associated AIDLs and permissions for
accessing SystemConfig. The service returns values obtained from a
static instance of com.android.server.SystemConfig.

Bug: 143112379
Test: atest SystemConfigTest
Change-Id: I1a863ae9f53db21d698376008e5b1da83309b141
parent d6395337
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -153,6 +153,7 @@ package android {
    field public static final String PROVIDE_TRUST_AGENT = "android.permission.PROVIDE_TRUST_AGENT";
    field public static final String QUERY_TIME_ZONE_RULES = "android.permission.QUERY_TIME_ZONE_RULES";
    field public static final String READ_ACTIVE_EMERGENCY_SESSION = "android.permission.READ_ACTIVE_EMERGENCY_SESSION";
    field public static final String READ_CARRIER_APP_INFO = "android.permission.READ_CARRIER_APP_INFO";
    field public static final String READ_CELL_BROADCASTS = "android.permission.READ_CELL_BROADCASTS";
    field public static final String READ_CONTENT_RATING_SYSTEMS = "android.permission.READ_CONTENT_RATING_SYSTEMS";
    field public static final String READ_DEVICE_CONFIG = "android.permission.READ_DEVICE_CONFIG";
@@ -1683,6 +1684,7 @@ package android.content {
    field public static final String SECURE_ELEMENT_SERVICE = "secure_element";
    field public static final String STATS_MANAGER = "stats";
    field public static final String STATUS_BAR_SERVICE = "statusbar";
    field public static final String SYSTEM_CONFIG_SERVICE = "system_config";
    field public static final String SYSTEM_UPDATE_SERVICE = "system_update";
    field public static final String TELEPHONY_IMS_SERVICE = "telephony_ims";
    field public static final String TELEPHONY_REGISTRY_SERVICE = "telephony_registry";
@@ -7006,6 +7008,11 @@ package android.os {
    field public static final int TUPLE_VALUE_TYPE = 7; // 0x7
  }
  public class SystemConfigManager {
    method @NonNull @RequiresPermission(android.Manifest.permission.READ_CARRIER_APP_INFO) public java.util.Set<java.lang.String> getDisabledUntilUsedPreinstalledCarrierApps();
    method @NonNull @RequiresPermission(android.Manifest.permission.READ_CARRIER_APP_INFO) public java.util.Map<java.lang.String,java.util.List<java.lang.String>> getDisabledUntilUsedPreinstalledCarrierAssociatedApps();
  }
  public class SystemProperties {
    method @NonNull public static String get(@NonNull String);
    method @NonNull public static String get(@NonNull String, @Nullable String);
+5 −0
Original line number Diff line number Diff line
@@ -2167,6 +2167,11 @@ package android.os {
    method public void log(android.os.StrictMode.ViolationInfo);
  }

  public class SystemConfigManager {
    method @NonNull @RequiresPermission("android.permission.READ_CARRIER_APP_INFO") public java.util.Set<java.lang.String> getDisabledUntilUsedPreinstalledCarrierApps();
    method @NonNull @RequiresPermission("android.permission.READ_CARRIER_APP_INFO") public java.util.Map<java.lang.String,java.util.List<java.lang.String>> getDisabledUntilUsedPreinstalledCarrierAssociatedApps();
  }

  public class SystemProperties {
    method @NonNull public static String get(@NonNull String);
    method @NonNull public static String get(@NonNull String, @Nullable String);
+8 −0
Original line number Diff line number Diff line
@@ -147,6 +147,7 @@ import android.os.RecoverySystem;
import android.os.RemoteException;
import android.os.ServiceManager;
import android.os.ServiceManager.ServiceNotFoundException;
import android.os.SystemConfigManager;
import android.os.SystemUpdateManager;
import android.os.SystemVibrator;
import android.os.UserHandle;
@@ -617,6 +618,13 @@ public final class SystemServiceRegistry {
                        return new SystemUpdateManager(service);
                    }});

        registerService(Context.SYSTEM_CONFIG_SERVICE, SystemConfigManager.class,
                new CachedServiceFetcher<SystemConfigManager>() {
                    @Override
                    public SystemConfigManager createService(ContextImpl ctx) {
                        return new SystemConfigManager();
                    }});

        registerService(Context.TELEPHONY_REGISTRY_SERVICE, TelephonyRegistryManager.class,
            new CachedServiceFetcher<TelephonyRegistryManager>() {
                @Override
+8 −0
Original line number Diff line number Diff line
@@ -4969,6 +4969,14 @@ public abstract class Context {
    @TestApi
    public static final String TELEPHONY_IMS_SERVICE = "telephony_ims";

    /**
     * Use with {@link #getSystemService(String)} to retrieve an
     * {@link android.os.SystemConfigManager}.
     * @hide
     */
    @SystemApi
    public static final String SYSTEM_CONFIG_SERVICE = "system_config";

    /**
     * Use with {@link #getSystemService(String)} to retrieve an
     * {@link android.telephony.ims.RcsMessageManager}.
+33 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2020 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 android.os;

/**
  * Binder interface to query SystemConfig in the system server.
  * {@hide}
  */
interface ISystemConfig {
    /**
     * @see SystemConfigManager#getDisabledUntilUsedPreinstalledCarrierApps
     */
    List<String> getDisabledUntilUsedPreinstalledCarrierApps();

    /**
     * @see SystemConfigManager#getDisabledUntilUsedPreinstalledCarrierAssociatedApps
     */
    Map getDisabledUntilUsedPreinstalledCarrierAssociatedApps();
}
Loading