Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 606c532d authored by Lucas Dupin's avatar Lucas Dupin Committed by Android (Google) Code Review
Browse files

Merge "Allow custom keyguard transient message"

parents 2bcc515f ef886544
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -3995,6 +3995,7 @@ package android.service.trust {
    method public final void removeEscrowToken(long, android.os.UserHandle);
    method public final void removeEscrowToken(long, android.os.UserHandle);
    method public final void revokeTrust();
    method public final void revokeTrust();
    method public final void setManagingTrust(boolean);
    method public final void setManagingTrust(boolean);
    method public final void showKeyguardErrorMessage(java.lang.CharSequence);
    method public final void unlockUserWithToken(long, byte[], android.os.UserHandle);
    method public final void unlockUserWithToken(long, byte[], android.os.UserHandle);
    field public static final int FLAG_GRANT_TRUST_DISMISS_KEYGUARD = 2; // 0x2
    field public static final int FLAG_GRANT_TRUST_DISMISS_KEYGUARD = 2; // 0x2
    field public static final int FLAG_GRANT_TRUST_INITIATED_BY_USER = 1; // 0x1
    field public static final int FLAG_GRANT_TRUST_INITIATED_BY_USER = 1; // 0x1
+1 −1
Original line number Original line Diff line number Diff line
@@ -501,7 +501,7 @@ public class KeyguardManager {
                }
                }
            });
            });
        } catch (RemoteException e) {
        } catch (RemoteException e) {
            Log.i(TAG, "Failed to dismiss keyguard: " + e);
            throw e.rethrowFromSystemServer();
        }
        }
    }
    }


+1 −0
Original line number Original line Diff line number Diff line
@@ -24,4 +24,5 @@ package android.app.trust;
oneway interface ITrustListener {
oneway interface ITrustListener {
    void onTrustChanged(boolean enabled, int userId, int flags);
    void onTrustChanged(boolean enabled, int userId, int flags);
    void onTrustManagedChanged(boolean managed, int userId);
    void onTrustManagedChanged(boolean managed, int userId);
    void onTrustError(in CharSequence message);
}
}
 No newline at end of file
+24 −5
Original line number Original line Diff line number Diff line
@@ -36,9 +36,11 @@ public class TrustManager {


    private static final int MSG_TRUST_CHANGED = 1;
    private static final int MSG_TRUST_CHANGED = 1;
    private static final int MSG_TRUST_MANAGED_CHANGED = 2;
    private static final int MSG_TRUST_MANAGED_CHANGED = 2;
    private static final int MSG_TRUST_ERROR = 3;


    private static final String TAG = "TrustManager";
    private static final String TAG = "TrustManager";
    private static final String DATA_FLAGS = "initiatedByUser";
    private static final String DATA_FLAGS = "initiatedByUser";
    private static final String DATA_MESSAGE = "message";


    private final ITrustManager mService;
    private final ITrustManager mService;
    private final ArrayMap<TrustListener, ITrustListener> mTrustListeners;
    private final ArrayMap<TrustListener, ITrustListener> mTrustListeners;
@@ -148,6 +150,13 @@ public class TrustManager {
                    mHandler.obtainMessage(MSG_TRUST_MANAGED_CHANGED, (managed ? 1 : 0), userId,
                    mHandler.obtainMessage(MSG_TRUST_MANAGED_CHANGED, (managed ? 1 : 0), userId,
                            trustListener).sendToTarget();
                            trustListener).sendToTarget();
                }
                }

                @Override
                public void onTrustError(CharSequence message) {
                    Message m = mHandler.obtainMessage(MSG_TRUST_ERROR);
                    m.getData().putCharSequence(DATA_MESSAGE, message);
                    m.sendToTarget();
                }
            };
            };
            mService.registerTrustListener(iTrustListener);
            mService.registerTrustListener(iTrustListener);
            mTrustListeners.put(trustListener, iTrustListener);
            mTrustListeners.put(trustListener, iTrustListener);
@@ -221,6 +230,10 @@ public class TrustManager {
                    break;
                    break;
                case MSG_TRUST_MANAGED_CHANGED:
                case MSG_TRUST_MANAGED_CHANGED:
                    ((TrustListener)msg.obj).onTrustManagedChanged(msg.arg1 != 0, msg.arg2);
                    ((TrustListener)msg.obj).onTrustManagedChanged(msg.arg1 != 0, msg.arg2);
                    break;
                case MSG_TRUST_ERROR:
                    final CharSequence message = msg.peekData().getCharSequence(DATA_MESSAGE);
                    ((TrustListener)msg.obj).onTrustError(message);
            }
            }
        }
        }
    };
    };
@@ -229,9 +242,9 @@ public class TrustManager {


        /**
        /**
         * Reports that the trust state has changed.
         * Reports that the trust state has changed.
         * @param enabled if true, the system believes the environment to be trusted.
         * @param enabled If true, the system believes the environment to be trusted.
         * @param userId the user, for which the trust changed.
         * @param userId The user, for which the trust changed.
         * @param flags flags specified by the trust agent when granting trust. See
         * @param flags Flags specified by the trust agent when granting trust. See
         *     {@link android.service.trust.TrustAgentService#grantTrust(CharSequence, long, int)
         *     {@link android.service.trust.TrustAgentService#grantTrust(CharSequence, long, int)
         *                 TrustAgentService.grantTrust(CharSequence, long, int)}.
         *                 TrustAgentService.grantTrust(CharSequence, long, int)}.
         */
         */
@@ -239,9 +252,15 @@ public class TrustManager {


        /**
        /**
         * Reports that whether trust is managed has changed
         * Reports that whether trust is managed has changed
         * @param enabled if true, at least one trust agent is managing trust.
         * @param enabled If true, at least one trust agent is managing trust.
         * @param userId the user, for which the state changed.
         * @param userId The user, for which the state changed.
         */
         */
        void onTrustManagedChanged(boolean enabled, int userId);
        void onTrustManagedChanged(boolean enabled, int userId);

        /**
         * Reports that an error happened on a TrustAgentService.
         * @param message A message that should be displayed on the UI.
         */
        void onTrustError(CharSequence message);
    }
    }
}
}
+1 −0
Original line number Original line Diff line number Diff line
@@ -32,4 +32,5 @@ oneway interface ITrustAgentServiceCallback {
    void isEscrowTokenActive(long handle, int userId);
    void isEscrowTokenActive(long handle, int userId);
    void removeEscrowToken(long handle, int userId);
    void removeEscrowToken(long handle, int userId);
    void unlockUserWithToken(long handle, in byte[] token, int userId);
    void unlockUserWithToken(long handle, in byte[] token, int userId);
    void showKeyguardErrorMessage(in CharSequence message);
}
}
Loading