upload android base code part9

This commit is contained in:
August 2018-08-08 20:16:11 +08:00
parent 5425409085
commit 071cdf34cd
2679 changed files with 329442 additions and 0 deletions

View file

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry exported="true" kind="lib" path="libs/dvlib.jar" sourcepath="/dvlib"/>
<classpathentry exported="true" kind="lib" path="libs/common.jar" sourcepath="/common"/>
<classpathentry exported="true" kind="lib" path="libs/commons-codec-1.4.jar"/>
<classpathentry exported="true" kind="lib" path="libs/commons-compress-1.0.jar"/>
<classpathentry exported="true" kind="lib" path="libs/commons-logging-1.1.1.jar"/>
<classpathentry exported="true" kind="lib" path="libs/guava-17.0.jar"/>
<classpathentry exported="true" kind="lib" path="libs/httpclient-4.1.1.jar"/>
<classpathentry exported="true" kind="lib" path="libs/httpcore-4.1.jar"/>
<classpathentry exported="true" kind="lib" path="libs/kxml2-2.3.0.jar"/>
<classpathentry exported="true" kind="lib" path="libs/layoutlib-api.jar" sourcepath="/layoutlib-api"/>
<classpathentry exported="true" kind="lib" path="libs/sdklib.jar" sourcepath="/sdklib"/>
<classpathentry exported="true" kind="lib" path="libs/sdkstats.jar" sourcepath="/sdkstats"/>
<classpathentry exported="true" kind="lib" path="libs/sdk-common.jar" sourcepath="/sdk-common"/>
<classpathentry exported="true" kind="lib" path="libs/httpmime-4.1.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View file

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>plugin-base</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

View file

@ -0,0 +1,98 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
org.eclipse.jdt.core.compiler.annotation.nonnull=com.android.annotations.NonNull
org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=com.android.annotations.NonNullByDefault
org.eclipse.jdt.core.compiler.annotation.nonnullisdefault=disabled
org.eclipse.jdt.core.compiler.annotation.nullable=com.android.annotations.Nullable
org.eclipse.jdt.core.compiler.annotation.nullanalysis=enabled
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
org.eclipse.jdt.core.compiler.problem.deadCode=warning
org.eclipse.jdt.core.compiler.problem.deprecation=warning
org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=enabled
org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning
org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=warning
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=error
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=warning
org.eclipse.jdt.core.compiler.problem.nullReference=warning
org.eclipse.jdt.core.compiler.problem.nullSpecInsufficientInfo=warning
org.eclipse.jdt.core.compiler.problem.nullSpecViolation=warning
org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=ignore
org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
org.eclipse.jdt.core.compiler.problem.potentialNullSpecViolation=error
org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=warning
org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning
org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=enabled
org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=disabled
org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
org.eclipse.jdt.core.compiler.problem.unclosedCloseable=error
org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
org.eclipse.jdt.core.compiler.problem.unusedImport=warning
org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=warning
org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
org.eclipse.jdt.core.compiler.source=1.6

View file

