upload android base code part6

This commit is contained in:
August 2018-08-08 17:48:24 +08:00
parent 421e214c7d
commit 4e516ec6ed
35396 changed files with 9188716 additions and 0 deletions

View file

@ -0,0 +1 @@
include $(call all-subdir-makefiles)

View file

@ -0,0 +1,51 @@
# Copyright (C) 2007 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.
#
# If you don't need to do a full clean build but would like to touch
# a file or delete some intermediate files, add a clean step to the end
# of the list. These steps will only be run once, if they haven't been
# run before.
#
# E.g.:
# $(call add-clean-step, touch -c external/sqlite/sqlite3.h)
# $(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/STATIC_LIBRARIES/libz_intermediates)
#
# Always use "touch -c" and "rm -f" or "rm -rf" to gracefully deal with
# files that are missing or have been moved.
#
# Use $(PRODUCT_OUT) to get to the "out/target/product/blah/" directory.
# Use $(OUT_DIR) to refer to the "out" directory.
#
# If you need to re-do something that's already mentioned, just copy
# the command and add it to the bottom of the list. E.g., if a change
# that you made last week required touching a file and a change you
# made today requires touching the same file, just copy the old
# touch step and add it to the end of the list.
#
# ************************************************
# NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST
# ************************************************
# For example:
#$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/APPS/AndroidTests_intermediates)
#$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/JAVA_LIBRARIES/core_intermediates)
#$(call add-clean-step, find $(OUT_DIR) -type f -name "IGTalkSession*" -print0 | xargs -0 rm -f)
#$(call add-clean-step, rm -rf $(PRODUCT_OUT)/data/*)
#$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/etc/apns-conf.xml)
#$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/etc/apns-conf.xml)
# ************************************************
# NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST
# ************************************************

View file

@ -0,0 +1,2 @@
amitmahajan@google.com
rgreenwalt@google.com

View file

@ -0,0 +1,3 @@
To build the add-on:
make -j8 PRODUCT-sample_addon-sdk_addon

View file

@ -0,0 +1 @@
include $(call all-subdir-makefiles)

View file

@ -0,0 +1,13 @@
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_PATH := $(PRODUCT_OUT)/system/priv-app
LOCAL_SRC_FILES := $(call all-java-files-under, src)
LOCAL_PACKAGE_NAME := LeanbackCustomizer
LOCAL_SDK_VERSION := current
include $(BUILD_PACKAGE)

View file

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.google.android.leanbacklauncher.partnercustomizer">
<uses-sdk
android:minSdkVersion="21"
android:targetSdkVersion="21" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.INTERNET" />
<application android:label="@string/app_label">
<receiver android:name=".PartnerReceiver">
<intent-filter>
<action android:name="com.google.android.leanbacklauncher.action.PARTNER_CUSTOMIZATION" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.PACKAGE_ADDED" />
<action android:name="android.intent.action.PACKAGE_REMOVED" />
<data android:scheme="package"/>
</intent-filter>
</receiver>
</application>
</manifest>

View file

@ -0,0 +1,20 @@
# To enable ProGuard in your project, edit project.properties
# to define the proguard.config property as described in that file.
#
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in ${sdk.dir}/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the ProGuard
# include property in project.properties.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# Add any project specific keep options here:
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

View file

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="partner_color">#FFFF00FF</color>
</resources>

View file

@ -0,0 +1,66 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<bool name="partner_show_live_tv_on_start_up">true</bool>
<bool name="disable_disconnected_inputs">false</bool>
<bool name="show_physical_tuners_separately">true</bool>
<string name="bundled_tuner_title">All Channels</string>
<item type="drawable" name="bundled_tuner_banner">@drawable/ic_bundled_tuner_banner</item>
<!-- DO NOT TRANSLATE -->
<string name="partner_app_sorting_mode" translatable="false">fixed</string>
<!-- DO NOT TRANSLATE -->
<string name="partner_wallpaper" translatable="false">bg_custom</string>
<!-- DO NOT TRANSLATE -->
<string name="partner_widget_provider_component_name" translatable="false">
com.google.android.leanbacklauncher.partnerwidget/.ClockWidgetProvider
</string>
<!-- DO NOT TRANSLATE -->
<string name="partner_search_icon" translatable="false">ic_launcher</string>
<!--
DO NOT TRANSLATE
List showing default out of box ordering for the launcher.
The higher in this list a package appears, the higher it will be in the launcher.
Since the apps row and games row are separate, we can safely put them in the same array.
This same list will be used to determine the initial ordering of recommendations.
The Google default out of box ordering will supercede this ordering if there is a conflict.
-->
<string-array name="partner_out_of_box_order" translatable="false">
<!-- Highest priority packages up here -->
<!-- Apps row -->
<item>com.ted.android.tv</item> <!-- TED -->
<item>com.clearchannel.iheartradio.tv</item> <!-- iHeartRadio -->
<item>com.plexapp.plex</item> <!-- Plex -->
<!-- Games row -->
<item>com.ayopagames.robotsloveicecream</item> <!-- Robots Love Ice Cream -->
<item>com.frogmind.badland</item> <!-- Badland -->
<item>com.bezircle</item> <!-- Bezircle -->
<!-- Lowest priority packages down here -->
</string-array>
<!-- DO NOT TRANSLATE -->
<string-array name="home_screen_row_ordering" translatable="false">
<item>partner_row</item>
<item>inputs_row</item>
<item>games_row</item>
<item>apps_row</item>
<item>settings_row</item>
</string-array>
<item type="drawable" name="partner_row_icon">@drawable/ic_title_custom</item>
<item type="drawable" name="apps_row_icon">@drawable/ic_title_apps</item>
<item type="drawable" name="games_row_icon">@drawable/ic_title_games</item>
<item type="drawable" name="inputs_row_icon">@drawable/ic_title_custom</item>
<item type="drawable" name="settings_row_icon">@drawable/ic_title_settings</item>
<!-- DO NOT TRANSLATE -->
<string name="partner_font" translatable="false">sans-serif-bold</string>
<!-- DO NOT TRANSLATE -->
<string name="launcher_category" translatable="false">android.intent.category.LEANBACK_LAUNCHER</string>
</resources>

View file

@ -0,0 +1,20 @@
<resources>
<string name="app_label">LeanbackCustomizer</string>
<string name="partner_row_title">Google\'s Top Picks</string>
<string name="apps_row_title">My Apps</string>
<string name="games_row_title">My Games</string>
<string name="inputs_row_title">My Inputs</string>
<string name="settings_row_title">My Settings</string>
<!-- Content description for Netflix App -->
<string name="ted">Ted</string>
<!-- Content description for banner to encourage users to download the Netflix App -->
<string name="try_ted">Try Ted</string>
<!-- Content description for Google Play Movies App -->
<string name="play_movies">Play Movies</string>
<!-- Content description for banner to encourage users to download Google Play Movies App -->
<string name="try_play_movies">Try Play Movies</string>
</resources>

View file

