Add new "addedInSdk" attribute to carrier-associated apps.
Previously, the sysconfig wasn't capable of understanding carrier-associated apps that were added after a device's initial launch (i.e. via OTA) because the logic in CarrierAppUtils explicitly avoids disabling such apps a second time. Most of this change is just plumbing everything through. For now, it's all @hide due to R API deadlines. It will be made public in S. Bug: 154872019 Test: manual, QA, atest FrameworksTelephonyTests:CarrierAppUtilsTest Change-Id: I530a4f73146b09879547ca2e0c26428957fef37a
This commit is contained in:
@@ -15,6 +15,9 @@
|
||||
*/
|
||||
package com.android.server;
|
||||
|
||||
import static java.util.stream.Collectors.toList;
|
||||
import static java.util.stream.Collectors.toMap;
|
||||
|
||||
import android.Manifest;
|
||||
import android.content.Context;
|
||||
import android.os.ISystemConfig;
|
||||
@@ -45,6 +48,19 @@ public class SystemConfigService extends SystemService {
|
||||
mContext.enforceCallingOrSelfPermission(Manifest.permission.READ_CARRIER_APP_INFO,
|
||||
"getDisabledUntilUsedPreInstalledCarrierAssociatedApps requires"
|
||||
+ " READ_CARRIER_APP_INFO");
|
||||
return SystemConfig.getInstance()
|
||||
.getDisabledUntilUsedPreinstalledCarrierAssociatedApps().entrySet().stream()
|
||||
.collect(toMap(
|
||||
Map.Entry::getKey,
|
||||
e -> e.getValue().stream().map(app -> app.packageName)
|
||||
.collect(toList())));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map getDisabledUntilUsedPreinstalledCarrierAssociatedAppEntries() {
|
||||
mContext.enforceCallingOrSelfPermission(Manifest.permission.READ_CARRIER_APP_INFO,
|
||||
"getDisabledUntilUsedPreInstalledCarrierAssociatedAppEntries requires"
|
||||
+ " READ_CARRIER_APP_INFO");
|
||||
return SystemConfig.getInstance()
|
||||
.getDisabledUntilUsedPreinstalledCarrierAssociatedApps();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user