Revert "Annotate dependency tags for dependencies of installed files"

This reverts commit 62a0cfd05460d0e760ce9133690e48861bb57eee.

Reason for revert: b/173475545

Change-Id: I4e834200c8e68dfa1b8144dfd1fa95ca68554980
diff --git a/cc/cc.go b/cc/cc.go
index 0724a76..5e4faf2 100644
--- a/cc/cc.go
+++ b/cc/cc.go
@@ -550,15 +550,7 @@
 	return d.Kind == staticLibraryDependency
 }
 
-// InstallDepNeeded returns true for shared libraries so that shared library dependencies of
-// binaries or other shared libraries are installed as dependencies.
-func (d libraryDependencyTag) InstallDepNeeded() bool {
-	return d.shared()
-}
-
-var _ android.InstallNeededDependencyTag = libraryDependencyTag{}
-
-// dependencyTag is used for tagging miscellaneous dependency types that don't fit into
+// dependencyTag is used for tagging miscellanous dependency types that don't fit into
 // libraryDependencyTag.  Each tag object is created globally and reused for multiple
 // dependencies (although since the object contains no references, assigning a tag to a
 // variable and modifying it will not modify the original).  Users can compare the tag
@@ -568,15 +560,6 @@
 	name string
 }
 
-// installDependencyTag is used for tagging miscellaneous dependency types that don't fit into
-// libraryDependencyTag, but where the dependency needs to be installed when the parent is
-// installed.
-type installDependencyTag struct {
-	blueprint.BaseDependencyTag
-	android.InstallAlwaysNeededDependencyTag
-	name string
-}
-
 var (
 	genSourceDepTag       = dependencyTag{name: "gen source"}
 	genHeaderDepTag       = dependencyTag{name: "gen header"}
@@ -588,7 +571,7 @@
 	staticVariantTag      = dependencyTag{name: "static variant"}
 	vndkExtDepTag         = dependencyTag{name: "vndk extends"}
 	dataLibDepTag         = dependencyTag{name: "data lib"}
-	runtimeDepTag         = installDependencyTag{name: "runtime lib"}
+	runtimeDepTag         = dependencyTag{name: "runtime lib"}
 	testPerSrcDepTag      = dependencyTag{name: "test_per_src"}
 	stubImplDepTag        = dependencyTag{name: "stub_impl"}
 )
@@ -615,7 +598,8 @@
 }
 
 func IsRuntimeDepTag(depTag blueprint.DependencyTag) bool {
-	return depTag == runtimeDepTag
+	ccDepTag, ok := depTag.(dependencyTag)
+	return ok && ccDepTag == runtimeDepTag
 }
 
 func IsTestPerSrcDepTag(depTag blueprint.DependencyTag) bool {
diff --git a/cc/cc_test.go b/cc/cc_test.go
index f695949..b803cba 100644
--- a/cc/cc_test.go
+++ b/cc/cc_test.go
@@ -3941,98 +3941,3 @@
 	}
 
 }
