This repository has been archived by the owner on Mar 16, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 272
android-DirectBoot #133
Comments
TrayContentProvider.java like this ? onCreate() >>
|
Why should we support this?
I dont get the value currently...
…On Tue, Jul 24, 2018, 11:27 AM malangstudio ***@***.***> wrote:
TrayContentProvider.java
like this ?
onCreate() >>
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
storageContext = getContext().createDeviceProtectedStorageContext();
if (storageContext.moveDatabaseFrom(getContext(), TrayDBHelper.DATABASE_NAME)) {
Log.d("TrayContentProvider", "[TrayDBHelper] TrayDBHelper.DATABASE_NAME.moveDatabaseFrom : true");
} else {
Log.d("TrayContentProvider", "[TrayDBHelper] TrayDBHelper.DATABASE_NAME.moveDatabaseFrom : false");
}
if (storageContext.moveDatabaseFrom(getContext(), TrayDBHelper.DATABASE_NAME_NO_BACKUP)) {
Log.d("TrayContentProvider", "[TrayDBHelper] TrayDBHelper.DATABASE_NAME_NO_BACKUP.moveDatabaseFrom : true");
} else {
Log.d("TrayContentProvider", "[TrayDBHelper] TrayDBHelper.DATABASE_NAME_NO_BACKUP.moveDatabaseFrom : false");
}
} else {
storageContext = getContext();
}
mUserDbHelper = new TrayDBHelper(storageContext, true);
mDeviceDbHelper = new TrayDBHelper(storageContext, false);
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#133 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AJwYe2AJ4QNvvYjrPuU5GWQmGVnilZPfks5uJuiOgaJpZM4VcIyk>
.
|
My project using Tray needs this feature too. But I recommend not to modify For example: final Context storageContext;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
storageContext = context.createDeviceProtectedStorageContext();
} else {
storageContext = context;
}
mPreferences = new TrayPreferences(storageContext, PREF_NAME, 1); However, I found Tray didn't work well with device protected storage context. I got stack trace logs:
I can guarantee that data can be read and written with device protected storage context. But logs told me the database is readonly. Do you have any idea? |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
https://android-developers.googleblog.com/2016/04/developing-for-direct-boot.html
Do you support this feature?
The text was updated successfully, but these errors were encountered: