M7350v1_en_gpl

This commit is contained in:
T
2024-09-09 08:52:07 +00:00
commit f9cc65cfda
65988 changed files with 26357421 additions and 0 deletions

View File

@ -0,0 +1,11 @@
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE_TAGS := optional
LOCAL_SRC_FILES := $(call all-subdir-java-files)
LOCAL_PACKAGE_NAME := AppWidgetProvider
LOCAL_CERTIFICATE := platform
include $(BUILD_PACKAGE)

View File

@ -0,0 +1,13 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.android.tests.appwidgetprovider">
<uses-permission android:name="android.permission.VIBRATE" />
<application>
<receiver android:name="TestAppWidgetProvider">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter>
<meta-data android:name="android.appwidget.provider" android:resource="@xml/appwidget_info" />
</receiver>
</application>
</manifest>

View File

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2006 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.
-->
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/oh_hai_text"
android:layout_width="150dp"
android:layout_height="150dp"
android:text="@string/oh_hai"
android:background="#8fff"
android:textColor="#000"
android:textStyle="bold"
/>

View File

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2006 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.
-->
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/oh_hai_text"
android:layout_width="150dp"
android:layout_height="150dp"
android:text="@string/appwidget_view_title"
android:background="#8fff"
android:textColor="#000"
android:textStyle="bold"
/>

View File

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- 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.
-->
<resources>
<string name="appwidget_view_title">Widget Test</string>
<string name="add_appwidget">Add Widget</string>
<string name="oh_hai">Oh hai.</string>
<string name="delete_appwidget">Delete</string>
</resources>

View File

@ -0,0 +1,7 @@
<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
android:minWidth="150dp"
android:minHeight="150dp"
android:updatePeriodMillis="2000"
android:initialLayout="@layout/test_appwidget"
>
</appwidget-provider>

View File

@ -0,0 +1,61 @@
/*
* 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.android.tests.appwidgetprovider;
import android.content.BroadcastReceiver;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.appwidget.AppWidgetManager;
import android.os.Bundle;
import android.os.SystemClock;
import android.util.Log;
import android.widget.RemoteViews;
public class TestAppWidgetProvider extends BroadcastReceiver {
static final String TAG = "TestAppWidgetProvider";
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
Log.d(TAG, "intent=" + intent);
if (AppWidgetManager.ACTION_APPWIDGET_ENABLED.equals(action)) {
Log.d(TAG, "ENABLED");
}
else if (AppWidgetManager.ACTION_APPWIDGET_DISABLED.equals(action)) {
Log.d(TAG, "DISABLED");
}
else if (AppWidgetManager.ACTION_APPWIDGET_UPDATE.equals(action)) {
if (true) return;
Log.d(TAG, "UPDATE");
Bundle extras = intent.getExtras();
int[] appWidgetIds = extras.getIntArray(AppWidgetManager.EXTRA_APPWIDGET_IDS);
AppWidgetManager gm = AppWidgetManager.getInstance(context);
RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.test_appwidget);
views.setTextViewText(R.id.oh_hai_text, "hai: " + SystemClock.elapsedRealtime());
if (false) {
gm.updateAppWidget(appWidgetIds, views);
} else {
gm.updateAppWidget(new ComponentName("com.android.tests.appwidgetprovider",
"com.android.tests.appwidgetprovider.TestAppWidgetProvider"), views);
}
}
}
}