diff options
56 files changed, 842 insertions, 108 deletions
diff --git a/core/api/current.txt b/core/api/current.txt index 6d9fe4494220..9a5e0de1f9b0 100644 --- a/core/api/current.txt +++ b/core/api/current.txt @@ -23754,6 +23754,7 @@ package android.media { field public static final String KEY_MPEGH_COMPATIBLE_SETS = "mpegh-compatible-sets"; field public static final String KEY_MPEGH_PROFILE_LEVEL_INDICATION = "mpegh-profile-level-indication"; field public static final String KEY_MPEGH_REFERENCE_CHANNEL_LAYOUT = "mpegh-reference-channel-layout"; + field @FlaggedApi("android.media.codec.num_input_slots") public static final String KEY_NUM_SLOTS = "num-slots"; field public static final String KEY_OPERATING_RATE = "operating-rate"; field public static final String KEY_OUTPUT_REORDER_DEPTH = "output-reorder-depth"; field public static final String KEY_PCM_ENCODING = "pcm-encoding"; @@ -40010,7 +40011,7 @@ package android.security.keystore { method @NonNull public android.security.keystore.KeyProtection.Builder setUserPresenceRequired(boolean); } - @FlaggedApi("android.security.keystore_grant_api") public class KeyStoreManager { + @FlaggedApi("android.security.keystore_grant_api") public final class KeyStoreManager { method @NonNull public java.util.List<java.security.cert.X509Certificate> getGrantedCertificateChainFromId(long) throws android.security.keystore.KeyPermanentlyInvalidatedException, java.security.UnrecoverableKeyException; method @NonNull public java.security.Key getGrantedKeyFromId(long) throws android.security.keystore.KeyPermanentlyInvalidatedException, java.security.UnrecoverableKeyException; method @NonNull public java.security.KeyPair getGrantedKeyPairFromId(long) throws android.security.keystore.KeyPermanentlyInvalidatedException, java.security.UnrecoverableKeyException; diff --git a/core/java/android/net/vcn/flags.aconfig b/core/java/android/net/vcn/flags.aconfig index 1adefe5a0b86..1b2c575917b2 100644 --- a/core/java/android/net/vcn/flags.aconfig +++ b/core/java/android/net/vcn/flags.aconfig @@ -18,13 +18,6 @@ flag { } flag { - name: "safe_mode_timeout_config" - namespace: "vcn" - description: "Feature flag for adjustable safe mode timeout" - bug: "317406085" -} - -flag { name: "fix_config_garbage_collection" namespace: "vcn" description: "Handle race condition in subscription change" diff --git a/keystore/java/android/security/keystore/KeyStoreManager.java b/keystore/java/android/security/keystore/KeyStoreManager.java index 197aaba4bcb5..e6091c1da8a5 100644 --- a/keystore/java/android/security/keystore/KeyStoreManager.java +++ b/keystore/java/android/security/keystore/KeyStoreManager.java @@ -49,7 +49,7 @@ import java.util.List; */ @FlaggedApi(android.security.Flags.FLAG_KEYSTORE_GRANT_API) @SystemService(Context.KEYSTORE_SERVICE) -public class KeyStoreManager { +public final class KeyStoreManager { private static final String TAG = "KeyStoreManager"; private static final Object sInstanceLock = new Object(); diff --git a/media/java/android/media/MediaFormat.java b/media/java/android/media/MediaFormat.java index b08a86ee8f46..bd65b2ecb76a 100644 --- a/media/java/android/media/MediaFormat.java +++ b/media/java/android/media/MediaFormat.java @@ -17,6 +17,7 @@ package android.media; import static android.media.codec.Flags.FLAG_IN_PROCESS_SW_AUDIO_CODEC; +import static android.media.codec.Flags.FLAG_NUM_INPUT_SLOTS; import static android.media.codec.Flags.FLAG_REGION_OF_INTEREST; import static android.media.codec.Flags.FLAG_APV_SUPPORT; @@ -1777,6 +1778,17 @@ public final class MediaFormat { public static final String KEY_SECURITY_MODEL = "security-model"; /** + * A key describing the number of slots used in the codec. When present in input format, + * the associated value indicates the number of input slots. The entry is set by the codec + * if configured with (@link MediaCodec#CONFIGURE_FLAG_BLOCK_MODEL), and will be ignored if set + * by the application. + * <p> + * The associated value is an integer. + */ + @FlaggedApi(FLAG_NUM_INPUT_SLOTS) + public static final String KEY_NUM_SLOTS = "num-slots"; + + /** * QpOffsetRect constitutes the metadata required for encoding a region of interest in an * image or a video frame. The region of interest is represented by a rectangle. The four * integer coordinates of the rectangle are stored in fields left, top, right, bottom. diff --git a/nfc/api/system-current.txt b/nfc/api/system-current.txt index 6aa8a2b73f2c..675c8f80add2 100644 --- a/nfc/api/system-current.txt +++ b/nfc/api/system-current.txt @@ -59,6 +59,7 @@ package android.nfc { method @FlaggedApi("android.nfc.nfc_oem_extension") @RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) public void clearPreference(); method @FlaggedApi("android.nfc.nfc_oem_extension") @NonNull public java.util.List<java.lang.String> getActiveNfceeList(); method @FlaggedApi("android.nfc.nfc_oem_extension") @NonNull @RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) public android.nfc.RoutingStatus getRoutingStatus(); + method @FlaggedApi("android.nfc.nfc_oem_extension") @NonNull @RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) public java.util.List<android.nfc.NfcRoutingTableEntry> getRoutingTable(); method @FlaggedApi("android.nfc.nfc_oem_extension") @RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) public boolean hasUserEnabledNfc(); method @FlaggedApi("android.nfc.nfc_oem_extension") @RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) public boolean isAutoChangeEnabled(); method @FlaggedApi("android.nfc.nfc_oem_extension") @RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) public boolean isTagPresent(); @@ -110,12 +111,46 @@ package android.nfc { method public void onTagDispatch(@NonNull java.util.function.Consumer<java.lang.Boolean>); } + @FlaggedApi("android.nfc.nfc_oem_extension") public abstract class NfcRoutingTableEntry { + method public int getNfceeId(); + } + @FlaggedApi("android.nfc.nfc_oem_extension") public class RoutingStatus { method @FlaggedApi("android.nfc.nfc_oem_extension") @RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) public int getDefaultIsoDepRoute(); method @FlaggedApi("android.nfc.nfc_oem_extension") @RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) public int getDefaultOffHostRoute(); method @FlaggedApi("android.nfc.nfc_oem_extension") @RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) public int getDefaultRoute(); } + @FlaggedApi("android.nfc.nfc_oem_extension") public class RoutingTableAidEntry extends android.nfc.NfcRoutingTableEntry { + method @FlaggedApi("android.nfc.nfc_oem_extension") @NonNull public String getAid(); + } + + @FlaggedApi("android.nfc.nfc_oem_extension") public class RoutingTableProtocolEntry extends android.nfc.NfcRoutingTableEntry { + method @FlaggedApi("android.nfc.nfc_oem_extension") public int getProtocol(); + field @FlaggedApi("android.nfc.nfc_oem_extension") public static final int PROTOCOL_ISO_DEP = 4; // 0x4 + field @FlaggedApi("android.nfc.nfc_oem_extension") public static final int PROTOCOL_NDEF = 7; // 0x7 + field @FlaggedApi("android.nfc.nfc_oem_extension") public static final int PROTOCOL_NFC_DEP = 5; // 0x5 + field @FlaggedApi("android.nfc.nfc_oem_extension") public static final int PROTOCOL_T1T = 1; // 0x1 + field @FlaggedApi("android.nfc.nfc_oem_extension") public static final int PROTOCOL_T2T = 2; // 0x2 + field @FlaggedApi("android.nfc.nfc_oem_extension") public static final int PROTOCOL_T3T = 3; // 0x3 + field @FlaggedApi("android.nfc.nfc_oem_extension") public static final int PROTOCOL_T5T = 6; // 0x6 + field @FlaggedApi("android.nfc.nfc_oem_extension") public static final int PROTOCOL_UNDETERMINED = 0; // 0x0 + field @FlaggedApi("android.nfc.nfc_oem_extension") public static final int PROTOCOL_UNSUPPORTED = -1; // 0xffffffff + } + + @FlaggedApi("android.nfc.nfc_oem_extension") public class RoutingTableSystemCodeEntry extends android.nfc.NfcRoutingTableEntry { + method @FlaggedApi("android.nfc.nfc_oem_extension") @NonNull public byte[] getSystemCode(); + } + + @FlaggedApi("android.nfc.nfc_oem_extension") public class RoutingTableTechnologyEntry extends android.nfc.NfcRoutingTableEntry { + method @FlaggedApi("android.nfc.nfc_oem_extension") public int getTechnology(); + field @FlaggedApi("android.nfc.nfc_oem_extension") public static final int TECHNOLOGY_A = 0; // 0x0 + field @FlaggedApi("android.nfc.nfc_oem_extension") public static final int TECHNOLOGY_B = 1; // 0x1 + field @FlaggedApi("android.nfc.nfc_oem_extension") public static final int TECHNOLOGY_F = 2; // 0x2 + field @FlaggedApi("android.nfc.nfc_oem_extension") public static final int TECHNOLOGY_UNSUPPORTED = -1; // 0xffffffff + field @FlaggedApi("android.nfc.nfc_oem_extension") public static final int TECHNOLOGY_V = 3; // 0x3 + } + } package android.nfc.cardemulation { diff --git a/nfc/java/android/nfc/Entry.aidl b/nfc/java/android/nfc/Entry.aidl new file mode 100644 index 000000000000..148c4ec86845 --- /dev/null +++ b/nfc/java/android/nfc/Entry.aidl @@ -0,0 +1,18 @@ +/* + * Copyright (C) 2024 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.nfc; + +parcelable Entry;
\ No newline at end of file diff --git a/nfc/java/android/nfc/Entry.java b/nfc/java/android/nfc/Entry.java new file mode 100644 index 000000000000..49d0f10dbfce --- /dev/null +++ b/nfc/java/android/nfc/Entry.java @@ -0,0 +1,77 @@ +/* + * Copyright (C) 2024 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.nfc; + +import android.annotation.NonNull; +import android.os.Parcel; +import android.os.Parcelable; + + +/** @hide */ +public final class Entry implements Parcelable { + private final byte mType; + private final byte mNfceeId; + private final String mEntry; + + public Entry(String entry, byte type, byte nfceeId) { + mEntry = entry; + mType = type; + mNfceeId = nfceeId; + } + + public byte getType() { + return mType; + } + + public byte getNfceeId() { + return mNfceeId; + } + + public String getEntry() { + return mEntry; + } + + @Override + public int describeContents() { + return 0; + } + + private Entry(Parcel in) { + this.mEntry = in.readString(); + this.mNfceeId = in.readByte(); + this.mType = in.readByte(); + } + + public static final @NonNull Parcelable.Creator<Entry> CREATOR = + new Parcelable.Creator<Entry>() { + @Override + public Entry createFromParcel(Parcel in) { + return new Entry(in); + } + + @Override + public Entry[] newArray(int size) { + return new Entry[size]; + } + }; + + @Override + public void writeToParcel(@NonNull Parcel dest, int flags) { + dest.writeString(mEntry); + dest.writeByte(mNfceeId); + dest.writeByte(mType); + } +} diff --git a/nfc/java/android/nfc/INfcAdapter.aidl b/nfc/java/android/nfc/INfcAdapter.aidl index a166b283f55b..40fd0683f465 100644 --- a/nfc/java/android/nfc/INfcAdapter.aidl +++ b/nfc/java/android/nfc/INfcAdapter.aidl @@ -18,6 +18,7 @@ package android.nfc; import android.app.PendingIntent; import android.content.IntentFilter; +import android.nfc.Entry; import android.nfc.NdefMessage; import android.nfc.Tag; import android.nfc.TechListParcel; @@ -117,4 +118,6 @@ interface INfcAdapter void triggerInitialization(); boolean getSettingStatus(); boolean isTagPresent(); + List<Entry> getRoutingTableEntryList(); + void indicateDataMigration(boolean inProgress, String pkg); } diff --git a/nfc/java/android/nfc/NfcAdapter.java b/nfc/java/android/nfc/NfcAdapter.java index d9fd42fd4f7a..c5d8191b22e6 100644 --- a/nfc/java/android/nfc/NfcAdapter.java +++ b/nfc/java/android/nfc/NfcAdapter.java @@ -2795,11 +2795,8 @@ public final class NfcAdapter { @IntRange(from = 0, to = 15) int gid, @IntRange(from = 0) int oid, @NonNull byte[] payload) { Objects.requireNonNull(payload, "Payload must not be null"); - try { - return sService.sendVendorNciMessage(mt, gid, oid, payload); - } catch (RemoteException e) { - throw e.rethrowFromSystemServer(); - } + return callServiceReturn(() -> sService.sendVendorNciMessage(mt, gid, oid, payload), + SEND_VENDOR_NCI_STATUS_FAILED); } /** @@ -2873,6 +2870,18 @@ public final class NfcAdapter { } /** + * Used by data migration to indicate data migration is in progrerss or not. + * + * Note: This is @hide intentionally since the client is inside the NFC apex. + * @param inProgress true if migration is in progress, false once done. + * @hide + */ + @RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) + public void indicateDataMigration(boolean inProgress) { + callService(() -> sService.indicateDataMigration(inProgress, mContext.getPackageName())); + } + + /** * Returns an instance of {@link NfcOemExtension} associated with {@link NfcAdapter} instance. * @hide */ diff --git a/nfc/java/android/nfc/NfcOemExtension.java b/nfc/java/android/nfc/NfcOemExtension.java index 1d2085c88213..1bfe71461ac3 100644 --- a/nfc/java/android/nfc/NfcOemExtension.java +++ b/nfc/java/android/nfc/NfcOemExtension.java @@ -43,6 +43,7 @@ import android.util.Log; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; +import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -71,6 +72,11 @@ import java.util.function.Supplier; public final class NfcOemExtension { private static final String TAG = "NfcOemExtension"; private static final int OEM_EXTENSION_RESPONSE_THRESHOLD_MS = 2000; + private static final int TYPE_TECHNOLOGY = 0; + private static final int TYPE_PROTOCOL = 1; + private static final int TYPE_AID = 2; + private static final int TYPE_SYSTEMCODE = 3; + private final NfcAdapter mAdapter; private final NfcOemExtensionCallback mOemNfcExtensionCallback; private boolean mIsRegistered = false; @@ -689,6 +695,39 @@ public final class NfcOemExtension { )); } + /** + * Gets current routing table entries. + * @return List of {@link NfcRoutingTableEntry} representing current routing table + */ + @NonNull + @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS) + @FlaggedApi(Flags.FLAG_NFC_OEM_EXTENSION) + public List<NfcRoutingTableEntry> getRoutingTable() { + List<Entry> entryList = NfcAdapter.callServiceReturn(() -> + NfcAdapter.sService.getRoutingTableEntryList(), null); + List<NfcRoutingTableEntry> result = new ArrayList<>(); + for (Entry entry : entryList) { + switch (entry.getType()) { + case TYPE_TECHNOLOGY -> result.add( + new RoutingTableTechnologyEntry(entry.getNfceeId(), + RoutingTableTechnologyEntry.techStringToInt(entry.getEntry())) + ); + case TYPE_PROTOCOL -> result.add( + new RoutingTableProtocolEntry(entry.getNfceeId(), + RoutingTableProtocolEntry.protocolStringToInt(entry.getEntry())) + ); + case TYPE_AID -> result.add( + new RoutingTableAidEntry(entry.getNfceeId(), entry.getEntry()) + ); + case TYPE_SYSTEMCODE -> result.add( + new RoutingTableSystemCodeEntry(entry.getNfceeId(), + entry.getEntry().getBytes(StandardCharsets.UTF_8)) + ); + } + } + return result; + } + private final class NfcOemExtensionCallback extends INfcOemExtensionCallback.Stub { @Override diff --git a/nfc/java/android/nfc/NfcRoutingTableEntry.java b/nfc/java/android/nfc/NfcRoutingTableEntry.java new file mode 100644 index 000000000000..4e913776a030 --- /dev/null +++ b/nfc/java/android/nfc/NfcRoutingTableEntry.java @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2024 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.nfc; + + +import android.annotation.FlaggedApi; +import android.annotation.SystemApi; + +/** + * Class to represent an entry of routing table. This class is abstract and extended by + * {@link RoutingTableTechnologyEntry}, {@link RoutingTableProtocolEntry}, + * {@link RoutingTableAidEntry} and {@link RoutingTableSystemCodeEntry}. + * + * @hide + */ +@FlaggedApi(Flags.FLAG_NFC_OEM_EXTENSION) +@SystemApi +public abstract class NfcRoutingTableEntry { + private final int mNfceeId; + + /** @hide */ + protected NfcRoutingTableEntry(int nfceeId) { + mNfceeId = nfceeId; + } + + /** + * Gets the NFCEE Id of this entry. + * @return an integer of NFCEE Id. + */ + public int getNfceeId() { + return mNfceeId; + } +} diff --git a/nfc/java/android/nfc/RoutingTableAidEntry.java b/nfc/java/android/nfc/RoutingTableAidEntry.java new file mode 100644 index 000000000000..7634fe342ab9 --- /dev/null +++ b/nfc/java/android/nfc/RoutingTableAidEntry.java @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2024 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.nfc; + +import android.annotation.FlaggedApi; +import android.annotation.NonNull; +import android.annotation.SystemApi; + +/** + * Represents an AID entry in current routing table. + * @hide + */ +@FlaggedApi(Flags.FLAG_NFC_OEM_EXTENSION) +@SystemApi +public class RoutingTableAidEntry extends NfcRoutingTableEntry { + private final String mValue; + + /** @hide */ + public RoutingTableAidEntry(int nfceeId, String value) { + super(nfceeId); + this.mValue = value; + } + + /** + * Gets AID value. + * @return String of AID + */ + @FlaggedApi(Flags.FLAG_NFC_OEM_EXTENSION) + @NonNull + public String getAid() { + return mValue; + } +} diff --git a/nfc/java/android/nfc/RoutingTableProtocolEntry.java b/nfc/java/android/nfc/RoutingTableProtocolEntry.java new file mode 100644 index 000000000000..0c5be7dd9d97 --- /dev/null +++ b/nfc/java/android/nfc/RoutingTableProtocolEntry.java @@ -0,0 +1,129 @@ +/* + * Copyright (C) 2024 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.nfc; + +import android.annotation.FlaggedApi; +import android.annotation.IntDef; +import android.annotation.SystemApi; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +/** + * Represents a protocol entry in current routing table. + * @hide + */ +@FlaggedApi(Flags.FLAG_NFC_OEM_EXTENSION) +@SystemApi +public class RoutingTableProtocolEntry extends NfcRoutingTableEntry { + /** + * Protocol undetermined. + */ + @FlaggedApi(Flags.FLAG_NFC_OEM_EXTENSION) + public static final int PROTOCOL_UNDETERMINED = 0; + /** + * T1T Protocol + */ + @FlaggedApi(Flags.FLAG_NFC_OEM_EXTENSION) + public static final int PROTOCOL_T1T = 1; + /** + * T2T Protocol + */ + @FlaggedApi(Flags.FLAG_NFC_OEM_EXTENSION) + public static final int PROTOCOL_T2T = 2; + /** + * T3T Protocol + */ + @FlaggedApi(Flags.FLAG_NFC_OEM_EXTENSION) + public static final int PROTOCOL_T3T = 3; + /** + * ISO-DEP Protocol + */ + @FlaggedApi(Flags.FLAG_NFC_OEM_EXTENSION) + public static final int PROTOCOL_ISO_DEP = 4; + /** + * DEP Protocol + */ + @FlaggedApi(Flags.FLAG_NFC_OEM_EXTENSION) + public static final int PROTOCOL_NFC_DEP = 5; + /** + * T5T Protocol + */ + @FlaggedApi(Flags.FLAG_NFC_OEM_EXTENSION) + public static final int PROTOCOL_T5T = 6; + /** + * NDEF Protocol + */ + @FlaggedApi(Flags.FLAG_NFC_OEM_EXTENSION) + public static final int PROTOCOL_NDEF = 7; + /** + * Unsupported Protocol + */ + @FlaggedApi(Flags.FLAG_NFC_OEM_EXTENSION) + public static final int PROTOCOL_UNSUPPORTED = -1; + + /** + * + * @hide + */ + @IntDef(prefix = { "PROTOCOL_" }, value = { + PROTOCOL_UNDETERMINED, + PROTOCOL_T1T, + PROTOCOL_T2T, + PROTOCOL_T3T, + PROTOCOL_ISO_DEP, + PROTOCOL_NFC_DEP, + PROTOCOL_T5T, + PROTOCOL_NDEF, + PROTOCOL_UNSUPPORTED + }) + @Retention(RetentionPolicy.SOURCE) + public @interface ProtocolValue {} + + private final @ProtocolValue int mValue; + + /** @hide */ + public RoutingTableProtocolEntry(int nfceeId, @ProtocolValue int value) { + super(nfceeId); + this.mValue = value; + } + + /** + * Gets Protocol value. + * @return Protocol defined in {@link ProtocolValue} + */ + @ProtocolValue + @FlaggedApi(Flags.FLAG_NFC_OEM_EXTENSION) + public int getProtocol() { + return mValue; + } + + /** @hide */ + @ProtocolValue + public static int protocolStringToInt(String protocolString) { + return switch (protocolString) { + case "PROTOCOL_T1T" -> PROTOCOL_T1T; + case "PROTOCOL_T2T" -> PROTOCOL_T2T; + case "PROTOCOL_T3T" -> PROTOCOL_T3T; + case "PROTOCOL_ISO_DEP" -> PROTOCOL_ISO_DEP; + case "PROTOCOL_NFC_DEP" -> PROTOCOL_NFC_DEP; + case "PROTOCOL_T5T" -> PROTOCOL_T5T; + case "PROTOCOL_NDEF" -> PROTOCOL_NDEF; + case "PROTOCOL_UNDETERMINED" -> PROTOCOL_UNDETERMINED; + default -> PROTOCOL_UNSUPPORTED; + }; + } +} diff --git a/nfc/java/android/nfc/RoutingTableSystemCodeEntry.java b/nfc/java/android/nfc/RoutingTableSystemCodeEntry.java new file mode 100644 index 000000000000..f87ad5f95195 --- /dev/null +++ b/nfc/java/android/nfc/RoutingTableSystemCodeEntry.java @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2024 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.nfc; + +import android.annotation.FlaggedApi; +import android.annotation.NonNull; +import android.annotation.SystemApi; + +/** + * Represents a system code entry in current routing table. + * @hide + */ +@FlaggedApi(Flags.FLAG_NFC_OEM_EXTENSION) +@SystemApi +public class RoutingTableSystemCodeEntry extends NfcRoutingTableEntry { + private final byte[] mValue; + + /** @hide */ + public RoutingTableSystemCodeEntry(int nfceeId, byte[] value) { + super(nfceeId); + this.mValue = value; + } + + /** + * Gets system code value. + * @return Byte array of system code + */ + @FlaggedApi(Flags.FLAG_NFC_OEM_EXTENSION) + @NonNull + public byte[] getSystemCode() { + return mValue; + } +} diff --git a/nfc/java/android/nfc/RoutingTableTechnologyEntry.java b/nfc/java/android/nfc/RoutingTableTechnologyEntry.java new file mode 100644 index 000000000000..f51a5299be11 --- /dev/null +++ b/nfc/java/android/nfc/RoutingTableTechnologyEntry.java @@ -0,0 +1,101 @@ +/* + * Copyright (C) 2024 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.nfc; + +import android.annotation.FlaggedApi; +import android.annotation.IntDef; +import android.annotation.SystemApi; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +/** + * Represents a technology entry in current routing table. + * @hide + */ +@FlaggedApi(Flags.FLAG_NFC_OEM_EXTENSION) +@SystemApi +public class RoutingTableTechnologyEntry extends NfcRoutingTableEntry { + /** + * Technology-A + */ + @FlaggedApi(Flags.FLAG_NFC_OEM_EXTENSION) + public static final int TECHNOLOGY_A = 0; + /** + * Technology-B + */ + @FlaggedApi(Flags.FLAG_NFC_OEM_EXTENSION) + public static final int TECHNOLOGY_B = 1; + /** + * Technology-F + */ + @FlaggedApi(Flags.FLAG_NFC_OEM_EXTENSION) + public static final int TECHNOLOGY_F = 2; + /** + * Technology-V + */ + @FlaggedApi(Flags.FLAG_NFC_OEM_EXTENSION) + public static final int TECHNOLOGY_V = 3; + /** + * Unsupported technology + */ + @FlaggedApi(Flags.FLAG_NFC_OEM_EXTENSION) + public static final int TECHNOLOGY_UNSUPPORTED = -1; + + /** + * + * @hide + */ + @IntDef(prefix = { "TECHNOLOGY_" }, value = { + TECHNOLOGY_A, + TECHNOLOGY_B, + TECHNOLOGY_F, + TECHNOLOGY_V, + TECHNOLOGY_UNSUPPORTED + }) + @Retention(RetentionPolicy.SOURCE) + public @interface TechnologyValue{} + + private final @TechnologyValue int mValue; + + /** @hide */ + public RoutingTableTechnologyEntry(int nfceeId, @TechnologyValue int value) { + super(nfceeId); + this.mValue = value; + } + + /** + * Gets technology value. + * @return technology value + */ + @TechnologyValue + @FlaggedApi(Flags.FLAG_NFC_OEM_EXTENSION) + public int getTechnology() { + return mValue; + } + + /** @hide */ + @TechnologyValue + public static int techStringToInt(String tech) { + return switch (tech) { + case "TECHNOLOGY_A" -> TECHNOLOGY_A; + case "TECHNOLOGY_B" -> TECHNOLOGY_B; + case "TECHNOLOGY_F" -> TECHNOLOGY_F; + case "TECHNOLOGY_V" -> TECHNOLOGY_V; + default -> TECHNOLOGY_UNSUPPORTED; + }; + } +} diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/CustomizationProvider.kt b/packages/SystemUI/src/com/android/systemui/keyguard/CustomizationProvider.kt index 342325ffee91..ca358e180b0b 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/CustomizationProvider.kt +++ b/packages/SystemUI/src/com/android/systemui/keyguard/CustomizationProvider.kt @@ -30,7 +30,7 @@ import android.net.Uri import android.os.Binder import android.os.Bundle import android.util.Log -import com.android.app.tracing.coroutines.runBlocking +import com.android.app.tracing.coroutines.runBlockingTraced as runBlocking import com.android.systemui.SystemUIAppComponentFactoryBase import com.android.systemui.SystemUIAppComponentFactoryBase.ContextAvailableCallback import com.android.systemui.dagger.qualifiers.Main diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/data/repository/KeyguardTransitionRepository.kt b/packages/SystemUI/src/com/android/systemui/keyguard/data/repository/KeyguardTransitionRepository.kt index 1b201ceda310..ac797feca550 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/data/repository/KeyguardTransitionRepository.kt +++ b/packages/SystemUI/src/com/android/systemui/keyguard/data/repository/KeyguardTransitionRepository.kt @@ -23,7 +23,7 @@ import android.annotation.FloatRange import android.annotation.SuppressLint import android.os.Trace import android.util.Log -import com.android.app.tracing.coroutines.withContext +import com.android.app.tracing.coroutines.withContextTraced as withContext import com.android.systemui.dagger.SysUISingleton import com.android.systemui.dagger.qualifiers.Main import com.android.systemui.keyguard.shared.model.KeyguardState diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromAodTransitionInteractor.kt b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromAodTransitionInteractor.kt index 2a9ee9fb8779..1e228eb5205d 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromAodTransitionInteractor.kt +++ b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromAodTransitionInteractor.kt @@ -18,7 +18,7 @@ package com.android.systemui.keyguard.domain.interactor import android.animation.ValueAnimator import com.android.app.animation.Interpolators -import com.android.app.tracing.coroutines.launch +import com.android.app.tracing.coroutines.launchTraced as launch import com.android.systemui.dagger.SysUISingleton import com.android.systemui.dagger.qualifiers.Background import com.android.systemui.dagger.qualifiers.Main diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromDreamingTransitionInteractor.kt b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromDreamingTransitionInteractor.kt index 7fa197c11e57..ab8075c7bcbf 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromDreamingTransitionInteractor.kt +++ b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromDreamingTransitionInteractor.kt @@ -18,7 +18,7 @@ package com.android.systemui.keyguard.domain.interactor import android.animation.ValueAnimator import com.android.app.animation.Interpolators -import com.android.app.tracing.coroutines.launch +import com.android.app.tracing.coroutines.launchTraced as launch import com.android.systemui.Flags.communalHub import com.android.systemui.dagger.SysUISingleton import com.android.systemui.dagger.qualifiers.Background diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromGlanceableHubTransitionInteractor.kt b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromGlanceableHubTransitionInteractor.kt index e516fa3c44bb..26d1c25b6634 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromGlanceableHubTransitionInteractor.kt +++ b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromGlanceableHubTransitionInteractor.kt @@ -18,7 +18,7 @@ package com.android.systemui.keyguard.domain.interactor import android.animation.ValueAnimator import com.android.app.animation.Interpolators -import com.android.app.tracing.coroutines.launch +import com.android.app.tracing.coroutines.launchTraced as launch import com.android.systemui.Flags import com.android.systemui.dagger.SysUISingleton import com.android.systemui.dagger.qualifiers.Background diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromGoneTransitionInteractor.kt b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromGoneTransitionInteractor.kt index f5b12a2ecfcf..a5b8ff034603 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromGoneTransitionInteractor.kt +++ b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromGoneTransitionInteractor.kt @@ -18,7 +18,7 @@ package com.android.systemui.keyguard.domain.interactor import android.animation.ValueAnimator import com.android.app.animation.Interpolators -import com.android.app.tracing.coroutines.launch +import com.android.app.tracing.coroutines.launchTraced as launch import com.android.systemui.communal.domain.interactor.CommunalInteractor import com.android.systemui.dagger.SysUISingleton import com.android.systemui.dagger.qualifiers.Background diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromLockscreenTransitionInteractor.kt b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromLockscreenTransitionInteractor.kt index f30eef080ede..a2c9da0d70e5 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromLockscreenTransitionInteractor.kt +++ b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromLockscreenTransitionInteractor.kt @@ -19,7 +19,7 @@ package com.android.systemui.keyguard.domain.interactor import android.animation.ValueAnimator import android.util.MathUtils import com.android.app.animation.Interpolators -import com.android.app.tracing.coroutines.launch +import com.android.app.tracing.coroutines.launchTraced as launch import com.android.systemui.Flags import com.android.systemui.dagger.SysUISingleton import com.android.systemui.dagger.qualifiers.Background diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/KeyguardQuickAffordanceInteractor.kt b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/KeyguardQuickAffordanceInteractor.kt index ccce3bf1397c..a01a0e467f34 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/KeyguardQuickAffordanceInteractor.kt +++ b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/KeyguardQuickAffordanceInteractor.kt @@ -22,7 +22,7 @@ import android.app.admin.DevicePolicyManager import android.content.Context import android.content.Intent import android.util.Log -import com.android.app.tracing.coroutines.withContext +import com.android.app.tracing.coroutines.withContextTraced as withContext import com.android.compose.animation.scene.ObservableTransitionState import com.android.internal.widget.LockPatternUtils import com.android.systemui.animation.DialogTransitionAnimator diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/AlternateBouncerMessageAreaViewBinder.kt b/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/AlternateBouncerMessageAreaViewBinder.kt index fe5f632c0b6a..23b7b664d4f1 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/AlternateBouncerMessageAreaViewBinder.kt +++ b/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/AlternateBouncerMessageAreaViewBinder.kt @@ -18,7 +18,7 @@ package com.android.systemui.keyguard.ui.binder import androidx.lifecycle.Lifecycle import androidx.lifecycle.repeatOnLifecycle -import com.android.app.tracing.coroutines.launch +import com.android.app.tracing.coroutines.launchTraced as launch import com.android.keyguard.AuthKeyguardMessageArea import com.android.systemui.keyguard.ui.viewmodel.AlternateBouncerMessageAreaViewModel import com.android.systemui.lifecycle.repeatWhenAttached diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/AlternateBouncerUdfpsViewBinder.kt b/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/AlternateBouncerUdfpsViewBinder.kt index 9dc77d3dc9d3..53eefa7408c7 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/AlternateBouncerUdfpsViewBinder.kt +++ b/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/AlternateBouncerUdfpsViewBinder.kt @@ -21,7 +21,7 @@ import android.content.res.ColorStateList import android.view.View import androidx.lifecycle.Lifecycle import androidx.lifecycle.repeatOnLifecycle -import com.android.app.tracing.coroutines.launch +import com.android.app.tracing.coroutines.launchTraced as launch import com.android.systemui.deviceentry.shared.DeviceEntryUdfpsRefactor import com.android.systemui.keyguard.ui.view.DeviceEntryIconView import com.android.systemui.keyguard.ui.viewmodel.AlternateBouncerUdfpsIconViewModel diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/AlternateBouncerViewBinder.kt b/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/AlternateBouncerViewBinder.kt index f8063c92124d..e7e4ed50bf7a 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/AlternateBouncerViewBinder.kt +++ b/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/AlternateBouncerViewBinder.kt @@ -29,7 +29,7 @@ import androidx.constraintlayout.widget.ConstraintLayout import androidx.constraintlayout.widget.ConstraintSet import androidx.lifecycle.Lifecycle import androidx.lifecycle.repeatOnLifecycle -import com.android.app.tracing.coroutines.launch +import com.android.app.tracing.coroutines.launchTraced as launch import com.android.systemui.CoreStartable import com.android.systemui.dagger.SysUISingleton import com.android.systemui.dagger.qualifiers.Application diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/DeviceEntryIconViewBinder.kt b/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/DeviceEntryIconViewBinder.kt index b45eae7301b4..646f0fde8cc0 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/DeviceEntryIconViewBinder.kt +++ b/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/DeviceEntryIconViewBinder.kt @@ -27,7 +27,7 @@ import androidx.compose.ui.graphics.toArgb import androidx.core.view.isInvisible import androidx.lifecycle.Lifecycle import androidx.lifecycle.repeatOnLifecycle -import com.android.app.tracing.coroutines.launch +import com.android.app.tracing.coroutines.launchTraced as launch import com.android.systemui.common.ui.view.LongPressHandlingView import com.android.systemui.deviceentry.shared.DeviceEntryUdfpsRefactor import com.android.systemui.keyguard.ui.view.DeviceEntryIconView diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardBlueprintViewBinder.kt b/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardBlueprintViewBinder.kt index bec8f3da9999..b684d196619a 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardBlueprintViewBinder.kt +++ b/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardBlueprintViewBinder.kt @@ -22,7 +22,7 @@ import androidx.constraintlayout.widget.ConstraintLayout import androidx.constraintlayout.widget.ConstraintSet import androidx.lifecycle.Lifecycle import androidx.lifecycle.repeatOnLifecycle -import com.android.app.tracing.coroutines.launch +import com.android.app.tracing.coroutines.launchTraced as launch import com.android.systemui.keyguard.KeyguardBottomAreaRefactor import com.android.systemui.keyguard.shared.model.KeyguardBlueprint import com.android.systemui.keyguard.ui.view.layout.blueprints.transitions.BaseBlueprintTransition diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardBottomAreaViewBinder.kt b/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardBottomAreaViewBinder.kt index 660a650fb916..3bdf7dac75b3 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardBottomAreaViewBinder.kt +++ b/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardBottomAreaViewBinder.kt @@ -36,7 +36,7 @@ import androidx.core.view.updateLayoutParams import androidx.lifecycle.Lifecycle import androidx.lifecycle.repeatOnLifecycle import com.android.app.animation.Interpolators -import com.android.app.tracing.coroutines.launch +import com.android.app.tracing.coroutines.launchTraced as launch import com.android.settingslib.Utils import com.android.systemui.animation.ActivityTransitionAnimator import com.android.systemui.animation.Expandable diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardIndicationAreaBinder.kt b/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardIndicationAreaBinder.kt index 23c2491813f7..93499027140b 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardIndicationAreaBinder.kt +++ b/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardIndicationAreaBinder.kt @@ -22,7 +22,7 @@ import android.view.ViewGroup import android.widget.TextView import androidx.lifecycle.Lifecycle import androidx.lifecycle.repeatOnLifecycle -import com.android.app.tracing.coroutines.launch +import com.android.app.tracing.coroutines.launchTraced as launch import com.android.systemui.keyguard.KeyguardBottomAreaRefactor import com.android.systemui.keyguard.MigrateClocksToBlueprint import com.android.systemui.keyguard.ui.viewmodel.KeyguardIndicationAreaViewModel diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardLongPressViewBinder.kt b/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardLongPressViewBinder.kt index 09fe067f7724..762760e3a1e3 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardLongPressViewBinder.kt +++ b/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardLongPressViewBinder.kt @@ -20,7 +20,7 @@ package com.android.systemui.keyguard.ui.binder import android.view.View import androidx.lifecycle.Lifecycle import androidx.lifecycle.repeatOnLifecycle -import com.android.app.tracing.coroutines.launch +import com.android.app.tracing.coroutines.launchTraced as launch import com.android.systemui.common.ui.view.LongPressHandlingView import com.android.systemui.keyguard.ui.viewmodel.KeyguardLongPressViewModel import com.android.systemui.lifecycle.repeatWhenAttached diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardPreviewClockViewBinder.kt b/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardPreviewClockViewBinder.kt index 8386628f4c83..86dae0cbc6aa 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardPreviewClockViewBinder.kt +++ b/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardPreviewClockViewBinder.kt @@ -33,7 +33,7 @@ import androidx.constraintlayout.widget.ConstraintSet.TOP import androidx.core.view.isVisible import androidx.lifecycle.Lifecycle import androidx.lifecycle.repeatOnLifecycle -import com.android.app.tracing.coroutines.launch +import com.android.app.tracing.coroutines.launchTraced as launch import com.android.internal.policy.SystemBarUtils import com.android.systemui.customization.R as customizationR import com.android.systemui.keyguard.shared.model.ClockSizeSetting diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardPreviewSmartspaceViewBinder.kt b/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardPreviewSmartspaceViewBinder.kt index 4b75b804e52b..baa681282a0b 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardPreviewSmartspaceViewBinder.kt +++ b/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardPreviewSmartspaceViewBinder.kt @@ -22,7 +22,7 @@ import android.view.View import androidx.core.view.isInvisible import androidx.lifecycle.Lifecycle import androidx.lifecycle.repeatOnLifecycle -import com.android.app.tracing.coroutines.launch +import com.android.app.tracing.coroutines.launchTraced as launch import com.android.systemui.keyguard.shared.model.ClockSizeSetting import com.android.systemui.keyguard.ui.viewmodel.KeyguardPreviewSmartspaceViewModel import com.android.systemui.lifecycle.repeatWhenAttached diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardSettingsViewBinder.kt b/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardSettingsViewBinder.kt index fa5756522a6a..8df67d38d0f2 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardSettingsViewBinder.kt +++ b/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardSettingsViewBinder.kt @@ -22,7 +22,7 @@ import android.view.View import androidx.core.view.isVisible import androidx.lifecycle.Lifecycle import androidx.lifecycle.repeatOnLifecycle -import com.android.app.tracing.coroutines.launch +import com.android.app.tracing.coroutines.launchTraced as launch import com.android.systemui.animation.ActivityTransitionAnimator import com.android.systemui.common.ui.binder.IconViewBinder import com.android.systemui.common.ui.binder.TextViewBinder diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardSmartspaceViewBinder.kt b/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardSmartspaceViewBinder.kt index 191056c5578a..7a13d657973c 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardSmartspaceViewBinder.kt +++ b/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardSmartspaceViewBinder.kt @@ -21,7 +21,7 @@ import androidx.constraintlayout.helper.widget.Layer import androidx.constraintlayout.widget.ConstraintLayout import androidx.lifecycle.Lifecycle import androidx.lifecycle.repeatOnLifecycle -import com.android.app.tracing.coroutines.launch +import com.android.app.tracing.coroutines.launchTraced as launch import com.android.systemui.keyguard.MigrateClocksToBlueprint import com.android.systemui.keyguard.domain.interactor.KeyguardBlueprintInteractor import com.android.systemui.keyguard.ui.view.layout.blueprints.transitions.IntraBlueprintTransition.Config diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardSurfaceBehindViewBinder.kt b/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardSurfaceBehindViewBinder.kt index fd27dc39299b..3934917d13c4 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardSurfaceBehindViewBinder.kt +++ b/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardSurfaceBehindViewBinder.kt @@ -16,7 +16,7 @@ package com.android.systemui.keyguard.ui.binder -import com.android.app.tracing.coroutines.launch +import com.android.app.tracing.coroutines.launchTraced as launch import com.android.systemui.keyguard.WindowManagerLockscreenVisibilityManager import com.android.systemui.keyguard.ui.viewmodel.KeyguardSurfaceBehindViewModel import kotlinx.coroutines.CoroutineScope diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/LightRevealScrimViewBinder.kt b/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/LightRevealScrimViewBinder.kt index b2ee68967878..2df17c39d90d 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/LightRevealScrimViewBinder.kt +++ b/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/LightRevealScrimViewBinder.kt @@ -18,7 +18,7 @@ package com.android.systemui.keyguard.ui.binder import androidx.lifecycle.Lifecycle import androidx.lifecycle.repeatOnLifecycle -import com.android.app.tracing.coroutines.launch +import com.android.app.tracing.coroutines.launchTraced as launch import com.android.systemui.keyguard.ui.viewmodel.LightRevealScrimViewModel import com.android.systemui.lifecycle.repeatWhenAttached import com.android.systemui.statusbar.LightRevealScrim diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/WindowManagerLockscreenVisibilityViewBinder.kt b/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/WindowManagerLockscreenVisibilityViewBinder.kt index ae46dd3a6ef3..b1ce47ee79e6 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/WindowManagerLockscreenVisibilityViewBinder.kt +++ b/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/WindowManagerLockscreenVisibilityViewBinder.kt @@ -16,7 +16,7 @@ package com.android.systemui.keyguard.ui.binder -import com.android.app.tracing.coroutines.launch +import com.android.app.tracing.coroutines.launchTraced as launch import com.android.systemui.keyguard.WindowManagerLockscreenVisibilityManager import com.android.systemui.keyguard.ui.viewmodel.WindowManagerLockscreenVisibilityViewModel import kotlinx.coroutines.CoroutineScope diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/KeyguardRootViewModel.kt b/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/KeyguardRootViewModel.kt index aefff7d0f79b..edd7ae0733b3 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/KeyguardRootViewModel.kt +++ b/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/KeyguardRootViewModel.kt @@ -20,7 +20,7 @@ package com.android.systemui.keyguard.ui.viewmodel import android.graphics.Point import android.util.MathUtils import android.view.View.VISIBLE -import com.android.app.tracing.coroutines.launch +import com.android.app.tracing.coroutines.launchTraced as launch import com.android.systemui.Flags.newAodTransition import com.android.systemui.common.shared.model.NotificationContainerBounds import com.android.systemui.communal.domain.interactor.CommunalInteractor diff --git a/packages/SystemUI/src/com/android/systemui/lifecycle/RepeatWhenAttached.kt b/packages/SystemUI/src/com/android/systemui/lifecycle/RepeatWhenAttached.kt index bf80e1870f1b..be32d108f676 100644 --- a/packages/SystemUI/src/com/android/systemui/lifecycle/RepeatWhenAttached.kt +++ b/packages/SystemUI/src/com/android/systemui/lifecycle/RepeatWhenAttached.kt @@ -26,7 +26,7 @@ import androidx.lifecycle.LifecycleOwner import androidx.lifecycle.LifecycleRegistry import androidx.lifecycle.lifecycleScope import com.android.app.tracing.coroutines.createCoroutineTracingContext -import com.android.app.tracing.coroutines.launch +import com.android.app.tracing.coroutines.launchTraced as launch import com.android.systemui.Flags.coroutineTracing import com.android.systemui.util.Assert import com.android.systemui.util.Compile diff --git a/packages/SystemUI/src/com/android/systemui/notetask/NoteTaskController.kt b/packages/SystemUI/src/com/android/systemui/notetask/NoteTaskController.kt index 3aa9daac4866..d0f6f7961889 100644 --- a/packages/SystemUI/src/com/android/systemui/notetask/NoteTaskController.kt +++ b/packages/SystemUI/src/com/android/systemui/notetask/NoteTaskController.kt @@ -37,7 +37,7 @@ import android.os.UserManager import android.provider.Settings import android.widget.Toast import androidx.annotation.VisibleForTesting -import com.android.app.tracing.coroutines.launch +import com.android.app.tracing.coroutines.launchTraced as launch import com.android.systemui.dagger.SysUISingleton import com.android.systemui.dagger.qualifiers.Application import com.android.systemui.dagger.qualifiers.Background diff --git a/packages/SystemUI/src/com/android/systemui/screenshot/ActionExecutor.kt b/packages/SystemUI/src/com/android/systemui/screenshot/ActionExecutor.kt index 1868b4a29f20..a7b6ec7bb713 100644 --- a/packages/SystemUI/src/com/android/systemui/screenshot/ActionExecutor.kt +++ b/packages/SystemUI/src/com/android/systemui/screenshot/ActionExecutor.kt @@ -26,7 +26,7 @@ import android.os.UserHandle import android.util.Log import android.util.Pair import android.view.Window -import com.android.app.tracing.coroutines.launch +import com.android.app.tracing.coroutines.launchTraced as launch import com.android.internal.app.ChooserActivity import com.android.systemui.dagger.qualifiers.Application import dagger.assisted.Assisted diff --git a/packages/SystemUI/src/com/android/systemui/screenshot/ActionIntentExecutor.kt b/packages/SystemUI/src/com/android/systemui/screenshot/ActionIntentExecutor.kt index 9e622801a01b..7b01c36489fb 100644 --- a/packages/SystemUI/src/com/android/systemui/screenshot/ActionIntentExecutor.kt +++ b/packages/SystemUI/src/com/android/systemui/screenshot/ActionIntentExecutor.kt @@ -31,7 +31,7 @@ import android.view.RemoteAnimationAdapter import android.view.RemoteAnimationTarget import android.view.WindowManager import android.view.WindowManagerGlobal -import com.android.app.tracing.coroutines.launch +import com.android.app.tracing.coroutines.launchTraced as launch import com.android.internal.infra.ServiceConnector import com.android.systemui.Flags import com.android.systemui.dagger.SysUISingleton diff --git a/packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotProxyService.kt b/packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotProxyService.kt index c8067df114fc..6df22f036273 100644 --- a/packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotProxyService.kt +++ b/packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotProxyService.kt @@ -21,7 +21,7 @@ import android.os.RemoteException import android.util.Log import androidx.lifecycle.LifecycleService import androidx.lifecycle.lifecycleScope -import com.android.app.tracing.coroutines.launch +import com.android.app.tracing.coroutines.launchTraced as launch import com.android.systemui.dagger.qualifiers.Main import com.android.systemui.plugins.ActivityStarter import com.android.systemui.shade.ShadeExpansionStateManager diff --git a/packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotSoundController.kt b/packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotSoundController.kt index d3a7fc4a3e4a..7aeec47241cb 100644 --- a/packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotSoundController.kt +++ b/packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotSoundController.kt @@ -18,7 +18,7 @@ package com.android.systemui.screenshot import android.media.MediaPlayer import android.util.Log -import com.android.app.tracing.coroutines.async +import com.android.app.tracing.coroutines.asyncTraced as async import com.android.systemui.dagger.qualifiers.Application import com.android.systemui.dagger.qualifiers.Background import javax.inject.Inject diff --git a/ravenwood/Android.bp b/ravenwood/Android.bp index 4731cfbfc935..0c2ce8dcb698 100644 --- a/ravenwood/Android.bp +++ b/ravenwood/Android.bp @@ -376,6 +376,7 @@ filegroup { ":ravenwood-empty-res", ":framework-platform-compat-config", ":services-platform-compat-config", + "texts/ravenwood-build.prop", ], device_first_srcs: [ ":apex_icu.dat", diff --git a/ravenwood/junit-impl-src/android/platform/test/ravenwood/RavenwoodRuntimeEnvironmentController.java b/ravenwood/junit-impl-src/android/platform/test/ravenwood/RavenwoodRuntimeEnvironmentController.java index 91778579ab28..c5a9c7b28ad3 100644 --- a/ravenwood/junit-impl-src/android/platform/test/ravenwood/RavenwoodRuntimeEnvironmentController.java +++ b/ravenwood/junit-impl-src/android/platform/test/ravenwood/RavenwoodRuntimeEnvironmentController.java @@ -22,7 +22,6 @@ import static com.android.ravenwood.common.RavenwoodCommonUtils.RAVENWOOD_INST_R import static com.android.ravenwood.common.RavenwoodCommonUtils.RAVENWOOD_RESOURCE_APK; import static com.android.ravenwood.common.RavenwoodCommonUtils.RAVENWOOD_VERBOSE_LOGGING; import static com.android.ravenwood.common.RavenwoodCommonUtils.RAVENWOOD_VERSION_JAVA_SYSPROP; -import static com.android.ravenwood.common.RavenwoodCommonUtils.getRavenwoodRuntimePath; import static org.junit.Assert.assertThrows; import static org.mockito.ArgumentMatchers.any; @@ -90,8 +89,6 @@ public class RavenwoodRuntimeEnvironmentController { private static final String LIBRAVENWOOD_INITIALIZER_NAME = "ravenwood_initializer"; private static final String RAVENWOOD_NATIVE_SYSPROP_NAME = "ravenwood_sysprop"; private static final String RAVENWOOD_NATIVE_RUNTIME_NAME = "ravenwood_runtime"; - private static final String RAVENWOOD_BUILD_PROP = - getRavenwoodRuntimePath() + "ravenwood-data/build.prop"; /** * When enabled, attempt to dump all thread stacks just before we hit the @@ -204,7 +201,7 @@ public class RavenwoodRuntimeEnvironmentController { System.load(RavenwoodCommonUtils.getJniLibraryPath(RAVENWOOD_NATIVE_RUNTIME_NAME)); // Do the basic set up for the android sysprops. - RavenwoodSystemProperties.initialize(RAVENWOOD_BUILD_PROP); + RavenwoodSystemProperties.initialize(); setSystemProperties(null); // Do this after loading RAVENWOOD_NATIVE_RUNTIME_NAME (which backs Os.setenv()), diff --git a/ravenwood/junit-src/android/platform/test/ravenwood/RavenwoodSystemProperties.java b/ravenwood/junit-src/android/platform/test/ravenwood/RavenwoodSystemProperties.java index 9bc45bee1775..3e4619f55c6d 100644 --- a/ravenwood/junit-src/android/platform/test/ravenwood/RavenwoodSystemProperties.java +++ b/ravenwood/junit-src/android/platform/test/ravenwood/RavenwoodSystemProperties.java @@ -16,21 +16,30 @@ package android.platform.test.ravenwood; -import static com.android.ravenwood.common.RavenwoodCommonUtils.RAVENWOOD_SYSPROP; +import static com.android.ravenwood.common.RavenwoodCommonUtils.RAVENWOOD_VERBOSE_LOGGING; +import static com.android.ravenwood.common.RavenwoodCommonUtils.getRavenwoodRuntimePath; -import com.android.ravenwood.common.RavenwoodCommonUtils; +import android.util.Log; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; import java.util.HashMap; import java.util.HashSet; +import java.util.LinkedHashMap; import java.util.Map; import java.util.Set; public class RavenwoodSystemProperties { private static final String TAG = "RavenwoodSystemProperties"; + /** We pull in propeties from this file. */ + private static final String RAVENWOOD_BUILD_PROP = "ravenwood-data/ravenwood-build.prop"; + + /** This is the actual build.prop we use to build the device (contents depends on lunch). */ + private static final String DEVICE_BUILD_PROP = "ravenwood-data/build.prop"; + + /** The default values. */ private static final Map<String, String> sDefaultValues = new HashMap<>(); private static final String[] PARTITIONS = { @@ -43,52 +52,54 @@ public class RavenwoodSystemProperties { "vendor_dlkm", }; - /** - * More info about property file loading: system/core/init/property_service.cpp - * In the following logic, the only partition we would need to consider is "system", - * since we only read from system-build.prop - */ - static void initialize(String propFile) { - // Load all properties from build.prop + private static Map<String, String> readProperties(String propFile) { + // Use an ordered map just for cleaner dump log. + final Map<String, String> ret = new LinkedHashMap<>(); try { Files.readAllLines(Path.of(propFile)).stream() .map(String::trim) .filter(s -> !s.startsWith("#")) .map(s -> s.split("\\s*=\\s*", 2)) .filter(a -> a.length == 2) - .forEach(a -> sDefaultValues.put(a[0], a[1])); + .forEach(a -> ret.put(a[0], a[1])); } catch (IOException e) { throw new RuntimeException(e); } + return ret; + } - // If ro.product.${name} is not set, derive from ro.product.${partition}.${name} - // If ro.product.cpu.abilist* is not set, derive from ro.${partition}.product.cpu.abilist* - for (var entry : Set.copyOf(sDefaultValues.entrySet())) { - final String key; - if (entry.getKey().startsWith("ro.product.system.")) { - var name = entry.getKey().substring(18); - key = "ro.product." + name; - - } else if (entry.getKey().startsWith("ro.system.product.cpu.abilist")) { - var name = entry.getKey().substring(22); - key = "ro.product.cpu." + name; + /** + * Load default sysprops from {@link #RAVENWOOD_BUILD_PROP}. We also pull in + * certain properties from the acutual device's build.prop {@link #DEVICE_BUILD_PROP} too. + * + * More info about property file loading: system/core/init/property_service.cpp + * In the following logic, the only partition we would need to consider is "system", + * since we only read from system-build.prop + */ + static void initialize() { + var path = getRavenwoodRuntimePath(); + var ravenwoodProps = readProperties(path + RAVENWOOD_BUILD_PROP); + var deviceProps = readProperties(path + DEVICE_BUILD_PROP); + + Log.i(TAG, "Default system properties:"); + ravenwoodProps.forEach((key, origValue) -> { + final String value; + + // If a value starts with "$$$", then this is a reference to the device-side value. + if (origValue.startsWith("$$$")) { + var deviceKey = origValue.substring(3); + var deviceValue = deviceProps.get(deviceKey); + if (deviceValue == null) { + throw new RuntimeException("Failed to initialize system properties. Key '" + + deviceKey + "' doesn't exist in the device side build.prop"); + } + value = deviceValue; } else { - continue; - } - if (!sDefaultValues.containsKey(key)) { - sDefaultValues.put(key, entry.getValue()); + value = origValue; } - } - - // Some other custom values - sDefaultValues.put("ro.board.first_api_level", "1"); - sDefaultValues.put("ro.product.first_api_level", "1"); - sDefaultValues.put("ro.soc.manufacturer", "Android"); - sDefaultValues.put("ro.soc.model", "Ravenwood"); - sDefaultValues.put(RAVENWOOD_SYSPROP, "1"); - - // Log all values - sDefaultValues.forEach((key, value) -> RavenwoodCommonUtils.log(TAG, key + "=" + value)); + Log.i(TAG, key + "=" + value); + sDefaultValues.put(key, value); + }); // Copy ro.product.* and ro.build.* to all partitions, just in case // We don't want to log these because these are just a lot of duplicate values @@ -104,6 +115,13 @@ public class RavenwoodSystemProperties { } } } + if (RAVENWOOD_VERBOSE_LOGGING) { + // Dump all properties for local debugging. + Log.v(TAG, "All system properties:"); + for (var key : sDefaultValues.keySet().stream().sorted().toList()) { + Log.v(TAG, "" + key + "=" + sDefaultValues.get(key)); + } + } } private volatile boolean mIsImmutable; diff --git a/ravenwood/runtime-helper-src/framework/android/util/Log_host.java b/ravenwood/runtime-helper-src/framework/android/util/Log_host.java index d232ef2076be..c85bd23db893 100644 --- a/ravenwood/runtime-helper-src/framework/android/util/Log_host.java +++ b/ravenwood/runtime-helper-src/framework/android/util/Log_host.java @@ -18,6 +18,7 @@ package android.util; import android.util.Log.Level; import com.android.internal.os.RuntimeInit; +import com.android.ravenwood.common.RavenwoodCommonUtils; import java.io.PrintStream; @@ -35,6 +36,9 @@ public class Log_host { } public static int println_native(int bufID, int priority, String tag, String msg) { + if (priority < Log.INFO && !RavenwoodCommonUtils.RAVENWOOD_VERBOSE_LOGGING) { + return msg.length(); // No verbose logging. + } final String buffer; switch (bufID) { case Log.LOG_ID_MAIN: buffer = "main"; break; diff --git a/ravenwood/scripts/run-ravenwood-tests.sh b/ravenwood/scripts/run-ravenwood-tests.sh index 1910100a7f5d..fe2269a8dc38 100755 --- a/ravenwood/scripts/run-ravenwood-tests.sh +++ b/ravenwood/scripts/run-ravenwood-tests.sh @@ -33,7 +33,7 @@ include_re="" exclude_re="" smoke_exclude_re="" dry_run="" -while getopts "sx:f:d" opt; do +while getopts "sx:f:dt" opt; do case "$opt" in s) # Remove slow tests. @@ -51,6 +51,9 @@ case "$opt" in # Dry run dry_run="echo" ;; + t) + export RAVENWOOD_LOG_OUT=$(tty) + ;; '?') exit 1 ;; diff --git a/ravenwood/texts/build.prop-sample-cuttlefish b/ravenwood/texts/build.prop-sample-cuttlefish new file mode 100644 index 000000000000..f78b727f5779 --- /dev/null +++ b/ravenwood/texts/build.prop-sample-cuttlefish @@ -0,0 +1,132 @@ +# This is file is generated with `aosp_cf_x86_64_phone-trunk_staging-eng` on 2024-11-06. +# We have this file here only as a reference. We don't actually use this file anywhere. + +#################################### +# from generate_common_build_props +# These properties identify this partition image. +#################################### +ro.product.system.brand=Android +ro.product.system.device=generic +ro.product.system.manufacturer=Android +ro.product.system.model=mainline +ro.product.system.name=mainline +ro.system.product.cpu.abilist=x86_64,x86,arm64-v8a,armeabi-v7a,armeabi +ro.system.product.cpu.abilist32=x86,armeabi-v7a,armeabi +ro.system.product.cpu.abilist64=x86_64,arm64-v8a +ro.system.build.date=Tue Nov 5 13:25:43 PST 2024 +ro.system.build.date.utc=1730841943 +ro.system.build.fingerprint=generic/aosp_cf_x86_64_phone/vsoc_x86_64:Baklava/MAIN/eng.omakot:eng/test-keys +ro.system.build.id=MAIN +ro.system.build.tags=test-keys +ro.system.build.type=eng +ro.system.build.version.incremental=eng.omakot +ro.system.build.version.release=15 +ro.system.build.version.release_or_codename=Baklava +ro.system.build.version.sdk=35 +#################################### +# from gen_build_prop.py:generate_build_info +#################################### +# begin build properties +ro.build.legacy.id=MAIN +ro.build.display.id=aosp_cf_x86_64_phone-eng Baklava MAIN eng.omakot test-keys +ro.build.version.incremental=eng.omakot +ro.build.version.sdk=35 +ro.build.version.preview_sdk=1 +ro.build.version.preview_sdk_fingerprint=2ef06129940d459014cf4dede3950d71 +ro.build.version.codename=Baklava +ro.build.version.all_codenames=Baklava +ro.build.version.known_codenames=Base,Base11,Cupcake,Donut,Eclair,Eclair01,EclairMr1,Froyo,Gingerbread,GingerbreadMr1,Honeycomb,HoneycombMr1,HoneycombMr2,IceCreamSandwich,IceCreamSandwichMr1,JellyBean,JellyBeanMr1,JellyBeanMr2,Kitkat,KitkatWatch,Lollipop,LollipopMr1,M,N,NMr1,O,OMr1,P,Q,R,S,Sv2,Tiramisu,UpsideDownCake,VanillaIceCream,Baklava +ro.build.version.release=15 +ro.build.version.release_or_codename=Baklava +ro.build.version.release_or_preview_display=Baklava +ro.build.version.security_patch=2024-08-05 +ro.build.version.base_os= +ro.build.version.min_supported_target_sdk=28 +ro.build.date=Tue Nov 5 13:25:43 PST 2024 +ro.build.date.utc=1730841943 +ro.build.type=eng +ro.build.user=omakoto +ro.build.host=omakoto-ct1.c.googlers.com +ro.build.tags=test-keys +ro.build.flavor=aosp_cf_x86_64_phone-eng +# ro.product.cpu.abi and ro.product.cpu.abi2 are obsolete, +# use ro.product.cpu.abilist instead. +ro.product.cpu.abi=x86_64 +ro.product.locale=en-US +ro.wifi.channels= +# ro.build.product is obsolete; use ro.product.device +ro.build.product=vsoc_x86_64 +# Do not try to parse description or thumbprint +ro.build.description=aosp_cf_x86_64_phone-eng Baklava MAIN eng.omakot test-keys +# end build properties +#################################### +# from variable ADDITIONAL_SYSTEM_PROPERTIES +#################################### +ro.treble.enabled=true +ro.llndk.api_level=202504 +ro.actionable_compatible_property.enabled=true +persist.debug.dalvik.vm.core_platform_api_policy=just-warn +ro.postinstall.fstab.prefix=/system +ro.kernel.android.checkjni=1 +ro.secure=0 +ro.allow.mock.location=1 +dalvik.vm.lockprof.threshold=500 +ro.debuggable=1 +dalvik.vm.image-dex2oat-filter=extract +init.svc_debug.no_fatal.zygote=true +net.bt.name=Android +ro.force.debuggable=0 +#################################### +# from variable PRODUCT_SYSTEM_PROPERTIES +#################################### +debug.atrace.tags.enableflags=0 +persist.traced.enable=1 +dalvik.vm.image-dex2oat-Xms=64m +dalvik.vm.image-dex2oat-Xmx=64m +dalvik.vm.dex2oat-Xms=64m +dalvik.vm.dex2oat-Xmx=512m +dalvik.vm.usejit=true +dalvik.vm.dexopt.secondary=true +dalvik.vm.dexopt.thermal-cutoff=2 +dalvik.vm.appimageformat=lz4 +ro.dalvik.vm.native.bridge=0 +pm.dexopt.post-boot=verify +pm.dexopt.first-boot=verify +pm.dexopt.boot-after-ota=verify +pm.dexopt.boot-after-mainline-update=verify +pm.dexopt.install=speed-profile +pm.dexopt.install-fast=skip +pm.dexopt.install-bulk=speed-profile +pm.dexopt.install-bulk-secondary=verify +pm.dexopt.install-bulk-downgraded=verify +pm.dexopt.install-bulk-secondary-downgraded=verify +pm.dexopt.bg-dexopt=speed-profile +pm.dexopt.ab-ota=speed-profile +pm.dexopt.inactive=verify +pm.dexopt.cmdline=verify +pm.dexopt.shared=speed +dalvik.vm.disable-art-service-dexopt=true +dalvik.vm.disable-odrefresh=true +dalvik.vm.dex2oat-resolve-startup-strings=true +dalvik.vm.dex2oat-max-image-block-size=524288 +dalvik.vm.minidebuginfo=true +dalvik.vm.dex2oat-minidebuginfo=true +dalvik.vm.madvise.vdexfile.size=104857600 +dalvik.vm.madvise.odexfile.size=104857600 +dalvik.vm.madvise.artfile.size=4294967295 +dalvik.vm.usap_pool_enabled=false +dalvik.vm.usap_refill_threshold=1 +dalvik.vm.usap_pool_size_max=3 +dalvik.vm.usap_pool_size_min=1 +dalvik.vm.usap_pool_refill_delay_ms=3000 +dalvik.vm.useartservice=true +dalvik.vm.enable_pr_dexopt=true +ro.cp_system_other_odex=1 +ro.apex.updatable=true +ro.launcher.depth.widget=0 +#################################### +# from variable PRODUCT_SYSTEM_DEFAULT_PROPERTIES +#################################### +# Auto-added by post_process_props.py +persist.sys.usb.config=adb +# end of file diff --git a/ravenwood/texts/ravenwood-build.prop b/ravenwood/texts/ravenwood-build.prop new file mode 100644 index 000000000000..93a18cffec50 --- /dev/null +++ b/ravenwood/texts/ravenwood-build.prop @@ -0,0 +1,44 @@ +# This file contains system properties used on ravenwood. + +ro.is_on_ravenwood=1 + +ro.board.first_api_level=1 +ro.product.first_api_level=1 +ro.soc.manufacturer=Android +ro.soc.model=Ravenwood +ro.debuggable=1 + +# The ones starting with "ro.product" or "ro.bild" will be copied to all "partitions" too. +# See RavenwoodSystemProperties. +ro.product.brand=Android +ro.product.device=Ravenwood +ro.product.manufacturer=Android +ro.product.model=Ravenwood +ro.product.name=Ravenwood +ro.product.cpu.abilist=x86_64 +ro.product.cpu.abilist32= +ro.product.cpu.abilist64=x86_64 + +ro.build.date=Thu Jan 01 00:00:00 GMT 2024 +ro.build.date.utc=1704092400 +ro.build.id=MAIN +ro.build.tags=dev-keys +ro.build.type=userdebug +ro.build.version.incremental=userdebug.ravenwood.20240101 + +# These are what we used to use on Ravenwood, copied here as a reference. +#ro.build.version.codename=REL +#ro.build.version.all_codenames=REL +#ro.build.version.known_codenames=REL +#ro.build.version.release=14 +#ro.build.version.release_or_codename=VanillaIceCream +#ro.build.version.sdk=34 + +# We pull in the following values from the real build.prop file. +ro.build.version.codename=$$$ro.build.version.codename +ro.build.version.all_codenames=$$$ro.build.version.codename +ro.build.version.known_codenames=$$$ro.build.version.codename +ro.build.version.release=$$$ro.build.version.release +ro.build.version.release_or_codename=$$$ro.build.version.release_or_codename +ro.build.version.release_or_preview_display=$$$ro.build.version.release_or_preview_display +ro.build.version.sdk=$$$ro.build.version.sdk diff --git a/services/core/java/com/android/server/vcn/VcnContext.java b/services/core/java/com/android/server/vcn/VcnContext.java index 6ce868540070..9213d96ad4ca 100644 --- a/services/core/java/com/android/server/vcn/VcnContext.java +++ b/services/core/java/com/android/server/vcn/VcnContext.java @@ -74,10 +74,6 @@ public class VcnContext { return mFeatureFlags; } - public boolean isFlagSafeModeTimeoutConfigEnabled() { - return mFeatureFlags.safeModeTimeoutConfig(); - } - /** * Verifies that the caller is running on the VcnContext Thread. * diff --git a/services/core/java/com/android/server/vcn/VcnGatewayConnection.java b/services/core/java/com/android/server/vcn/VcnGatewayConnection.java index 2d3bc84debff..2325f358e301 100644 --- a/services/core/java/com/android/server/vcn/VcnGatewayConnection.java +++ b/services/core/java/com/android/server/vcn/VcnGatewayConnection.java @@ -1263,7 +1263,7 @@ public class VcnGatewayConnection extends StateMachine { final PersistableBundleWrapper carrierConfig = snapshot.getCarrierConfigForSubGrp(subGrp); int resultSeconds = defaultSeconds; - if (vcnContext.isFlagSafeModeTimeoutConfigEnabled() && carrierConfig != null) { + if (carrierConfig != null) { resultSeconds = carrierConfig.getInt( VcnManager.VCN_SAFE_MODE_TIMEOUT_SECONDS_KEY, defaultSeconds); diff --git a/tests/vcn/java/com/android/server/vcn/VcnGatewayConnectionTest.java b/tests/vcn/java/com/android/server/vcn/VcnGatewayConnectionTest.java index 49665f7a3304..613b92616707 100644 --- a/tests/vcn/java/com/android/server/vcn/VcnGatewayConnectionTest.java +++ b/tests/vcn/java/com/android/server/vcn/VcnGatewayConnectionTest.java @@ -360,12 +360,10 @@ public class VcnGatewayConnectionTest extends VcnGatewayConnectionTestBase { private void verifyGetSafeModeTimeoutMs( boolean isInTestMode, - boolean isConfigTimeoutSupported, PersistableBundleWrapper carrierConfig, long expectedTimeoutMs) throws Exception { doReturn(isInTestMode).when(mVcnContext).isInTestMode(); - doReturn(isConfigTimeoutSupported).when(mVcnContext).isFlagSafeModeTimeoutConfigEnabled(); final TelephonySubscriptionSnapshot snapshot = mock(TelephonySubscriptionSnapshot.class); doReturn(carrierConfig).when(snapshot).getCarrierConfigForSubGrp(TEST_SUB_GRP); @@ -377,16 +375,7 @@ public class VcnGatewayConnectionTest extends VcnGatewayConnectionTestBase { } @Test - public void testGetSafeModeTimeoutMs_configTimeoutUnsupported() throws Exception { - verifyGetSafeModeTimeoutMs( - false /* isInTestMode */, - false /* isConfigTimeoutSupported */, - null /* carrierConfig */, - TimeUnit.SECONDS.toMillis(SAFEMODE_TIMEOUT_SECONDS)); - } - - @Test - public void testGetSafeModeTimeoutMs_configTimeoutSupported() throws Exception { + public void testGetSafeModeTimeoutMs() throws Exception { final int carrierConfigTimeoutSeconds = 20; final PersistableBundleWrapper carrierConfig = mock(PersistableBundleWrapper.class); doReturn(carrierConfigTimeoutSeconds) @@ -395,17 +384,14 @@ public class VcnGatewayConnectionTest extends VcnGatewayConnectionTestBase { verifyGetSafeModeTimeoutMs( false /* isInTestMode */, - true /* isConfigTimeoutSupported */, carrierConfig, TimeUnit.SECONDS.toMillis(carrierConfigTimeoutSeconds)); } @Test - public void testGetSafeModeTimeoutMs_configTimeoutSupported_carrierConfigNull() - throws Exception { + public void testGetSafeModeTimeoutMs_carrierConfigNull() throws Exception { verifyGetSafeModeTimeoutMs( false /* isInTestMode */, - true /* isConfigTimeoutSupported */, null /* carrierConfig */, TimeUnit.SECONDS.toMillis(SAFEMODE_TIMEOUT_SECONDS)); } @@ -420,7 +406,6 @@ public class VcnGatewayConnectionTest extends VcnGatewayConnectionTestBase { verifyGetSafeModeTimeoutMs( true /* isInTestMode */, - true /* isConfigTimeoutSupported */, carrierConfig, TimeUnit.SECONDS.toMillis(carrierConfigTimeoutSeconds)); } diff --git a/tests/vcn/java/com/android/server/vcn/VcnGatewayConnectionTestBase.java b/tests/vcn/java/com/android/server/vcn/VcnGatewayConnectionTestBase.java index 4c7b25aaa7c3..8374fd944568 100644 --- a/tests/vcn/java/com/android/server/vcn/VcnGatewayConnectionTestBase.java +++ b/tests/vcn/java/com/android/server/vcn/VcnGatewayConnectionTestBase.java @@ -222,7 +222,6 @@ public class VcnGatewayConnectionTestBase { doReturn(mTestLooper.getLooper()).when(mVcnContext).getLooper(); doReturn(mVcnNetworkProvider).when(mVcnContext).getVcnNetworkProvider(); doReturn(mFeatureFlags).when(mVcnContext).getFeatureFlags(); - doReturn(true).when(mVcnContext).isFlagSafeModeTimeoutConfigEnabled(); doReturn(mUnderlyingNetworkController) .when(mDeps) |