@ -0,0 +1,151 @@
/*
* Copyright (C) 2014 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.google.android.leanbacklauncher.partnercustomizer;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.graphics.BitmapFactory;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
/**
* This class posts notifications that are used to populate the Partner Row of the Leanback Launcher
* It also allows the system/launcher to find the correct partner customization
* package.
*
* Packages using this broadcast receiver must also be a system app to be used for
* partner customization.
*/
public class PartnerReceiver extends BroadcastReceiver {
private static final String ACTION_PARTNER_CUSTOMIZATION =
"com.google.android.leanbacklauncher.action.PARTNER_CUSTOMIZATION";
private static final String EXTRA_ROW_WRAPPING_CUTOFF =
"com.google.android.leanbacklauncher.extra.ROW_WRAPPING_CUTOFF";
private static final String PARTNER_GROUP = "partner_row_entry";
private static final String BLACKLIST_PACKAGE = "com.google.android.leanbacklauncher.replacespackage";
private static final String TED_PKG_NAME = "com.ted.android.tv";
private static final String PLAY_MOVIES_PKG_NAME = "com.google.android.videos";
private Context mContext;
private NotificationManager mNotifMan;
private PackageManager mPkgMan;
// Cutoff value for when the Launcher displays the Partner row as a single
// row, or a two row grid. Can be used for correctly positioning the partner
// app entries.
private int mRowCutoff = 0;
@Override
public void onReceive(Context context, Intent intent) {
if (mContext == null) {
mContext = context;
mNotifMan = (NotificationManager)
mContext.getSystemService(Context.NOTIFICATION_SERVICE);
mPkgMan = mContext.getPackageManager();
}
String action = intent.getAction();
if (Intent.ACTION_PACKAGE_ADDED.equals(action)||
Intent.ACTION_PACKAGE_REMOVED.equals(action)) {
postNotification(getPackageName(intent));
} else if (ACTION_PARTNER_CUSTOMIZATION.equals(action)) {
mRowCutoff = intent.getIntExtra(EXTRA_ROW_WRAPPING_CUTOFF, 0);
postNotification(TED_PKG_NAME);
postNotification(PLAY_MOVIES_PKG_NAME);
}
}
private void postNotification(String pkgName) {
int sort;
int resId;
int backupResId;
int titleId;
int backupTitleId;
switch (pkgName) {
case TED_PKG_NAME:
sort = 1;
resId = R.drawable.ic_ted_banner;
backupResId = R.drawable.ic_try_ted_banner;
titleId = R.string.ted;
backupTitleId = R.string.try_ted;
break;
case PLAY_MOVIES_PKG_NAME:
sort = 2;
resId = R.drawable.ic_play_movies_banner;
backupResId = R.drawable.ic_try_play_movies_banner;
titleId = R.string.play_movies;
backupTitleId = R.string.try_play_movies;
break;
default:
return;
}
postNotification(sort, resId, backupResId, titleId, backupTitleId, pkgName);
}
private void postNotification(int sort, int resId, int backupResId,
int titleId, int backupTitleId, String pkgName) {
int id = resId;
Intent intent = mPkgMan.getLeanbackLaunchIntentForPackage(pkgName);
if (intent == null) {
titleId = backupTitleId;
resId = backupResId;
intent = getBackupIntent(pkgName);
}
Notification.Builder bob = new Notification.Builder(mContext);
Bundle extras = new Bundle();
extras.putString(BLACKLIST_PACKAGE, pkgName);
bob.setContentTitle(mContext.getString(titleId))
.setSmallIcon(R.drawable.ic_launcher)
.setLargeIcon(BitmapFactory.decodeResource(mContext.getResources(), resId))
.setContentIntent(PendingIntent.getActivity(mContext, 0, intent, 0))
.setCategory(Notification.CATEGORY_RECOMMENDATION)
.setGroup(PARTNER_GROUP)
.setSortKey(sort+"")
.setColor(mContext.getResources().getColor(R.color.partner_color))
.setExtras(extras);
mNotifMan.notify(id, bob.build());
}
private Intent getBackupIntent(String pkgName) {
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse("market://details?id=" + pkgName));
return intent;
}
private String getPackageName(Intent intent) {
Uri uri = intent.getData();
String pkg = uri != null ? uri.getSchemeSpecificPart() : null;
return pkg;
}
}

View file

@ -0,0 +1,7 @@
package com.google.android.leanbacklauncher.partnercustomizer;
import android.app.Activity;
public class TestActivity extends Activity {
}

View file

@ -0,0 +1,13 @@
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_PATH := $(PRODUCT_OUT)/system/app
LOCAL_SRC_FILES := $(call all-java-files-under, src)
LOCAL_PACKAGE_NAME := LeanbackWidget
LOCAL_SDK_VERSION := current
include $(BUILD_PACKAGE)

View file

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.google.android.leanbacklauncher.partnerwidget">
<uses-sdk
android:minSdkVersion="19"
android:targetSdkVersion="19" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<application android:label="@string/app_label">
<receiver android:name=".ClockWidgetProvider" >
<intent-filter>
<action android:name="android.net.conn.INET_CONDITION_ACTION" />
<action android:name="android.net.conn.CONNECTIVITY_CHANGE" />
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter>
<meta-data
android:name="android.appwidget.provider"
android:resource="@xml/clock_widget_info" />
</receiver>
</application>
</manifest>

View file

@ -0,0 +1,20 @@
# To enable ProGuard in your project, edit project.properties
# to define the proguard.config property as described in that file.
#
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in ${sdk.dir}/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the ProGuard
# include property in project.properties.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# Add any project specific keep options here:
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 833 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 680 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 934 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 775 B

View file

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="@dimen/widget_top_margin" >
<TextClock
android:id="@+id/clock"
android:layout_width="@dimen/clock_width"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:gravity="center_vertical|end"
android:format12Hour="@string/widget_12_hours_format"
android:format24Hour="@string/widget_24_hours_format"
android:fontFamily="@string/light_font"
android:includeFontPadding="false"
android:textColor="@color/clock_text_color"
android:textSize="@dimen/clock_text_size" />
<ImageView
android:id="@+id/connectivity_indicator"
android:layout_width="@dimen/connectivity_status_size"
android:layout_height="@dimen/connectivity_status_size"
android:layout_toStartOf="@+id/clock"
android:layout_centerVertical="true"
android:src="@null" />
</RelativeLayout>

View file

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="clock_text_color">#FFEEEEEE</color>
</resources>

View file

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- DO NOT TRANSLATE -->
<string name="font" translatable="false">sans-serif-condensed</string>
<!-- DO NOT TRANSLATE -->
<string name="light_font" translatable="false">sans-serif-light</string>
<!-- DO NOT TRANSLATE -->
<string name="regular_font" translatable="false">sans-serif</string>
<string name="widget_12_hours_format" translatable="false">h:mm</string>
<string name="widget_24_hours_format" translatable="false">kk:mm</string>
</resources>

View file

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="clock_text_size">36sp</dimen>
<dimen name="clock_width">106dp</dimen>
<dimen name="connectivity_status_size">32dp</dimen>
<dimen name="widget_top_margin">1dp</dimen>
</resources>

View file

@ -0,0 +1,5 @@
<resources>
<string name="app_label">LeanbackWidget</string>
</resources>

View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
android:updatePeriodMillis="1800000"
android:initialLayout="@layout/clock_widget"
android:widgetCategory="home_screen"
android:resizeMode="none" />

View file