-
-func TestInstallSharedLibs(t *testing.T) {
-	bp := `
-		cc_binary {
-			name: "bin",
-			host_supported: true,
-			shared_libs: ["libshared"],
-			runtime_libs: ["libruntime"],
-			srcs: [":gen"],
-		}
-
-		cc_library_shared {
-			name: "libshared",
-			host_supported: true,
-			shared_libs: ["libtransitive"],
-		}
-
-		cc_library_shared {
-			name: "libtransitive",
-			host_supported: true,
-		}
-
-		cc_library_shared {
-			name: "libruntime",
-			host_supported: true,
-		}
-
-		cc_binary_host {
-			name: "tool",
-			srcs: ["foo.cpp"],
-		}
-
-		genrule {
-			name: "gen",
-			tools: ["tool"],
-			out: ["gen.cpp"],
-			cmd: "$(location tool) $(out)",
-		}
-	`
-
-	config := TestConfig(buildDir, android.Android, nil, bp, nil)
-	ctx := testCcWithConfig(t, config)
-
-	hostBin := ctx.ModuleForTests("bin", config.BuildOSTarget.String()).Description("install")
-	hostShared := ctx.ModuleForTests("libshared", config.BuildOSTarget.String()+"_shared").Description("install")
-	hostRuntime := ctx.ModuleForTests("libruntime", config.BuildOSTarget.String()+"_shared").Description("install")
-	hostTransitive := ctx.ModuleForTests("libtransitive", config.BuildOSTarget.String()+"_shared").Description("install")
-	hostTool := ctx.ModuleForTests("tool", config.BuildOSTarget.String()).Description("install")
-
-	if g, w := hostBin.Implicits.Strings(), hostShared.Output.String(); !android.InList(w, g) {
-		t.Errorf("expected host bin dependency %q, got %q", w, g)
-	}
-
-	if g, w := hostBin.Implicits.Strings(), hostTransitive.Output.String(); !android.InList(w, g) {
-		t.Errorf("expected host bin dependency %q, got %q", w, g)
-	}
-
-	if g, w := hostShared.Implicits.Strings(), hostTransitive.Output.String(); !android.InList(w, g) {
-		t.Errorf("expected host bin dependency %q, got %q", w, g)
-	}
-
-	if g, w := hostBin.Implicits.Strings(), hostRuntime.Output.String(); !android.InList(w, g) {
-		t.Errorf("expected host bin dependency %q, got %q", w, g)
-	}
-
-	if g, w := hostBin.Implicits.Strings(), hostTool.Output.String(); android.InList(w, g) {
-		t.Errorf("expected no host bin dependency %q, got %q", w, g)
-	}
-
-	deviceBin := ctx.ModuleForTests("bin", "android_arm64_armv8-a").Description("install")
-	deviceShared := ctx.ModuleForTests("libshared", "android_arm64_armv8-a_shared").Description("install")
-	deviceTransitive := ctx.ModuleForTests("libtransitive", "android_arm64_armv8-a_shared").Description("install")
-	deviceRuntime := ctx.ModuleForTests("libruntime", "android_arm64_armv8-a_shared").Description("install")
-
-	if g, w := deviceBin.OrderOnly.Strings(), deviceShared.Output.String(); !android.InList(w, g) {
-		t.Errorf("expected device bin dependency %q, got %q", w, g)
-	}
-
-	if g, w := deviceBin.OrderOnly.Strings(), deviceTransitive.Output.String(); !android.InList(w, g) {
-		t.Errorf("expected device bin dependency %q, got %q", w, g)
-	}
-
-	if g, w := deviceShared.OrderOnly.Strings(), deviceTransitive.Output.String(); !android.InList(w, g) {
-		t.Errorf("expected device bin dependency %q, got %q", w, g)
-	}
-
-	if g, w := deviceBin.OrderOnly.Strings(), deviceRuntime.Output.String(); !android.InList(w, g) {
-		t.Errorf("expected device bin dependency %q, got %q", w, g)
-	}
-
-	if g, w := deviceBin.OrderOnly.Strings(), hostTool.Output.String(); android.InList(w, g) {
-		t.Errorf("expected no device bin dependency %q, got %q", w, g)
-	}
-
-}
diff --git a/cc/testing.go b/cc/testing.go
index a3235e9..5a311f4 100644
--- a/cc/testing.go
+++ b/cc/testing.go
@@ -16,7 +16,6 @@
 
 import (
 	"android/soong/android"
-	"android/soong/genrule"
 )
 
 func RegisterRequiredBuildComponentsForTest(ctx android.RegistrationContext) {
@@ -25,7 +24,6 @@
 	RegisterBinaryBuildComponents(ctx)
 	RegisterLibraryBuildComponents(ctx)
 	RegisterLibraryHeadersBuildComponents(ctx)
-	genrule.RegisterGenruleBuildComponents(ctx)
 
 	ctx.RegisterModuleType("toolchain_library", ToolchainLibraryFactory)
 	ctx.RegisterModuleType("llndk_library", LlndkLibraryFactory)