@ -0,0 +1,157 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Common Android Utilities
Bundle-SymbolicName: com.android.ide.eclipse.base;singleton:=true
Bundle-Version: 24.3.3.qualifier
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime
Bundle-ActivationPolicy: lazy
Bundle-Vendor: The Android Open Source Project
Bundle-ClassPath: .,
libs/annotations.jar,
libs/common.jar,
libs/commons-codec-1.4.jar,
libs/commons-compress-1.0.jar,
libs/commons-logging-1.1.1.jar,
libs/guava-17.0.jar,
libs/httpclient-4.1.1.jar,
libs/httpcore-4.1.jar,
libs/httpmime-4.1.jar,
libs/kxml2-2.3.0.jar,
libs/layoutlib-api.jar,
libs/sdklib.jar,
libs/sdkstats.jar,
libs/dvlib.jar,
libs/sdk-common.jar
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Export-Package: com.android,
com.android.annotations,
com.android.annotations.concurrency,
com.android.build,
com.android.dvlib,
com.android.ide.common.build,
com.android.ide.common.internal,
com.android.ide.common.packaging,
com.android.ide.common.rendering,
com.android.ide.common.rendering.api,
com.android.ide.common.rendering.legacy,
com.android.ide.common.repository,
com.android.ide.common.res2,
com.android.ide.common.resources,
com.android.ide.common.resources.configuration,
com.android.ide.common.sdk,
com.android.ide.common.signing,
com.android.ide.common.xml,
com.android.ide.eclipse.base,
com.android.ide.eclipse.base.internal.preferences,
com.android.io,
com.android.layoutlib.api,
com.android.prefs,
com.android.resources,
com.android.sdklib,
com.android.sdklib.build,
com.android.sdklib.devices,
com.android.sdklib.internal.androidTarget,
com.android.sdklib.internal.avd,
com.android.sdklib.internal.build,
com.android.sdklib.internal.project,
com.android.sdklib.internal.repository,
com.android.sdklib.internal.repository.archives,
com.android.sdklib.internal.repository.packages,
com.android.sdklib.internal.repository.sources,
com.android.sdklib.internal.repository.updater,
com.android.sdklib.io,
com.android.sdklib.repository,
com.android.sdklib.repository.descriptors,
com.android.sdklib.repository.local,
com.android.sdklib.repository.remote,
com.android.sdklib.util,
com.android.sdkstats,
com.android.util,
com.android.utils,
com.android.xml,
com.google.common.annotations,
com.google.common.base,
com.google.common.base.internal,
com.google.common.cache,
com.google.common.collect,
com.google.common.escape,
com.google.common.eventbus,
com.google.common.hash,
com.google.common.html,
com.google.common.io,
com.google.common.math,
com.google.common.net,
com.google.common.primitives,
com.google.common.reflect,
com.google.common.util.concurrent,
com.google.common.xml,
com.google.thirdparty.publicsuffix,
org.apache.commons.codec,
org.apache.commons.codec.binary,
org.apache.commons.codec.digest,
org.apache.commons.codec.language,
org.apache.commons.codec.net,
org.apache.commons.compress.archivers,
org.apache.commons.compress.archivers.ar,
org.apache.commons.compress.archivers.arj,
org.apache.commons.compress.archivers.cpio,
org.apache.commons.compress.archivers.dump,
org.apache.commons.compress.archivers.jar,
org.apache.commons.compress.archivers.sevenz,
org.apache.commons.compress.archivers.tar,
org.apache.commons.compress.archivers.zip,
org.apache.commons.compress.changes,
org.apache.commons.compress.compressors,
org.apache.commons.compress.compressors.bzip2,
org.apache.commons.compress.compressors.gzip,
org.apache.commons.compress.compressors.lzma,
org.apache.commons.compress.compressors.pack200,
org.apache.commons.compress.compressors.snappy,
org.apache.commons.compress.compressors.xz,
org.apache.commons.compress.compressors.z,
org.apache.commons.compress.compressors.z._internal_,
org.apache.commons.compress.utils,
org.apache.commons.logging,
org.apache.commons.logging.impl,
org.apache.http,
org.apache.http.annotation,
org.apache.http.auth,
org.apache.http.auth.params,
org.apache.http.client,
org.apache.http.client.entity,
org.apache.http.client.methods,
org.apache.http.client.params,
org.apache.http.client.protocol,
org.apache.http.client.utils,
org.apache.http.conn,
org.apache.http.conn.params,
org.apache.http.conn.routing,
org.apache.http.conn.scheme,
org.apache.http.conn.ssl,
org.apache.http.conn.util,
org.apache.http.cookie,
org.apache.http.cookie.params,
org.apache.http.entity,
org.apache.http.entity.mime,
org.apache.http.entity.mime.content,
org.apache.http.impl,
org.apache.http.impl.auth,
org.apache.http.impl.client,
org.apache.http.impl.conn,
org.apache.http.impl.conn.tsccm,
org.apache.http.impl.cookie,
org.apache.http.impl.entity,
org.apache.http.impl.io,
org.apache.http.io,
org.apache.http.message,
org.apache.http.params,
org.apache.http.protocol,
org.apache.http.util,
org.kxml2.io,
org.kxml2.kdom,
org.kxml2.wap,
org.kxml2.wap.syncml,
org.kxml2.wap.wml,
org.kxml2.wap.wv,
org.xmlpull.v1

View file

@ -0,0 +1,7 @@
output.. = bin/
bin.includes = .,\
libs/,\
META-INF/,\
plugin.xml
jars.compile.order = .
source.. = src/

View file

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
<extension
point="org.eclipse.ui.preferencePages">
<page
category="com.android.ide.eclipse.preferences.main"
class="com.android.ide.eclipse.base.internal.preferences.UsagePreferencePage"
id="com.android.ide.eclipse.common.preferences.UsagePreferencePage"
name="Usage Stats">
</page>
</extension>
</plugin>