@ -0,0 +1,95 @@
package com.google.android.leanbacklauncher.partnerwidget;
import android.appwidget.AppWidgetManager;
import android.appwidget.AppWidgetProvider;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.os.Bundle;
import android.widget.RemoteViews;
public class ClockWidgetProvider extends AppWidgetProvider {
private static final String SHARED_PREFS = "widget-prefs";
private static final int INET_CONDITION_THRESHOLD = 50;
private static final String INET_CONDITION_ACTION = "android.net.conn.INET_CONDITION_ACTION";
private static final String EXTRA_INET_CONDITION = "inetCondition";
@Override
public void onReceive(Context context, Intent intent) {
String intentAction = intent.getAction();
if (INET_CONDITION_ACTION.equals(intentAction) ||
ConnectivityManager.CONNECTIVITY_ACTION.equals(intentAction)) {
if (INET_CONDITION_ACTION.equals(intentAction)) {
// a broadcast with this intent action is only fired when we are actually connected
// (i.e connectionStatus = 100). So, clearing connectivity status when changing
// networks is required
int connectionStatus = intent.getIntExtra(EXTRA_INET_CONDITION, -551);
writeConnectivity(context, connectionStatus > INET_CONDITION_THRESHOLD);
}
update(context);
}
super.onReceive(context, intent);
}
@Override
public void onAppWidgetOptionsChanged(Context context, AppWidgetManager appWidgetManager,
int appWidgetId, Bundle newOptions) {
update(context);
}
public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {
update(context);
super.onUpdate(context, appWidgetManager, appWidgetIds);
}
private void update(Context context) {
AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(context);
ComponentName thisWidget = new ComponentName(context, ClockWidgetProvider.class);
appWidgetManager.updateAppWidget(thisWidget, getRemoteViews(context));
}
private RemoteViews getRemoteViews(Context context) {
RemoteViews remoteViews = new RemoteViews(context.getPackageName(), R.layout.clock_widget);
remoteViews.setImageViewResource(R.id.connectivity_indicator, getConnectedResId(context));
return remoteViews;
}
private static int getConnectedResId(Context context) {
ConnectivityManager cm = (ConnectivityManager) context
.getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo info = cm.getActiveNetworkInfo();
int resId = 0;
if (info == null || !info.isAvailable() || !info.isConnected()) {
// can't have Internet access with no network
writeConnectivity(context, false);
resId = R.drawable.ic_widget_wifi_not_connected;
} else if (!readConnectivity(context)) {
resId = R.drawable.ic_widget_wifi_no_internet;
} else {
// internet is connected and working, show nothing
resId = android.R.color.transparent;
}
return resId;
}
private static void writeConnectivity(Context context, boolean inetConnected) {
context.getSharedPreferences(SHARED_PREFS, Context.MODE_PRIVATE).edit()
.putBoolean(EXTRA_INET_CONDITION, inetConnected).apply();
}
private static boolean readConnectivity(Context context) {
return context.getSharedPreferences(SHARED_PREFS, Context.MODE_PRIVATE).getBoolean(
EXTRA_INET_CONDITION, true);
}
}

View file

@ -0,0 +1,37 @@
# Copyright 2010, 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.
ifneq ($(TARGET_BUILD_JAVA_SUPPORT_LEVEL),)
# This is the makefile for the Email Policy package contained elsewhere in this sample.
# When deploying to an actual device, you must change LOCAL_PACKAGE_NAME to the name desired for
# your local version, e.g. LOCAL_PACKAGE_NAME := MyDeviceEmailPolicy This will cause the build
# system to create "MyDeviceEmailPolicy.apk". You must then add this to the appropriate product.mk
# file for your device, to include the APK file in your system image.
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE_TAGS := optional
LOCAL_SRC_FILES := $(call all-java-files-under, src)
LOCAL_PACKAGE_NAME := SampleEmailPolicy
LOCAL_CERTIFICATE := platform
LOCAL_PROGUARD_FLAG_FILES := proguard.flags
include $(BUILD_PACKAGE)
endif # JAVA_SUPPORT

View file

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2010 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.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.android.email.policy"
>
<!--
This package has no components. It is simply a container for a single class, which is
loaded and used by the email application.
-->
<application android:label="@string/app_label">
</application>
</manifest>

View file

@ -0,0 +1,23 @@
# Copyright 2010, 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.
This package contains sample code for building Email Policy packages. These are small Android
Package (APK) files containing a device-specific configuration values for the Email application.
These policy files are intended for use by an OEM who is building a device using the Android
Open Source platform, but wishes to provide small customizations to the Email application without
having to edit or merge changes directly into its source. It also allows the same Email application
to be deployed to devices with slightly different policies.
For more information, see the comments in src/com/android/email/policy/EmailPolicy.java.

View file

@ -0,0 +1,21 @@
# Copyright 2010, 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.
# Prevent ProGuard from discarding the "getPolicy" method, or the class that contains it.
-keep class com.android.email.policy.EmailPolicy
-keepclasseswithmembers class * {
public static android.os.Bundle getPolicy(java.lang.String, android.os.Bundle);
}

View file

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2010 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.
-->
<!-- This string will never be seen by the user -->
<resources>
<string name="app_label">Email policy</string>
</resources>

View file

@ -0,0 +1,247 @@
/*
* Copyright (C) 2010 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.email.policy;
import android.os.Bundle;
/**
* This sample is the framework that can be used to build EmailPolicy packages for inclusion
* on specific devices. This sample is intended for use by OEMs or other creators of system
* images.
*
* When this package is built and included in a system image, the Email application will detect
* it (using reflection) and will make calls to the getPolicy() method at certain times. This
* can be used to provide local customization of the Email application.
*
* Do not change the package, class name, or method name - these must match the names used in
* this sample code or the Email application will not find the helper.
*
* Three customization points are provided:
*
* * Alternate strings for Exchange/ActiveSync UI
* * Insertion of device-specific text into IMAP ID commands
* * Device- or Carrier- specific account presets
*
* Each policy request may contain one or more parameters; These are supplied as keyed entries
* in the "arguments" bundle. If there is a single argument, it will typically use the same key
* as the policy name. If there are multiple arguments, they keys are provided and called out.
*
* In all cases, getPolicy() should return a bundle. For default behavior, or for any unknown
* policy, simply return Bundle.EMPTY.
*
* To return actual data, create a new bundle and place result values in it. If there is a single
* return value, this value is placed in the return bundle using the same key as the request.
* If there are multiple return values, keys will be provided for them as well.
*
* Future versions of the Email application may access additional customization points. If
* the call to getPolicy() is made with an unknown or unexpected policy keys, or the expected
* argument values cannot be found, the method should Bundle.EMPTY.
*/
public class EmailPolicy {
/**
* This policy request configures the UI to conform to various Exchange/ActiveSync
* license requirements. In the default configuration, the UI will refer to this protocol as
* "Exchange", while in the alternate configuration, the UI will refer to it as
* "Exchange ActiveSync" or "Microsoft Exchange ActiveSync".
*
* For the default behavior, return the empty bundle.
* For the alternate behavior, return a bundle containing a single entry with a key of
* USE_ALTERNATE_EXCHANGE_STRINGS and a value of "true".
*/
private static final String USE_ALTERNATE_EXCHANGE_STRINGS = "useAlternateExchangeStrings";
/**
* This policy request allows you to insert field/value pairs into the IMAP ID command, which
* is sent to an IMAP server on each connection.
*
* The following arguments are provided:
* * GET_IMAP_ID_USER - the userid of the account being connected to
* * GET_IMAP_ID_HOST - the hostname of the server being connected to
* * GET_IMAP_ID_CAPA - the values returned by the "CAPA" command
*
* For default behavior (no values inserted), return the empty bundle.
* To insert additional values into the IMAP ID command, return a bundle containing a single
* entry with a key of GET_IMAP_ID and a String value. The value must be field/value pairs
* surrounded by quotes and separated by spaces. Multiple field/value pairs may be provided.
* See RFC 2971 for more information.
*/
private static final String GET_IMAP_ID = "getImapId";
private static final String GET_IMAP_ID_USER = "getImapId.user";
private static final String GET_IMAP_ID_HOST = "getImapId.host";
private static final String GET_IMAP_ID_CAPA = "getImapId.capabilities";
/**
* This policy request allows you to supply preset server configurations to provide
* automatic setup/configuration for specific email providers. These values supplement (or
* override) the automatic configurations provided in res/xml/providers.xml in
* the Email sources. (See that file for more information and plenty of samples.)
*
* The only argument (with the key FIND_PROVIDER) is a string containing the domain that the
* user entered as part of their email address; For example, if the user enters
* "MyEmailAddress@gmail.com", the domain will be "gmail.com".
*
* If no server information is provided for this domain, simply return Bundle.EMPTY.
* If server information is available for this domain, it can be returned in the following
* values:
* * FIND_PROVIDER_IN_URI The server configuration for the incoming (IMAP or POP) server
* * FIND_PROVIDER_IN_USER Format of the username (login) value
* * FIND_PROVIDER_OUT_URI The server configuration for the outgoing (SMTP) server
* * FIND_PROVIDER_OUT_USER Format of the username (login) value
*
* Valid incoming uri schemes are:
* imap IMAP with no transport security.
* imap+tls+ IMAP with required TLS transport security.
* If TLS is not available the connection fails.
* imap+ssl+ IMAP with required SSL transport security.
* If SSL is not available the connection fails.
*
* pop3 POP3 with no transport security.
* pop3+tls+ POP3 with required TLS transport security.
* If TLS is not available the connection fails.
* pop3+ssl+ POP3 with required SSL transport security.
* If SSL is not available the connection fails.
*
* Valid outgoing uri schemes are:
* smtp SMTP with no transport security.
* smtp+tls+ SMTP with required TLS transport security.
* If TLS is not available the connection fails.
* smtp+ssl+ SMTP with required SSL transport security.
* If SSL is not available the connection fails.
*
* To the above schemes you may also add "trustallcerts" to indicate that,
* although link encryption is still required, "non-trusted" certificates may
* will be excepted. For example, "imap+ssl+trustallcerts" or
* "smtp+tls+trustallcerts". This should only used when necessary, as it
* could allow a spoofed server to intercept password and mail.
*
* The URIs should be full templates for connection, including a port if
* the service uses a non-default port. The default ports are as follows:
* imap 143 pop3 110 smtp 587
* imap+tls+ 143 pop3+tls+ 110 smtp+tls+ 587
* imap+ssl+ 993 pop3+ssl+ 995 smtp+ssl+ 465
*
* The username attribute is used to supply a template for the username
* that will be presented to the server. This username is built from a
* set of variables that are substituted with parts of the user
* specified email address.
*
* Valid substitution values for the username attribute are:
* $email - the email address the user entered
* $user - the value before the @ sign in the email address the user entered
* $domain - the value after the @ signin the email address the user entered
*
* The username attribute MUST be specified for the incoming element, so the POP3 or IMAP
* server can identify the mailbox to be opened.
*
* The username attribute MAY be the empty string for the outgoing element, but only if the
* SMTP server supports anonymous transmission (most don't).
*
* For more information about these values, and many examples, see res/xml/providers.xml in
* the Email sources.
*/
private static final String FIND_PROVIDER = "findProvider";
private static final String FIND_PROVIDER_IN_URI = "findProvider.inUri";
private static final String FIND_PROVIDER_IN_USER = "findProvider.inUser";
private static final String FIND_PROVIDER_OUT_URI = "findProvider.outUri";
private static final String FIND_PROVIDER_OUT_USER = "findProvider.outUser";
/**
* The following data is simply examples, and would be changed (or removed) based on the
* requirements for your device.
*/
/**
* Sample: Email domains that will be auto-configured. In our example, a number of domains
* are controlled by a single mail server.
*/
private static final String[] KNOWN_DOMAINS = new String[] {
"physics.school.edu", "math.school.edu", "language.school.edu", "history.school.edu"
};
/**
* Sample: When we see a particular capability (identifying a particular server), send
* back a special value in the IMAP ID command.
*/
private static final String MY_SERVER_CAPABILITY = "MY-SERVER-CAPABILITY";
private static final String MY_DEVICE_ID = "\"DEVICE-ID-FIELD\" \"MY-DEVICE-ID-VALUE\"";
/**
* Entry point from the Email application.
*
* @param policy A string requesting a particular policy
* @param arguments A bundle containing zero or more argument values for the requested policy
* @return A bundle containing zero or more return values for the requested policy
*/
public static Bundle getPolicy(String policy, Bundle arguments) {
/*
* Policy: Use alternate exchange strings
*/
if (USE_ALTERNATE_EXCHANGE_STRINGS.equals(policy)) {
// Un-comment the following code to select alternate exchange strings
// Bundle alternates = new Bundle();
// alternates.putBoolean(USE_ALTERNATE_EXCHANGE_STRINGS, true);
// return alternates;
}
/*
* Policy: For a known domain, configure to the servers for that domain
*/
if (FIND_PROVIDER.equals(policy)) {
String domain = arguments.getString(FIND_PROVIDER);
if (domain != null) {
domain = domain.toLowerCase();
boolean isKnownDomain = false;
for (String knownDomain : KNOWN_DOMAINS) {
if (knownDomain.equals(domain)) {
isKnownDomain = true;
break;
}
}
if (isKnownDomain) {
Bundle b = new Bundle();
b.putString(FIND_PROVIDER_IN_URI, "imap+ssl://imap.school.edu");
b.putString(FIND_PROVIDER_IN_USER, "$email");
b.putString(FIND_PROVIDER_OUT_URI, "smtp+ssl://smtp.school.edu");
b.putString(FIND_PROVIDER_OUT_USER, "$email");
return b;
}
}
}
/**
* Policy: If the IMAP server presents a particular capability, send back a particular
* identifier in the IMAP ID.
*/
if (GET_IMAP_ID.equals(policy)) {
String capabilities = arguments.getString(GET_IMAP_ID_CAPA);
if (capabilities != null) {
if (capabilities.toUpperCase().contains(MY_SERVER_CAPABILITY)) {
Bundle b = new Bundle();
b.putString(GET_IMAP_ID, MY_DEVICE_ID);
return b;
}
}
}
/**
* For any other policy request, or any policy request that cannot be processed,
* return an empty bundle.
*/
return Bundle.EMPTY;
}
}

View file

@ -0,0 +1,13 @@
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_PATH := $(PRODUCT_OUT)/system/priv-app
LOCAL_SRC_FILES := $(call all-java-files-under, src)
LOCAL_PACKAGE_NAME := TvSetupCustomizer
LOCAL_SDK_VERSION := current
include $(BUILD_PACKAGE)

View file

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.google.android.tvsetup.partnercustomizer">
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.INTERNET" />
<application android:label="@string/app_label">
<receiver android:name=".PartnerReceiver">
<intent-filter>
<action android:name="com.google.android.tvsetup.action.PARTNER_CUSTOMIZATION" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.PACKAGE_ADDED" />
<action android:name="android.intent.action.PACKAGE_REMOVED" />
<data android:scheme="package"/>
</intent-filter>
</receiver>
</application>
</manifest>

View file

@ -0,0 +1,20 @@
# To enable ProGuard in your project, edit project.properties
# to define the proguard.config property as described in that file.
#
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in ${sdk.dir}/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the ProGuard
# include property in project.properties.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# Add any project specific keep options here:
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

View file

@ -0,0 +1,4 @@
<resources>
<!-- Welcome message -->
<string name="welcome_message">a really really long welcome message, because german</string>
</resources>

View file

@ -0,0 +1,4 @@
<resources>
<!-- Welcome message -->
<string name="welcome_message">welcome_message, eh?</string>
</resources>

View file

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2012-2014 Google Inc. All Rights Reserved. -->
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Display "SKIP" in network selection screen -->
<bool name="show_skip_network">true</bool>
<!-- Allow user to skip Google signin at signin setup step -->
<bool name="show_skip_signin">true</bool>
<!-- Show wifi WPS option at top of list -->
<bool name="show_wps_at_top">true</bool>
<!-- Prevent users from returning to the pre-setup oem customization hook -->
<bool name="prevent_prehook_replay">true</bool>
</resources>

View file

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2012-2014 Google Inc. All Rights Reserved. -->
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Max width for welcome text (default: 536dp) -->
<dimen name="welcome_message_max_width">400dp</dimen>
<!-- Offset (positive or negative) for the welcome message (default: 0) -->
<dimen name="welcome_message_offset">-100dp</dimen>
</resources>

View file

@ -0,0 +1,11 @@
<resources>
<string name="app_label">SetupCustomizer</string>
<!-- Welcome message -->
<string name="welcome_message">welcome_message</string>
<!-- Custom wallpaper [DO NOT TRANSLATE] -->
<string name="setup_wallpaper_component" translatable="false">com.android.systemui/com.android.systemui.ImageWallpaper</string>
</resources>

View file

@ -0,0 +1,33 @@
/*
* Copyright (C) 2014 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.google.android.tvsetup.partnercustomizer;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
/**
* This class allows the system/setup app to find the partner customization package.
*
* Package must be a system app to be used for partner customization.
*/
public class PartnerReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
}
}

View file

@ -0,0 +1,43 @@
#
# Copyright (C) 2008 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.
#
ifneq ($(TARGET_BUILD_JAVA_SUPPORT_LEVEL),)
# This makefile is an example of writing an application that will link against
# a custom shared library included with an Android system.
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE_TAGS := optional
# This is the target being built.
LOCAL_PACKAGE_NAME := PlatformLibraryClient
# Only compile source java files in this apk.
LOCAL_SRC_FILES := $(call all-java-files-under, src)
# Link against the current Android SDK.
LOCAL_SDK_VERSION := current
# Also link against our own custom library.
LOCAL_JAVA_LIBRARIES := com.example.android.platform_library
LOCAL_PROGUARD_ENABLED := disabled
include $(BUILD_PACKAGE)
endif # JAVA_SUPPORT

View file

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2008 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.
-->
<!-- This is an example of writing a client application for a custom
platform library. -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.android.platform_library.client">
<application android:label="Platform Lib Client">
<!-- This tells the system about the custom library used by the
application, so that it can be properly loaded and linked
to the app when the app is initialized. -->
<uses-library android:name="com.example.android.platform_library" />
<activity android:name="Client">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>
</manifest>

View file

@ -0,0 +1,43 @@
/*
* Copyright (C) 2007 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.example.android.platform_library.client;
import com.example.android.platform_library.PlatformLibrary;
import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;
/**
* Use a custom platform library.
*/
public class Client extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Call an API on the library.
PlatformLibrary pl = new PlatformLibrary();
int res = pl.getInt(false);
// We'll just make our own view to show the result.
TextView tv = new TextView(this);
tv.setText("Got from lib: " + res);
setContentView(tv);
}
}

View file

@ -0,0 +1,37 @@
#
# Copyright (C) 2008 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.
#
ifneq ($(TARGET_BUILD_JAVA_SUPPORT_LEVEL),)
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE_TAGS := optional
# This is the target being built.
LOCAL_PACKAGE_NAME := UpgradeExample
# Only compile source java files in this apk.
LOCAL_SRC_FILES := $(call all-java-files-under, src)
# Link against the current Android SDK.
LOCAL_SDK_VERSION := current
LOCAL_PROGUARD_ENABLED := disabled
include $(BUILD_PACKAGE)
endif # JAVA_SUPPORT

View file

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2008 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.
-->
<!-- This is an example of writing an application that will can perform
additional work after a system update.. -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.android.platform.upgrade">
<application android:label="Upgrade App">
<receiver android:name="Upgrade">
<!-- This broadcast is sent after the core system has finished
booting, before the home app is launched or BOOT_COMPLETED
is sent. -->
<intent-filter>
<action android:name="android.intent.action.PRE_BOOT_COMPLETED"/>
</intent-filter>
</receiver>
</application>
</manifest>

View file

