Loading core/java/android/content/pm/FeatureInfo.java +13 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package android.content.pm; import android.os.Parcel; import android.os.Parcelable; import android.util.proto.ProtoOutputStream; /** * Definition of a single optional hardware or software feature of an Android Loading Loading @@ -113,6 +114,18 @@ public class FeatureInfo implements Parcelable { dest.writeInt(flags); } /** @hide */ public void writeToProto(ProtoOutputStream proto, long fieldId) { long token = proto.start(fieldId); if (name != null) { proto.write(FeatureInfoProto.NAME, name); } proto.write(FeatureInfoProto.VERSION, version); proto.write(FeatureInfoProto.GLES_VERSION, getGlEsVersion()); proto.write(FeatureInfoProto.FLAGS, flags); proto.end(token); } public static final Creator<FeatureInfo> CREATOR = new Creator<FeatureInfo>() { @Override public FeatureInfo createFromParcel(Parcel source) { Loading core/proto/android/content/featureinfo.proto 0 → 100644 +29 −0 Original line number Diff line number Diff line /* * Copyright (C) 2016 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. */ syntax = "proto2"; option java_package = "android.content.pm"; option java_multiple_files = true; package android.content.pm; message FeatureInfoProto { optional string name = 1; optional int32 version = 2; optional string gles_version = 3; optional int32 flags = 4; } core/proto/android/os/incident.proto +5 −1 Original line number Diff line number Diff line Loading @@ -100,7 +100,11 @@ message IncidentProto { (section).args = "diskstats --proto" ]; optional android.service.pm.PackageServiceDumpProto package = 3008; optional android.service.pm.PackageServiceDumpProto package = 3008 [ (section).type = SECTION_DUMPSYS, (section).args = "package --proto" ]; optional android.service.power.PowerServiceDumpProto power = 3009; optional android.service.print.PrintServiceDumpProto print = 3010; Loading core/proto/android/service/package.proto +3 −5 Original line number Diff line number Diff line Loading @@ -17,6 +17,8 @@ syntax = "proto2"; package android.service.pm; import "frameworks/base/core/proto/android/content/featureinfo.proto"; option java_multiple_files = true; option java_outer_classname = "PackageServiceProto"; Loading @@ -36,10 +38,6 @@ message PackageServiceDumpProto { // Should be filled if is_jar is false optional string apk = 4; } message FeatureProto { optional string name = 1; optional int32 version = 2; } message SharedUserProto { optional int32 user_id = 1; optional string name = 2; Loading @@ -49,7 +47,7 @@ message PackageServiceDumpProto { optional PackageShortProto required_verifier_package = 1; optional PackageShortProto verifier_package = 2; repeated SharedLibraryProto shared_libraries = 3; repeated FeatureProto features = 4; repeated android.content.pm.FeatureInfoProto features = 4; repeated PackageProto packages = 5; repeated SharedUserProto shared_users = 6; // Messages from the settings problem file Loading services/core/java/com/android/server/pm/PackageManagerService.java +1 −5 Original line number Diff line number Diff line Loading @@ -21860,11 +21860,7 @@ Slog.v(TAG, ":: stepped forward, applying functor at tag " + parser.getName()); synchronized (mAvailableFeatures) { final int count = mAvailableFeatures.size(); for (int i = 0; i < count; i++) { final FeatureInfo feat = mAvailableFeatures.valueAt(i); final long featureToken = proto.start(PackageServiceDumpProto.FEATURES); proto.write(PackageServiceDumpProto.FeatureProto.NAME, feat.name); proto.write(PackageServiceDumpProto.FeatureProto.VERSION, feat.version); proto.end(featureToken); mAvailableFeatures.valueAt(i).writeToProto(proto, PackageServiceDumpProto.FEATURES); } } } Loading
core/java/android/content/pm/FeatureInfo.java +13 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package android.content.pm; import android.os.Parcel; import android.os.Parcelable; import android.util.proto.ProtoOutputStream; /** * Definition of a single optional hardware or software feature of an Android Loading Loading @@ -113,6 +114,18 @@ public class FeatureInfo implements Parcelable { dest.writeInt(flags); } /** @hide */ public void writeToProto(ProtoOutputStream proto, long fieldId) { long token = proto.start(fieldId); if (name != null) { proto.write(FeatureInfoProto.NAME, name); } proto.write(FeatureInfoProto.VERSION, version); proto.write(FeatureInfoProto.GLES_VERSION, getGlEsVersion()); proto.write(FeatureInfoProto.FLAGS, flags); proto.end(token); } public static final Creator<FeatureInfo> CREATOR = new Creator<FeatureInfo>() { @Override public FeatureInfo createFromParcel(Parcel source) { Loading
core/proto/android/content/featureinfo.proto 0 → 100644 +29 −0 Original line number Diff line number Diff line /* * Copyright (C) 2016 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. */ syntax = "proto2"; option java_package = "android.content.pm"; option java_multiple_files = true; package android.content.pm; message FeatureInfoProto { optional string name = 1; optional int32 version = 2; optional string gles_version = 3; optional int32 flags = 4; }
core/proto/android/os/incident.proto +5 −1 Original line number Diff line number Diff line Loading @@ -100,7 +100,11 @@ message IncidentProto { (section).args = "diskstats --proto" ]; optional android.service.pm.PackageServiceDumpProto package = 3008; optional android.service.pm.PackageServiceDumpProto package = 3008 [ (section).type = SECTION_DUMPSYS, (section).args = "package --proto" ]; optional android.service.power.PowerServiceDumpProto power = 3009; optional android.service.print.PrintServiceDumpProto print = 3010; Loading
core/proto/android/service/package.proto +3 −5 Original line number Diff line number Diff line Loading @@ -17,6 +17,8 @@ syntax = "proto2"; package android.service.pm; import "frameworks/base/core/proto/android/content/featureinfo.proto"; option java_multiple_files = true; option java_outer_classname = "PackageServiceProto"; Loading @@ -36,10 +38,6 @@ message PackageServiceDumpProto { // Should be filled if is_jar is false optional string apk = 4; } message FeatureProto { optional string name = 1; optional int32 version = 2; } message SharedUserProto { optional int32 user_id = 1; optional string name = 2; Loading @@ -49,7 +47,7 @@ message PackageServiceDumpProto { optional PackageShortProto required_verifier_package = 1; optional PackageShortProto verifier_package = 2; repeated SharedLibraryProto shared_libraries = 3; repeated FeatureProto features = 4; repeated android.content.pm.FeatureInfoProto features = 4; repeated PackageProto packages = 5; repeated SharedUserProto shared_users = 6; // Messages from the settings problem file Loading
services/core/java/com/android/server/pm/PackageManagerService.java +1 −5 Original line number Diff line number Diff line Loading @@ -21860,11 +21860,7 @@ Slog.v(TAG, ":: stepped forward, applying functor at tag " + parser.getName()); synchronized (mAvailableFeatures) { final int count = mAvailableFeatures.size(); for (int i = 0; i < count; i++) { final FeatureInfo feat = mAvailableFeatures.valueAt(i); final long featureToken = proto.start(PackageServiceDumpProto.FEATURES); proto.write(PackageServiceDumpProto.FeatureProto.NAME, feat.name); proto.write(PackageServiceDumpProto.FeatureProto.VERSION, feat.version); proto.end(featureToken); mAvailableFeatures.valueAt(i).writeToProto(proto, PackageServiceDumpProto.FEATURES); } } }