View file

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<version>24.3.3-SNAPSHOT</version>
<artifactId>com.android.ide.eclipse.base</artifactId>
<packaging>eclipse-plugin</packaging>
<name>base</name>
<parent>
<relativePath>../../pom.xml</relativePath>
<groupId>adt.group</groupId>
<artifactId>parent</artifactId>
<version>1.0.0-SNAPSHOT</version>
</parent>
</project>

View file

@ -0,0 +1,41 @@
/*
* Copyright (C) 2012 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.ide.eclipse.base;
import org.eclipse.core.runtime.Platform;
import org.osgi.framework.Bundle;
import org.osgi.framework.Version;
public class InstallDetails {
private static final String ADT_PLUGIN_ID = "com.android.ide.eclipse.adt"; //$NON-NLS-1$
private static final String ECLIPSE_PLATFORM_PLUGIN_ID = "org.eclipse.platform"; //$NON-NLS-1$
/**
* Returns true if the ADT plugin is available in the current platform. This is useful
* for distinguishing between specific RCP applications vs. ADT + Eclipse.
*/
public static boolean isAdtInstalled() {
Bundle b = Platform.getBundle(ADT_PLUGIN_ID);
return b != null;
}
/** Returns the version of current eclipse platform. */
public static Version getPlatformVersion() {
Bundle b = Platform.getBundle(ECLIPSE_PLATFORM_PLUGIN_ID);
return b == null ? Version.emptyVersion : b.getVersion();
}
}

View file

@ -0,0 +1,123 @@
/*
* Copyright (C) 2012 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.ide.eclipse.base.internal.preferences;
import com.android.sdkstats.DdmsPreferenceStore;
import com.android.sdkstats.SdkStatsPermissionDialog;
import org.eclipse.jface.preference.BooleanFieldEditor;
import org.eclipse.jface.preference.PreferencePage;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Link;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;
public class UsagePreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
private static final int WRAP_WIDTH_PX = 200;
private BooleanFieldEditor mOptInCheckBox;
private DdmsPreferenceStore mStore = new DdmsPreferenceStore();
public UsagePreferencePage() {
}
@Override
public void init(IWorkbench workbench) {
// pass
}
@Override
protected Control createContents(Composite parent) {
Composite top = new Composite(parent, SWT.NONE);
top.setLayout(new GridLayout(1, false));
top.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
Label l = new Label(top, SWT.WRAP);
l.setText(SdkStatsPermissionDialog.BODY_TEXT);
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
gd.widthHint = WRAP_WIDTH_PX;
l.setLayoutData(gd);
Link privacyPolicyLink = new Link(top, SWT.WRAP);
gd = new GridData(GridData.FILL_HORIZONTAL);
gd.widthHint = WRAP_WIDTH_PX;
privacyPolicyLink.setLayoutData(gd);
privacyPolicyLink.setText(SdkStatsPermissionDialog.PRIVACY_POLICY_LINK_TEXT);
privacyPolicyLink.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent event) {
SdkStatsPermissionDialog.openUrl(event.text);
}
});
mOptInCheckBox = new BooleanFieldEditor(DdmsPreferenceStore.PING_OPT_IN,
SdkStatsPermissionDialog.CHECKBOX_TEXT, top);
mOptInCheckBox.setPage(this);
mOptInCheckBox.setPreferenceStore(mStore.getPreferenceStore());
mOptInCheckBox.load();
return top;
}
/* (non-Javadoc)
* @see org.eclipse.jface.preference.PreferencePage#performCancel()
*/
@Override
public boolean performCancel() {
mOptInCheckBox.load();
return super.performCancel();
}
/* (non-Javadoc)
* @see org.eclipse.jface.preference.PreferencePage#performDefaults()
*/
@Override
protected void performDefaults() {
mOptInCheckBox.loadDefault();
super.performDefaults();
}
/* (non-Javadoc)
* @see org.eclipse.jface.preference.PreferencePage#performOk()
*/
@Override
public boolean performOk() {
save();
return super.performOk();
}
/* (non-Javadoc)
* @see org.eclipse.jface.preference.PreferencePage#performApply()
*/
@Override
protected void performApply() {
save();
super.performApply();
}
private void save() {
mStore.setPingOptIn(mOptInCheckBox.getBooleanValue());
}
}