@ -0,0 +1,48 @@
/*
* Copyright (C) 2007 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.example.android.platform.upgrade;
import android.content.BroadcastReceiver;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.util.Log;
/**
* This will be launched during system boot, after the core system has
* been brought up but before any non-persistent processes have been
* started. It is launched in a special state, with no content provider
* or custom application class associated with the process running.
*/
public class Upgrade extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
// We are now running with the system up, but no apps started,
// so can do whatever cleanup after an upgrade that we want.
Log.i("Example", "******************* UPGRADE HERE *******************");
// And now disable this component so it won't get launched during
// the following system boots.
context.getPackageManager().setComponentEnabledSetting(
new ComponentName(context, getClass()),
PackageManager.COMPONENT_ENABLED_STATE_DISABLED,
PackageManager.DONT_KILL_APP);
}
}

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,213 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- use empty string to specify no proxy or port -->
<!-- This version must agree with that in apps/common/res/apns.xml -->
<apns version="8">
<apn carrier="Verizon"
mcc="310"
mnc="004"
apn="internet"
type="default,mms,dun"
mmsc="http://vzpix.com/servlets/mms"
user="hrltest@vztest.com"
password="vzwtest"
protocol="IPV4V6"
/>
<apn carrier="Verizon Internet"
mcc="310"
mnc="004"
apn="VZWINTERNET"
type="default,dun"
protocol="IPV4V6"
roaming_protocol="IPV4V6"
/>
<apn carrier="Verizon FOTA"
mcc="310"
mnc="004"
apn="VZWADMIN"
type="fota"
protocol="IPV4V6"
roaming_protocol="IPV4V6"
/>
<apn carrier="Verizon IMS"
mcc="310"
mnc="004"
apn="VZWIMS"
type="ims,ia"
protocol="IPV4V6"
roaming_protocol="IPV4V6"
/>
<apn carrier="Verizon CBS"
mcc="310"
mnc="004"
apn="VZWAPP"
type="cbs,mms"
mmsc="http://vzpix.com/servlets/mms"
user="hrltest@vztest.com"
password="vzwtest"
protocol="IPV4V6"
roaming_protocol="IPV4V6"
/>
<!-- Modify Apn database for VZW LTE support -->
<apn carrier="LTE - Verizon Internet"
mcc="311"
mnc="480"
apn="VZWINTERNET"
type="default,dun"
protocol="IPV4V6"
roaming_protocol="IPV4V6"
bearer="14"
/>
<apn carrier="LTE - Verizon FOTA"
mcc="311"
mnc="480"
apn="VZWADMIN"
type="fota"
protocol="IPV4V6"
roaming_protocol="IPV4V6"
bearer="14"
/>
<apn carrier="LTE - Verizon IMS"
mcc="311"
mnc="480"
apn="VZWIMS"
type="ims,ia"
protocol="IPV4V6"
roaming_protocol="IPV4V6"
bearer="14"
/>
<apn carrier="LTE - Verizon CBS"
mcc="311"
mnc="480"
apn="VZWAPP"
type="cbs,mms"
mmsc="http://vzpix.com/servlets/mms"
user="hrltest@vztest.com"
password="vzwtest"
protocol="IPV4V6"
roaming_protocol="IPV4V6"
bearer="14"
/>
<apn carrier="LTE - VZW Roaming Internet"
mcc="204"
mnc="04"
apn="VZWINTERNET"
type="default,dun"
protocol="IPV4V6"
roaming_protocol="IPV4V6"
bearer="14"
/>
<apn carrier="LTE - VZW Roaming FOTA"
mcc="204"
mnc="04"
apn="VZWADMIN"
type="fota"
protocol="IPV4V6"
roaming_protocol="IPV4V6"
bearer="14"
/>
<apn carrier="LTE - VZW Roaming IMS"
mcc="204"
mnc="04"
apn="VZWIMS"
type="ims,ia"
protocol="IPV4V6"
roaming_protocol="IPV4V6"
bearer="14"
/>
<apn carrier="LTE - VZW Roaming CBS"
mcc="204"
mnc="04"
apn="VZWAPP"
type="cbs,mms"
mmsc="http://vzpix.com/servlets/mms"
user="hrltest@vztest.com"
password="vzwtest"
protocol="IPV4V6"
roaming_protocol="IPV4V6"
bearer="14"
/>
<!-- END modify Apn database for VZW LTE support -->
<!-- Modify Apn database for VZW EHRPD support -->
<apn carrier="EHRPD - Verizon Internet"
mcc="311"
mnc="480"
apn="VZWINTERNET"
type="default,dun"
protocol="IPV4V6"
roaming_protocol="IPV4V6"
bearer="13"
/>
<apn carrier="EHRPD - Verizon FOTA"
mcc="311"
mnc="480"
apn="VZWADMIN"
type="fota"
protocol="IPV4V6"
roaming_protocol="IPV4V6"
bearer="13"
/>
<apn carrier="EHRPD - Verizon IMS"
mcc="311"
mnc="480"
apn="VZWIMS"
type="ims,ia"
protocol="IPV4V6"
roaming_protocol="IPV4V6"
bearer="13"
/>
<apn carrier="EHRPD - Verizon CBS"
mcc="311"
mnc="480"
apn="VZWAPP"
type="cbs,mms"
mmsc="http://vzpix.com/servlets/mms"
user="hrltest@vztest.com"
password="vzwtest"
protocol="IPV4V6"
roaming_protocol="IPV4V6"
bearer="13"
/>
<apn carrier="EHRPD - VZW Roaming Internet"
mcc="204"
mnc="04"
apn="VZWINTERNET"
type="default,dun"
protocol="IPV4V6"
roaming_protocol="IPV4V6"
bearer="13"
/>
<apn carrier="EHRPD - VZW Roaming FOTA"
mcc="204"
mnc="04"
apn="VZWADMIN"
type="fota"
protocol="IPV4V6"
roaming_protocol="IPV4V6"
bearer="13"
/>
<apn carrier="EHRPD - VZW Roaming IMS"
mcc="204"
mnc="04"
apn="VZWIMS"
type="ims,ia"
protocol="IPV4V6"
roaming_protocol="IPV4V6"
bearer="13"
/>
<apn carrier="EHRPD - VZW Roaming CBS"
mcc="204"
mnc="04"
apn="VZWAPP"
type="cbs,mms"
mmsc="http://vzpix.com/servlets/mms"
user="hrltest@vztest.com"
password="vzwtest"
protocol="IPV4V6"
roaming_protocol="IPV4V6"
bearer="13"
/>
<!-- END modify Apn database for VZW EHRPD support -->
</apns>

View file

@ -0,0 +1 @@
include $(call all-subdir-makefiles)

View file

@ -0,0 +1,60 @@
#
# Copyright (C) 2008 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.
#
ifneq ($(TARGET_BUILD_JAVA_SUPPORT_LEVEL),)
# This makefile shows how to build your own shared library that can be
# shipped on the system of a phone, and included additional examples of
# including JNI code with the library and writing client applications against it.
LOCAL_PATH := $(call my-dir)
# the library
# ============================================================
include $(CLEAR_VARS)
LOCAL_SRC_FILES := \
$(call all-subdir-java-files)
LOCAL_MODULE_TAGS := optional
# This is the target being built.
LOCAL_MODULE:= com.example.android.platform_library
include $(BUILD_JAVA_LIBRARY)
# the documentation
# ============================================================
include $(CLEAR_VARS)
LOCAL_SRC_FILES := $(call all-subdir-java-files) $(call all-subdir-html-files)
LOCAL_MODULE:= platform_library
LOCAL_DROIDDOC_OPTIONS :=
LOCAL_MODULE_CLASS := JAVA_LIBRARIES
LOCAL_DROIDDOC_USE_STANDARD_DOCLET := true
include $(BUILD_DROIDDOC)
# The JNI component
# ============================================================
# Also build all of the sub-targets under this one: the library's
# associated JNI code, and a sample client of the library.
include $(CLEAR_VARS)
include $(call all-makefiles-under,$(LOCAL_PATH))
endif # JAVA_SUPPORT

View file

@ -0,0 +1,74 @@
Platform Library Example
~~~~~~~~~~~~~~~~~~~~~~~~
This directory contains a full example of writing your own Android platform
shared library, without changing the Android framework. It also shows how to
write JNI code for incorporating native code into the library, and a client
application that uses the library.
This example is ONLY for people working with the open source platform to
create a system image that will be delivered on a device which will include
a custom library as shown here. It can not be used to create a third party
shared library, which is not currently supported in Android.
To declare your library to the framework, you must place a file with a .xml
extension in the /system/etc/permissions directory with the following contents:
<?xml version="1.0" encoding="utf-8"?>
<permissions>
<library name="com.example.android.platform_library"
file="/system/framework/com.example.android.platform_library.jar"/>
</permissions>
There are three major parts of this example, supplying three distinct
build targets and corresponding build outputs:
com.example.android.platform_library
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The top-level Android.mk defines the rules to build the shared library itself,
whose target is "com.example.android.platform_library". The code for this
library lives under java/.
Note that the product for this library is a raw .jar file, NOT a .apk, which
means there is no manifest or resources associated with the library.
Unfortunately this means that if you need any resources for the library, such
as drawables or layout files, you will need to add these to the core framework
resources under frameworks/base/res. Please make sure when doing this that
you do not make any of these resources public, they should not become part of
the Android API. In the future we will allow shared libraries to have their
own resources.
Other than that, the library is very straight-forward, and you can write
basically whatever code you want. You can also put code in other Java
namespaces -- the namespace given in the <library> tag above is just the
public unique name by which clients will link to your library, but once this
link happens all of the Java namespaces in that library will be available
to the client.
libplatform_library_jni
~~~~~~~~~~~~~~~~~~~~~~~
This is an optional example of how to write JNI code associated with a
shared library. This code lives under jni/. The jni/Android.mk file defines
the rules for building the final .so in which the code lives. This example
provides everything needed to hook up the native code with the Java library
and call through to it, plus a very simple JNI call.
PlatformLibraryClient
~~~~~~~~~~~~~~~~~~~~~
This shows an example of how you can write client applications for your new
shared library. This code lives under client/. Note that the example is
simply a regular Android .apk, like all of the other .apks created by the
build system. The only two special things needed to use your library are:
- A LOCAL_JAVA_LIBRARIES line in the Android.mk to have the build system link
against your shared library.
- A <uses-library> line in the AndroidManifest.xml to have the runtime load
your library into the application.

View file

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<permissions>
<library name="com.example.android.platform_library"
file="/system/framework/com.example.android.platform_library.jar"/>
</permissions>

View file

@ -0,0 +1,66 @@
/*
* Copyright (C) 2008 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.example.android.platform_library;
import android.util.Log;
public final class PlatformLibrary {
static {
/*
* Load the library. If it's already loaded, this does nothing.
*/
System.loadLibrary("platform_library_jni");
}
private int mJniInt = -1;
public PlatformLibrary() {}
/*
* Test native methods.
*/
public int getInt(boolean bad) {
/* this alters mJniInt */
int result = getJniInt(bad);
/* reverse a string, for no very good reason */
String reverse = reverseString("Android!");
Log.i("PlatformLibrary", "getInt: " + result + ", '" + reverse + "'");
return mJniInt;
}
/*
* Simple method, called from native code.
*/
private static void yodel(String msg) {
Log.d("PlatformLibrary", "yodel: " + msg);
}
/*
* Trivial native method call. If "bad" is true, this will throw an
* exception.
*/
native private int getJniInt(boolean bad);
/*
* Native method that returns a new string that is the reverse of
* the original. This also calls yodel().
*/
native private static String reverseString(String str);
}

View file

@ -0,0 +1,49 @@
#
# Copyright (C) 2008 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.
#
# This makefile supplies the rules for building a library of JNI code for
# use by our example platform shared library.
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE_TAGS := optional
# This is the target being built.
LOCAL_MODULE:= libplatform_library_jni
# All of the source files that we will compile.
LOCAL_SRC_FILES:= \
PlatformLibrary.cpp
# All of the shared libraries we link against.
LOCAL_SHARED_LIBRARIES := \
libnativehelper \
libcutils \
libutils \
liblog
# No static libraries.
LOCAL_STATIC_LIBRARIES :=
# Also need the JNI headers.
LOCAL_C_INCLUDES += \
$(JNI_H_INCLUDE)
# No specia compiler flags.
LOCAL_CFLAGS +=
include $(BUILD_SHARED_LIBRARY)

View file

@ -0,0 +1,273 @@
/*
* Copyright (C) 2008 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.
*/
#define LOG_TAG "PlatformLibrary"
#include "utils/Log.h"
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <assert.h>
#include "jni.h"
// ----------------------------------------------------------------------------
/*
* Field/method IDs and class object references.
*
* You should not need to store the JNIEnv pointer in here. It is
* thread-specific and will be passed back in on every call.
*/
static struct {
jclass platformLibraryClass;
jfieldID jniInt;
jmethodID yodel;
} gCachedState;
// ----------------------------------------------------------------------------
/*
* Helper function to throw an arbitrary exception.
*
* Takes the exception class name, a format string, and one optional integer
* argument (useful for including an error code, perhaps from errno).
*/
static void throwException(JNIEnv* env, const char* ex, const char* fmt,
int data) {
if (jclass cls = env->FindClass(ex)) {
if (fmt != NULL) {
char msg[1000];
snprintf(msg, sizeof(msg), fmt, data);
env->ThrowNew(cls, msg);
} else {
env->ThrowNew(cls, NULL);
}
/*
* This is usually not necessary -- local references are released
* automatically when the native code returns to the VM. It's
* required if the code doesn't actually return, e.g. it's sitting
* in a native event loop.
*/
env->DeleteLocalRef(cls);
}
}
/*
* Trivial sample method.
*
* If "bad" is true, this throws an exception. Otherwise, this sets the
* "mJniInt" field to 42 and returns 24.
*/
static jint PlatformLibrary_getJniInt(JNIEnv* env, jobject thiz, jboolean bad) {
if (bad) {
throwException(env, "java/lang/IllegalStateException",
"you are bad", 0);
return 0; /* return value will be ignored */
}
env->SetIntField(thiz, gCachedState.jniInt, 42);
return (jint)24;
}
/*
* A more complex sample method.
*
* This takes a String as an argument, and returns a new String with
* characters in reverse order. The new string is passed to another method.
* This demonstrates basic String manipulation functions and method
* invocation.
*
* This method is declared "static", so there's no "this" pointer; instead,
* we get a pointer to the class object.
*/
static jstring PlatformLibrary_reverseString(JNIEnv* env, jclass clazz,
jstring str) {
if (str == NULL) {
throwException(env, "java/lang/NullPointerException", NULL, 0);
return NULL;
}
/*
* Get a pointer to the string's UTF-16 character data. The data
* may be a copy or a pointer to the original. Since String data
* is immutable, we're not allowed to touch it.
*/
const jchar* strChars = env->GetStringChars(str, NULL);
if (strChars == NULL) {
/* something went wrong */
ALOGW("Couldn't get string chars\n");
return NULL;
}
jsize strLength = env->GetStringLength(str);
/*
* Write a progress message to the log. Log messages are UTF-8, so
* we want to convert the string to show it.
*/
const char* printable = env->GetStringUTFChars(str, NULL);
if (printable != NULL) {
ALOGD("Reversing string '%s'\n", printable);
env->ReleaseStringUTFChars(str, printable);
}
/*
* Copy the characters to temporary storage, reversing as we go.
*/
jchar tempChars[strLength];
for (int i = 0; i < strLength; i++) {
tempChars[i] = strChars[strLength -1 -i];
}
/*
* Release the original String. That way, if something fails later on,
* we don't have to worry about this leading to a memory leak.
*/
env->ReleaseStringChars(str, strChars);
strChars = NULL; /* this pointer no longer valid */
/*
* Create a new String with the chars.
*/
jstring result = env->NewString(tempChars, strLength);
if (result == NULL) {
ALOGE("NewString failed\n");
return NULL;
}
/*
* Now let's do something with it. We already have the methodID for
* "yodel", so we can invoke it directly. It's in our class, so we
* can use the Class object reference that was passed in.
*/
env->CallStaticVoidMethod(clazz, gCachedState.yodel, result);
return result;
}
// ----------------------------------------------------------------------------
/*
* Array of methods.
*
* Each entry has three fields: the name of the method, the method
* signature, and a pointer to the native implementation.
*/
static const JNINativeMethod gMethods[] = {
{ "getJniInt", "(Z)I",
(void*)PlatformLibrary_getJniInt },
{ "reverseString", "(Ljava/lang/String;)Ljava/lang/String;",
(void*)PlatformLibrary_reverseString },
};
/*
* Do some (slow-ish) lookups now and save the results.
*
* Returns 0 on success.
*/
static int cacheIds(JNIEnv* env, jclass clazz) {
/*
* Save the class in case we want to use it later. Because this is a
* reference to the Class object, we need to convert it to a JNI global
* reference.
*/
gCachedState.platformLibraryClass = (jclass) env->NewGlobalRef(clazz);
if (clazz == NULL) {
ALOGE("Can't create new global ref\n");
return -1;
}
/*
* Cache field and method IDs. IDs are not references, which means we
* don't need to call NewGlobalRef on them.
*/
gCachedState.jniInt = env->GetFieldID(clazz, "mJniInt", "I");
if (gCachedState.jniInt == NULL) {
ALOGE("Can't find PlatformLibrary.mJniInt\n");
return -1;
}
gCachedState.yodel = env->GetStaticMethodID(clazz, "yodel",
"(Ljava/lang/String;)V");
if (gCachedState.yodel == NULL) {
ALOGE("Can't find PlatformLibrary.yodel\n");
return -1;
}
return 0;
}
/*
* Explicitly register all methods for our class.
*
* While we're at it, cache some class references and method/field IDs.
*
* Returns 0 on success.
*/
static int registerMethods(JNIEnv* env) {
static const char* const kClassName =
"com/example/android/platform_library/PlatformLibrary";
jclass clazz;
/* look up the class */
clazz = env->FindClass(kClassName);
if (clazz == NULL) {
ALOGE("Can't find class %s\n", kClassName);
return -1;
}
/* register all the methods */
if (env->RegisterNatives(clazz, gMethods,
sizeof(gMethods) / sizeof(gMethods[0])) != JNI_OK)
{
ALOGE("Failed registering methods for %s\n", kClassName);
return -1;
}
/* fill out the rest of the ID cache */
return cacheIds(env, clazz);
}
// ----------------------------------------------------------------------------
/*
* This is called by the VM when the shared library is first loaded.
*/
jint JNI_OnLoad(JavaVM* vm, void* reserved) {
JNIEnv* env = NULL;
jint result = -1;
if (vm->GetEnv((void**) &env, JNI_VERSION_1_4) != JNI_OK) {
ALOGE("ERROR: GetEnv failed\n");
goto bail;
}
assert(env != NULL);
if (registerMethods(env) != 0) {
ALOGE("ERROR: PlatformLibrary native registration failed\n");
goto bail;
}
/* success -- return valid version number */
result = JNI_VERSION_1_4;
bail:
return result;
}

