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 := LargeAssetTest
LOCAL_CERTIFICATE := platform
include $(BUILD_PACKAGE)

View File

@ -0,0 +1,28 @@
<!-- 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.largeassettest">
<application>
<activity android:name="LargeAssetTest" android:label="Large Asset Test">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>

Binary file not shown.

View File

@ -0,0 +1,52 @@
<?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.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="25dp"
android:textColor="#ffffffff"
android:text="@string/prompt"
/>
<TextView android:id="@+id/result"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginTop="25dp"
android:textSize="24sp"
android:textColor="#ffffffff"
/>
<Button android:id="@+id/validate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/button_text" />
<TextView
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:layout_weight="1"
/>
</LinearLayout>

View File

@ -0,0 +1,23 @@
<?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.
-->
<resources>
<string name="prompt">Click the button below to read and validate the large binary asset.</string>
<string name="button_text">Validate the asset</string>
</resources>

View File

@ -0,0 +1,104 @@
/*
* 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.
*/
package com.android.largeassettest;
import android.app.Activity;
import android.content.Context;
import android.content.res.AssetManager;
import android.os.AsyncTask;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import java.io.InputStream;
import java.io.IOException;
/**
* Skeleton to test large-asset handling. The asset in question is one million
* four-byte integers, in ascending numeric order.
*/
public class LargeAssetTest extends Activity {
Button mValidateButton;
TextView mResultText;
Validator mValidateThread;
@Override
protected void onCreate(Bundle icicle) {
super.onCreate(icicle);
setContentView(R.layout.lat);
mResultText = (TextView) findViewById(R.id.result);
mValidateButton = (Button) findViewById(R.id.validate);
mValidateButton.setOnClickListener(mClickListener);
}
View.OnClickListener mClickListener = new View.OnClickListener() {
public void onClick(View v) {
mValidateButton.setEnabled(false);
mValidateThread = new Validator();
mValidateThread.execute(LargeAssetTest.this.getAssets());
}
};
/**
* Validation happens in a separate thread
*/
class Validator extends AsyncTask<AssetManager, Integer, Boolean> {
static final String TAG = "Validator";
@Override
protected Boolean doInBackground(AssetManager... params) {
AssetManager am = params[0];
try {
InputStream is = am.open("million-ints", AssetManager.ACCESS_STREAMING);
byte[] buf = new byte[4];
for (int i = 0; i < 1000000; i++) {
int num = is.read(buf, 0, 4);
if (num != 4) {
Log.e(TAG, "Wanted 4 bytes but read " + num);
return false;
}
// the byte array is stored in the asset in little-endian order
int value = (buf[3] << 24) + ((buf[2] & 0xFF) << 16)
+ ((buf[1] & 0xFF) << 8) + (buf[0] & 0xFF);
if (value != i) {
Log.e(TAG, "Mismatch: index " + i + " : value " + value);
return false;
}
}
is.close();
} catch (IOException e) {
Log.w(TAG, "Couldn't open asset", e);
return false;
}
Log.i(TAG, "Finished, reporting valid");
return true;
}
@Override
protected void onPostExecute(Boolean result) {
CharSequence text = (result) ? "Valid!" : "NOT VALID";
mResultText.setText(text);
mValidateButton.setEnabled(true);
}
}
}