From a46f16d7ecf33173eb11d6b791bbccfa0664375d Mon Sep 17 00:00:00 2001 From: Chiachang Wang Date: Fri, 24 Sep 2021 15:09:42 +0800 Subject: Cleanup empty class in NetworkPermissionConfig The previous issue was resolved so that NetworkPermissionConfig could be built as a no-code app. Cleanup the code accordingly to reduce the apk size. The apk size is reduced from 16.8kB to 12.6kB from local build. Bug: 132924647 Test: atest NetworkStackTests Test: Build, flash, connect to wifi/cellular normally Change-Id: Ibc66e87832253ed0d022753f66141743c5a770dd --- Android.bp | 3 --- AndroidManifest.xml | 3 ++- .../android/server/NetworkPermissionConfig.java | 26 ---------------------- 3 files changed, 2 insertions(+), 30 deletions(-) delete mode 100644 src/com/android/server/NetworkPermissionConfig.java diff --git a/Android.bp b/Android.bp index d4b0ced..81af6ff 100644 --- a/Android.bp +++ b/Android.bp @@ -20,9 +20,6 @@ package { java_defaults { name: "NetworkPermissionConfigDefaults", - // TODO: mark app as hasCode=false in manifest once soong stops complaining about apps without - // a classes.dex. - srcs: ["src/**/*.java"], platform_apis: true, target_sdk_version: "30", min_sdk_version: "29", diff --git a/AndroidManifest.xml b/AndroidManifest.xml index a6af0d6..92fa57f 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -40,5 +40,6 @@ + android:usesCleartextTraffic="true" + android:hasCode="false"/> diff --git a/src/com/android/server/NetworkPermissionConfig.java b/src/com/android/server/NetworkPermissionConfig.java deleted file mode 100644 index c904e23..0000000 --- a/src/com/android/server/NetworkPermissionConfig.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (C) 2019 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 com.android.server; - -import android.app.Application; - -/** - * Empty application for NetworkPermissionConfig that only exists because - * soong builds complain if APKs have no source file. - */ -public class NetworkPermissionConfig extends Application { -} -- cgit v1.2.3