View file

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/**
* Copyright (c) 2009, 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.
*/
-->
<resources>
<string name="def_backup_transport">com.google.android.gms/.backup.BackupTransportService</string>
</resources>

View file

@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/**
* 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.
*/
-->
<resources>
<!-- Enable overlay for all location components. -->
<bool name="config_enableNetworkLocationOverlay" translatable="false">true</bool>
<bool name="config_enableFusedLocationOverlay" translatable="false">true</bool>
<bool name="config_enableGeocoderOverlay" translatable="false">true</bool>
<bool name="config_enableGeofenceOverlay" translatable="false">true</bool>
<!--
Sets the package names whose certificates should be used to
verify location providers are allowed to be loaded.
-->
<string-array name="config_locationProviderPackageNames" translatable="false">
<item>com.google.android.gms</item>
<item>com.android.location.fused</item>
</string-array>
</resources>

View file

@ -0,0 +1,13 @@
#
# This file should set PRODUCT_MAKEFILES to a list of product makefiles
# to expose to the build system. LOCAL_DIR will already be set to
# the directory containing this file.
#
# This file may not rely on the value of any variable other than
# LOCAL_DIR; do not use any conditionals, and do not look up the
# value of any variable that isn't set in this file or in a file that
# it includes.
#
PRODUCT_MAKEFILES := \
$(LOCAL_DIR)/sample_addon.mk

View file

@ -0,0 +1 @@
+com.example.android.platform_library.*

View file

@ -0,0 +1,22 @@
#
# Copyright (C) 2008 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.
#
# This is an example of how to set an overlay that configures the
# default backup transport. In this example, the configuration points
# to the Google implementation, to show the exact syntax in a real-world
# example.
PRODUCT_PACKAGE_OVERLAYS := device/sample/overlays/backup

View file

@ -0,0 +1,25 @@
#
# Copyright (C) 2008 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.
#
# This is an example of how to set an overlay that configures the
# default backup transport. In this example, the configuration points
# to the Google implementation, to show the exact syntax in a real-world
# example.
PRODUCT_PACKAGE_OVERLAYS := device/sample/overlays/location
# Uncomment this line to include the Google network and fused location providers
#PRODUCT_PACKAGES := NetworkLocation

View file

@ -0,0 +1,44 @@
# List of apps and optional libraries (Java and native) to put in the add-on system image.
PRODUCT_PACKAGES := \
PlatformLibraryClient \
com.example.android.platform_library \
libplatform_library_jni
# Manually copy the optional library XML files in the system image.
PRODUCT_COPY_FILES := \
device/sample/frameworks/PlatformLibrary/com.example.android.platform_library.xml:system/etc/permissions/com.example.android.platform_library.xml
# name of the add-on
PRODUCT_SDK_ADDON_NAME := platform_library
# Copy the manifest and hardware files for the SDK add-on.
# The content of those files is manually created for now.
PRODUCT_SDK_ADDON_COPY_FILES := \
device/sample/sdk_addon/manifest.ini:manifest.ini \
device/sample/sdk_addon/hardware.ini:hardware.ini \
$(call find-copy-subdir-files,*,device/sample/skins/WVGAMedDpi,skins/WVGAMedDpi)
# Add this to PRODUCT_SDK_ADDON_COPY_FILES to copy the files for an
# emulator skin (or for samples)
#$(call find-copy-subdir-files,*,device/sample/skins/WVGAMedDpi,skins/WVGAMedDpi)
# Copy the jar files for the optional libraries that are exposed as APIs.
PRODUCT_SDK_ADDON_COPY_MODULES := \
com.example.android.platform_library:libs/platform_library.jar
# Rules for public APIs
PRODUCT_SDK_ADDON_STUB_DEFS := $(LOCAL_PATH)/addon_stub_defs
# Name of the doc to generate and put in the add-on. This must match the name defined
# in the optional library with the tag
# LOCAL_MODULE:= platform_library
# in the documentation section.
PRODUCT_SDK_ADDON_DOC_MODULES := platform_library
# This add-on extends the default sdk product.
$(call inherit-product, $(SRC_TARGET_DIR)/product/sdk.mk)
# Real name of the add-on. This is the name used to build the add-on.
# Use 'make PRODUCT-<PRODUCT_NAME>-sdk_addon' to build the add-on.
PRODUCT_NAME := sample_addon

View file

@ -0,0 +1,3 @@
# Custom hardware options for the add-on.
# Properties defined here impact all AVD targetting this add-on.
# Each skin can also override those values with its own hardware.ini file.

View file

@ -0,0 +1,44 @@
# SDK Add-on Manifest
# File encoding is UTF-8
# Name and vendor of the add-on.
# Add-ons are uniquely identified by a string composed of name, vendor and api.
# 2 add-ons with the same identifier cannot be installed in the same SDK
# and only the add-on with the highest rev number will be installed.
# Name and vendor are used to create folder names, so they shouldn't contain
# any special characters. Also, the character ':' is forbidden.
# Mandatory character set: a-z A-Z 0-9 _.-
name=Sample Add-On
vendor=Android Open Source Project
description=sample add-on
# version of the Android platform on which this add-on is built.
api=15
# revision of the add-on. This must be a strict integer.
revision=1
# list of libraries, separated by a semi-colon.
# This must be the name of the libraries, as required by the
# <uses-library> node in the AndroidManifest.xml file.
libraries=com.example.android.platform_library
# details for each library. format is:
# <library.name>=<name>.jar;<desc>
# where
# <library.name>: the name of the library defined in the property "libraries" above.
# <name>.jar: the jar file containing the library API. This is to be located in
# the add-on folder in libs/
com.example.android.platform_library=platform_library.jar;Sample optional plaform library
# default skin name. Optional. Only useful if the add-on has its own skin, or
# if it wishes to override the default skin of the base platform.
# This should be the name of the skin in the skins/ folder of the add-on.
skin=WVGAMedDpi
# USB Vendor ID
# This 16-bit integer allows adb to detect new devices, by extending the list
# of USB Vendor IDs it knows. After installing an add-on the command
# 'android update' adb' must be run to update a file that adb reads during
# start-up.
#usb-vendor=0x0000

Binary file not shown.

After

Width:  |  Height:  |  Size: 449 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 825 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 795 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 453 B

Some files were not shown because too many files have changed in this diff Show more